element-ui.common.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413
  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 = 45);
  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/utils/resize-event");
  148. /***/ }),
  149. /* 15 */
  150. /***/ (function(module, exports) {
  151. module.exports = require("element-ui/lib/utils/types");
  152. /***/ }),
  153. /* 16 */
  154. /***/ (function(module, exports) {
  155. module.exports = require("throttle-debounce/debounce");
  156. /***/ }),
  157. /* 17 */
  158. /***/ (function(module, exports) {
  159. module.exports = require("element-ui/lib/checkbox");
  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/button-group");
  204. /***/ }),
  205. /* 29 */
  206. /***/ (function(module, exports) {
  207. module.exports = require("element-ui/lib/tag");
  208. /***/ }),
  209. /* 30 */
  210. /***/ (function(module, exports) {
  211. module.exports = require("element-ui/lib/utils/scrollbar-width");
  212. /***/ }),
  213. /* 31 */
  214. /***/ (function(module, exports) {
  215. module.exports = require("element-ui/lib/checkbox-group");
  216. /***/ }),
  217. /* 32 */
  218. /***/ (function(module, exports) {
  219. module.exports = require("element-ui/lib/utils/after-leave");
  220. /***/ }),
  221. /* 33 */
  222. /***/ (function(module, exports) {
  223. module.exports = require("element-ui/lib/progress");
  224. /***/ }),
  225. /* 34 */
  226. /***/ (function(module, exports) {
  227. module.exports = require("element-ui/lib/utils/aria-utils");
  228. /***/ }),
  229. /* 35 */
  230. /***/ (function(module, exports) {
  231. module.exports = require("throttle-debounce");
  232. /***/ }),
  233. /* 36 */
  234. /***/ (function(module, exports) {
  235. module.exports = require("element-ui/lib/select");
  236. /***/ }),
  237. /* 37 */
  238. /***/ (function(module, exports) {
  239. module.exports = require("element-ui/lib/option");
  240. /***/ }),
  241. /* 38 */
  242. /***/ (function(module, exports) {
  243. module.exports = require("normalize-wheel");
  244. /***/ }),
  245. /* 39 */
  246. /***/ (function(module, exports) {
  247. module.exports = require("element-ui/lib/utils/aria-dialog");
  248. /***/ }),
  249. /* 40 */
  250. /***/ (function(module, exports) {
  251. module.exports = require("async-validator");
  252. /***/ }),
  253. /* 41 */
  254. /***/ (function(module, exports) {
  255. module.exports = require("element-ui/lib/input-number");
  256. /***/ }),
  257. /* 42 */
  258. /***/ (function(module, exports) {
  259. module.exports = require("element-ui/lib/cascader-panel");
  260. /***/ }),
  261. /* 43 */
  262. /***/ (function(module, exports) {
  263. module.exports = require("element-ui/lib/radio");
  264. /***/ }),
  265. /* 44 */
  266. /***/ (function(module, exports) {
  267. module.exports = require("element-ui/lib/popover");
  268. /***/ }),
  269. /* 45 */
  270. /***/ (function(module, exports, __webpack_require__) {
  271. module.exports = __webpack_require__(46);
  272. /***/ }),
  273. /* 46 */
  274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  275. "use strict";
  276. __webpack_require__.r(__webpack_exports__);
  277. // 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&
  278. var pagervue_type_template_id_7274f267_render = function() {
  279. var _vm = this
  280. var _h = _vm.$createElement
  281. var _c = _vm._self._c || _h
  282. return _c(
  283. "ul",
  284. { staticClass: "el-pager", on: { click: _vm.onPagerClick } },
  285. [
  286. _vm.pageCount > 0
  287. ? _c(
  288. "li",
  289. {
  290. staticClass: "number",
  291. class: { active: _vm.currentPage === 1, disabled: _vm.disabled }
  292. },
  293. [_vm._v("1")]
  294. )
  295. : _vm._e(),
  296. _vm.showPrevMore
  297. ? _c("li", {
  298. staticClass: "el-icon more btn-quickprev",
  299. class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
  300. on: {
  301. mouseenter: function($event) {
  302. _vm.onMouseenter("left")
  303. },
  304. mouseleave: function($event) {
  305. _vm.quickprevIconClass = "el-icon-more"
  306. }
  307. }
  308. })
  309. : _vm._e(),
  310. _vm._l(_vm.pagers, function(pager) {
  311. return _c(
  312. "li",
  313. {
  314. key: pager,
  315. staticClass: "number",
  316. class: { active: _vm.currentPage === pager, disabled: _vm.disabled }
  317. },
  318. [_vm._v(_vm._s(pager))]
  319. )
  320. }),
  321. _vm.showNextMore
  322. ? _c("li", {
  323. staticClass: "el-icon more btn-quicknext",
  324. class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
  325. on: {
  326. mouseenter: function($event) {
  327. _vm.onMouseenter("right")
  328. },
  329. mouseleave: function($event) {
  330. _vm.quicknextIconClass = "el-icon-more"
  331. }
  332. }
  333. })
  334. : _vm._e(),
  335. _vm.pageCount > 1
  336. ? _c(
  337. "li",
  338. {
  339. staticClass: "number",
  340. class: {
  341. active: _vm.currentPage === _vm.pageCount,
  342. disabled: _vm.disabled
  343. }
  344. },
  345. [_vm._v(_vm._s(_vm.pageCount))]
  346. )
  347. : _vm._e()
  348. ],
  349. 2
  350. )
  351. }
  352. var staticRenderFns = []
  353. pagervue_type_template_id_7274f267_render._withStripped = true
  354. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  355. // 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&
  356. //
  357. //
  358. //
  359. //
  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. /* harmony default export */ var pagervue_type_script_lang_js_ = ({
  389. name: 'ElPager',
  390. props: {
  391. currentPage: Number,
  392. pageCount: Number,
  393. pagerCount: Number,
  394. disabled: Boolean
  395. },
  396. watch: {
  397. showPrevMore: function showPrevMore(val) {
  398. if (!val) this.quickprevIconClass = 'el-icon-more';
  399. },
  400. showNextMore: function showNextMore(val) {
  401. if (!val) this.quicknextIconClass = 'el-icon-more';
  402. }
  403. },
  404. methods: {
  405. onPagerClick: function onPagerClick(event) {
  406. var target = event.target;
  407. if (target.tagName === 'UL' || this.disabled) {
  408. return;
  409. }
  410. var newPage = Number(event.target.textContent);
  411. var pageCount = this.pageCount;
  412. var currentPage = this.currentPage;
  413. var pagerCountOffset = this.pagerCount - 2;
  414. if (target.className.indexOf('more') !== -1) {
  415. if (target.className.indexOf('quickprev') !== -1) {
  416. newPage = currentPage - pagerCountOffset;
  417. } else if (target.className.indexOf('quicknext') !== -1) {
  418. newPage = currentPage + pagerCountOffset;
  419. }
  420. }
  421. /* istanbul ignore if */
  422. if (!isNaN(newPage)) {
  423. if (newPage < 1) {
  424. newPage = 1;
  425. }
  426. if (newPage > pageCount) {
  427. newPage = pageCount;
  428. }
  429. }
  430. if (newPage !== currentPage) {
  431. this.$emit('change', newPage);
  432. }
  433. },
  434. onMouseenter: function onMouseenter(direction) {
  435. if (this.disabled) return;
  436. if (direction === 'left') {
  437. this.quickprevIconClass = 'el-icon-d-arrow-left';
  438. } else {
  439. this.quicknextIconClass = 'el-icon-d-arrow-right';
  440. }
  441. }
  442. },
  443. computed: {
  444. pagers: function pagers() {
  445. var pagerCount = this.pagerCount;
  446. var halfPagerCount = (pagerCount - 1) / 2;
  447. var currentPage = Number(this.currentPage);
  448. var pageCount = Number(this.pageCount);
  449. var showPrevMore = false;
  450. var showNextMore = false;
  451. if (pageCount > pagerCount) {
  452. if (currentPage > pagerCount - halfPagerCount) {
  453. showPrevMore = true;
  454. }
  455. if (currentPage < pageCount - halfPagerCount) {
  456. showNextMore = true;
  457. }
  458. }
  459. var array = [];
  460. if (showPrevMore && !showNextMore) {
  461. var startPage = pageCount - (pagerCount - 2);
  462. for (var i = startPage; i < pageCount; i++) {
  463. array.push(i);
  464. }
  465. } else if (!showPrevMore && showNextMore) {
  466. for (var _i = 2; _i < pagerCount; _i++) {
  467. array.push(_i);
  468. }
  469. } else if (showPrevMore && showNextMore) {
  470. var offset = Math.floor(pagerCount / 2) - 1;
  471. for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) {
  472. array.push(_i2);
  473. }
  474. } else {
  475. for (var _i3 = 2; _i3 < pageCount; _i3++) {
  476. array.push(_i3);
  477. }
  478. }
  479. this.showPrevMore = showPrevMore;
  480. this.showNextMore = showNextMore;
  481. return array;
  482. }
  483. },
  484. data: function data() {
  485. return {
  486. current: null,
  487. showPrevMore: false,
  488. showNextMore: false,
  489. quicknextIconClass: 'el-icon-more',
  490. quickprevIconClass: 'el-icon-more'
  491. };
  492. }
  493. });
  494. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  495. /* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
  496. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  497. /* globals __VUE_SSR_CONTEXT__ */
  498. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  499. // This module is a runtime utility for cleaner component module output and will
  500. // be included in the final webpack user bundle.
  501. function normalizeComponent (
  502. scriptExports,
  503. render,
  504. staticRenderFns,
  505. functionalTemplate,
  506. injectStyles,
  507. scopeId,
  508. moduleIdentifier, /* server only */
  509. shadowMode /* vue-cli only */
  510. ) {
  511. // Vue.extend constructor export interop
  512. var options = typeof scriptExports === 'function'
  513. ? scriptExports.options
  514. : scriptExports
  515. // render functions
  516. if (render) {
  517. options.render = render
  518. options.staticRenderFns = staticRenderFns
  519. options._compiled = true
  520. }
  521. // functional template
  522. if (functionalTemplate) {
  523. options.functional = true
  524. }
  525. // scopedId
  526. if (scopeId) {
  527. options._scopeId = 'data-v-' + scopeId
  528. }
  529. var hook
  530. if (moduleIdentifier) { // server build
  531. hook = function (context) {
  532. // 2.3 injection
  533. context =
  534. context || // cached call
  535. (this.$vnode && this.$vnode.ssrContext) || // stateful
  536. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  537. // 2.2 with runInNewContext: true
  538. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  539. context = __VUE_SSR_CONTEXT__
  540. }
  541. // inject component styles
  542. if (injectStyles) {
  543. injectStyles.call(this, context)
  544. }
  545. // register component module identifier for async chunk inferrence
  546. if (context && context._registeredComponents) {
  547. context._registeredComponents.add(moduleIdentifier)
  548. }
  549. }
  550. // used by ssr in case component is cached and beforeCreate
  551. // never gets called
  552. options._ssrRegister = hook
  553. } else if (injectStyles) {
  554. hook = shadowMode
  555. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  556. : injectStyles
  557. }
  558. if (hook) {
  559. if (options.functional) {
  560. // for template-only hot-reload because in that case the render fn doesn't
  561. // go through the normalizer
  562. options._injectStyles = hook
  563. // register for functioal component in vue file
  564. var originalRender = options.render
  565. options.render = function renderWithStyleInjection (h, context) {
  566. hook.call(context)
  567. return originalRender(h, context)
  568. }
  569. } else {
  570. // inject component registration as beforeCreate hook
  571. var existing = options.beforeCreate
  572. options.beforeCreate = existing
  573. ? [].concat(existing, hook)
  574. : [hook]
  575. }
  576. }
  577. return {
  578. exports: scriptExports,
  579. options: options
  580. }
  581. }
  582. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue
  583. /* normalize component */
  584. var component = normalizeComponent(
  585. src_pagervue_type_script_lang_js_,
  586. pagervue_type_template_id_7274f267_render,
  587. staticRenderFns,
  588. false,
  589. null,
  590. null,
  591. null
  592. )
  593. /* hot reload */
  594. if (false) { var api; }
  595. component.options.__file = "packages/pagination/src/pager.vue"
  596. /* harmony default export */ var pager = (component.exports);
  597. // EXTERNAL MODULE: external "element-ui/lib/select"
  598. var select_ = __webpack_require__(36);
  599. var select_default = /*#__PURE__*/__webpack_require__.n(select_);
  600. // EXTERNAL MODULE: external "element-ui/lib/option"
  601. var option_ = __webpack_require__(37);
  602. var option_default = /*#__PURE__*/__webpack_require__.n(option_);
  603. // EXTERNAL MODULE: external "element-ui/lib/input"
  604. var input_ = __webpack_require__(8);
  605. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  606. // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
  607. var locale_ = __webpack_require__(4);
  608. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  609. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  610. var util_ = __webpack_require__(2);
  611. // CONCATENATED MODULE: ./packages/pagination/src/pagination.js
  612. /* harmony default export */ var pagination = ({
  613. name: 'ElPagination',
  614. props: {
  615. pageSize: {
  616. type: Number,
  617. default: 10
  618. },
  619. small: Boolean,
  620. total: Number,
  621. pageCount: Number,
  622. pagerCount: {
  623. type: Number,
  624. validator: function validator(value) {
  625. return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1;
  626. },
  627. default: 7
  628. },
  629. currentPage: {
  630. type: Number,
  631. default: 1
  632. },
  633. layout: {
  634. default: 'prev, pager, next, jumper, ->, total'
  635. },
  636. pageSizes: {
  637. type: Array,
  638. default: function _default() {
  639. return [10, 20, 30, 40, 50, 100];
  640. }
  641. },
  642. popperClass: String,
  643. prevText: String,
  644. nextText: String,
  645. background: Boolean,
  646. disabled: Boolean,
  647. hideOnSinglePage: Boolean
  648. },
  649. data: function data() {
  650. return {
  651. internalCurrentPage: 1,
  652. internalPageSize: 0,
  653. lastEmittedPage: -1,
  654. userChangePageSize: false
  655. };
  656. },
  657. render: function render(h) {
  658. var layout = this.layout;
  659. if (!layout) return null;
  660. if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
  661. var template = h('div', { 'class': ['el-pagination', {
  662. 'is-background': this.background,
  663. 'el-pagination--small': this.small
  664. }] });
  665. var TEMPLATE_MAP = {
  666. prev: h('prev'),
  667. jumper: h('jumper'),
  668. pager: h('pager', {
  669. attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled },
  670. on: {
  671. 'change': this.handleCurrentChange
  672. }
  673. }),
  674. next: h('next'),
  675. sizes: h('sizes', {
  676. attrs: { pageSizes: this.pageSizes }
  677. }),
  678. slot: h('slot', [this.$slots.default ? this.$slots.default : '']),
  679. total: h('total')
  680. };
  681. var components = layout.split(',').map(function (item) {
  682. return item.trim();
  683. });
  684. var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' });
  685. var haveRightWrapper = false;
  686. template.children = template.children || [];
  687. rightWrapper.children = rightWrapper.children || [];
  688. components.forEach(function (compo) {
  689. if (compo === '->') {
  690. haveRightWrapper = true;
  691. return;
  692. }
  693. if (!haveRightWrapper) {
  694. template.children.push(TEMPLATE_MAP[compo]);
  695. } else {
  696. rightWrapper.children.push(TEMPLATE_MAP[compo]);
  697. }
  698. });
  699. if (haveRightWrapper) {
  700. template.children.unshift(rightWrapper);
  701. }
  702. return template;
  703. },
  704. components: {
  705. Prev: {
  706. render: function render(h) {
  707. return h(
  708. 'button',
  709. {
  710. attrs: {
  711. type: 'button',
  712. disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1
  713. },
  714. 'class': 'btn-prev', on: {
  715. 'click': this.$parent.prev
  716. }
  717. },
  718. [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })]
  719. );
  720. }
  721. },
  722. Next: {
  723. render: function render(h) {
  724. return h(
  725. 'button',
  726. {
  727. attrs: {
  728. type: 'button',
  729. disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0
  730. },
  731. 'class': 'btn-next', on: {
  732. 'click': this.$parent.next
  733. }
  734. },
  735. [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  736. );
  737. }
  738. },
  739. Sizes: {
  740. mixins: [locale_default.a],
  741. props: {
  742. pageSizes: Array
  743. },
  744. watch: {
  745. pageSizes: {
  746. immediate: true,
  747. handler: function handler(newVal, oldVal) {
  748. if (Object(util_["valueEquals"])(newVal, oldVal)) return;
  749. if (Array.isArray(newVal)) {
  750. this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
  751. }
  752. }
  753. }
  754. },
  755. render: function render(h) {
  756. var _this = this;
  757. return h(
  758. 'span',
  759. { 'class': 'el-pagination__sizes' },
  760. [h(
  761. 'el-select',
  762. {
  763. attrs: {
  764. value: this.$parent.internalPageSize,
  765. popperClass: this.$parent.popperClass || '',
  766. size: 'mini',
  767. disabled: this.$parent.disabled },
  768. on: {
  769. 'input': this.handleChange
  770. }
  771. },
  772. [this.pageSizes.map(function (item) {
  773. return h('el-option', {
  774. attrs: {
  775. value: item,
  776. label: item + _this.t('el.pagination.pagesize') }
  777. });
  778. })]
  779. )]
  780. );
  781. },
  782. components: {
  783. ElSelect: select_default.a,
  784. ElOption: option_default.a
  785. },
  786. methods: {
  787. handleChange: function handleChange(val) {
  788. if (val !== this.$parent.internalPageSize) {
  789. this.$parent.internalPageSize = val = parseInt(val, 10);
  790. this.$parent.userChangePageSize = true;
  791. this.$parent.$emit('update:pageSize', val);
  792. this.$parent.$emit('size-change', val);
  793. }
  794. }
  795. }
  796. },
  797. Jumper: {
  798. mixins: [locale_default.a],
  799. components: { ElInput: input_default.a },
  800. data: function data() {
  801. return {
  802. userInput: null
  803. };
  804. },
  805. watch: {
  806. '$parent.internalCurrentPage': function $parentInternalCurrentPage() {
  807. this.userInput = null;
  808. }
  809. },
  810. methods: {
  811. handleKeyup: function handleKeyup(_ref) {
  812. var keyCode = _ref.keyCode,
  813. target = _ref.target;
  814. // Chrome, Safari, Firefox triggers change event on Enter
  815. // Hack for IE: https://github.com/ElemeFE/element/issues/11710
  816. // Drop this method when we no longer supports IE
  817. if (keyCode === 13) {
  818. this.handleChange(target.value);
  819. }
  820. },
  821. handleInput: function handleInput(value) {
  822. this.userInput = value;
  823. },
  824. handleChange: function handleChange(value) {
  825. this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
  826. this.$parent.emitChange();
  827. this.userInput = null;
  828. }
  829. },
  830. render: function render(h) {
  831. return h(
  832. 'span',
  833. { 'class': 'el-pagination__jump' },
  834. [this.t('el.pagination.goto'), h('el-input', {
  835. 'class': 'el-pagination__editor is-in-pagination',
  836. attrs: { min: 1,
  837. max: this.$parent.internalPageCount,
  838. value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage,
  839. type: 'number',
  840. disabled: this.$parent.disabled
  841. },
  842. nativeOn: {
  843. 'keyup': this.handleKeyup
  844. },
  845. on: {
  846. 'input': this.handleInput,
  847. 'change': this.handleChange
  848. }
  849. }), this.t('el.pagination.pageClassifier')]
  850. );
  851. }
  852. },
  853. Total: {
  854. mixins: [locale_default.a],
  855. render: function render(h) {
  856. return typeof this.$parent.total === 'number' ? h(
  857. 'span',
  858. { 'class': 'el-pagination__total' },
  859. [this.t('el.pagination.total', { total: this.$parent.total })]
  860. ) : '';
  861. }
  862. },
  863. Pager: pager
  864. },
  865. methods: {
  866. handleCurrentChange: function handleCurrentChange(val) {
  867. this.internalCurrentPage = this.getValidCurrentPage(val);
  868. this.userChangePageSize = true;
  869. this.emitChange();
  870. },
  871. prev: function prev() {
  872. if (this.disabled) return;
  873. var newVal = this.internalCurrentPage - 1;
  874. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  875. this.$emit('prev-click', this.internalCurrentPage);
  876. this.emitChange();
  877. },
  878. next: function next() {
  879. if (this.disabled) return;
  880. var newVal = this.internalCurrentPage + 1;
  881. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  882. this.$emit('next-click', this.internalCurrentPage);
  883. this.emitChange();
  884. },
  885. getValidCurrentPage: function getValidCurrentPage(value) {
  886. value = parseInt(value, 10);
  887. var havePageCount = typeof this.internalPageCount === 'number';
  888. var resetValue = void 0;
  889. if (!havePageCount) {
  890. if (isNaN(value) || value < 1) resetValue = 1;
  891. } else {
  892. if (value < 1) {
  893. resetValue = 1;
  894. } else if (value > this.internalPageCount) {
  895. resetValue = this.internalPageCount;
  896. }
  897. }
  898. if (resetValue === undefined && isNaN(value)) {
  899. resetValue = 1;
  900. } else if (resetValue === 0) {
  901. resetValue = 1;
  902. }
  903. return resetValue === undefined ? value : resetValue;
  904. },
  905. emitChange: function emitChange() {
  906. var _this2 = this;
  907. this.$nextTick(function () {
  908. if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) {
  909. _this2.$emit('current-change', _this2.internalCurrentPage);
  910. _this2.lastEmittedPage = _this2.internalCurrentPage;
  911. _this2.userChangePageSize = false;
  912. }
  913. });
  914. }
  915. },
  916. computed: {
  917. internalPageCount: function internalPageCount() {
  918. if (typeof this.total === 'number') {
  919. return Math.max(1, Math.ceil(this.total / this.internalPageSize));
  920. } else if (typeof this.pageCount === 'number') {
  921. return Math.max(1, this.pageCount);
  922. }
  923. return null;
  924. }
  925. },
  926. watch: {
  927. currentPage: {
  928. immediate: true,
  929. handler: function handler(val) {
  930. this.internalCurrentPage = this.getValidCurrentPage(val);
  931. }
  932. },
  933. pageSize: {
  934. immediate: true,
  935. handler: function handler(val) {
  936. this.internalPageSize = isNaN(val) ? 10 : val;
  937. }
  938. },
  939. internalCurrentPage: {
  940. immediate: true,
  941. handler: function handler(newVal) {
  942. this.$emit('update:currentPage', newVal);
  943. this.lastEmittedPage = -1;
  944. }
  945. },
  946. internalPageCount: function internalPageCount(newVal) {
  947. /* istanbul ignore if */
  948. var oldPage = this.internalCurrentPage;
  949. if (newVal > 0 && oldPage === 0) {
  950. this.internalCurrentPage = 1;
  951. } else if (oldPage > newVal) {
  952. this.internalCurrentPage = newVal === 0 ? 1 : newVal;
  953. this.userChangePageSize && this.emitChange();
  954. }
  955. this.userChangePageSize = false;
  956. }
  957. }
  958. });
  959. // CONCATENATED MODULE: ./packages/pagination/index.js
  960. /* istanbul ignore next */
  961. pagination.install = function (Vue) {
  962. Vue.component(pagination.name, pagination);
  963. };
  964. /* harmony default export */ var packages_pagination = (pagination);
  965. // 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&
  966. var componentvue_type_template_id_60140e62_render = function() {
  967. var _vm = this
  968. var _h = _vm.$createElement
  969. var _c = _vm._self._c || _h
  970. return _c(
  971. "transition",
  972. {
  973. attrs: { name: "dialog-fade" },
  974. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  975. },
  976. [
  977. _c(
  978. "div",
  979. {
  980. directives: [
  981. {
  982. name: "show",
  983. rawName: "v-show",
  984. value: _vm.visible,
  985. expression: "visible"
  986. }
  987. ],
  988. staticClass: "el-dialog__wrapper",
  989. on: {
  990. click: function($event) {
  991. if ($event.target !== $event.currentTarget) {
  992. return null
  993. }
  994. return _vm.handleWrapperClick($event)
  995. }
  996. }
  997. },
  998. [
  999. _c(
  1000. "div",
  1001. {
  1002. key: _vm.key,
  1003. ref: "dialog",
  1004. class: [
  1005. "el-dialog",
  1006. {
  1007. "is-fullscreen": _vm.fullscreen,
  1008. "el-dialog--center": _vm.center
  1009. },
  1010. _vm.customClass
  1011. ],
  1012. style: _vm.style,
  1013. attrs: {
  1014. role: "dialog",
  1015. "aria-modal": "true",
  1016. "aria-label": _vm.title || "dialog"
  1017. }
  1018. },
  1019. [
  1020. _c(
  1021. "div",
  1022. { staticClass: "el-dialog__header" },
  1023. [
  1024. _vm._t("title", [
  1025. _c("span", { staticClass: "el-dialog__title" }, [
  1026. _vm._v(_vm._s(_vm.title))
  1027. ])
  1028. ]),
  1029. _vm.showClose
  1030. ? _c(
  1031. "button",
  1032. {
  1033. staticClass: "el-dialog__headerbtn",
  1034. attrs: { type: "button", "aria-label": "Close" },
  1035. on: { click: _vm.handleClose }
  1036. },
  1037. [
  1038. _c("i", {
  1039. staticClass:
  1040. "el-dialog__close el-icon el-icon-close"
  1041. })
  1042. ]
  1043. )
  1044. : _vm._e()
  1045. ],
  1046. 2
  1047. ),
  1048. _vm.rendered
  1049. ? _c(
  1050. "div",
  1051. { staticClass: "el-dialog__body" },
  1052. [_vm._t("default")],
  1053. 2
  1054. )
  1055. : _vm._e(),
  1056. _vm.$slots.footer
  1057. ? _c(
  1058. "div",
  1059. { staticClass: "el-dialog__footer" },
  1060. [_vm._t("footer")],
  1061. 2
  1062. )
  1063. : _vm._e()
  1064. ]
  1065. )
  1066. ]
  1067. )
  1068. ]
  1069. )
  1070. }
  1071. var componentvue_type_template_id_60140e62_staticRenderFns = []
  1072. componentvue_type_template_id_60140e62_render._withStripped = true
  1073. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=template&id=60140e62&
  1074. // EXTERNAL MODULE: external "element-ui/lib/utils/popup"
  1075. var popup_ = __webpack_require__(11);
  1076. var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
  1077. // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
  1078. var migrating_ = __webpack_require__(9);
  1079. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  1080. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  1081. var emitter_ = __webpack_require__(3);
  1082. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  1083. // 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&
  1084. //
  1085. //
  1086. //
  1087. //
  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. /* harmony default export */ var componentvue_type_script_lang_js_ = ({
  1124. name: 'ElDialog',
  1125. mixins: [popup_default.a, emitter_default.a, migrating_default.a],
  1126. props: {
  1127. title: {
  1128. type: String,
  1129. default: ''
  1130. },
  1131. modal: {
  1132. type: Boolean,
  1133. default: true
  1134. },
  1135. modalAppendToBody: {
  1136. type: Boolean,
  1137. default: true
  1138. },
  1139. appendToBody: {
  1140. type: Boolean,
  1141. default: false
  1142. },
  1143. lockScroll: {
  1144. type: Boolean,
  1145. default: true
  1146. },
  1147. closeOnClickModal: {
  1148. type: Boolean,
  1149. default: true
  1150. },
  1151. closeOnPressEscape: {
  1152. type: Boolean,
  1153. default: true
  1154. },
  1155. showClose: {
  1156. type: Boolean,
  1157. default: true
  1158. },
  1159. width: String,
  1160. fullscreen: Boolean,
  1161. customClass: {
  1162. type: String,
  1163. default: ''
  1164. },
  1165. top: {
  1166. type: String,
  1167. default: '15vh'
  1168. },
  1169. beforeClose: Function,
  1170. center: {
  1171. type: Boolean,
  1172. default: false
  1173. },
  1174. destroyOnClose: Boolean
  1175. },
  1176. data: function data() {
  1177. return {
  1178. closed: false,
  1179. key: 0
  1180. };
  1181. },
  1182. watch: {
  1183. visible: function visible(val) {
  1184. var _this = this;
  1185. if (val) {
  1186. this.closed = false;
  1187. this.$emit('open');
  1188. this.$el.addEventListener('scroll', this.updatePopper);
  1189. this.$nextTick(function () {
  1190. _this.$refs.dialog.scrollTop = 0;
  1191. });
  1192. if (this.appendToBody) {
  1193. document.body.appendChild(this.$el);
  1194. }
  1195. } else {
  1196. this.$el.removeEventListener('scroll', this.updatePopper);
  1197. if (!this.closed) this.$emit('close');
  1198. if (this.destroyOnClose) {
  1199. this.$nextTick(function () {
  1200. _this.key++;
  1201. });
  1202. }
  1203. }
  1204. }
  1205. },
  1206. computed: {
  1207. style: function style() {
  1208. var style = {};
  1209. if (!this.fullscreen) {
  1210. style.marginTop = this.top;
  1211. if (this.width) {
  1212. style.width = this.width;
  1213. }
  1214. }
  1215. return style;
  1216. }
  1217. },
  1218. methods: {
  1219. getMigratingConfig: function getMigratingConfig() {
  1220. return {
  1221. props: {
  1222. 'size': 'size is removed.'
  1223. }
  1224. };
  1225. },
  1226. handleWrapperClick: function handleWrapperClick() {
  1227. if (!this.closeOnClickModal) return;
  1228. this.handleClose();
  1229. },
  1230. handleClose: function handleClose() {
  1231. if (typeof this.beforeClose === 'function') {
  1232. this.beforeClose(this.hide);
  1233. } else {
  1234. this.hide();
  1235. }
  1236. },
  1237. hide: function hide(cancel) {
  1238. if (cancel !== false) {
  1239. this.$emit('update:visible', false);
  1240. this.$emit('close');
  1241. this.closed = true;
  1242. }
  1243. },
  1244. updatePopper: function updatePopper() {
  1245. this.broadcast('ElSelectDropdown', 'updatePopper');
  1246. this.broadcast('ElDropdownMenu', 'updatePopper');
  1247. },
  1248. afterEnter: function afterEnter() {
  1249. this.$emit('opened');
  1250. },
  1251. afterLeave: function afterLeave() {
  1252. this.$emit('closed');
  1253. }
  1254. },
  1255. mounted: function mounted() {
  1256. if (this.visible) {
  1257. this.rendered = true;
  1258. this.open();
  1259. if (this.appendToBody) {
  1260. document.body.appendChild(this.$el);
  1261. }
  1262. }
  1263. },
  1264. destroyed: function destroyed() {
  1265. // if appendToBody is true, remove DOM node after destroy
  1266. if (this.appendToBody && this.$el && this.$el.parentNode) {
  1267. this.$el.parentNode.removeChild(this.$el);
  1268. }
  1269. }
  1270. });
  1271. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=script&lang=js&
  1272. /* harmony default export */ var src_componentvue_type_script_lang_js_ = (componentvue_type_script_lang_js_);
  1273. // CONCATENATED MODULE: ./packages/dialog/src/component.vue
  1274. /* normalize component */
  1275. var component_component = normalizeComponent(
  1276. src_componentvue_type_script_lang_js_,
  1277. componentvue_type_template_id_60140e62_render,
  1278. componentvue_type_template_id_60140e62_staticRenderFns,
  1279. false,
  1280. null,
  1281. null,
  1282. null
  1283. )
  1284. /* hot reload */
  1285. if (false) { var component_api; }
  1286. component_component.options.__file = "packages/dialog/src/component.vue"
  1287. /* harmony default export */ var src_component = (component_component.exports);
  1288. // CONCATENATED MODULE: ./packages/dialog/index.js
  1289. /* istanbul ignore next */
  1290. src_component.install = function (Vue) {
  1291. Vue.component(src_component.name, src_component);
  1292. };
  1293. /* harmony default export */ var dialog = (src_component);
  1294. // 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&
  1295. var autocompletevue_type_template_id_152f2ee6_render = function() {
  1296. var _vm = this
  1297. var _h = _vm.$createElement
  1298. var _c = _vm._self._c || _h
  1299. return _c(
  1300. "div",
  1301. {
  1302. directives: [
  1303. {
  1304. name: "clickoutside",
  1305. rawName: "v-clickoutside",
  1306. value: _vm.close,
  1307. expression: "close"
  1308. }
  1309. ],
  1310. staticClass: "el-autocomplete",
  1311. attrs: {
  1312. "aria-haspopup": "listbox",
  1313. role: "combobox",
  1314. "aria-expanded": _vm.suggestionVisible,
  1315. "aria-owns": _vm.id
  1316. }
  1317. },
  1318. [
  1319. _c(
  1320. "el-input",
  1321. _vm._b(
  1322. {
  1323. ref: "input",
  1324. on: {
  1325. input: _vm.handleInput,
  1326. change: _vm.handleChange,
  1327. focus: _vm.handleFocus,
  1328. blur: _vm.handleBlur,
  1329. clear: _vm.handleClear
  1330. },
  1331. nativeOn: {
  1332. keydown: [
  1333. function($event) {
  1334. if (
  1335. !("button" in $event) &&
  1336. _vm._k($event.keyCode, "up", 38, $event.key, [
  1337. "Up",
  1338. "ArrowUp"
  1339. ])
  1340. ) {
  1341. return null
  1342. }
  1343. $event.preventDefault()
  1344. _vm.highlight(_vm.highlightedIndex - 1)
  1345. },
  1346. function($event) {
  1347. if (
  1348. !("button" in $event) &&
  1349. _vm._k($event.keyCode, "down", 40, $event.key, [
  1350. "Down",
  1351. "ArrowDown"
  1352. ])
  1353. ) {
  1354. return null
  1355. }
  1356. $event.preventDefault()
  1357. _vm.highlight(_vm.highlightedIndex + 1)
  1358. },
  1359. function($event) {
  1360. if (
  1361. !("button" in $event) &&
  1362. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  1363. ) {
  1364. return null
  1365. }
  1366. return _vm.handleKeyEnter($event)
  1367. },
  1368. function($event) {
  1369. if (
  1370. !("button" in $event) &&
  1371. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  1372. ) {
  1373. return null
  1374. }
  1375. return _vm.close($event)
  1376. }
  1377. ]
  1378. }
  1379. },
  1380. "el-input",
  1381. [_vm.$props, _vm.$attrs],
  1382. false
  1383. ),
  1384. [
  1385. _vm.$slots.prepend
  1386. ? _c("template", { slot: "prepend" }, [_vm._t("prepend")], 2)
  1387. : _vm._e(),
  1388. _vm.$slots.append
  1389. ? _c("template", { slot: "append" }, [_vm._t("append")], 2)
  1390. : _vm._e(),
  1391. _vm.$slots.prefix
  1392. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  1393. : _vm._e(),
  1394. _vm.$slots.suffix
  1395. ? _c("template", { slot: "suffix" }, [_vm._t("suffix")], 2)
  1396. : _vm._e()
  1397. ],
  1398. 2
  1399. ),
  1400. _c(
  1401. "el-autocomplete-suggestions",
  1402. {
  1403. ref: "suggestions",
  1404. class: [_vm.popperClass ? _vm.popperClass : ""],
  1405. attrs: {
  1406. "visible-arrow": "",
  1407. "popper-options": _vm.popperOptions,
  1408. "append-to-body": _vm.popperAppendToBody,
  1409. placement: _vm.placement,
  1410. id: _vm.id
  1411. }
  1412. },
  1413. _vm._l(_vm.suggestions, function(item, index) {
  1414. return _c(
  1415. "li",
  1416. {
  1417. key: index,
  1418. class: { highlighted: _vm.highlightedIndex === index },
  1419. attrs: {
  1420. id: _vm.id + "-item-" + index,
  1421. role: "option",
  1422. "aria-selected": _vm.highlightedIndex === index
  1423. },
  1424. on: {
  1425. click: function($event) {
  1426. _vm.select(item)
  1427. }
  1428. }
  1429. },
  1430. [
  1431. _vm._t(
  1432. "default",
  1433. [
  1434. _vm._v("\n " + _vm._s(item[_vm.valueKey]) + "\n ")
  1435. ],
  1436. { item: item }
  1437. )
  1438. ],
  1439. 2
  1440. )
  1441. }),
  1442. 0
  1443. )
  1444. ],
  1445. 1
  1446. )
  1447. }
  1448. var autocompletevue_type_template_id_152f2ee6_staticRenderFns = []
  1449. autocompletevue_type_template_id_152f2ee6_render._withStripped = true
  1450. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6&
  1451. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  1452. var debounce_ = __webpack_require__(16);
  1453. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  1454. // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
  1455. var clickoutside_ = __webpack_require__(10);
  1456. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1457. // 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&
  1458. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_render = function() {
  1459. var _vm = this
  1460. var _h = _vm.$createElement
  1461. var _c = _vm._self._c || _h
  1462. return _c(
  1463. "transition",
  1464. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  1465. [
  1466. _c(
  1467. "div",
  1468. {
  1469. directives: [
  1470. {
  1471. name: "show",
  1472. rawName: "v-show",
  1473. value: _vm.showPopper,
  1474. expression: "showPopper"
  1475. }
  1476. ],
  1477. staticClass: "el-autocomplete-suggestion el-popper",
  1478. class: {
  1479. "is-loading": !_vm.parent.hideLoading && _vm.parent.loading
  1480. },
  1481. style: { width: _vm.dropdownWidth },
  1482. attrs: { role: "region" }
  1483. },
  1484. [
  1485. _c(
  1486. "el-scrollbar",
  1487. {
  1488. attrs: {
  1489. tag: "ul",
  1490. "wrap-class": "el-autocomplete-suggestion__wrap",
  1491. "view-class": "el-autocomplete-suggestion__list"
  1492. }
  1493. },
  1494. [
  1495. !_vm.parent.hideLoading && _vm.parent.loading
  1496. ? _c("li", [_c("i", { staticClass: "el-icon-loading" })])
  1497. : _vm._t("default")
  1498. ],
  1499. 2
  1500. )
  1501. ],
  1502. 1
  1503. )
  1504. ]
  1505. )
  1506. }
  1507. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns = []
  1508. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render._withStripped = true
  1509. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0&
  1510. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  1511. var vue_popper_ = __webpack_require__(5);
  1512. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  1513. // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
  1514. var scrollbar_ = __webpack_require__(18);
  1515. var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
  1516. // 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&
  1517. //
  1518. //
  1519. //
  1520. //
  1521. //
  1522. //
  1523. //
  1524. //
  1525. //
  1526. //
  1527. //
  1528. //
  1529. //
  1530. //
  1531. //
  1532. //
  1533. //
  1534. //
  1535. //
  1536. /* harmony default export */ var autocomplete_suggestionsvue_type_script_lang_js_ = ({
  1537. components: { ElScrollbar: scrollbar_default.a },
  1538. mixins: [vue_popper_default.a, emitter_default.a],
  1539. componentName: 'ElAutocompleteSuggestions',
  1540. data: function data() {
  1541. return {
  1542. parent: this.$parent,
  1543. dropdownWidth: ''
  1544. };
  1545. },
  1546. props: {
  1547. options: {
  1548. default: function _default() {
  1549. return {
  1550. gpuAcceleration: false
  1551. };
  1552. }
  1553. },
  1554. id: String
  1555. },
  1556. methods: {
  1557. select: function select(item) {
  1558. this.dispatch('ElAutocomplete', 'item-click', item);
  1559. }
  1560. },
  1561. updated: function updated() {
  1562. var _this = this;
  1563. this.$nextTick(function (_) {
  1564. _this.popperJS && _this.updatePopper();
  1565. });
  1566. },
  1567. mounted: function mounted() {
  1568. this.$parent.popperElm = this.popperElm = this.$el;
  1569. this.referenceElm = this.$parent.$refs.input.$refs.input || this.$parent.$refs.input.$refs.textarea;
  1570. this.referenceList = this.$el.querySelector('.el-autocomplete-suggestion__list');
  1571. this.referenceList.setAttribute('role', 'listbox');
  1572. this.referenceList.setAttribute('id', this.id);
  1573. },
  1574. created: function created() {
  1575. var _this2 = this;
  1576. this.$on('visible', function (val, inputWidth) {
  1577. _this2.dropdownWidth = inputWidth + 'px';
  1578. _this2.showPopper = val;
  1579. });
  1580. }
  1581. });
  1582. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js&
  1583. /* harmony default export */ var src_autocomplete_suggestionsvue_type_script_lang_js_ = (autocomplete_suggestionsvue_type_script_lang_js_);
  1584. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue
  1585. /* normalize component */
  1586. var autocomplete_suggestions_component = normalizeComponent(
  1587. src_autocomplete_suggestionsvue_type_script_lang_js_,
  1588. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render,
  1589. autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns,
  1590. false,
  1591. null,
  1592. null,
  1593. null
  1594. )
  1595. /* hot reload */
  1596. if (false) { var autocomplete_suggestions_api; }
  1597. autocomplete_suggestions_component.options.__file = "packages/autocomplete/src/autocomplete-suggestions.vue"
  1598. /* harmony default export */ var autocomplete_suggestions = (autocomplete_suggestions_component.exports);
  1599. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  1600. var focus_ = __webpack_require__(23);
  1601. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  1602. // 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&
  1603. //
  1604. //
  1605. //
  1606. //
  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. /* harmony default export */ var autocompletevue_type_script_lang_js_ = ({
  1663. name: 'ElAutocomplete',
  1664. mixins: [emitter_default.a, focus_default()('input'), migrating_default.a],
  1665. inheritAttrs: false,
  1666. componentName: 'ElAutocomplete',
  1667. components: {
  1668. ElInput: input_default.a,
  1669. ElAutocompleteSuggestions: autocomplete_suggestions
  1670. },
  1671. directives: { Clickoutside: clickoutside_default.a },
  1672. props: {
  1673. valueKey: {
  1674. type: String,
  1675. default: 'value'
  1676. },
  1677. popperClass: String,
  1678. popperOptions: Object,
  1679. placeholder: String,
  1680. clearable: {
  1681. type: Boolean,
  1682. default: false
  1683. },
  1684. disabled: Boolean,
  1685. name: String,
  1686. size: String,
  1687. value: String,
  1688. maxlength: Number,
  1689. minlength: Number,
  1690. autofocus: Boolean,
  1691. fetchSuggestions: Function,
  1692. triggerOnFocus: {
  1693. type: Boolean,
  1694. default: true
  1695. },
  1696. customItem: String,
  1697. selectWhenUnmatched: {
  1698. type: Boolean,
  1699. default: false
  1700. },
  1701. prefixIcon: String,
  1702. suffixIcon: String,
  1703. label: String,
  1704. debounce: {
  1705. type: Number,
  1706. default: 300
  1707. },
  1708. placement: {
  1709. type: String,
  1710. default: 'bottom-start'
  1711. },
  1712. hideLoading: Boolean,
  1713. popperAppendToBody: {
  1714. type: Boolean,
  1715. default: true
  1716. },
  1717. highlightFirstItem: {
  1718. type: Boolean,
  1719. default: false
  1720. }
  1721. },
  1722. data: function data() {
  1723. return {
  1724. activated: false,
  1725. suggestions: [],
  1726. loading: false,
  1727. highlightedIndex: -1,
  1728. suggestionDisabled: false
  1729. };
  1730. },
  1731. computed: {
  1732. suggestionVisible: function suggestionVisible() {
  1733. var suggestions = this.suggestions;
  1734. var isValidData = Array.isArray(suggestions) && suggestions.length > 0;
  1735. return (isValidData || this.loading) && this.activated;
  1736. },
  1737. id: function id() {
  1738. return 'el-autocomplete-' + Object(util_["generateId"])();
  1739. }
  1740. },
  1741. watch: {
  1742. suggestionVisible: function suggestionVisible(val) {
  1743. var $input = this.getInput();
  1744. if ($input) {
  1745. this.broadcast('ElAutocompleteSuggestions', 'visible', [val, $input.offsetWidth]);
  1746. }
  1747. }
  1748. },
  1749. methods: {
  1750. getMigratingConfig: function getMigratingConfig() {
  1751. return {
  1752. props: {
  1753. 'custom-item': 'custom-item is removed, use scoped slot instead.',
  1754. 'props': 'props is removed, use value-key instead.'
  1755. }
  1756. };
  1757. },
  1758. getData: function getData(queryString) {
  1759. var _this = this;
  1760. if (this.suggestionDisabled) {
  1761. return;
  1762. }
  1763. this.loading = true;
  1764. this.fetchSuggestions(queryString, function (suggestions) {
  1765. _this.loading = false;
  1766. if (_this.suggestionDisabled) {
  1767. return;
  1768. }
  1769. if (Array.isArray(suggestions)) {
  1770. _this.suggestions = suggestions;
  1771. _this.highlightedIndex = _this.highlightFirstItem ? 0 : -1;
  1772. } else {
  1773. console.error('[Element Error][Autocomplete]autocomplete suggestions must be an array');
  1774. }
  1775. });
  1776. },
  1777. handleInput: function handleInput(value) {
  1778. this.$emit('input', value);
  1779. this.suggestionDisabled = false;
  1780. if (!this.triggerOnFocus && !value) {
  1781. this.suggestionDisabled = true;
  1782. this.suggestions = [];
  1783. return;
  1784. }
  1785. this.debouncedGetData(value);
  1786. },
  1787. handleChange: function handleChange(value) {
  1788. this.$emit('change', value);
  1789. },
  1790. handleFocus: function handleFocus(event) {
  1791. this.activated = true;
  1792. this.$emit('focus', event);
  1793. if (this.triggerOnFocus) {
  1794. this.debouncedGetData(this.value);
  1795. }
  1796. },
  1797. handleBlur: function handleBlur(event) {
  1798. this.$emit('blur', event);
  1799. },
  1800. handleClear: function handleClear() {
  1801. this.activated = false;
  1802. this.$emit('clear');
  1803. },
  1804. close: function close(e) {
  1805. this.activated = false;
  1806. },
  1807. handleKeyEnter: function handleKeyEnter(e) {
  1808. var _this2 = this;
  1809. if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
  1810. e.preventDefault();
  1811. this.select(this.suggestions[this.highlightedIndex]);
  1812. } else if (this.selectWhenUnmatched) {
  1813. this.$emit('select', { value: this.value });
  1814. this.$nextTick(function (_) {
  1815. _this2.suggestions = [];
  1816. _this2.highlightedIndex = -1;
  1817. });
  1818. }
  1819. },
  1820. select: function select(item) {
  1821. var _this3 = this;
  1822. this.$emit('input', item[this.valueKey]);
  1823. this.$emit('select', item);
  1824. this.$nextTick(function (_) {
  1825. _this3.suggestions = [];
  1826. _this3.highlightedIndex = -1;
  1827. });
  1828. },
  1829. highlight: function highlight(index) {
  1830. if (!this.suggestionVisible || this.loading) {
  1831. return;
  1832. }
  1833. if (index < 0) {
  1834. this.highlightedIndex = -1;
  1835. return;
  1836. }
  1837. if (index >= this.suggestions.length) {
  1838. index = this.suggestions.length - 1;
  1839. }
  1840. var suggestion = this.$refs.suggestions.$el.querySelector('.el-autocomplete-suggestion__wrap');
  1841. var suggestionList = suggestion.querySelectorAll('.el-autocomplete-suggestion__list li');
  1842. var highlightItem = suggestionList[index];
  1843. var scrollTop = suggestion.scrollTop;
  1844. var offsetTop = highlightItem.offsetTop;
  1845. if (offsetTop + highlightItem.scrollHeight > scrollTop + suggestion.clientHeight) {
  1846. suggestion.scrollTop += highlightItem.scrollHeight;
  1847. }
  1848. if (offsetTop < scrollTop) {
  1849. suggestion.scrollTop -= highlightItem.scrollHeight;
  1850. }
  1851. this.highlightedIndex = index;
  1852. var $input = this.getInput();
  1853. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1854. },
  1855. getInput: function getInput() {
  1856. return this.$refs.input.getInput();
  1857. }
  1858. },
  1859. mounted: function mounted() {
  1860. var _this4 = this;
  1861. this.debouncedGetData = debounce_default()(this.debounce, this.getData);
  1862. this.$on('item-click', function (item) {
  1863. _this4.select(item);
  1864. });
  1865. var $input = this.getInput();
  1866. $input.setAttribute('role', 'textbox');
  1867. $input.setAttribute('aria-autocomplete', 'list');
  1868. $input.setAttribute('aria-controls', 'id');
  1869. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1870. },
  1871. beforeDestroy: function beforeDestroy() {
  1872. this.$refs.suggestions.$destroy();
  1873. }
  1874. });
  1875. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js&
  1876. /* harmony default export */ var src_autocompletevue_type_script_lang_js_ = (autocompletevue_type_script_lang_js_);
  1877. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue
  1878. /* normalize component */
  1879. var autocomplete_component = normalizeComponent(
  1880. src_autocompletevue_type_script_lang_js_,
  1881. autocompletevue_type_template_id_152f2ee6_render,
  1882. autocompletevue_type_template_id_152f2ee6_staticRenderFns,
  1883. false,
  1884. null,
  1885. null,
  1886. null
  1887. )
  1888. /* hot reload */
  1889. if (false) { var autocomplete_api; }
  1890. autocomplete_component.options.__file = "packages/autocomplete/src/autocomplete.vue"
  1891. /* harmony default export */ var autocomplete = (autocomplete_component.exports);
  1892. // CONCATENATED MODULE: ./packages/autocomplete/index.js
  1893. /* istanbul ignore next */
  1894. autocomplete.install = function (Vue) {
  1895. Vue.component(autocomplete.name, autocomplete);
  1896. };
  1897. /* harmony default export */ var packages_autocomplete = (autocomplete);
  1898. // EXTERNAL MODULE: external "element-ui/lib/button"
  1899. var button_ = __webpack_require__(13);
  1900. var button_default = /*#__PURE__*/__webpack_require__.n(button_);
  1901. // EXTERNAL MODULE: external "element-ui/lib/button-group"
  1902. var button_group_ = __webpack_require__(28);
  1903. var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
  1904. // 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&
  1905. /* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
  1906. name: 'ElDropdown',
  1907. componentName: 'ElDropdown',
  1908. mixins: [emitter_default.a, migrating_default.a],
  1909. directives: { Clickoutside: clickoutside_default.a },
  1910. components: {
  1911. ElButton: button_default.a,
  1912. ElButtonGroup: button_group_default.a
  1913. },
  1914. provide: function provide() {
  1915. return {
  1916. dropdown: this
  1917. };
  1918. },
  1919. props: {
  1920. trigger: {
  1921. type: String,
  1922. default: 'hover'
  1923. },
  1924. type: String,
  1925. size: {
  1926. type: String,
  1927. default: ''
  1928. },
  1929. splitButton: Boolean,
  1930. hideOnClick: {
  1931. type: Boolean,
  1932. default: true
  1933. },
  1934. placement: {
  1935. type: String,
  1936. default: 'bottom-end'
  1937. },
  1938. visibleArrow: {
  1939. default: true
  1940. },
  1941. showTimeout: {
  1942. type: Number,
  1943. default: 250
  1944. },
  1945. hideTimeout: {
  1946. type: Number,
  1947. default: 150
  1948. },
  1949. tabindex: {
  1950. type: Number,
  1951. default: 0
  1952. },
  1953. disabled: {
  1954. type: Boolean,
  1955. default: false
  1956. }
  1957. },
  1958. data: function data() {
  1959. return {
  1960. timeout: null,
  1961. visible: false,
  1962. triggerElm: null,
  1963. menuItems: null,
  1964. menuItemsArray: null,
  1965. dropdownElm: null,
  1966. focusing: false,
  1967. listId: 'dropdown-menu-' + Object(util_["generateId"])()
  1968. };
  1969. },
  1970. computed: {
  1971. dropdownSize: function dropdownSize() {
  1972. return this.size || (this.$ELEMENT || {}).size;
  1973. }
  1974. },
  1975. mounted: function mounted() {
  1976. this.$on('menu-item-click', this.handleMenuItemClick);
  1977. },
  1978. watch: {
  1979. visible: function visible(val) {
  1980. this.broadcast('ElDropdownMenu', 'visible', val);
  1981. this.$emit('visible-change', val);
  1982. },
  1983. focusing: function focusing(val) {
  1984. var selfDefine = this.$el.querySelector('.el-dropdown-selfdefine');
  1985. if (selfDefine) {
  1986. // 自定义
  1987. if (val) {
  1988. selfDefine.className += ' focusing';
  1989. } else {
  1990. selfDefine.className = selfDefine.className.replace('focusing', '');
  1991. }
  1992. }
  1993. }
  1994. },
  1995. methods: {
  1996. getMigratingConfig: function getMigratingConfig() {
  1997. return {
  1998. props: {
  1999. 'menu-align': 'menu-align is renamed to placement.'
  2000. }
  2001. };
  2002. },
  2003. show: function show() {
  2004. var _this = this;
  2005. if (this.disabled) return;
  2006. clearTimeout(this.timeout);
  2007. this.timeout = setTimeout(function () {
  2008. _this.visible = true;
  2009. }, this.trigger === 'click' ? 0 : this.showTimeout);
  2010. },
  2011. hide: function hide() {
  2012. var _this2 = this;
  2013. if (this.disabled) return;
  2014. this.removeTabindex();
  2015. if (this.tabindex >= 0) {
  2016. this.resetTabindex(this.triggerElm);
  2017. }
  2018. clearTimeout(this.timeout);
  2019. this.timeout = setTimeout(function () {
  2020. _this2.visible = false;
  2021. }, this.trigger === 'click' ? 0 : this.hideTimeout);
  2022. },
  2023. handleClick: function handleClick() {
  2024. if (this.disabled) return;
  2025. if (this.visible) {
  2026. this.hide();
  2027. } else {
  2028. this.show();
  2029. }
  2030. },
  2031. handleTriggerKeyDown: function handleTriggerKeyDown(ev) {
  2032. var keyCode = ev.keyCode;
  2033. if ([38, 40].indexOf(keyCode) > -1) {
  2034. // up/down
  2035. this.removeTabindex();
  2036. this.resetTabindex(this.menuItems[0]);
  2037. this.menuItems[0].focus();
  2038. ev.preventDefault();
  2039. ev.stopPropagation();
  2040. } else if (keyCode === 13) {
  2041. // space enter选中
  2042. this.handleClick();
  2043. } else if ([9, 27].indexOf(keyCode) > -1) {
  2044. // tab || esc
  2045. this.hide();
  2046. }
  2047. },
  2048. handleItemKeyDown: function handleItemKeyDown(ev) {
  2049. var keyCode = ev.keyCode;
  2050. var target = ev.target;
  2051. var currentIndex = this.menuItemsArray.indexOf(target);
  2052. var max = this.menuItemsArray.length - 1;
  2053. var nextIndex = void 0;
  2054. if ([38, 40].indexOf(keyCode) > -1) {
  2055. // up/down
  2056. if (keyCode === 38) {
  2057. // up
  2058. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  2059. } else {
  2060. // down
  2061. nextIndex = currentIndex < max ? currentIndex + 1 : max;
  2062. }
  2063. this.removeTabindex();
  2064. this.resetTabindex(this.menuItems[nextIndex]);
  2065. this.menuItems[nextIndex].focus();
  2066. ev.preventDefault();
  2067. ev.stopPropagation();
  2068. } else if (keyCode === 13) {
  2069. // enter选中
  2070. this.triggerElmFocus();
  2071. target.click();
  2072. if (this.hideOnClick) {
  2073. // click关闭
  2074. this.visible = false;
  2075. }
  2076. } else if ([9, 27].indexOf(keyCode) > -1) {
  2077. // tab // esc
  2078. this.hide();
  2079. this.triggerElmFocus();
  2080. }
  2081. },
  2082. resetTabindex: function resetTabindex(ele) {
  2083. // 下次tab时组件聚焦元素
  2084. this.removeTabindex();
  2085. ele.setAttribute('tabindex', '0'); // 下次期望的聚焦元素
  2086. },
  2087. removeTabindex: function removeTabindex() {
  2088. this.triggerElm.setAttribute('tabindex', '-1');
  2089. this.menuItemsArray.forEach(function (item) {
  2090. item.setAttribute('tabindex', '-1');
  2091. });
  2092. },
  2093. initAria: function initAria() {
  2094. this.dropdownElm.setAttribute('id', this.listId);
  2095. this.triggerElm.setAttribute('aria-haspopup', 'list');
  2096. this.triggerElm.setAttribute('aria-controls', this.listId);
  2097. if (!this.splitButton) {
  2098. // 自定义
  2099. this.triggerElm.setAttribute('role', 'button');
  2100. this.triggerElm.setAttribute('tabindex', this.tabindex);
  2101. this.triggerElm.setAttribute('class', (this.triggerElm.getAttribute('class') || '') + ' el-dropdown-selfdefine'); // 控制
  2102. }
  2103. },
  2104. initEvent: function initEvent() {
  2105. var _this3 = this;
  2106. var trigger = this.trigger,
  2107. show = this.show,
  2108. hide = this.hide,
  2109. handleClick = this.handleClick,
  2110. splitButton = this.splitButton,
  2111. handleTriggerKeyDown = this.handleTriggerKeyDown,
  2112. handleItemKeyDown = this.handleItemKeyDown;
  2113. this.triggerElm = splitButton ? this.$refs.trigger.$el : this.$slots.default[0].elm;
  2114. var dropdownElm = this.dropdownElm;
  2115. this.triggerElm.addEventListener('keydown', handleTriggerKeyDown); // triggerElm keydown
  2116. dropdownElm.addEventListener('keydown', handleItemKeyDown, true); // item keydown
  2117. // 控制自定义元素的样式
  2118. if (!splitButton) {
  2119. this.triggerElm.addEventListener('focus', function () {
  2120. _this3.focusing = true;
  2121. });
  2122. this.triggerElm.addEventListener('blur', function () {
  2123. _this3.focusing = false;
  2124. });
  2125. this.triggerElm.addEventListener('click', function () {
  2126. _this3.focusing = false;
  2127. });
  2128. }
  2129. if (trigger === 'hover') {
  2130. this.triggerElm.addEventListener('mouseenter', show);
  2131. this.triggerElm.addEventListener('mouseleave', hide);
  2132. dropdownElm.addEventListener('mouseenter', show);
  2133. dropdownElm.addEventListener('mouseleave', hide);
  2134. } else if (trigger === 'click') {
  2135. this.triggerElm.addEventListener('click', handleClick);
  2136. }
  2137. },
  2138. handleMenuItemClick: function handleMenuItemClick(command, instance) {
  2139. if (this.hideOnClick) {
  2140. this.visible = false;
  2141. }
  2142. this.$emit('command', command, instance);
  2143. },
  2144. triggerElmFocus: function triggerElmFocus() {
  2145. this.triggerElm.focus && this.triggerElm.focus();
  2146. },
  2147. initDomOperation: function initDomOperation() {
  2148. this.dropdownElm = this.popperElm;
  2149. this.menuItems = this.dropdownElm.querySelectorAll("[tabindex='-1']");
  2150. this.menuItemsArray = [].slice.call(this.menuItems);
  2151. this.initEvent();
  2152. this.initAria();
  2153. }
  2154. },
  2155. render: function render(h) {
  2156. var _this4 = this;
  2157. var hide = this.hide,
  2158. splitButton = this.splitButton,
  2159. type = this.type,
  2160. dropdownSize = this.dropdownSize,
  2161. disabled = this.disabled;
  2162. var handleMainButtonClick = function handleMainButtonClick(event) {
  2163. _this4.$emit('click', event);
  2164. hide();
  2165. };
  2166. var triggerElm = null;
  2167. if (splitButton) {
  2168. triggerElm = h('el-button-group', [h(
  2169. 'el-button',
  2170. {
  2171. attrs: { type: type, size: dropdownSize, disabled: disabled },
  2172. nativeOn: {
  2173. 'click': handleMainButtonClick
  2174. }
  2175. },
  2176. [this.$slots.default]
  2177. ), h(
  2178. 'el-button',
  2179. { ref: 'trigger', attrs: { type: type, size: dropdownSize, disabled: disabled },
  2180. 'class': 'el-dropdown__caret-button' },
  2181. [h('i', { 'class': 'el-dropdown__icon el-icon-arrow-down' })]
  2182. )]);
  2183. } else {
  2184. triggerElm = this.$slots.default;
  2185. var vnodeData = triggerElm[0].data || {};
  2186. var _vnodeData$attrs = vnodeData.attrs,
  2187. attrs = _vnodeData$attrs === undefined ? {} : _vnodeData$attrs;
  2188. if (disabled && !attrs.disabled) {
  2189. attrs.disabled = true;
  2190. vnodeData.attrs = attrs;
  2191. }
  2192. }
  2193. var menuElm = disabled ? null : this.$slots.dropdown;
  2194. return h(
  2195. 'div',
  2196. { 'class': 'el-dropdown', directives: [{
  2197. name: 'clickoutside',
  2198. value: hide
  2199. }],
  2200. attrs: { 'aria-disabled': disabled }
  2201. },
  2202. [triggerElm, menuElm]
  2203. );
  2204. }
  2205. });
  2206. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
  2207. /* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
  2208. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
  2209. var dropdown_render, dropdown_staticRenderFns
  2210. /* normalize component */
  2211. var dropdown_component = normalizeComponent(
  2212. src_dropdownvue_type_script_lang_js_,
  2213. dropdown_render,
  2214. dropdown_staticRenderFns,
  2215. false,
  2216. null,
  2217. null,
  2218. null
  2219. )
  2220. /* hot reload */
  2221. if (false) { var dropdown_api; }
  2222. dropdown_component.options.__file = "packages/dropdown/src/dropdown.vue"
  2223. /* harmony default export */ var dropdown = (dropdown_component.exports);
  2224. // CONCATENATED MODULE: ./packages/dropdown/index.js
  2225. /* istanbul ignore next */
  2226. dropdown.install = function (Vue) {
  2227. Vue.component(dropdown.name, dropdown);
  2228. };
  2229. /* harmony default export */ var packages_dropdown = (dropdown);
  2230. // 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&
  2231. var dropdown_menuvue_type_template_id_0da6b714_render = function() {
  2232. var _vm = this
  2233. var _h = _vm.$createElement
  2234. var _c = _vm._self._c || _h
  2235. return _c(
  2236. "transition",
  2237. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  2238. [
  2239. _c(
  2240. "ul",
  2241. {
  2242. directives: [
  2243. {
  2244. name: "show",
  2245. rawName: "v-show",
  2246. value: _vm.showPopper,
  2247. expression: "showPopper"
  2248. }
  2249. ],
  2250. staticClass: "el-dropdown-menu el-popper",
  2251. class: [_vm.size && "el-dropdown-menu--" + _vm.size]
  2252. },
  2253. [_vm._t("default")],
  2254. 2
  2255. )
  2256. ]
  2257. )
  2258. }
  2259. var dropdown_menuvue_type_template_id_0da6b714_staticRenderFns = []
  2260. dropdown_menuvue_type_template_id_0da6b714_render._withStripped = true
  2261. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
  2262. // 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&
  2263. //
  2264. //
  2265. //
  2266. //
  2267. //
  2268. //
  2269. //
  2270. /* harmony default export */ var dropdown_menuvue_type_script_lang_js_ = ({
  2271. name: 'ElDropdownMenu',
  2272. componentName: 'ElDropdownMenu',
  2273. mixins: [vue_popper_default.a],
  2274. props: {
  2275. visibleArrow: {
  2276. type: Boolean,
  2277. default: true
  2278. },
  2279. arrowOffset: {
  2280. type: Number,
  2281. default: 0
  2282. }
  2283. },
  2284. data: function data() {
  2285. return {
  2286. size: this.dropdown.dropdownSize
  2287. };
  2288. },
  2289. inject: ['dropdown'],
  2290. created: function created() {
  2291. var _this = this;
  2292. this.$on('updatePopper', function () {
  2293. if (_this.showPopper) _this.updatePopper();
  2294. });
  2295. this.$on('visible', function (val) {
  2296. _this.showPopper = val;
  2297. });
  2298. },
  2299. mounted: function mounted() {
  2300. this.dropdown.popperElm = this.popperElm = this.$el;
  2301. this.referenceElm = this.dropdown.$el;
  2302. // compatible with 2.6 new v-slot syntax
  2303. // issue link https://github.com/ElemeFE/element/issues/14345
  2304. this.dropdown.initDomOperation();
  2305. },
  2306. watch: {
  2307. 'dropdown.placement': {
  2308. immediate: true,
  2309. handler: function handler(val) {
  2310. this.currentPlacement = val;
  2311. }
  2312. }
  2313. }
  2314. });
  2315. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
  2316. /* harmony default export */ var src_dropdown_menuvue_type_script_lang_js_ = (dropdown_menuvue_type_script_lang_js_);
  2317. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue
  2318. /* normalize component */
  2319. var dropdown_menu_component = normalizeComponent(
  2320. src_dropdown_menuvue_type_script_lang_js_,
  2321. dropdown_menuvue_type_template_id_0da6b714_render,
  2322. dropdown_menuvue_type_template_id_0da6b714_staticRenderFns,
  2323. false,
  2324. null,
  2325. null,
  2326. null
  2327. )
  2328. /* hot reload */
  2329. if (false) { var dropdown_menu_api; }
  2330. dropdown_menu_component.options.__file = "packages/dropdown/src/dropdown-menu.vue"
  2331. /* harmony default export */ var dropdown_menu = (dropdown_menu_component.exports);
  2332. // CONCATENATED MODULE: ./packages/dropdown-menu/index.js
  2333. /* istanbul ignore next */
  2334. dropdown_menu.install = function (Vue) {
  2335. Vue.component(dropdown_menu.name, dropdown_menu);
  2336. };
  2337. /* harmony default export */ var packages_dropdown_menu = (dropdown_menu);
  2338. // 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&
  2339. var dropdown_itemvue_type_template_id_6359102a_render = function() {
  2340. var _vm = this
  2341. var _h = _vm.$createElement
  2342. var _c = _vm._self._c || _h
  2343. return _c(
  2344. "li",
  2345. {
  2346. staticClass: "el-dropdown-menu__item",
  2347. class: {
  2348. "is-disabled": _vm.disabled,
  2349. "el-dropdown-menu__item--divided": _vm.divided
  2350. },
  2351. attrs: {
  2352. "aria-disabled": _vm.disabled,
  2353. tabindex: _vm.disabled ? null : -1
  2354. },
  2355. on: { click: _vm.handleClick }
  2356. },
  2357. [_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(), _vm._t("default")],
  2358. 2
  2359. )
  2360. }
  2361. var dropdown_itemvue_type_template_id_6359102a_staticRenderFns = []
  2362. dropdown_itemvue_type_template_id_6359102a_render._withStripped = true
  2363. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
  2364. // 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&
  2365. //
  2366. //
  2367. //
  2368. //
  2369. //
  2370. //
  2371. //
  2372. //
  2373. //
  2374. //
  2375. //
  2376. //
  2377. //
  2378. //
  2379. //
  2380. /* harmony default export */ var dropdown_itemvue_type_script_lang_js_ = ({
  2381. name: 'ElDropdownItem',
  2382. mixins: [emitter_default.a],
  2383. props: {
  2384. command: {},
  2385. disabled: Boolean,
  2386. divided: Boolean,
  2387. icon: String
  2388. },
  2389. methods: {
  2390. handleClick: function handleClick(e) {
  2391. this.dispatch('ElDropdown', 'menu-item-click', [this.command, this]);
  2392. }
  2393. }
  2394. });
  2395. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
  2396. /* harmony default export */ var src_dropdown_itemvue_type_script_lang_js_ = (dropdown_itemvue_type_script_lang_js_);
  2397. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue
  2398. /* normalize component */
  2399. var dropdown_item_component = normalizeComponent(
  2400. src_dropdown_itemvue_type_script_lang_js_,
  2401. dropdown_itemvue_type_template_id_6359102a_render,
  2402. dropdown_itemvue_type_template_id_6359102a_staticRenderFns,
  2403. false,
  2404. null,
  2405. null,
  2406. null
  2407. )
  2408. /* hot reload */
  2409. if (false) { var dropdown_item_api; }
  2410. dropdown_item_component.options.__file = "packages/dropdown/src/dropdown-item.vue"
  2411. /* harmony default export */ var dropdown_item = (dropdown_item_component.exports);
  2412. // CONCATENATED MODULE: ./packages/dropdown-item/index.js
  2413. /* istanbul ignore next */
  2414. dropdown_item.install = function (Vue) {
  2415. Vue.component(dropdown_item.name, dropdown_item);
  2416. };
  2417. /* harmony default export */ var packages_dropdown_item = (dropdown_item);
  2418. // CONCATENATED MODULE: ./src/utils/aria-utils.js
  2419. var aria = aria || {};
  2420. aria.Utils = aria.Utils || {};
  2421. /**
  2422. * @desc Set focus on descendant nodes until the first focusable element is
  2423. * found.
  2424. * @param element
  2425. * DOM node for which to find the first focusable descendant.
  2426. * @returns
  2427. * true if a focusable element is found and focus is set.
  2428. */
  2429. aria.Utils.focusFirstDescendant = function (element) {
  2430. for (var i = 0; i < element.childNodes.length; i++) {
  2431. var child = element.childNodes[i];
  2432. if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
  2433. return true;
  2434. }
  2435. }
  2436. return false;
  2437. };
  2438. /**
  2439. * @desc Find the last descendant node that is focusable.
  2440. * @param element
  2441. * DOM node for which to find the last focusable descendant.
  2442. * @returns
  2443. * true if a focusable element is found and focus is set.
  2444. */
  2445. aria.Utils.focusLastDescendant = function (element) {
  2446. for (var i = element.childNodes.length - 1; i >= 0; i--) {
  2447. var child = element.childNodes[i];
  2448. if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
  2449. return true;
  2450. }
  2451. }
  2452. return false;
  2453. };
  2454. /**
  2455. * @desc Set Attempt to set focus on the current node.
  2456. * @param element
  2457. * The node to attempt to focus on.
  2458. * @returns
  2459. * true if element is focused.
  2460. */
  2461. aria.Utils.attemptFocus = function (element) {
  2462. if (!aria.Utils.isFocusable(element)) {
  2463. return false;
  2464. }
  2465. aria.Utils.IgnoreUtilFocusChanges = true;
  2466. try {
  2467. element.focus();
  2468. } catch (e) {}
  2469. aria.Utils.IgnoreUtilFocusChanges = false;
  2470. return document.activeElement === element;
  2471. };
  2472. aria.Utils.isFocusable = function (element) {
  2473. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
  2474. return true;
  2475. }
  2476. if (element.disabled) {
  2477. return false;
  2478. }
  2479. switch (element.nodeName) {
  2480. case 'A':
  2481. return !!element.href && element.rel !== 'ignore';
  2482. case 'INPUT':
  2483. return element.type !== 'hidden' && element.type !== 'file';
  2484. case 'BUTTON':
  2485. case 'SELECT':
  2486. case 'TEXTAREA':
  2487. return true;
  2488. default:
  2489. return false;
  2490. }
  2491. };
  2492. /**
  2493. * 触发一个事件
  2494. * mouseenter, mouseleave, mouseover, keyup, change, click 等
  2495. * @param {Element} elm
  2496. * @param {String} name
  2497. * @param {*} opts
  2498. */
  2499. aria.Utils.triggerEvent = function (elm, name) {
  2500. var eventName = void 0;
  2501. if (/^mouse|click/.test(name)) {
  2502. eventName = 'MouseEvents';
  2503. } else if (/^key/.test(name)) {
  2504. eventName = 'KeyboardEvent';
  2505. } else {
  2506. eventName = 'HTMLEvents';
  2507. }
  2508. var evt = document.createEvent(eventName);
  2509. for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  2510. opts[_key - 2] = arguments[_key];
  2511. }
  2512. evt.initEvent.apply(evt, [name].concat(opts));
  2513. elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
  2514. return elm;
  2515. };
  2516. aria.Utils.keys = {
  2517. tab: 9,
  2518. enter: 13,
  2519. space: 32,
  2520. left: 37,
  2521. up: 38,
  2522. right: 39,
  2523. down: 40,
  2524. esc: 27
  2525. };
  2526. /* harmony default export */ var aria_utils = (aria.Utils);
  2527. // CONCATENATED MODULE: ./src/utils/menu/aria-submenu.js
  2528. var SubMenu = function SubMenu(parent, domNode) {
  2529. this.domNode = domNode;
  2530. this.parent = parent;
  2531. this.subMenuItems = [];
  2532. this.subIndex = 0;
  2533. this.init();
  2534. };
  2535. SubMenu.prototype.init = function () {
  2536. this.subMenuItems = this.domNode.querySelectorAll('li');
  2537. this.addListeners();
  2538. };
  2539. SubMenu.prototype.gotoSubIndex = function (idx) {
  2540. if (idx === this.subMenuItems.length) {
  2541. idx = 0;
  2542. } else if (idx < 0) {
  2543. idx = this.subMenuItems.length - 1;
  2544. }
  2545. this.subMenuItems[idx].focus();
  2546. this.subIndex = idx;
  2547. };
  2548. SubMenu.prototype.addListeners = function () {
  2549. var _this = this;
  2550. var keys = aria_utils.keys;
  2551. var parentNode = this.parent.domNode;
  2552. Array.prototype.forEach.call(this.subMenuItems, function (el) {
  2553. el.addEventListener('keydown', function (event) {
  2554. var prevDef = false;
  2555. switch (event.keyCode) {
  2556. case keys.down:
  2557. _this.gotoSubIndex(_this.subIndex + 1);
  2558. prevDef = true;
  2559. break;
  2560. case keys.up:
  2561. _this.gotoSubIndex(_this.subIndex - 1);
  2562. prevDef = true;
  2563. break;
  2564. case keys.tab:
  2565. aria_utils.triggerEvent(parentNode, 'mouseleave');
  2566. break;
  2567. case keys.enter:
  2568. case keys.space:
  2569. prevDef = true;
  2570. event.currentTarget.click();
  2571. break;
  2572. }
  2573. if (prevDef) {
  2574. event.preventDefault();
  2575. event.stopPropagation();
  2576. }
  2577. return false;
  2578. });
  2579. });
  2580. };
  2581. /* harmony default export */ var aria_submenu = (SubMenu);
  2582. // CONCATENATED MODULE: ./src/utils/menu/aria-menuitem.js
  2583. var MenuItem = function MenuItem(domNode) {
  2584. this.domNode = domNode;
  2585. this.submenu = null;
  2586. this.init();
  2587. };
  2588. MenuItem.prototype.init = function () {
  2589. this.domNode.setAttribute('tabindex', '0');
  2590. var menuChild = this.domNode.querySelector('.el-menu');
  2591. if (menuChild) {
  2592. this.submenu = new aria_submenu(this, menuChild);
  2593. }
  2594. this.addListeners();
  2595. };
  2596. MenuItem.prototype.addListeners = function () {
  2597. var _this = this;
  2598. var keys = aria_utils.keys;
  2599. this.domNode.addEventListener('keydown', function (event) {
  2600. var prevDef = false;
  2601. switch (event.keyCode) {
  2602. case keys.down:
  2603. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2604. _this.submenu && _this.submenu.gotoSubIndex(0);
  2605. prevDef = true;
  2606. break;
  2607. case keys.up:
  2608. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2609. _this.submenu && _this.submenu.gotoSubIndex(_this.submenu.subMenuItems.length - 1);
  2610. prevDef = true;
  2611. break;
  2612. case keys.tab:
  2613. aria_utils.triggerEvent(event.currentTarget, 'mouseleave');
  2614. break;
  2615. case keys.enter:
  2616. case keys.space:
  2617. prevDef = true;
  2618. event.currentTarget.click();
  2619. break;
  2620. }
  2621. if (prevDef) {
  2622. event.preventDefault();
  2623. }
  2624. });
  2625. };
  2626. /* harmony default export */ var aria_menuitem = (MenuItem);
  2627. // CONCATENATED MODULE: ./src/utils/menu/aria-menubar.js
  2628. var Menu = function Menu(domNode) {
  2629. this.domNode = domNode;
  2630. this.init();
  2631. };
  2632. Menu.prototype.init = function () {
  2633. var menuChildren = this.domNode.childNodes;
  2634. [].filter.call(menuChildren, function (child) {
  2635. return child.nodeType === 1;
  2636. }).forEach(function (child) {
  2637. new aria_menuitem(child); // eslint-disable-line
  2638. });
  2639. };
  2640. /* harmony default export */ var aria_menubar = (Menu);
  2641. // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
  2642. var dom_ = __webpack_require__(1);
  2643. // 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&
  2644. /* harmony default export */ var menuvue_type_script_lang_js_ = ({
  2645. name: 'ElMenu',
  2646. render: function render(h) {
  2647. var component = h(
  2648. 'ul',
  2649. {
  2650. attrs: {
  2651. role: 'menubar'
  2652. },
  2653. key: +this.collapse,
  2654. style: { backgroundColor: this.backgroundColor || '' },
  2655. 'class': {
  2656. 'el-menu--horizontal': this.mode === 'horizontal',
  2657. 'el-menu--collapse': this.collapse,
  2658. "el-menu": true
  2659. }
  2660. },
  2661. [this.$slots.default]
  2662. );
  2663. if (this.collapseTransition) {
  2664. return h('el-menu-collapse-transition', [component]);
  2665. } else {
  2666. return component;
  2667. }
  2668. },
  2669. componentName: 'ElMenu',
  2670. mixins: [emitter_default.a, migrating_default.a],
  2671. provide: function provide() {
  2672. return {
  2673. rootMenu: this
  2674. };
  2675. },
  2676. components: {
  2677. 'el-menu-collapse-transition': {
  2678. functional: true,
  2679. render: function render(createElement, context) {
  2680. var data = {
  2681. props: {
  2682. mode: 'out-in'
  2683. },
  2684. on: {
  2685. beforeEnter: function beforeEnter(el) {
  2686. el.style.opacity = 0.2;
  2687. },
  2688. enter: function enter(el) {
  2689. Object(dom_["addClass"])(el, 'el-opacity-transition');
  2690. el.style.opacity = 1;
  2691. },
  2692. afterEnter: function afterEnter(el) {
  2693. Object(dom_["removeClass"])(el, 'el-opacity-transition');
  2694. el.style.opacity = '';
  2695. },
  2696. beforeLeave: function beforeLeave(el) {
  2697. if (!el.dataset) el.dataset = {};
  2698. if (Object(dom_["hasClass"])(el, 'el-menu--collapse')) {
  2699. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2700. el.dataset.oldOverflow = el.style.overflow;
  2701. el.dataset.scrollWidth = el.clientWidth;
  2702. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2703. } else {
  2704. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2705. el.dataset.oldOverflow = el.style.overflow;
  2706. el.dataset.scrollWidth = el.clientWidth;
  2707. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2708. }
  2709. el.style.width = el.scrollWidth + 'px';
  2710. el.style.overflow = 'hidden';
  2711. },
  2712. leave: function leave(el) {
  2713. Object(dom_["addClass"])(el, 'horizontal-collapse-transition');
  2714. el.style.width = el.dataset.scrollWidth + 'px';
  2715. }
  2716. }
  2717. };
  2718. return createElement('transition', data, context.children);
  2719. }
  2720. }
  2721. },
  2722. props: {
  2723. mode: {
  2724. type: String,
  2725. default: 'vertical'
  2726. },
  2727. defaultActive: {
  2728. type: String,
  2729. default: ''
  2730. },
  2731. defaultOpeneds: Array,
  2732. uniqueOpened: Boolean,
  2733. router: Boolean,
  2734. menuTrigger: {
  2735. type: String,
  2736. default: 'hover'
  2737. },
  2738. collapse: Boolean,
  2739. backgroundColor: String,
  2740. textColor: String,
  2741. activeTextColor: String,
  2742. collapseTransition: {
  2743. type: Boolean,
  2744. default: true
  2745. }
  2746. },
  2747. data: function data() {
  2748. return {
  2749. activeIndex: this.defaultActive,
  2750. openedMenus: this.defaultOpeneds && !this.collapse ? this.defaultOpeneds.slice(0) : [],
  2751. items: {},
  2752. submenus: {}
  2753. };
  2754. },
  2755. computed: {
  2756. hoverBackground: function hoverBackground() {
  2757. return this.backgroundColor ? this.mixColor(this.backgroundColor, 0.2) : '';
  2758. },
  2759. isMenuPopup: function isMenuPopup() {
  2760. return this.mode === 'horizontal' || this.mode === 'vertical' && this.collapse;
  2761. }
  2762. },
  2763. watch: {
  2764. defaultActive: function defaultActive(value) {
  2765. if (!this.items[value]) {
  2766. this.activeIndex = null;
  2767. }
  2768. this.updateActiveIndex(value);
  2769. },
  2770. defaultOpeneds: function defaultOpeneds(value) {
  2771. if (!this.collapse) {
  2772. this.openedMenus = value;
  2773. }
  2774. },
  2775. collapse: function collapse(value) {
  2776. if (value) this.openedMenus = [];
  2777. this.broadcast('ElSubmenu', 'toggle-collapse', value);
  2778. }
  2779. },
  2780. methods: {
  2781. updateActiveIndex: function updateActiveIndex(val) {
  2782. var item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];
  2783. if (item) {
  2784. this.activeIndex = item.index;
  2785. this.initOpenedMenu();
  2786. } else {
  2787. this.activeIndex = null;
  2788. }
  2789. },
  2790. getMigratingConfig: function getMigratingConfig() {
  2791. return {
  2792. props: {
  2793. 'theme': 'theme is removed.'
  2794. }
  2795. };
  2796. },
  2797. getColorChannels: function getColorChannels(color) {
  2798. color = color.replace('#', '');
  2799. if (/^[0-9a-fA-F]{3}$/.test(color)) {
  2800. color = color.split('');
  2801. for (var i = 2; i >= 0; i--) {
  2802. color.splice(i, 0, color[i]);
  2803. }
  2804. color = color.join('');
  2805. }
  2806. if (/^[0-9a-fA-F]{6}$/.test(color)) {
  2807. return {
  2808. red: parseInt(color.slice(0, 2), 16),
  2809. green: parseInt(color.slice(2, 4), 16),
  2810. blue: parseInt(color.slice(4, 6), 16)
  2811. };
  2812. } else {
  2813. return {
  2814. red: 255,
  2815. green: 255,
  2816. blue: 255
  2817. };
  2818. }
  2819. },
  2820. mixColor: function mixColor(color, percent) {
  2821. var _getColorChannels = this.getColorChannels(color),
  2822. red = _getColorChannels.red,
  2823. green = _getColorChannels.green,
  2824. blue = _getColorChannels.blue;
  2825. if (percent > 0) {
  2826. // shade given color
  2827. red *= 1 - percent;
  2828. green *= 1 - percent;
  2829. blue *= 1 - percent;
  2830. } else {
  2831. // tint given color
  2832. red += (255 - red) * percent;
  2833. green += (255 - green) * percent;
  2834. blue += (255 - blue) * percent;
  2835. }
  2836. return 'rgb(' + Math.round(red) + ', ' + Math.round(green) + ', ' + Math.round(blue) + ')';
  2837. },
  2838. addItem: function addItem(item) {
  2839. this.$set(this.items, item.index, item);
  2840. },
  2841. removeItem: function removeItem(item) {
  2842. delete this.items[item.index];
  2843. },
  2844. addSubmenu: function addSubmenu(item) {
  2845. this.$set(this.submenus, item.index, item);
  2846. },
  2847. removeSubmenu: function removeSubmenu(item) {
  2848. delete this.submenus[item.index];
  2849. },
  2850. openMenu: function openMenu(index, indexPath) {
  2851. var openedMenus = this.openedMenus;
  2852. if (openedMenus.indexOf(index) !== -1) return;
  2853. // 将不在该菜单路径下的其余菜单收起
  2854. // collapse all menu that are not under current menu item
  2855. if (this.uniqueOpened) {
  2856. this.openedMenus = openedMenus.filter(function (index) {
  2857. return indexPath.indexOf(index) !== -1;
  2858. });
  2859. }
  2860. this.openedMenus.push(index);
  2861. },
  2862. closeMenu: function closeMenu(index) {
  2863. var i = this.openedMenus.indexOf(index);
  2864. if (i !== -1) {
  2865. this.openedMenus.splice(i, 1);
  2866. }
  2867. },
  2868. handleSubmenuClick: function handleSubmenuClick(submenu) {
  2869. var index = submenu.index,
  2870. indexPath = submenu.indexPath;
  2871. var isOpened = this.openedMenus.indexOf(index) !== -1;
  2872. if (isOpened) {
  2873. this.closeMenu(index);
  2874. this.$emit('close', index, indexPath);
  2875. } else {
  2876. this.openMenu(index, indexPath);
  2877. this.$emit('open', index, indexPath);
  2878. }
  2879. },
  2880. handleItemClick: function handleItemClick(item) {
  2881. var _this = this;
  2882. var index = item.index,
  2883. indexPath = item.indexPath;
  2884. var oldActiveIndex = this.activeIndex;
  2885. var hasIndex = item.index !== null;
  2886. if (hasIndex) {
  2887. this.activeIndex = item.index;
  2888. }
  2889. this.$emit('select', index, indexPath, item);
  2890. if (this.mode === 'horizontal' || this.collapse) {
  2891. this.openedMenus = [];
  2892. }
  2893. if (this.router && hasIndex) {
  2894. this.routeToItem(item, function (error) {
  2895. _this.activeIndex = oldActiveIndex;
  2896. if (error) {
  2897. // vue-router 3.1.0+ push/replace cause NavigationDuplicated error
  2898. // https://github.com/ElemeFE/element/issues/17044
  2899. if (error.name === 'NavigationDuplicated') return;
  2900. console.error(error);
  2901. }
  2902. });
  2903. }
  2904. },
  2905. // 初始化展开菜单
  2906. // initialize opened menu
  2907. initOpenedMenu: function initOpenedMenu() {
  2908. var _this2 = this;
  2909. var index = this.activeIndex;
  2910. var activeItem = this.items[index];
  2911. if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
  2912. var indexPath = activeItem.indexPath;
  2913. // 展开该菜单项的路径上所有子菜单
  2914. // expand all submenus of the menu item
  2915. indexPath.forEach(function (index) {
  2916. var submenu = _this2.submenus[index];
  2917. submenu && _this2.openMenu(index, submenu.indexPath);
  2918. });
  2919. },
  2920. routeToItem: function routeToItem(item, onError) {
  2921. var route = item.route || item.index;
  2922. try {
  2923. this.$router.push(route, function () {}, onError);
  2924. } catch (e) {
  2925. console.error(e);
  2926. }
  2927. },
  2928. open: function open(index) {
  2929. var _this3 = this;
  2930. var indexPath = this.submenus[index.toString()].indexPath;
  2931. indexPath.forEach(function (i) {
  2932. return _this3.openMenu(i, indexPath);
  2933. });
  2934. },
  2935. close: function close(index) {
  2936. this.closeMenu(index);
  2937. }
  2938. },
  2939. mounted: function mounted() {
  2940. this.initOpenedMenu();
  2941. this.$on('item-click', this.handleItemClick);
  2942. this.$on('submenu-click', this.handleSubmenuClick);
  2943. if (this.mode === 'horizontal') {
  2944. new aria_menubar(this.$el); // eslint-disable-line
  2945. }
  2946. this.$watch('items', this.updateActiveIndex);
  2947. }
  2948. });
  2949. // CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=script&lang=js&
  2950. /* harmony default export */ var src_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_);
  2951. // CONCATENATED MODULE: ./packages/menu/src/menu.vue
  2952. var menu_render, menu_staticRenderFns
  2953. /* normalize component */
  2954. var menu_component = normalizeComponent(
  2955. src_menuvue_type_script_lang_js_,
  2956. menu_render,
  2957. menu_staticRenderFns,
  2958. false,
  2959. null,
  2960. null,
  2961. null
  2962. )
  2963. /* hot reload */
  2964. if (false) { var menu_api; }
  2965. menu_component.options.__file = "packages/menu/src/menu.vue"
  2966. /* harmony default export */ var src_menu = (menu_component.exports);
  2967. // CONCATENATED MODULE: ./packages/menu/index.js
  2968. /* istanbul ignore next */
  2969. src_menu.install = function (Vue) {
  2970. Vue.component(src_menu.name, src_menu);
  2971. };
  2972. /* harmony default export */ var packages_menu = (src_menu);
  2973. // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
  2974. var collapse_transition_ = __webpack_require__(21);
  2975. var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
  2976. // CONCATENATED MODULE: ./packages/menu/src/menu-mixin.js
  2977. /* harmony default export */ var menu_mixin = ({
  2978. inject: ['rootMenu'],
  2979. computed: {
  2980. indexPath: function indexPath() {
  2981. var path = [this.index];
  2982. var parent = this.$parent;
  2983. while (parent.$options.componentName !== 'ElMenu') {
  2984. if (parent.index) {
  2985. path.unshift(parent.index);
  2986. }
  2987. parent = parent.$parent;
  2988. }
  2989. return path;
  2990. },
  2991. parentMenu: function parentMenu() {
  2992. var parent = this.$parent;
  2993. while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
  2994. parent = parent.$parent;
  2995. }
  2996. return parent;
  2997. },
  2998. paddingStyle: function paddingStyle() {
  2999. if (this.rootMenu.mode !== 'vertical') return {};
  3000. var padding = 20;
  3001. var parent = this.$parent;
  3002. if (this.rootMenu.collapse) {
  3003. padding = 20;
  3004. } else {
  3005. while (parent && parent.$options.componentName !== 'ElMenu') {
  3006. if (parent.$options.componentName === 'ElSubmenu') {
  3007. padding += 20;
  3008. }
  3009. parent = parent.$parent;
  3010. }
  3011. }
  3012. return { paddingLeft: padding + 'px' };
  3013. }
  3014. }
  3015. });
  3016. // 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&
  3017. var poperMixins = {
  3018. props: {
  3019. transformOrigin: {
  3020. type: [Boolean, String],
  3021. default: false
  3022. },
  3023. offset: vue_popper_default.a.props.offset,
  3024. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  3025. popperOptions: vue_popper_default.a.props.popperOptions
  3026. },
  3027. data: vue_popper_default.a.data,
  3028. methods: vue_popper_default.a.methods,
  3029. beforeDestroy: vue_popper_default.a.beforeDestroy,
  3030. deactivated: vue_popper_default.a.deactivated
  3031. };
  3032. /* harmony default export */ var submenuvue_type_script_lang_js_ = ({
  3033. name: 'ElSubmenu',
  3034. componentName: 'ElSubmenu',
  3035. mixins: [menu_mixin, emitter_default.a, poperMixins],
  3036. components: { ElCollapseTransition: collapse_transition_default.a },
  3037. props: {
  3038. index: {
  3039. type: String,
  3040. required: true
  3041. },
  3042. showTimeout: {
  3043. type: Number,
  3044. default: 300
  3045. },
  3046. hideTimeout: {
  3047. type: Number,
  3048. default: 300
  3049. },
  3050. popperClass: String,
  3051. disabled: Boolean,
  3052. popperAppendToBody: {
  3053. type: Boolean,
  3054. default: undefined
  3055. }
  3056. },
  3057. data: function data() {
  3058. return {
  3059. popperJS: null,
  3060. timeout: null,
  3061. items: {},
  3062. submenus: {},
  3063. mouseInChild: false
  3064. };
  3065. },
  3066. watch: {
  3067. opened: function opened(val) {
  3068. var _this = this;
  3069. if (this.isMenuPopup) {
  3070. this.$nextTick(function (_) {
  3071. _this.updatePopper();
  3072. });
  3073. }
  3074. }
  3075. },
  3076. computed: {
  3077. // popper option
  3078. appendToBody: function appendToBody() {
  3079. return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
  3080. },
  3081. menuTransitionName: function menuTransitionName() {
  3082. return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
  3083. },
  3084. opened: function opened() {
  3085. return this.rootMenu.openedMenus.indexOf(this.index) > -1;
  3086. },
  3087. active: function active() {
  3088. var isActive = false;
  3089. var submenus = this.submenus;
  3090. var items = this.items;
  3091. Object.keys(items).forEach(function (index) {
  3092. if (items[index].active) {
  3093. isActive = true;
  3094. }
  3095. });
  3096. Object.keys(submenus).forEach(function (index) {
  3097. if (submenus[index].active) {
  3098. isActive = true;
  3099. }
  3100. });
  3101. return isActive;
  3102. },
  3103. hoverBackground: function hoverBackground() {
  3104. return this.rootMenu.hoverBackground;
  3105. },
  3106. backgroundColor: function backgroundColor() {
  3107. return this.rootMenu.backgroundColor || '';
  3108. },
  3109. activeTextColor: function activeTextColor() {
  3110. return this.rootMenu.activeTextColor || '';
  3111. },
  3112. textColor: function textColor() {
  3113. return this.rootMenu.textColor || '';
  3114. },
  3115. mode: function mode() {
  3116. return this.rootMenu.mode;
  3117. },
  3118. isMenuPopup: function isMenuPopup() {
  3119. return this.rootMenu.isMenuPopup;
  3120. },
  3121. titleStyle: function titleStyle() {
  3122. if (this.mode !== 'horizontal') {
  3123. return {
  3124. color: this.textColor
  3125. };
  3126. }
  3127. return {
  3128. borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
  3129. color: this.active ? this.activeTextColor : this.textColor
  3130. };
  3131. },
  3132. isFirstLevel: function isFirstLevel() {
  3133. var isFirstLevel = true;
  3134. var parent = this.$parent;
  3135. while (parent && parent !== this.rootMenu) {
  3136. if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
  3137. isFirstLevel = false;
  3138. break;
  3139. } else {
  3140. parent = parent.$parent;
  3141. }
  3142. }
  3143. return isFirstLevel;
  3144. }
  3145. },
  3146. methods: {
  3147. handleCollapseToggle: function handleCollapseToggle(value) {
  3148. if (value) {
  3149. this.initPopper();
  3150. } else {
  3151. this.doDestroy();
  3152. }
  3153. },
  3154. addItem: function addItem(item) {
  3155. this.$set(this.items, item.index, item);
  3156. },
  3157. removeItem: function removeItem(item) {
  3158. delete this.items[item.index];
  3159. },
  3160. addSubmenu: function addSubmenu(item) {
  3161. this.$set(this.submenus, item.index, item);
  3162. },
  3163. removeSubmenu: function removeSubmenu(item) {
  3164. delete this.submenus[item.index];
  3165. },
  3166. handleClick: function handleClick() {
  3167. var rootMenu = this.rootMenu,
  3168. disabled = this.disabled;
  3169. if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3170. return;
  3171. }
  3172. this.dispatch('ElMenu', 'submenu-click', this);
  3173. },
  3174. handleMouseenter: function handleMouseenter(event) {
  3175. var _this2 = this;
  3176. var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
  3177. if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
  3178. return;
  3179. }
  3180. var rootMenu = this.rootMenu,
  3181. disabled = this.disabled;
  3182. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3183. return;
  3184. }
  3185. this.dispatch('ElSubmenu', 'mouse-enter-child');
  3186. clearTimeout(this.timeout);
  3187. this.timeout = setTimeout(function () {
  3188. _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
  3189. }, showTimeout);
  3190. if (this.appendToBody) {
  3191. this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
  3192. }
  3193. },
  3194. handleMouseleave: function handleMouseleave() {
  3195. var _this3 = this;
  3196. var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3197. var rootMenu = this.rootMenu;
  3198. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
  3199. return;
  3200. }
  3201. this.dispatch('ElSubmenu', 'mouse-leave-child');
  3202. clearTimeout(this.timeout);
  3203. this.timeout = setTimeout(function () {
  3204. !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
  3205. }, this.hideTimeout);
  3206. if (this.appendToBody && deepDispatch) {
  3207. if (this.$parent.$options.name === 'ElSubmenu') {
  3208. this.$parent.handleMouseleave(true);
  3209. }
  3210. }
  3211. },
  3212. handleTitleMouseenter: function handleTitleMouseenter() {
  3213. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3214. var title = this.$refs['submenu-title'];
  3215. title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
  3216. },
  3217. handleTitleMouseleave: function handleTitleMouseleave() {
  3218. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3219. var title = this.$refs['submenu-title'];
  3220. title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
  3221. },
  3222. updatePlacement: function updatePlacement() {
  3223. this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
  3224. },
  3225. initPopper: function initPopper() {
  3226. this.referenceElm = this.$el;
  3227. this.popperElm = this.$refs.menu;
  3228. this.updatePlacement();
  3229. }
  3230. },
  3231. created: function created() {
  3232. var _this4 = this;
  3233. this.$on('toggle-collapse', this.handleCollapseToggle);
  3234. this.$on('mouse-enter-child', function () {
  3235. _this4.mouseInChild = true;
  3236. clearTimeout(_this4.timeout);
  3237. });
  3238. this.$on('mouse-leave-child', function () {
  3239. _this4.mouseInChild = false;
  3240. clearTimeout(_this4.timeout);
  3241. });
  3242. },
  3243. mounted: function mounted() {
  3244. this.parentMenu.addSubmenu(this);
  3245. this.rootMenu.addSubmenu(this);
  3246. this.initPopper();
  3247. },
  3248. beforeDestroy: function beforeDestroy() {
  3249. this.parentMenu.removeSubmenu(this);
  3250. this.rootMenu.removeSubmenu(this);
  3251. },
  3252. render: function render(h) {
  3253. var _this5 = this;
  3254. var active = this.active,
  3255. opened = this.opened,
  3256. paddingStyle = this.paddingStyle,
  3257. titleStyle = this.titleStyle,
  3258. backgroundColor = this.backgroundColor,
  3259. rootMenu = this.rootMenu,
  3260. currentPlacement = this.currentPlacement,
  3261. menuTransitionName = this.menuTransitionName,
  3262. mode = this.mode,
  3263. disabled = this.disabled,
  3264. popperClass = this.popperClass,
  3265. $slots = this.$slots,
  3266. isFirstLevel = this.isFirstLevel;
  3267. var popupMenu = h(
  3268. 'transition',
  3269. {
  3270. attrs: { name: menuTransitionName }
  3271. },
  3272. [h(
  3273. 'div',
  3274. {
  3275. ref: 'menu',
  3276. directives: [{
  3277. name: 'show',
  3278. value: opened
  3279. }],
  3280. 'class': ['el-menu--' + mode, popperClass],
  3281. on: {
  3282. 'mouseenter': function mouseenter($event) {
  3283. return _this5.handleMouseenter($event, 100);
  3284. },
  3285. 'mouseleave': function mouseleave() {
  3286. return _this5.handleMouseleave(true);
  3287. },
  3288. 'focus': function focus($event) {
  3289. return _this5.handleMouseenter($event, 100);
  3290. }
  3291. }
  3292. },
  3293. [h(
  3294. 'ul',
  3295. {
  3296. attrs: {
  3297. role: 'menu'
  3298. },
  3299. 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
  3300. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3301. [$slots.default]
  3302. )]
  3303. )]
  3304. );
  3305. var inlineMenu = h('el-collapse-transition', [h(
  3306. 'ul',
  3307. {
  3308. attrs: {
  3309. role: 'menu'
  3310. },
  3311. 'class': 'el-menu el-menu--inline',
  3312. directives: [{
  3313. name: 'show',
  3314. value: opened
  3315. }],
  3316. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3317. [$slots.default]
  3318. )]);
  3319. var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
  3320. return h(
  3321. 'li',
  3322. {
  3323. 'class': {
  3324. 'el-submenu': true,
  3325. 'is-active': active,
  3326. 'is-opened': opened,
  3327. 'is-disabled': disabled
  3328. },
  3329. attrs: { role: 'menuitem',
  3330. 'aria-haspopup': 'true',
  3331. 'aria-expanded': opened
  3332. },
  3333. on: {
  3334. 'mouseenter': this.handleMouseenter,
  3335. 'mouseleave': function mouseleave() {
  3336. return _this5.handleMouseleave(false);
  3337. },
  3338. 'focus': this.handleMouseenter
  3339. }
  3340. },
  3341. [h(
  3342. 'div',
  3343. {
  3344. 'class': 'el-submenu__title',
  3345. ref: 'submenu-title',
  3346. on: {
  3347. 'click': this.handleClick,
  3348. 'mouseenter': this.handleTitleMouseenter,
  3349. 'mouseleave': this.handleTitleMouseleave
  3350. },
  3351. style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
  3352. },
  3353. [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
  3354. ), this.isMenuPopup ? popupMenu : inlineMenu]
  3355. );
  3356. }
  3357. });
  3358. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  3359. /* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
  3360. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
  3361. var submenu_render, submenu_staticRenderFns
  3362. /* normalize component */
  3363. var submenu_component = normalizeComponent(
  3364. src_submenuvue_type_script_lang_js_,
  3365. submenu_render,
  3366. submenu_staticRenderFns,
  3367. false,
  3368. null,
  3369. null,
  3370. null
  3371. )
  3372. /* hot reload */
  3373. if (false) { var submenu_api; }
  3374. submenu_component.options.__file = "packages/menu/src/submenu.vue"
  3375. /* harmony default export */ var submenu = (submenu_component.exports);
  3376. // CONCATENATED MODULE: ./packages/submenu/index.js
  3377. /* istanbul ignore next */
  3378. submenu.install = function (Vue) {
  3379. Vue.component(submenu.name, submenu);
  3380. };
  3381. /* harmony default export */ var packages_submenu = (submenu);
  3382. // 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&
  3383. var menu_itemvue_type_template_id_2a5dbfea_render = function() {
  3384. var _vm = this
  3385. var _h = _vm.$createElement
  3386. var _c = _vm._self._c || _h
  3387. return _c(
  3388. "li",
  3389. {
  3390. staticClass: "el-menu-item",
  3391. class: {
  3392. "is-active": _vm.active,
  3393. "is-disabled": _vm.disabled
  3394. },
  3395. style: [
  3396. _vm.paddingStyle,
  3397. _vm.itemStyle,
  3398. { backgroundColor: _vm.backgroundColor }
  3399. ],
  3400. attrs: { role: "menuitem", tabindex: "-1" },
  3401. on: {
  3402. click: _vm.handleClick,
  3403. mouseenter: _vm.onMouseEnter,
  3404. focus: _vm.onMouseEnter,
  3405. blur: _vm.onMouseLeave,
  3406. mouseleave: _vm.onMouseLeave
  3407. }
  3408. },
  3409. [
  3410. _vm.parentMenu.$options.componentName === "ElMenu" &&
  3411. _vm.rootMenu.collapse &&
  3412. _vm.$slots.title
  3413. ? _c("el-tooltip", { attrs: { effect: "dark", placement: "right" } }, [
  3414. _c(
  3415. "div",
  3416. { attrs: { slot: "content" }, slot: "content" },
  3417. [_vm._t("title")],
  3418. 2
  3419. ),
  3420. _c(
  3421. "div",
  3422. {
  3423. staticStyle: {
  3424. position: "absolute",
  3425. left: "0",
  3426. top: "0",
  3427. height: "100%",
  3428. width: "100%",
  3429. display: "inline-block",
  3430. "box-sizing": "border-box",
  3431. padding: "0 20px"
  3432. }
  3433. },
  3434. [_vm._t("default")],
  3435. 2
  3436. )
  3437. ])
  3438. : [_vm._t("default"), _vm._t("title")]
  3439. ],
  3440. 2
  3441. )
  3442. }
  3443. var menu_itemvue_type_template_id_2a5dbfea_staticRenderFns = []
  3444. menu_itemvue_type_template_id_2a5dbfea_render._withStripped = true
  3445. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
  3446. // EXTERNAL MODULE: external "element-ui/lib/tooltip"
  3447. var tooltip_ = __webpack_require__(26);
  3448. var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
  3449. // 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&
  3450. //
  3451. //
  3452. //
  3453. //
  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. /* harmony default export */ var menu_itemvue_type_script_lang_js_ = ({
  3481. name: 'ElMenuItem',
  3482. componentName: 'ElMenuItem',
  3483. mixins: [menu_mixin, emitter_default.a],
  3484. components: { ElTooltip: tooltip_default.a },
  3485. props: {
  3486. index: {
  3487. default: null,
  3488. validator: function validator(val) {
  3489. return typeof val === 'string' || val === null;
  3490. }
  3491. },
  3492. route: [String, Object],
  3493. disabled: Boolean
  3494. },
  3495. computed: {
  3496. active: function active() {
  3497. return this.index === this.rootMenu.activeIndex;
  3498. },
  3499. hoverBackground: function hoverBackground() {
  3500. return this.rootMenu.hoverBackground;
  3501. },
  3502. backgroundColor: function backgroundColor() {
  3503. return this.rootMenu.backgroundColor || '';
  3504. },
  3505. activeTextColor: function activeTextColor() {
  3506. return this.rootMenu.activeTextColor || '';
  3507. },
  3508. textColor: function textColor() {
  3509. return this.rootMenu.textColor || '';
  3510. },
  3511. mode: function mode() {
  3512. return this.rootMenu.mode;
  3513. },
  3514. itemStyle: function itemStyle() {
  3515. var style = {
  3516. color: this.active ? this.activeTextColor : this.textColor
  3517. };
  3518. if (this.mode === 'horizontal' && !this.isNested) {
  3519. style.borderBottomColor = this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent';
  3520. }
  3521. return style;
  3522. },
  3523. isNested: function isNested() {
  3524. return this.parentMenu !== this.rootMenu;
  3525. }
  3526. },
  3527. methods: {
  3528. onMouseEnter: function onMouseEnter() {
  3529. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3530. this.$el.style.backgroundColor = this.hoverBackground;
  3531. },
  3532. onMouseLeave: function onMouseLeave() {
  3533. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3534. this.$el.style.backgroundColor = this.backgroundColor;
  3535. },
  3536. handleClick: function handleClick() {
  3537. if (!this.disabled) {
  3538. this.dispatch('ElMenu', 'item-click', this);
  3539. this.$emit('click', this);
  3540. }
  3541. }
  3542. },
  3543. mounted: function mounted() {
  3544. this.parentMenu.addItem(this);
  3545. this.rootMenu.addItem(this);
  3546. },
  3547. beforeDestroy: function beforeDestroy() {
  3548. this.parentMenu.removeItem(this);
  3549. this.rootMenu.removeItem(this);
  3550. }
  3551. });
  3552. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
  3553. /* harmony default export */ var src_menu_itemvue_type_script_lang_js_ = (menu_itemvue_type_script_lang_js_);
  3554. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue
  3555. /* normalize component */
  3556. var menu_item_component = normalizeComponent(
  3557. src_menu_itemvue_type_script_lang_js_,
  3558. menu_itemvue_type_template_id_2a5dbfea_render,
  3559. menu_itemvue_type_template_id_2a5dbfea_staticRenderFns,
  3560. false,
  3561. null,
  3562. null,
  3563. null
  3564. )
  3565. /* hot reload */
  3566. if (false) { var menu_item_api; }
  3567. menu_item_component.options.__file = "packages/menu/src/menu-item.vue"
  3568. /* harmony default export */ var menu_item = (menu_item_component.exports);
  3569. // CONCATENATED MODULE: ./packages/menu-item/index.js
  3570. /* istanbul ignore next */
  3571. menu_item.install = function (Vue) {
  3572. Vue.component(menu_item.name, menu_item);
  3573. };
  3574. /* harmony default export */ var packages_menu_item = (menu_item);
  3575. // 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&
  3576. var menu_item_groupvue_type_template_id_543b7bdc_render = function() {
  3577. var _vm = this
  3578. var _h = _vm.$createElement
  3579. var _c = _vm._self._c || _h
  3580. return _c("li", { staticClass: "el-menu-item-group" }, [
  3581. _c(
  3582. "div",
  3583. {
  3584. staticClass: "el-menu-item-group__title",
  3585. style: { paddingLeft: _vm.levelPadding + "px" }
  3586. },
  3587. [!_vm.$slots.title ? [_vm._v(_vm._s(_vm.title))] : _vm._t("title")],
  3588. 2
  3589. ),
  3590. _c("ul", [_vm._t("default")], 2)
  3591. ])
  3592. }
  3593. var menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns = []
  3594. menu_item_groupvue_type_template_id_543b7bdc_render._withStripped = true
  3595. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
  3596. // 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&
  3597. //
  3598. //
  3599. //
  3600. //
  3601. //
  3602. //
  3603. //
  3604. //
  3605. //
  3606. //
  3607. //
  3608. /* harmony default export */ var menu_item_groupvue_type_script_lang_js_ = ({
  3609. name: 'ElMenuItemGroup',
  3610. componentName: 'ElMenuItemGroup',
  3611. inject: ['rootMenu'],
  3612. props: {
  3613. title: {
  3614. type: String
  3615. }
  3616. },
  3617. data: function data() {
  3618. return {
  3619. paddingLeft: 20
  3620. };
  3621. },
  3622. computed: {
  3623. levelPadding: function levelPadding() {
  3624. var padding = 20;
  3625. var parent = this.$parent;
  3626. if (this.rootMenu.collapse) return 20;
  3627. while (parent && parent.$options.componentName !== 'ElMenu') {
  3628. if (parent.$options.componentName === 'ElSubmenu') {
  3629. padding += 20;
  3630. }
  3631. parent = parent.$parent;
  3632. }
  3633. return padding;
  3634. }
  3635. }
  3636. });
  3637. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
  3638. /* harmony default export */ var src_menu_item_groupvue_type_script_lang_js_ = (menu_item_groupvue_type_script_lang_js_);
  3639. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue
  3640. /* normalize component */
  3641. var menu_item_group_component = normalizeComponent(
  3642. src_menu_item_groupvue_type_script_lang_js_,
  3643. menu_item_groupvue_type_template_id_543b7bdc_render,
  3644. menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns,
  3645. false,
  3646. null,
  3647. null,
  3648. null
  3649. )
  3650. /* hot reload */
  3651. if (false) { var menu_item_group_api; }
  3652. menu_item_group_component.options.__file = "packages/menu/src/menu-item-group.vue"
  3653. /* harmony default export */ var menu_item_group = (menu_item_group_component.exports);
  3654. // CONCATENATED MODULE: ./packages/menu-item-group/index.js
  3655. /* istanbul ignore next */
  3656. menu_item_group.install = function (Vue) {
  3657. Vue.component(menu_item_group.name, menu_item_group);
  3658. };
  3659. /* harmony default export */ var packages_menu_item_group = (menu_item_group);
  3660. // 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&
  3661. var inputvue_type_template_id_343dd774_render = function() {
  3662. var _vm = this
  3663. var _h = _vm.$createElement
  3664. var _c = _vm._self._c || _h
  3665. return _c(
  3666. "div",
  3667. {
  3668. class: [
  3669. _vm.type === "textarea" ? "el-textarea" : "el-input",
  3670. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  3671. {
  3672. "is-disabled": _vm.inputDisabled,
  3673. "is-exceed": _vm.inputExceed,
  3674. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  3675. "el-input-group--append": _vm.$slots.append,
  3676. "el-input-group--prepend": _vm.$slots.prepend,
  3677. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  3678. "el-input--suffix":
  3679. _vm.$slots.suffix ||
  3680. _vm.suffixIcon ||
  3681. _vm.clearable ||
  3682. _vm.showPassword
  3683. }
  3684. ],
  3685. on: {
  3686. mouseenter: function($event) {
  3687. _vm.hovering = true
  3688. },
  3689. mouseleave: function($event) {
  3690. _vm.hovering = false
  3691. }
  3692. }
  3693. },
  3694. [
  3695. _vm.type !== "textarea"
  3696. ? [
  3697. _vm.$slots.prepend
  3698. ? _c(
  3699. "div",
  3700. { staticClass: "el-input-group__prepend" },
  3701. [_vm._t("prepend")],
  3702. 2
  3703. )
  3704. : _vm._e(),
  3705. _vm.type !== "textarea"
  3706. ? _c(
  3707. "input",
  3708. _vm._b(
  3709. {
  3710. ref: "input",
  3711. staticClass: "el-input__inner",
  3712. attrs: {
  3713. tabindex: _vm.tabindex,
  3714. type: _vm.showPassword
  3715. ? _vm.passwordVisible
  3716. ? "text"
  3717. : "password"
  3718. : _vm.type,
  3719. disabled: _vm.inputDisabled,
  3720. readonly: _vm.readonly,
  3721. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3722. "aria-label": _vm.label
  3723. },
  3724. on: {
  3725. compositionstart: _vm.handleCompositionStart,
  3726. compositionupdate: _vm.handleCompositionUpdate,
  3727. compositionend: _vm.handleCompositionEnd,
  3728. input: _vm.handleInput,
  3729. focus: _vm.handleFocus,
  3730. blur: _vm.handleBlur,
  3731. change: _vm.handleChange
  3732. }
  3733. },
  3734. "input",
  3735. _vm.$attrs,
  3736. false
  3737. )
  3738. )
  3739. : _vm._e(),
  3740. _vm.$slots.prefix || _vm.prefixIcon
  3741. ? _c(
  3742. "span",
  3743. { staticClass: "el-input__prefix" },
  3744. [
  3745. _vm._t("prefix"),
  3746. _vm.prefixIcon
  3747. ? _c("i", {
  3748. staticClass: "el-input__icon",
  3749. class: _vm.prefixIcon
  3750. })
  3751. : _vm._e()
  3752. ],
  3753. 2
  3754. )
  3755. : _vm._e(),
  3756. _vm.getSuffixVisible()
  3757. ? _c("span", { staticClass: "el-input__suffix" }, [
  3758. _c(
  3759. "span",
  3760. { staticClass: "el-input__suffix-inner" },
  3761. [
  3762. !_vm.showClear ||
  3763. !_vm.showPwdVisible ||
  3764. !_vm.isWordLimitVisible
  3765. ? [
  3766. _vm._t("suffix"),
  3767. _vm.suffixIcon
  3768. ? _c("i", {
  3769. staticClass: "el-input__icon",
  3770. class: _vm.suffixIcon
  3771. })
  3772. : _vm._e()
  3773. ]
  3774. : _vm._e(),
  3775. _vm.showClear
  3776. ? _c("i", {
  3777. staticClass:
  3778. "el-input__icon el-icon-circle-close el-input__clear",
  3779. on: {
  3780. mousedown: function($event) {
  3781. $event.preventDefault()
  3782. },
  3783. click: _vm.clear
  3784. }
  3785. })
  3786. : _vm._e(),
  3787. _vm.showPwdVisible
  3788. ? _c("i", {
  3789. staticClass:
  3790. "el-input__icon el-icon-view el-input__clear",
  3791. on: { click: _vm.handlePasswordVisible }
  3792. })
  3793. : _vm._e(),
  3794. _vm.isWordLimitVisible
  3795. ? _c("span", { staticClass: "el-input__count" }, [
  3796. _c(
  3797. "span",
  3798. { staticClass: "el-input__count-inner" },
  3799. [
  3800. _vm._v(
  3801. "\n " +
  3802. _vm._s(_vm.textLength) +
  3803. "/" +
  3804. _vm._s(_vm.upperLimit) +
  3805. "\n "
  3806. )
  3807. ]
  3808. )
  3809. ])
  3810. : _vm._e()
  3811. ],
  3812. 2
  3813. ),
  3814. _vm.validateState
  3815. ? _c("i", {
  3816. staticClass: "el-input__icon",
  3817. class: ["el-input__validateIcon", _vm.validateIcon]
  3818. })
  3819. : _vm._e()
  3820. ])
  3821. : _vm._e(),
  3822. _vm.$slots.append
  3823. ? _c(
  3824. "div",
  3825. { staticClass: "el-input-group__append" },
  3826. [_vm._t("append")],
  3827. 2
  3828. )
  3829. : _vm._e()
  3830. ]
  3831. : _c(
  3832. "textarea",
  3833. _vm._b(
  3834. {
  3835. ref: "textarea",
  3836. staticClass: "el-textarea__inner",
  3837. style: _vm.textareaStyle,
  3838. attrs: {
  3839. tabindex: _vm.tabindex,
  3840. disabled: _vm.inputDisabled,
  3841. readonly: _vm.readonly,
  3842. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3843. "aria-label": _vm.label
  3844. },
  3845. on: {
  3846. compositionstart: _vm.handleCompositionStart,
  3847. compositionupdate: _vm.handleCompositionUpdate,
  3848. compositionend: _vm.handleCompositionEnd,
  3849. input: _vm.handleInput,
  3850. focus: _vm.handleFocus,
  3851. blur: _vm.handleBlur,
  3852. change: _vm.handleChange
  3853. }
  3854. },
  3855. "textarea",
  3856. _vm.$attrs,
  3857. false
  3858. )
  3859. ),
  3860. _vm.isWordLimitVisible && _vm.type === "textarea"
  3861. ? _c("span", { staticClass: "el-input__count" }, [
  3862. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  3863. ])
  3864. : _vm._e()
  3865. ],
  3866. 2
  3867. )
  3868. }
  3869. var inputvue_type_template_id_343dd774_staticRenderFns = []
  3870. inputvue_type_template_id_343dd774_render._withStripped = true
  3871. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  3872. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  3873. var hiddenTextarea = void 0;
  3874. 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';
  3875. 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'];
  3876. function calculateNodeStyling(targetElement) {
  3877. var style = window.getComputedStyle(targetElement);
  3878. var boxSizing = style.getPropertyValue('box-sizing');
  3879. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  3880. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  3881. var contextStyle = CONTEXT_STYLE.map(function (name) {
  3882. return name + ':' + style.getPropertyValue(name);
  3883. }).join(';');
  3884. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  3885. }
  3886. function calcTextareaHeight(targetElement) {
  3887. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  3888. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  3889. if (!hiddenTextarea) {
  3890. hiddenTextarea = document.createElement('textarea');
  3891. document.body.appendChild(hiddenTextarea);
  3892. }
  3893. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  3894. paddingSize = _calculateNodeStyling.paddingSize,
  3895. borderSize = _calculateNodeStyling.borderSize,
  3896. boxSizing = _calculateNodeStyling.boxSizing,
  3897. contextStyle = _calculateNodeStyling.contextStyle;
  3898. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  3899. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  3900. var height = hiddenTextarea.scrollHeight;
  3901. var result = {};
  3902. if (boxSizing === 'border-box') {
  3903. height = height + borderSize;
  3904. } else if (boxSizing === 'content-box') {
  3905. height = height - paddingSize;
  3906. }
  3907. hiddenTextarea.value = '';
  3908. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  3909. if (minRows !== null) {
  3910. var minHeight = singleRowHeight * minRows;
  3911. if (boxSizing === 'border-box') {
  3912. minHeight = minHeight + paddingSize + borderSize;
  3913. }
  3914. height = Math.max(minHeight, height);
  3915. result.minHeight = minHeight + 'px';
  3916. }
  3917. if (maxRows !== null) {
  3918. var maxHeight = singleRowHeight * maxRows;
  3919. if (boxSizing === 'border-box') {
  3920. maxHeight = maxHeight + paddingSize + borderSize;
  3921. }
  3922. height = Math.min(maxHeight, height);
  3923. }
  3924. result.height = height + 'px';
  3925. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  3926. hiddenTextarea = null;
  3927. return result;
  3928. };
  3929. // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
  3930. var merge_ = __webpack_require__(7);
  3931. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  3932. // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
  3933. var shared_ = __webpack_require__(19);
  3934. // 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&
  3935. //
  3936. //
  3937. //
  3938. //
  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. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  4045. name: 'ElInput',
  4046. componentName: 'ElInput',
  4047. mixins: [emitter_default.a, migrating_default.a],
  4048. inheritAttrs: false,
  4049. inject: {
  4050. elForm: {
  4051. default: ''
  4052. },
  4053. elFormItem: {
  4054. default: ''
  4055. }
  4056. },
  4057. data: function data() {
  4058. return {
  4059. textareaCalcStyle: {},
  4060. hovering: false,
  4061. focused: false,
  4062. isComposing: false,
  4063. passwordVisible: false
  4064. };
  4065. },
  4066. props: {
  4067. value: [String, Number],
  4068. size: String,
  4069. resize: String,
  4070. form: String,
  4071. disabled: Boolean,
  4072. readonly: Boolean,
  4073. type: {
  4074. type: String,
  4075. default: 'text'
  4076. },
  4077. autosize: {
  4078. type: [Boolean, Object],
  4079. default: false
  4080. },
  4081. autocomplete: {
  4082. type: String,
  4083. default: 'off'
  4084. },
  4085. /** @Deprecated in next major version */
  4086. autoComplete: {
  4087. type: String,
  4088. validator: function validator(val) {
  4089. false && false;
  4090. return true;
  4091. }
  4092. },
  4093. validateEvent: {
  4094. type: Boolean,
  4095. default: true
  4096. },
  4097. suffixIcon: String,
  4098. prefixIcon: String,
  4099. label: String,
  4100. clearable: {
  4101. type: Boolean,
  4102. default: false
  4103. },
  4104. showPassword: {
  4105. type: Boolean,
  4106. default: false
  4107. },
  4108. showWordLimit: {
  4109. type: Boolean,
  4110. default: false
  4111. },
  4112. tabindex: String
  4113. },
  4114. computed: {
  4115. _elFormItemSize: function _elFormItemSize() {
  4116. return (this.elFormItem || {}).elFormItemSize;
  4117. },
  4118. validateState: function validateState() {
  4119. return this.elFormItem ? this.elFormItem.validateState : '';
  4120. },
  4121. needStatusIcon: function needStatusIcon() {
  4122. return this.elForm ? this.elForm.statusIcon : false;
  4123. },
  4124. validateIcon: function validateIcon() {
  4125. return {
  4126. validating: 'el-icon-loading',
  4127. success: 'el-icon-circle-check',
  4128. error: 'el-icon-circle-close'
  4129. }[this.validateState];
  4130. },
  4131. textareaStyle: function textareaStyle() {
  4132. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  4133. },
  4134. inputSize: function inputSize() {
  4135. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4136. },
  4137. inputDisabled: function inputDisabled() {
  4138. return this.disabled || (this.elForm || {}).disabled;
  4139. },
  4140. nativeInputValue: function nativeInputValue() {
  4141. return this.value === null || this.value === undefined ? '' : String(this.value);
  4142. },
  4143. showClear: function showClear() {
  4144. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  4145. },
  4146. showPwdVisible: function showPwdVisible() {
  4147. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  4148. },
  4149. isWordLimitVisible: function isWordLimitVisible() {
  4150. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  4151. },
  4152. upperLimit: function upperLimit() {
  4153. return this.$attrs.maxlength;
  4154. },
  4155. textLength: function textLength() {
  4156. if (typeof this.value === 'number') {
  4157. return String(this.value).length;
  4158. }
  4159. return (this.value || '').length;
  4160. },
  4161. inputExceed: function inputExceed() {
  4162. // show exceed style if length of initial value greater then maxlength
  4163. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  4164. }
  4165. },
  4166. watch: {
  4167. value: function value(val) {
  4168. this.$nextTick(this.resizeTextarea);
  4169. if (this.validateEvent) {
  4170. this.dispatch('ElFormItem', 'el.form.change', [val]);
  4171. }
  4172. },
  4173. // native input value is set explicitly
  4174. // do not use v-model / :value in template
  4175. // see: https://github.com/ElemeFE/element/issues/14521
  4176. nativeInputValue: function nativeInputValue() {
  4177. this.setNativeInputValue();
  4178. },
  4179. // when change between <input> and <textarea>,
  4180. // update DOM dependent value and styles
  4181. // https://github.com/ElemeFE/element/issues/14857
  4182. type: function type() {
  4183. var _this = this;
  4184. this.$nextTick(function () {
  4185. _this.setNativeInputValue();
  4186. _this.resizeTextarea();
  4187. _this.updateIconOffset();
  4188. });
  4189. }
  4190. },
  4191. methods: {
  4192. focus: function focus() {
  4193. this.getInput().focus();
  4194. },
  4195. blur: function blur() {
  4196. this.getInput().blur();
  4197. },
  4198. getMigratingConfig: function getMigratingConfig() {
  4199. return {
  4200. props: {
  4201. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  4202. 'on-icon-click': 'on-icon-click is removed.'
  4203. },
  4204. events: {
  4205. 'click': 'click is removed.'
  4206. }
  4207. };
  4208. },
  4209. handleBlur: function handleBlur(event) {
  4210. this.focused = false;
  4211. this.$emit('blur', event);
  4212. if (this.validateEvent) {
  4213. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  4214. }
  4215. },
  4216. select: function select() {
  4217. this.getInput().select();
  4218. },
  4219. resizeTextarea: function resizeTextarea() {
  4220. if (this.$isServer) return;
  4221. var autosize = this.autosize,
  4222. type = this.type;
  4223. if (type !== 'textarea') return;
  4224. if (!autosize) {
  4225. this.textareaCalcStyle = {
  4226. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  4227. };
  4228. return;
  4229. }
  4230. var minRows = autosize.minRows;
  4231. var maxRows = autosize.maxRows;
  4232. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  4233. },
  4234. setNativeInputValue: function setNativeInputValue() {
  4235. var input = this.getInput();
  4236. if (!input) return;
  4237. if (input.value === this.nativeInputValue) return;
  4238. input.value = this.nativeInputValue;
  4239. },
  4240. handleFocus: function handleFocus(event) {
  4241. this.focused = true;
  4242. this.$emit('focus', event);
  4243. },
  4244. handleCompositionStart: function handleCompositionStart(event) {
  4245. this.$emit('compositionstart', event);
  4246. this.isComposing = true;
  4247. },
  4248. handleCompositionUpdate: function handleCompositionUpdate(event) {
  4249. this.$emit('compositionupdate', event);
  4250. var text = event.target.value;
  4251. var lastCharacter = text[text.length - 1] || '';
  4252. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  4253. },
  4254. handleCompositionEnd: function handleCompositionEnd(event) {
  4255. this.$emit('compositionend', event);
  4256. if (this.isComposing) {
  4257. this.isComposing = false;
  4258. this.handleInput(event);
  4259. }
  4260. },
  4261. handleInput: function handleInput(event) {
  4262. // should not emit input during composition
  4263. // see: https://github.com/ElemeFE/element/issues/10516
  4264. if (this.isComposing) return;
  4265. // hack for https://github.com/ElemeFE/element/issues/8548
  4266. // should remove the following line when we don't support IE
  4267. if (event.target.value === this.nativeInputValue) return;
  4268. this.$emit('input', event.target.value);
  4269. // ensure native input value is controlled
  4270. // see: https://github.com/ElemeFE/element/issues/12850
  4271. this.$nextTick(this.setNativeInputValue);
  4272. },
  4273. handleChange: function handleChange(event) {
  4274. this.$emit('change', event.target.value);
  4275. },
  4276. calcIconOffset: function calcIconOffset(place) {
  4277. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  4278. if (!elList.length) return;
  4279. var el = null;
  4280. for (var i = 0; i < elList.length; i++) {
  4281. if (elList[i].parentNode === this.$el) {
  4282. el = elList[i];
  4283. break;
  4284. }
  4285. }
  4286. if (!el) return;
  4287. var pendantMap = {
  4288. suffix: 'append',
  4289. prefix: 'prepend'
  4290. };
  4291. var pendant = pendantMap[place];
  4292. if (this.$slots[pendant]) {
  4293. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  4294. } else {
  4295. el.removeAttribute('style');
  4296. }
  4297. },
  4298. updateIconOffset: function updateIconOffset() {
  4299. this.calcIconOffset('prefix');
  4300. this.calcIconOffset('suffix');
  4301. },
  4302. clear: function clear() {
  4303. this.$emit('input', '');
  4304. this.$emit('change', '');
  4305. this.$emit('clear');
  4306. },
  4307. handlePasswordVisible: function handlePasswordVisible() {
  4308. var _this2 = this;
  4309. this.passwordVisible = !this.passwordVisible;
  4310. this.$nextTick(function () {
  4311. _this2.focus();
  4312. });
  4313. },
  4314. getInput: function getInput() {
  4315. return this.$refs.input || this.$refs.textarea;
  4316. },
  4317. getSuffixVisible: function getSuffixVisible() {
  4318. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  4319. }
  4320. },
  4321. created: function created() {
  4322. this.$on('inputSelect', this.select);
  4323. },
  4324. mounted: function mounted() {
  4325. this.setNativeInputValue();
  4326. this.resizeTextarea();
  4327. this.updateIconOffset();
  4328. },
  4329. updated: function updated() {
  4330. this.$nextTick(this.updateIconOffset);
  4331. }
  4332. });
  4333. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  4334. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  4335. // CONCATENATED MODULE: ./packages/input/src/input.vue
  4336. /* normalize component */
  4337. var input_component = normalizeComponent(
  4338. src_inputvue_type_script_lang_js_,
  4339. inputvue_type_template_id_343dd774_render,
  4340. inputvue_type_template_id_343dd774_staticRenderFns,
  4341. false,
  4342. null,
  4343. null,
  4344. null
  4345. )
  4346. /* hot reload */
  4347. if (false) { var input_api; }
  4348. input_component.options.__file = "packages/input/src/input.vue"
  4349. /* harmony default export */ var src_input = (input_component.exports);
  4350. // CONCATENATED MODULE: ./packages/input/index.js
  4351. /* istanbul ignore next */
  4352. src_input.install = function (Vue) {
  4353. Vue.component(src_input.name, src_input);
  4354. };
  4355. /* harmony default export */ var packages_input = (src_input);
  4356. // 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&
  4357. var input_numbervue_type_template_id_42f8cf66_render = function() {
  4358. var _vm = this
  4359. var _h = _vm.$createElement
  4360. var _c = _vm._self._c || _h
  4361. return _c(
  4362. "div",
  4363. {
  4364. class: [
  4365. "el-input-number",
  4366. _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "",
  4367. { "is-disabled": _vm.inputNumberDisabled },
  4368. { "is-without-controls": !_vm.controls },
  4369. { "is-controls-right": _vm.controlsAtRight }
  4370. ],
  4371. on: {
  4372. dragstart: function($event) {
  4373. $event.preventDefault()
  4374. }
  4375. }
  4376. },
  4377. [
  4378. _vm.controls
  4379. ? _c(
  4380. "span",
  4381. {
  4382. directives: [
  4383. {
  4384. name: "repeat-click",
  4385. rawName: "v-repeat-click",
  4386. value: _vm.decrease,
  4387. expression: "decrease"
  4388. }
  4389. ],
  4390. staticClass: "el-input-number__decrease",
  4391. class: { "is-disabled": _vm.minDisabled },
  4392. attrs: { role: "button" },
  4393. on: {
  4394. keydown: function($event) {
  4395. if (
  4396. !("button" in $event) &&
  4397. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4398. ) {
  4399. return null
  4400. }
  4401. return _vm.decrease($event)
  4402. }
  4403. }
  4404. },
  4405. [
  4406. _c("i", {
  4407. class:
  4408. "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus")
  4409. })
  4410. ]
  4411. )
  4412. : _vm._e(),
  4413. _vm.controls
  4414. ? _c(
  4415. "span",
  4416. {
  4417. directives: [
  4418. {
  4419. name: "repeat-click",
  4420. rawName: "v-repeat-click",
  4421. value: _vm.increase,
  4422. expression: "increase"
  4423. }
  4424. ],
  4425. staticClass: "el-input-number__increase",
  4426. class: { "is-disabled": _vm.maxDisabled },
  4427. attrs: { role: "button" },
  4428. on: {
  4429. keydown: function($event) {
  4430. if (
  4431. !("button" in $event) &&
  4432. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4433. ) {
  4434. return null
  4435. }
  4436. return _vm.increase($event)
  4437. }
  4438. }
  4439. },
  4440. [
  4441. _c("i", {
  4442. class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus")
  4443. })
  4444. ]
  4445. )
  4446. : _vm._e(),
  4447. _c("el-input", {
  4448. ref: "input",
  4449. attrs: {
  4450. value: _vm.displayValue,
  4451. placeholder: _vm.placeholder,
  4452. disabled: _vm.inputNumberDisabled,
  4453. size: _vm.inputNumberSize,
  4454. max: _vm.max,
  4455. min: _vm.min,
  4456. name: _vm.name,
  4457. label: _vm.label
  4458. },
  4459. on: {
  4460. blur: _vm.handleBlur,
  4461. focus: _vm.handleFocus,
  4462. input: _vm.handleInput,
  4463. change: _vm.handleInputChange
  4464. },
  4465. nativeOn: {
  4466. keydown: [
  4467. function($event) {
  4468. if (
  4469. !("button" in $event) &&
  4470. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  4471. ) {
  4472. return null
  4473. }
  4474. $event.preventDefault()
  4475. return _vm.increase($event)
  4476. },
  4477. function($event) {
  4478. if (
  4479. !("button" in $event) &&
  4480. _vm._k($event.keyCode, "down", 40, $event.key, [
  4481. "Down",
  4482. "ArrowDown"
  4483. ])
  4484. ) {
  4485. return null
  4486. }
  4487. $event.preventDefault()
  4488. return _vm.decrease($event)
  4489. }
  4490. ]
  4491. }
  4492. })
  4493. ],
  4494. 1
  4495. )
  4496. }
  4497. var input_numbervue_type_template_id_42f8cf66_staticRenderFns = []
  4498. input_numbervue_type_template_id_42f8cf66_render._withStripped = true
  4499. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  4500. // CONCATENATED MODULE: ./src/directives/repeat-click.js
  4501. /* harmony default export */ var repeat_click = ({
  4502. bind: function bind(el, binding, vnode) {
  4503. var interval = null;
  4504. var startTime = void 0;
  4505. var handler = function handler() {
  4506. return vnode.context[binding.expression].apply();
  4507. };
  4508. var clear = function clear() {
  4509. if (Date.now() - startTime < 100) {
  4510. handler();
  4511. }
  4512. clearInterval(interval);
  4513. interval = null;
  4514. };
  4515. Object(dom_["on"])(el, 'mousedown', function (e) {
  4516. if (e.button !== 0) return;
  4517. startTime = Date.now();
  4518. Object(dom_["once"])(document, 'mouseup', clear);
  4519. clearInterval(interval);
  4520. interval = setInterval(handler, 100);
  4521. });
  4522. }
  4523. });
  4524. // 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&
  4525. //
  4526. //
  4527. //
  4528. //
  4529. //
  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. /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({
  4573. name: 'ElInputNumber',
  4574. mixins: [focus_default()('input')],
  4575. inject: {
  4576. elForm: {
  4577. default: ''
  4578. },
  4579. elFormItem: {
  4580. default: ''
  4581. }
  4582. },
  4583. directives: {
  4584. repeatClick: repeat_click
  4585. },
  4586. components: {
  4587. ElInput: input_default.a
  4588. },
  4589. props: {
  4590. step: {
  4591. type: Number,
  4592. default: 1
  4593. },
  4594. stepStrictly: {
  4595. type: Boolean,
  4596. default: false
  4597. },
  4598. max: {
  4599. type: Number,
  4600. default: Infinity
  4601. },
  4602. min: {
  4603. type: Number,
  4604. default: -Infinity
  4605. },
  4606. value: {},
  4607. disabled: Boolean,
  4608. size: String,
  4609. controls: {
  4610. type: Boolean,
  4611. default: true
  4612. },
  4613. controlsPosition: {
  4614. type: String,
  4615. default: ''
  4616. },
  4617. name: String,
  4618. label: String,
  4619. placeholder: String,
  4620. precision: {
  4621. type: Number,
  4622. validator: function validator(val) {
  4623. return val >= 0 && val === parseInt(val, 10);
  4624. }
  4625. }
  4626. },
  4627. data: function data() {
  4628. return {
  4629. currentValue: 0,
  4630. userInput: null
  4631. };
  4632. },
  4633. watch: {
  4634. value: {
  4635. immediate: true,
  4636. handler: function handler(value) {
  4637. var newVal = value === undefined ? value : Number(value);
  4638. if (newVal !== undefined) {
  4639. if (isNaN(newVal)) {
  4640. return;
  4641. }
  4642. if (this.stepStrictly) {
  4643. var stepPrecision = this.getPrecision(this.step);
  4644. var precisionFactor = Math.pow(10, stepPrecision);
  4645. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  4646. }
  4647. if (this.precision !== undefined) {
  4648. newVal = this.toPrecision(newVal, this.precision);
  4649. }
  4650. }
  4651. if (newVal >= this.max) newVal = this.max;
  4652. if (newVal <= this.min) newVal = this.min;
  4653. this.currentValue = newVal;
  4654. this.userInput = null;
  4655. this.$emit('input', newVal);
  4656. }
  4657. }
  4658. },
  4659. computed: {
  4660. minDisabled: function minDisabled() {
  4661. return this._decrease(this.value, this.step) < this.min;
  4662. },
  4663. maxDisabled: function maxDisabled() {
  4664. return this._increase(this.value, this.step) > this.max;
  4665. },
  4666. numPrecision: function numPrecision() {
  4667. var value = this.value,
  4668. step = this.step,
  4669. getPrecision = this.getPrecision,
  4670. precision = this.precision;
  4671. var stepPrecision = getPrecision(step);
  4672. if (precision !== undefined) {
  4673. if (stepPrecision > precision) {
  4674. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  4675. }
  4676. return precision;
  4677. } else {
  4678. return Math.max(getPrecision(value), stepPrecision);
  4679. }
  4680. },
  4681. controlsAtRight: function controlsAtRight() {
  4682. return this.controls && this.controlsPosition === 'right';
  4683. },
  4684. _elFormItemSize: function _elFormItemSize() {
  4685. return (this.elFormItem || {}).elFormItemSize;
  4686. },
  4687. inputNumberSize: function inputNumberSize() {
  4688. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4689. },
  4690. inputNumberDisabled: function inputNumberDisabled() {
  4691. return this.disabled || !!(this.elForm || {}).disabled;
  4692. },
  4693. displayValue: function displayValue() {
  4694. if (this.userInput !== null) {
  4695. return this.userInput;
  4696. }
  4697. var currentValue = this.currentValue;
  4698. if (typeof currentValue === 'number') {
  4699. if (this.stepStrictly) {
  4700. var stepPrecision = this.getPrecision(this.step);
  4701. var precisionFactor = Math.pow(10, stepPrecision);
  4702. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  4703. }
  4704. if (this.precision !== undefined) {
  4705. currentValue = currentValue.toFixed(this.precision);
  4706. }
  4707. }
  4708. return currentValue;
  4709. }
  4710. },
  4711. methods: {
  4712. toPrecision: function toPrecision(num, precision) {
  4713. if (precision === undefined) precision = this.numPrecision;
  4714. return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
  4715. },
  4716. getPrecision: function getPrecision(value) {
  4717. if (value === undefined) return 0;
  4718. var valueString = value.toString();
  4719. var dotPosition = valueString.indexOf('.');
  4720. var precision = 0;
  4721. if (dotPosition !== -1) {
  4722. precision = valueString.length - dotPosition - 1;
  4723. }
  4724. return precision;
  4725. },
  4726. _increase: function _increase(val, step) {
  4727. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4728. var precisionFactor = Math.pow(10, this.numPrecision);
  4729. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  4730. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  4731. },
  4732. _decrease: function _decrease(val, step) {
  4733. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4734. var precisionFactor = Math.pow(10, this.numPrecision);
  4735. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  4736. },
  4737. increase: function increase() {
  4738. if (this.inputNumberDisabled || this.maxDisabled) return;
  4739. var value = this.value || 0;
  4740. var newVal = this._increase(value, this.step);
  4741. this.setCurrentValue(newVal);
  4742. },
  4743. decrease: function decrease() {
  4744. if (this.inputNumberDisabled || this.minDisabled) return;
  4745. var value = this.value || 0;
  4746. var newVal = this._decrease(value, this.step);
  4747. this.setCurrentValue(newVal);
  4748. },
  4749. handleBlur: function handleBlur(event) {
  4750. this.$emit('blur', event);
  4751. },
  4752. handleFocus: function handleFocus(event) {
  4753. this.$emit('focus', event);
  4754. },
  4755. setCurrentValue: function setCurrentValue(newVal) {
  4756. var oldVal = this.currentValue;
  4757. if (typeof newVal === 'number' && this.precision !== undefined) {
  4758. newVal = this.toPrecision(newVal, this.precision);
  4759. }
  4760. if (newVal >= this.max) newVal = this.max;
  4761. if (newVal <= this.min) newVal = this.min;
  4762. if (oldVal === newVal) return;
  4763. this.userInput = null;
  4764. this.$emit('input', newVal);
  4765. this.$emit('change', newVal, oldVal);
  4766. this.currentValue = newVal;
  4767. },
  4768. handleInput: function handleInput(value) {
  4769. this.userInput = value;
  4770. },
  4771. handleInputChange: function handleInputChange(value) {
  4772. var newVal = value === '' ? undefined : Number(value);
  4773. if (!isNaN(newVal) || value === '') {
  4774. this.setCurrentValue(newVal);
  4775. }
  4776. this.userInput = null;
  4777. },
  4778. select: function select() {
  4779. this.$refs.input.select();
  4780. }
  4781. },
  4782. mounted: function mounted() {
  4783. var innerInput = this.$refs.input.$refs.input;
  4784. innerInput.setAttribute('role', 'spinbutton');
  4785. innerInput.setAttribute('aria-valuemax', this.max);
  4786. innerInput.setAttribute('aria-valuemin', this.min);
  4787. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4788. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  4789. },
  4790. updated: function updated() {
  4791. if (!this.$refs || !this.$refs.input) return;
  4792. var innerInput = this.$refs.input.$refs.input;
  4793. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4794. }
  4795. });
  4796. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  4797. /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_);
  4798. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue
  4799. /* normalize component */
  4800. var input_number_component = normalizeComponent(
  4801. src_input_numbervue_type_script_lang_js_,
  4802. input_numbervue_type_template_id_42f8cf66_render,
  4803. input_numbervue_type_template_id_42f8cf66_staticRenderFns,
  4804. false,
  4805. null,
  4806. null,
  4807. null
  4808. )
  4809. /* hot reload */
  4810. if (false) { var input_number_api; }
  4811. input_number_component.options.__file = "packages/input-number/src/input-number.vue"
  4812. /* harmony default export */ var input_number = (input_number_component.exports);
  4813. // CONCATENATED MODULE: ./packages/input-number/index.js
  4814. /* istanbul ignore next */
  4815. input_number.install = function (Vue) {
  4816. Vue.component(input_number.name, input_number);
  4817. };
  4818. /* harmony default export */ var packages_input_number = (input_number);
  4819. // 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&
  4820. var radiovue_type_template_id_69cd6268_render = function() {
  4821. var _vm = this
  4822. var _h = _vm.$createElement
  4823. var _c = _vm._self._c || _h
  4824. return _c(
  4825. "label",
  4826. {
  4827. staticClass: "el-radio",
  4828. class: [
  4829. _vm.border && _vm.radioSize ? "el-radio--" + _vm.radioSize : "",
  4830. { "is-disabled": _vm.isDisabled },
  4831. { "is-focus": _vm.focus },
  4832. { "is-bordered": _vm.border },
  4833. { "is-checked": _vm.model === _vm.label }
  4834. ],
  4835. attrs: {
  4836. role: "radio",
  4837. "aria-checked": _vm.model === _vm.label,
  4838. "aria-disabled": _vm.isDisabled,
  4839. tabindex: _vm.tabIndex
  4840. },
  4841. on: {
  4842. keydown: function($event) {
  4843. if (
  4844. !("button" in $event) &&
  4845. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  4846. ) {
  4847. return null
  4848. }
  4849. $event.stopPropagation()
  4850. $event.preventDefault()
  4851. _vm.model = _vm.isDisabled ? _vm.model : _vm.label
  4852. }
  4853. }
  4854. },
  4855. [
  4856. _c(
  4857. "span",
  4858. {
  4859. staticClass: "el-radio__input",
  4860. class: {
  4861. "is-disabled": _vm.isDisabled,
  4862. "is-checked": _vm.model === _vm.label
  4863. }
  4864. },
  4865. [
  4866. _c("span", { staticClass: "el-radio__inner" }),
  4867. _c("input", {
  4868. directives: [
  4869. {
  4870. name: "model",
  4871. rawName: "v-model",
  4872. value: _vm.model,
  4873. expression: "model"
  4874. }
  4875. ],
  4876. ref: "radio",
  4877. staticClass: "el-radio__original",
  4878. attrs: {
  4879. type: "radio",
  4880. "aria-hidden": "true",
  4881. name: _vm.name,
  4882. disabled: _vm.isDisabled,
  4883. tabindex: "-1",
  4884. autocomplete: "off"
  4885. },
  4886. domProps: {
  4887. value: _vm.label,
  4888. checked: _vm._q(_vm.model, _vm.label)
  4889. },
  4890. on: {
  4891. focus: function($event) {
  4892. _vm.focus = true
  4893. },
  4894. blur: function($event) {
  4895. _vm.focus = false
  4896. },
  4897. change: [
  4898. function($event) {
  4899. _vm.model = _vm.label
  4900. },
  4901. _vm.handleChange
  4902. ]
  4903. }
  4904. })
  4905. ]
  4906. ),
  4907. _c(
  4908. "span",
  4909. {
  4910. staticClass: "el-radio__label",
  4911. on: {
  4912. keydown: function($event) {
  4913. $event.stopPropagation()
  4914. }
  4915. }
  4916. },
  4917. [
  4918. _vm._t("default"),
  4919. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  4920. ],
  4921. 2
  4922. )
  4923. ]
  4924. )
  4925. }
  4926. var radiovue_type_template_id_69cd6268_staticRenderFns = []
  4927. radiovue_type_template_id_69cd6268_render._withStripped = true
  4928. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=template&id=69cd6268&
  4929. // 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&
  4930. //
  4931. //
  4932. //
  4933. //
  4934. //
  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. /* harmony default export */ var radiovue_type_script_lang_js_ = ({
  4976. name: 'ElRadio',
  4977. mixins: [emitter_default.a],
  4978. inject: {
  4979. elForm: {
  4980. default: ''
  4981. },
  4982. elFormItem: {
  4983. default: ''
  4984. }
  4985. },
  4986. componentName: 'ElRadio',
  4987. props: {
  4988. value: {},
  4989. label: {},
  4990. disabled: Boolean,
  4991. name: String,
  4992. border: Boolean,
  4993. size: String
  4994. },
  4995. data: function data() {
  4996. return {
  4997. focus: false
  4998. };
  4999. },
  5000. computed: {
  5001. isGroup: function isGroup() {
  5002. var parent = this.$parent;
  5003. while (parent) {
  5004. if (parent.$options.componentName !== 'ElRadioGroup') {
  5005. parent = parent.$parent;
  5006. } else {
  5007. this._radioGroup = parent;
  5008. return true;
  5009. }
  5010. }
  5011. return false;
  5012. },
  5013. model: {
  5014. get: function get() {
  5015. return this.isGroup ? this._radioGroup.value : this.value;
  5016. },
  5017. set: function set(val) {
  5018. if (this.isGroup) {
  5019. this.dispatch('ElRadioGroup', 'input', [val]);
  5020. } else {
  5021. this.$emit('input', val);
  5022. }
  5023. this.$refs.radio && (this.$refs.radio.checked = this.model === this.label);
  5024. }
  5025. },
  5026. _elFormItemSize: function _elFormItemSize() {
  5027. return (this.elFormItem || {}).elFormItemSize;
  5028. },
  5029. radioSize: function radioSize() {
  5030. var temRadioSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5031. return this.isGroup ? this._radioGroup.radioGroupSize || temRadioSize : temRadioSize;
  5032. },
  5033. isDisabled: function isDisabled() {
  5034. return this.isGroup ? this._radioGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
  5035. },
  5036. tabIndex: function tabIndex() {
  5037. return this.isDisabled || this.isGroup && this.model !== this.label ? -1 : 0;
  5038. }
  5039. },
  5040. methods: {
  5041. handleChange: function handleChange() {
  5042. var _this = this;
  5043. this.$nextTick(function () {
  5044. _this.$emit('change', _this.model);
  5045. _this.isGroup && _this.dispatch('ElRadioGroup', 'handleChange', _this.model);
  5046. });
  5047. }
  5048. }
  5049. });
  5050. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=script&lang=js&
  5051. /* harmony default export */ var src_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
  5052. // CONCATENATED MODULE: ./packages/radio/src/radio.vue
  5053. /* normalize component */
  5054. var radio_component = normalizeComponent(
  5055. src_radiovue_type_script_lang_js_,
  5056. radiovue_type_template_id_69cd6268_render,
  5057. radiovue_type_template_id_69cd6268_staticRenderFns,
  5058. false,
  5059. null,
  5060. null,
  5061. null
  5062. )
  5063. /* hot reload */
  5064. if (false) { var radio_api; }
  5065. radio_component.options.__file = "packages/radio/src/radio.vue"
  5066. /* harmony default export */ var src_radio = (radio_component.exports);
  5067. // CONCATENATED MODULE: ./packages/radio/index.js
  5068. /* istanbul ignore next */
  5069. src_radio.install = function (Vue) {
  5070. Vue.component(src_radio.name, src_radio);
  5071. };
  5072. /* harmony default export */ var packages_radio = (src_radio);
  5073. // 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&
  5074. var radio_groupvue_type_template_id_818a704c_render = function() {
  5075. var _vm = this
  5076. var _h = _vm.$createElement
  5077. var _c = _vm._self._c || _h
  5078. return _c(
  5079. _vm._elTag,
  5080. {
  5081. tag: "component",
  5082. staticClass: "el-radio-group",
  5083. attrs: { role: "radiogroup" },
  5084. on: { keydown: _vm.handleKeydown }
  5085. },
  5086. [_vm._t("default")],
  5087. 2
  5088. )
  5089. }
  5090. var radio_groupvue_type_template_id_818a704c_staticRenderFns = []
  5091. radio_groupvue_type_template_id_818a704c_render._withStripped = true
  5092. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=template&id=818a704c&
  5093. // 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&
  5094. //
  5095. //
  5096. //
  5097. //
  5098. //
  5099. //
  5100. //
  5101. //
  5102. //
  5103. //
  5104. var keyCode = Object.freeze({
  5105. LEFT: 37,
  5106. UP: 38,
  5107. RIGHT: 39,
  5108. DOWN: 40
  5109. });
  5110. /* harmony default export */ var radio_groupvue_type_script_lang_js_ = ({
  5111. name: 'ElRadioGroup',
  5112. componentName: 'ElRadioGroup',
  5113. inject: {
  5114. elFormItem: {
  5115. default: ''
  5116. }
  5117. },
  5118. mixins: [emitter_default.a],
  5119. props: {
  5120. value: {},
  5121. size: String,
  5122. fill: String,
  5123. textColor: String,
  5124. disabled: Boolean
  5125. },
  5126. computed: {
  5127. _elFormItemSize: function _elFormItemSize() {
  5128. return (this.elFormItem || {}).elFormItemSize;
  5129. },
  5130. _elTag: function _elTag() {
  5131. var tag = (this.$vnode.data || {}).tag;
  5132. if (!tag || tag === 'component') tag = 'div';
  5133. return tag;
  5134. },
  5135. radioGroupSize: function radioGroupSize() {
  5136. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5137. }
  5138. },
  5139. created: function created() {
  5140. var _this = this;
  5141. this.$on('handleChange', function (value) {
  5142. _this.$emit('change', value);
  5143. });
  5144. },
  5145. mounted: function mounted() {
  5146. // 当radioGroup没有默认选项时,第一个可以选中Tab导航
  5147. var radios = this.$el.querySelectorAll('[type=radio]');
  5148. var firstLabel = this.$el.querySelectorAll('[role=radio]')[0];
  5149. if (![].some.call(radios, function (radio) {
  5150. return radio.checked;
  5151. }) && firstLabel) {
  5152. firstLabel.tabIndex = 0;
  5153. }
  5154. },
  5155. methods: {
  5156. handleKeydown: function handleKeydown(e) {
  5157. // 左右上下按键 可以在radio组内切换不同选项
  5158. var target = e.target;
  5159. var className = target.nodeName === 'INPUT' ? '[type=radio]' : '[role=radio]';
  5160. var radios = this.$el.querySelectorAll(className);
  5161. var length = radios.length;
  5162. var index = [].indexOf.call(radios, target);
  5163. var roleRadios = this.$el.querySelectorAll('[role=radio]');
  5164. switch (e.keyCode) {
  5165. case keyCode.LEFT:
  5166. case keyCode.UP:
  5167. e.stopPropagation();
  5168. e.preventDefault();
  5169. if (index === 0) {
  5170. roleRadios[length - 1].click();
  5171. roleRadios[length - 1].focus();
  5172. } else {
  5173. roleRadios[index - 1].click();
  5174. roleRadios[index - 1].focus();
  5175. }
  5176. break;
  5177. case keyCode.RIGHT:
  5178. case keyCode.DOWN:
  5179. if (index === length - 1) {
  5180. e.stopPropagation();
  5181. e.preventDefault();
  5182. roleRadios[0].click();
  5183. roleRadios[0].focus();
  5184. } else {
  5185. roleRadios[index + 1].click();
  5186. roleRadios[index + 1].focus();
  5187. }
  5188. break;
  5189. default:
  5190. break;
  5191. }
  5192. }
  5193. },
  5194. watch: {
  5195. value: function value(_value) {
  5196. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  5197. }
  5198. }
  5199. });
  5200. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=script&lang=js&
  5201. /* harmony default export */ var src_radio_groupvue_type_script_lang_js_ = (radio_groupvue_type_script_lang_js_);
  5202. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue
  5203. /* normalize component */
  5204. var radio_group_component = normalizeComponent(
  5205. src_radio_groupvue_type_script_lang_js_,
  5206. radio_groupvue_type_template_id_818a704c_render,
  5207. radio_groupvue_type_template_id_818a704c_staticRenderFns,
  5208. false,
  5209. null,
  5210. null,
  5211. null
  5212. )
  5213. /* hot reload */
  5214. if (false) { var radio_group_api; }
  5215. radio_group_component.options.__file = "packages/radio/src/radio-group.vue"
  5216. /* harmony default export */ var radio_group = (radio_group_component.exports);
  5217. // CONCATENATED MODULE: ./packages/radio-group/index.js
  5218. /* istanbul ignore next */
  5219. radio_group.install = function (Vue) {
  5220. Vue.component(radio_group.name, radio_group);
  5221. };
  5222. /* harmony default export */ var packages_radio_group = (radio_group);
  5223. // 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&
  5224. var radio_buttonvue_type_template_id_18a77a32_render = function() {
  5225. var _vm = this
  5226. var _h = _vm.$createElement
  5227. var _c = _vm._self._c || _h
  5228. return _c(
  5229. "label",
  5230. {
  5231. staticClass: "el-radio-button",
  5232. class: [
  5233. _vm.size ? "el-radio-button--" + _vm.size : "",
  5234. { "is-active": _vm.value === _vm.label },
  5235. { "is-disabled": _vm.isDisabled },
  5236. { "is-focus": _vm.focus }
  5237. ],
  5238. attrs: {
  5239. role: "radio",
  5240. "aria-checked": _vm.value === _vm.label,
  5241. "aria-disabled": _vm.isDisabled,
  5242. tabindex: _vm.tabIndex
  5243. },
  5244. on: {
  5245. keydown: function($event) {
  5246. if (
  5247. !("button" in $event) &&
  5248. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  5249. ) {
  5250. return null
  5251. }
  5252. $event.stopPropagation()
  5253. $event.preventDefault()
  5254. _vm.value = _vm.isDisabled ? _vm.value : _vm.label
  5255. }
  5256. }
  5257. },
  5258. [
  5259. _c("input", {
  5260. directives: [
  5261. {
  5262. name: "model",
  5263. rawName: "v-model",
  5264. value: _vm.value,
  5265. expression: "value"
  5266. }
  5267. ],
  5268. staticClass: "el-radio-button__orig-radio",
  5269. attrs: {
  5270. type: "radio",
  5271. name: _vm.name,
  5272. disabled: _vm.isDisabled,
  5273. tabindex: "-1",
  5274. autocomplete: "off"
  5275. },
  5276. domProps: { value: _vm.label, checked: _vm._q(_vm.value, _vm.label) },
  5277. on: {
  5278. change: [
  5279. function($event) {
  5280. _vm.value = _vm.label
  5281. },
  5282. _vm.handleChange
  5283. ],
  5284. focus: function($event) {
  5285. _vm.focus = true
  5286. },
  5287. blur: function($event) {
  5288. _vm.focus = false
  5289. }
  5290. }
  5291. }),
  5292. _c(
  5293. "span",
  5294. {
  5295. staticClass: "el-radio-button__inner",
  5296. style: _vm.value === _vm.label ? _vm.activeStyle : null,
  5297. on: {
  5298. keydown: function($event) {
  5299. $event.stopPropagation()
  5300. }
  5301. }
  5302. },
  5303. [
  5304. _vm._t("default"),
  5305. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5306. ],
  5307. 2
  5308. )
  5309. ]
  5310. )
  5311. }
  5312. var radio_buttonvue_type_template_id_18a77a32_staticRenderFns = []
  5313. radio_buttonvue_type_template_id_18a77a32_render._withStripped = true
  5314. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=template&id=18a77a32&
  5315. // 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&
  5316. //
  5317. //
  5318. //
  5319. //
  5320. //
  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. /* harmony default export */ var radio_buttonvue_type_script_lang_js_ = ({
  5354. name: 'ElRadioButton',
  5355. mixins: [emitter_default.a],
  5356. inject: {
  5357. elForm: {
  5358. default: ''
  5359. },
  5360. elFormItem: {
  5361. default: ''
  5362. }
  5363. },
  5364. props: {
  5365. label: {},
  5366. disabled: Boolean,
  5367. name: String
  5368. },
  5369. data: function data() {
  5370. return {
  5371. focus: false
  5372. };
  5373. },
  5374. computed: {
  5375. value: {
  5376. get: function get() {
  5377. return this._radioGroup.value;
  5378. },
  5379. set: function set(value) {
  5380. this._radioGroup.$emit('input', value);
  5381. }
  5382. },
  5383. _radioGroup: function _radioGroup() {
  5384. var parent = this.$parent;
  5385. while (parent) {
  5386. if (parent.$options.componentName !== 'ElRadioGroup') {
  5387. parent = parent.$parent;
  5388. } else {
  5389. return parent;
  5390. }
  5391. }
  5392. return false;
  5393. },
  5394. activeStyle: function activeStyle() {
  5395. return {
  5396. backgroundColor: this._radioGroup.fill || '',
  5397. borderColor: this._radioGroup.fill || '',
  5398. boxShadow: this._radioGroup.fill ? '-1px 0 0 0 ' + this._radioGroup.fill : '',
  5399. color: this._radioGroup.textColor || ''
  5400. };
  5401. },
  5402. _elFormItemSize: function _elFormItemSize() {
  5403. return (this.elFormItem || {}).elFormItemSize;
  5404. },
  5405. size: function size() {
  5406. return this._radioGroup.radioGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5407. },
  5408. isDisabled: function isDisabled() {
  5409. return this.disabled || this._radioGroup.disabled || (this.elForm || {}).disabled;
  5410. },
  5411. tabIndex: function tabIndex() {
  5412. return this.isDisabled || this._radioGroup && this.value !== this.label ? -1 : 0;
  5413. }
  5414. },
  5415. methods: {
  5416. handleChange: function handleChange() {
  5417. var _this = this;
  5418. this.$nextTick(function () {
  5419. _this.dispatch('ElRadioGroup', 'handleChange', _this.value);
  5420. });
  5421. }
  5422. }
  5423. });
  5424. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=script&lang=js&
  5425. /* harmony default export */ var src_radio_buttonvue_type_script_lang_js_ = (radio_buttonvue_type_script_lang_js_);
  5426. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue
  5427. /* normalize component */
  5428. var radio_button_component = normalizeComponent(
  5429. src_radio_buttonvue_type_script_lang_js_,
  5430. radio_buttonvue_type_template_id_18a77a32_render,
  5431. radio_buttonvue_type_template_id_18a77a32_staticRenderFns,
  5432. false,
  5433. null,
  5434. null,
  5435. null
  5436. )
  5437. /* hot reload */
  5438. if (false) { var radio_button_api; }
  5439. radio_button_component.options.__file = "packages/radio/src/radio-button.vue"
  5440. /* harmony default export */ var radio_button = (radio_button_component.exports);
  5441. // CONCATENATED MODULE: ./packages/radio-button/index.js
  5442. /* istanbul ignore next */
  5443. radio_button.install = function (Vue) {
  5444. Vue.component(radio_button.name, radio_button);
  5445. };
  5446. /* harmony default export */ var packages_radio_button = (radio_button);
  5447. // 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&
  5448. var checkboxvue_type_template_id_d0387074_render = function() {
  5449. var _vm = this
  5450. var _h = _vm.$createElement
  5451. var _c = _vm._self._c || _h
  5452. return _c(
  5453. "label",
  5454. {
  5455. staticClass: "el-checkbox",
  5456. class: [
  5457. _vm.border && _vm.checkboxSize
  5458. ? "el-checkbox--" + _vm.checkboxSize
  5459. : "",
  5460. { "is-disabled": _vm.isDisabled },
  5461. { "is-bordered": _vm.border },
  5462. { "is-checked": _vm.isChecked }
  5463. ],
  5464. attrs: { id: _vm.id }
  5465. },
  5466. [
  5467. _c(
  5468. "span",
  5469. {
  5470. staticClass: "el-checkbox__input",
  5471. class: {
  5472. "is-disabled": _vm.isDisabled,
  5473. "is-checked": _vm.isChecked,
  5474. "is-indeterminate": _vm.indeterminate,
  5475. "is-focus": _vm.focus
  5476. },
  5477. attrs: {
  5478. tabindex: _vm.indeterminate ? 0 : false,
  5479. role: _vm.indeterminate ? "checkbox" : false,
  5480. "aria-checked": _vm.indeterminate ? "mixed" : false
  5481. }
  5482. },
  5483. [
  5484. _c("span", { staticClass: "el-checkbox__inner" }),
  5485. _vm.trueLabel || _vm.falseLabel
  5486. ? _c("input", {
  5487. directives: [
  5488. {
  5489. name: "model",
  5490. rawName: "v-model",
  5491. value: _vm.model,
  5492. expression: "model"
  5493. }
  5494. ],
  5495. staticClass: "el-checkbox__original",
  5496. attrs: {
  5497. type: "checkbox",
  5498. "aria-hidden": _vm.indeterminate ? "true" : "false",
  5499. name: _vm.name,
  5500. disabled: _vm.isDisabled,
  5501. "true-value": _vm.trueLabel,
  5502. "false-value": _vm.falseLabel
  5503. },
  5504. domProps: {
  5505. checked: Array.isArray(_vm.model)
  5506. ? _vm._i(_vm.model, null) > -1
  5507. : _vm._q(_vm.model, _vm.trueLabel)
  5508. },
  5509. on: {
  5510. change: [
  5511. function($event) {
  5512. var $$a = _vm.model,
  5513. $$el = $event.target,
  5514. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5515. if (Array.isArray($$a)) {
  5516. var $$v = null,
  5517. $$i = _vm._i($$a, $$v)
  5518. if ($$el.checked) {
  5519. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5520. } else {
  5521. $$i > -1 &&
  5522. (_vm.model = $$a
  5523. .slice(0, $$i)
  5524. .concat($$a.slice($$i + 1)))
  5525. }
  5526. } else {
  5527. _vm.model = $$c
  5528. }
  5529. },
  5530. _vm.handleChange
  5531. ],
  5532. focus: function($event) {
  5533. _vm.focus = true
  5534. },
  5535. blur: function($event) {
  5536. _vm.focus = false
  5537. }
  5538. }
  5539. })
  5540. : _c("input", {
  5541. directives: [
  5542. {
  5543. name: "model",
  5544. rawName: "v-model",
  5545. value: _vm.model,
  5546. expression: "model"
  5547. }
  5548. ],
  5549. staticClass: "el-checkbox__original",
  5550. attrs: {
  5551. type: "checkbox",
  5552. "aria-hidden": _vm.indeterminate ? "true" : "false",
  5553. disabled: _vm.isDisabled,
  5554. name: _vm.name
  5555. },
  5556. domProps: {
  5557. value: _vm.label,
  5558. checked: Array.isArray(_vm.model)
  5559. ? _vm._i(_vm.model, _vm.label) > -1
  5560. : _vm.model
  5561. },
  5562. on: {
  5563. change: [
  5564. function($event) {
  5565. var $$a = _vm.model,
  5566. $$el = $event.target,
  5567. $$c = $$el.checked ? true : false
  5568. if (Array.isArray($$a)) {
  5569. var $$v = _vm.label,
  5570. $$i = _vm._i($$a, $$v)
  5571. if ($$el.checked) {
  5572. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5573. } else {
  5574. $$i > -1 &&
  5575. (_vm.model = $$a
  5576. .slice(0, $$i)
  5577. .concat($$a.slice($$i + 1)))
  5578. }
  5579. } else {
  5580. _vm.model = $$c
  5581. }
  5582. },
  5583. _vm.handleChange
  5584. ],
  5585. focus: function($event) {
  5586. _vm.focus = true
  5587. },
  5588. blur: function($event) {
  5589. _vm.focus = false
  5590. }
  5591. }
  5592. })
  5593. ]
  5594. ),
  5595. _vm.$slots.default || _vm.label
  5596. ? _c(
  5597. "span",
  5598. { staticClass: "el-checkbox__label" },
  5599. [
  5600. _vm._t("default"),
  5601. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5602. ],
  5603. 2
  5604. )
  5605. : _vm._e()
  5606. ]
  5607. )
  5608. }
  5609. var checkboxvue_type_template_id_d0387074_staticRenderFns = []
  5610. checkboxvue_type_template_id_d0387074_render._withStripped = true
  5611. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=d0387074&
  5612. // 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&
  5613. //
  5614. //
  5615. //
  5616. //
  5617. //
  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. /* harmony default export */ var checkboxvue_type_script_lang_js_ = ({
  5669. name: 'ElCheckbox',
  5670. mixins: [emitter_default.a],
  5671. inject: {
  5672. elForm: {
  5673. default: ''
  5674. },
  5675. elFormItem: {
  5676. default: ''
  5677. }
  5678. },
  5679. componentName: 'ElCheckbox',
  5680. data: function data() {
  5681. return {
  5682. selfModel: false,
  5683. focus: false,
  5684. isLimitExceeded: false
  5685. };
  5686. },
  5687. computed: {
  5688. model: {
  5689. get: function get() {
  5690. return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  5691. },
  5692. set: function set(val) {
  5693. if (this.isGroup) {
  5694. this.isLimitExceeded = false;
  5695. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  5696. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  5697. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  5698. } else {
  5699. this.$emit('input', val);
  5700. this.selfModel = val;
  5701. }
  5702. }
  5703. },
  5704. isChecked: function isChecked() {
  5705. if ({}.toString.call(this.model) === '[object Boolean]') {
  5706. return this.model;
  5707. } else if (Array.isArray(this.model)) {
  5708. return this.model.indexOf(this.label) > -1;
  5709. } else if (this.model !== null && this.model !== undefined) {
  5710. return this.model === this.trueLabel;
  5711. }
  5712. },
  5713. isGroup: function isGroup() {
  5714. var parent = this.$parent;
  5715. while (parent) {
  5716. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  5717. parent = parent.$parent;
  5718. } else {
  5719. this._checkboxGroup = parent;
  5720. return true;
  5721. }
  5722. }
  5723. return false;
  5724. },
  5725. store: function store() {
  5726. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  5727. },
  5728. /* used to make the isDisabled judgment under max/min props */
  5729. isLimitDisabled: function isLimitDisabled() {
  5730. var _checkboxGroup = this._checkboxGroup,
  5731. max = _checkboxGroup.max,
  5732. min = _checkboxGroup.min;
  5733. return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
  5734. },
  5735. isDisabled: function isDisabled() {
  5736. return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
  5737. },
  5738. _elFormItemSize: function _elFormItemSize() {
  5739. return (this.elFormItem || {}).elFormItemSize;
  5740. },
  5741. checkboxSize: function checkboxSize() {
  5742. var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5743. return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
  5744. }
  5745. },
  5746. props: {
  5747. value: {},
  5748. label: {},
  5749. indeterminate: Boolean,
  5750. disabled: Boolean,
  5751. checked: Boolean,
  5752. name: String,
  5753. trueLabel: [String, Number],
  5754. falseLabel: [String, Number],
  5755. id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5756. controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5757. border: Boolean,
  5758. size: String
  5759. },
  5760. methods: {
  5761. addToStore: function addToStore() {
  5762. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  5763. this.model.push(this.label);
  5764. } else {
  5765. this.model = this.trueLabel || true;
  5766. }
  5767. },
  5768. handleChange: function handleChange(ev) {
  5769. var _this = this;
  5770. if (this.isLimitExceeded) return;
  5771. var value = void 0;
  5772. if (ev.target.checked) {
  5773. value = this.trueLabel === undefined ? true : this.trueLabel;
  5774. } else {
  5775. value = this.falseLabel === undefined ? false : this.falseLabel;
  5776. }
  5777. this.$emit('change', value, ev);
  5778. this.$nextTick(function () {
  5779. if (_this.isGroup) {
  5780. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  5781. }
  5782. });
  5783. }
  5784. },
  5785. created: function created() {
  5786. this.checked && this.addToStore();
  5787. },
  5788. mounted: function mounted() {
  5789. // 为indeterminate元素 添加aria-controls 属性
  5790. if (this.indeterminate) {
  5791. this.$el.setAttribute('aria-controls', this.controls);
  5792. }
  5793. },
  5794. watch: {
  5795. value: function value(_value) {
  5796. this.dispatch('ElFormItem', 'el.form.change', _value);
  5797. }
  5798. }
  5799. });
  5800. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js&
  5801. /* harmony default export */ var src_checkboxvue_type_script_lang_js_ = (checkboxvue_type_script_lang_js_);
  5802. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
  5803. /* normalize component */
  5804. var checkbox_component = normalizeComponent(
  5805. src_checkboxvue_type_script_lang_js_,
  5806. checkboxvue_type_template_id_d0387074_render,
  5807. checkboxvue_type_template_id_d0387074_staticRenderFns,
  5808. false,
  5809. null,
  5810. null,
  5811. null
  5812. )
  5813. /* hot reload */
  5814. if (false) { var checkbox_api; }
  5815. checkbox_component.options.__file = "packages/checkbox/src/checkbox.vue"
  5816. /* harmony default export */ var src_checkbox = (checkbox_component.exports);
  5817. // CONCATENATED MODULE: ./packages/checkbox/index.js
  5818. /* istanbul ignore next */
  5819. src_checkbox.install = function (Vue) {
  5820. Vue.component(src_checkbox.name, src_checkbox);
  5821. };
  5822. /* harmony default export */ var packages_checkbox = (src_checkbox);
  5823. // 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&
  5824. var checkbox_buttonvue_type_template_id_478e906e_render = function() {
  5825. var _vm = this
  5826. var _h = _vm.$createElement
  5827. var _c = _vm._self._c || _h
  5828. return _c(
  5829. "label",
  5830. {
  5831. staticClass: "el-checkbox-button",
  5832. class: [
  5833. _vm.size ? "el-checkbox-button--" + _vm.size : "",
  5834. { "is-disabled": _vm.isDisabled },
  5835. { "is-checked": _vm.isChecked },
  5836. { "is-focus": _vm.focus }
  5837. ],
  5838. attrs: {
  5839. role: "checkbox",
  5840. "aria-checked": _vm.isChecked,
  5841. "aria-disabled": _vm.isDisabled
  5842. }
  5843. },
  5844. [
  5845. _vm.trueLabel || _vm.falseLabel
  5846. ? _c("input", {
  5847. directives: [
  5848. {
  5849. name: "model",
  5850. rawName: "v-model",
  5851. value: _vm.model,
  5852. expression: "model"
  5853. }
  5854. ],
  5855. staticClass: "el-checkbox-button__original",
  5856. attrs: {
  5857. type: "checkbox",
  5858. name: _vm.name,
  5859. disabled: _vm.isDisabled,
  5860. "true-value": _vm.trueLabel,
  5861. "false-value": _vm.falseLabel
  5862. },
  5863. domProps: {
  5864. checked: Array.isArray(_vm.model)
  5865. ? _vm._i(_vm.model, null) > -1
  5866. : _vm._q(_vm.model, _vm.trueLabel)
  5867. },
  5868. on: {
  5869. change: [
  5870. function($event) {
  5871. var $$a = _vm.model,
  5872. $$el = $event.target,
  5873. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5874. if (Array.isArray($$a)) {
  5875. var $$v = null,
  5876. $$i = _vm._i($$a, $$v)
  5877. if ($$el.checked) {
  5878. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5879. } else {
  5880. $$i > -1 &&
  5881. (_vm.model = $$a
  5882. .slice(0, $$i)
  5883. .concat($$a.slice($$i + 1)))
  5884. }
  5885. } else {
  5886. _vm.model = $$c
  5887. }
  5888. },
  5889. _vm.handleChange
  5890. ],
  5891. focus: function($event) {
  5892. _vm.focus = true
  5893. },
  5894. blur: function($event) {
  5895. _vm.focus = false
  5896. }
  5897. }
  5898. })
  5899. : _c("input", {
  5900. directives: [
  5901. {
  5902. name: "model",
  5903. rawName: "v-model",
  5904. value: _vm.model,
  5905. expression: "model"
  5906. }
  5907. ],
  5908. staticClass: "el-checkbox-button__original",
  5909. attrs: {
  5910. type: "checkbox",
  5911. name: _vm.name,
  5912. disabled: _vm.isDisabled
  5913. },
  5914. domProps: {
  5915. value: _vm.label,
  5916. checked: Array.isArray(_vm.model)
  5917. ? _vm._i(_vm.model, _vm.label) > -1
  5918. : _vm.model
  5919. },
  5920. on: {
  5921. change: [
  5922. function($event) {
  5923. var $$a = _vm.model,
  5924. $$el = $event.target,
  5925. $$c = $$el.checked ? true : false
  5926. if (Array.isArray($$a)) {
  5927. var $$v = _vm.label,
  5928. $$i = _vm._i($$a, $$v)
  5929. if ($$el.checked) {
  5930. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5931. } else {
  5932. $$i > -1 &&
  5933. (_vm.model = $$a
  5934. .slice(0, $$i)
  5935. .concat($$a.slice($$i + 1)))
  5936. }
  5937. } else {
  5938. _vm.model = $$c
  5939. }
  5940. },
  5941. _vm.handleChange
  5942. ],
  5943. focus: function($event) {
  5944. _vm.focus = true
  5945. },
  5946. blur: function($event) {
  5947. _vm.focus = false
  5948. }
  5949. }
  5950. }),
  5951. _vm.$slots.default || _vm.label
  5952. ? _c(
  5953. "span",
  5954. {
  5955. staticClass: "el-checkbox-button__inner",
  5956. style: _vm.isChecked ? _vm.activeStyle : null
  5957. },
  5958. [_vm._t("default", [_vm._v(_vm._s(_vm.label))])],
  5959. 2
  5960. )
  5961. : _vm._e()
  5962. ]
  5963. )
  5964. }
  5965. var checkbox_buttonvue_type_template_id_478e906e_staticRenderFns = []
  5966. checkbox_buttonvue_type_template_id_478e906e_render._withStripped = true
  5967. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  5968. // 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&
  5969. //
  5970. //
  5971. //
  5972. //
  5973. //
  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. /* harmony default export */ var checkbox_buttonvue_type_script_lang_js_ = ({
  6015. name: 'ElCheckboxButton',
  6016. mixins: [emitter_default.a],
  6017. inject: {
  6018. elForm: {
  6019. default: ''
  6020. },
  6021. elFormItem: {
  6022. default: ''
  6023. }
  6024. },
  6025. data: function data() {
  6026. return {
  6027. selfModel: false,
  6028. focus: false,
  6029. isLimitExceeded: false
  6030. };
  6031. },
  6032. props: {
  6033. value: {},
  6034. label: {},
  6035. disabled: Boolean,
  6036. checked: Boolean,
  6037. name: String,
  6038. trueLabel: [String, Number],
  6039. falseLabel: [String, Number]
  6040. },
  6041. computed: {
  6042. model: {
  6043. get: function get() {
  6044. return this._checkboxGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  6045. },
  6046. set: function set(val) {
  6047. if (this._checkboxGroup) {
  6048. this.isLimitExceeded = false;
  6049. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  6050. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  6051. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  6052. } else if (this.value !== undefined) {
  6053. this.$emit('input', val);
  6054. } else {
  6055. this.selfModel = val;
  6056. }
  6057. }
  6058. },
  6059. isChecked: function isChecked() {
  6060. if ({}.toString.call(this.model) === '[object Boolean]') {
  6061. return this.model;
  6062. } else if (Array.isArray(this.model)) {
  6063. return this.model.indexOf(this.label) > -1;
  6064. } else if (this.model !== null && this.model !== undefined) {
  6065. return this.model === this.trueLabel;
  6066. }
  6067. },
  6068. _checkboxGroup: function _checkboxGroup() {
  6069. var parent = this.$parent;
  6070. while (parent) {
  6071. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  6072. parent = parent.$parent;
  6073. } else {
  6074. return parent;
  6075. }
  6076. }
  6077. return false;
  6078. },
  6079. store: function store() {
  6080. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  6081. },
  6082. activeStyle: function activeStyle() {
  6083. return {
  6084. backgroundColor: this._checkboxGroup.fill || '',
  6085. borderColor: this._checkboxGroup.fill || '',
  6086. color: this._checkboxGroup.textColor || '',
  6087. 'box-shadow': '-1px 0 0 0 ' + this._checkboxGroup.fill
  6088. };
  6089. },
  6090. _elFormItemSize: function _elFormItemSize() {
  6091. return (this.elFormItem || {}).elFormItemSize;
  6092. },
  6093. size: function size() {
  6094. return this._checkboxGroup.checkboxGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  6095. },
  6096. /* used to make the isDisabled judgment under max/min props */
  6097. isLimitDisabled: function isLimitDisabled() {
  6098. var _checkboxGroup2 = this._checkboxGroup,
  6099. max = _checkboxGroup2.max,
  6100. min = _checkboxGroup2.min;
  6101. return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
  6102. },
  6103. isDisabled: function isDisabled() {
  6104. return this._checkboxGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
  6105. }
  6106. },
  6107. methods: {
  6108. addToStore: function addToStore() {
  6109. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  6110. this.model.push(this.label);
  6111. } else {
  6112. this.model = this.trueLabel || true;
  6113. }
  6114. },
  6115. handleChange: function handleChange(ev) {
  6116. var _this = this;
  6117. if (this.isLimitExceeded) return;
  6118. var value = void 0;
  6119. if (ev.target.checked) {
  6120. value = this.trueLabel === undefined ? true : this.trueLabel;
  6121. } else {
  6122. value = this.falseLabel === undefined ? false : this.falseLabel;
  6123. }
  6124. this.$emit('change', value, ev);
  6125. this.$nextTick(function () {
  6126. if (_this._checkboxGroup) {
  6127. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  6128. }
  6129. });
  6130. }
  6131. },
  6132. created: function created() {
  6133. this.checked && this.addToStore();
  6134. }
  6135. });
  6136. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  6137. /* harmony default export */ var src_checkbox_buttonvue_type_script_lang_js_ = (checkbox_buttonvue_type_script_lang_js_);
  6138. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue
  6139. /* normalize component */
  6140. var checkbox_button_component = normalizeComponent(
  6141. src_checkbox_buttonvue_type_script_lang_js_,
  6142. checkbox_buttonvue_type_template_id_478e906e_render,
  6143. checkbox_buttonvue_type_template_id_478e906e_staticRenderFns,
  6144. false,
  6145. null,
  6146. null,
  6147. null
  6148. )
  6149. /* hot reload */
  6150. if (false) { var checkbox_button_api; }
  6151. checkbox_button_component.options.__file = "packages/checkbox/src/checkbox-button.vue"
  6152. /* harmony default export */ var checkbox_button = (checkbox_button_component.exports);
  6153. // CONCATENATED MODULE: ./packages/checkbox-button/index.js
  6154. /* istanbul ignore next */
  6155. checkbox_button.install = function (Vue) {
  6156. Vue.component(checkbox_button.name, checkbox_button);
  6157. };
  6158. /* harmony default export */ var packages_checkbox_button = (checkbox_button);
  6159. // 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&
  6160. var checkbox_groupvue_type_template_id_7289a290_render = function() {
  6161. var _vm = this
  6162. var _h = _vm.$createElement
  6163. var _c = _vm._self._c || _h
  6164. return _c(
  6165. "div",
  6166. {
  6167. staticClass: "el-checkbox-group",
  6168. attrs: { role: "group", "aria-label": "checkbox-group" }
  6169. },
  6170. [_vm._t("default")],
  6171. 2
  6172. )
  6173. }
  6174. var checkbox_groupvue_type_template_id_7289a290_staticRenderFns = []
  6175. checkbox_groupvue_type_template_id_7289a290_render._withStripped = true
  6176. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=template&id=7289a290&
  6177. // 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&
  6178. /* harmony default export */ var checkbox_groupvue_type_script_lang_js_ = ({
  6179. name: 'ElCheckboxGroup',
  6180. componentName: 'ElCheckboxGroup',
  6181. mixins: [emitter_default.a],
  6182. inject: {
  6183. elFormItem: {
  6184. default: ''
  6185. }
  6186. },
  6187. props: {
  6188. value: {},
  6189. disabled: Boolean,
  6190. min: Number,
  6191. max: Number,
  6192. size: String,
  6193. fill: String,
  6194. textColor: String
  6195. },
  6196. computed: {
  6197. _elFormItemSize: function _elFormItemSize() {
  6198. return (this.elFormItem || {}).elFormItemSize;
  6199. },
  6200. checkboxGroupSize: function checkboxGroupSize() {
  6201. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  6202. }
  6203. },
  6204. watch: {
  6205. value: function value(_value) {
  6206. this.dispatch('ElFormItem', 'el.form.change', [_value]);
  6207. }
  6208. }
  6209. });
  6210. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=script&lang=js&
  6211. /* harmony default export */ var src_checkbox_groupvue_type_script_lang_js_ = (checkbox_groupvue_type_script_lang_js_);
  6212. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue
  6213. /* normalize component */
  6214. var checkbox_group_component = normalizeComponent(
  6215. src_checkbox_groupvue_type_script_lang_js_,
  6216. checkbox_groupvue_type_template_id_7289a290_render,
  6217. checkbox_groupvue_type_template_id_7289a290_staticRenderFns,
  6218. false,
  6219. null,
  6220. null,
  6221. null
  6222. )
  6223. /* hot reload */
  6224. if (false) { var checkbox_group_api; }
  6225. checkbox_group_component.options.__file = "packages/checkbox/src/checkbox-group.vue"
  6226. /* harmony default export */ var checkbox_group = (checkbox_group_component.exports);
  6227. // CONCATENATED MODULE: ./packages/checkbox-group/index.js
  6228. /* istanbul ignore next */
  6229. checkbox_group.install = function (Vue) {
  6230. Vue.component(checkbox_group.name, checkbox_group);
  6231. };
  6232. /* harmony default export */ var packages_checkbox_group = (checkbox_group);
  6233. // 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&
  6234. var componentvue_type_template_id_2dcd8fbb_render = function() {
  6235. var _vm = this
  6236. var _h = _vm.$createElement
  6237. var _c = _vm._self._c || _h
  6238. return _c(
  6239. "div",
  6240. {
  6241. staticClass: "el-switch",
  6242. class: { "is-disabled": _vm.switchDisabled, "is-checked": _vm.checked },
  6243. attrs: {
  6244. role: "switch",
  6245. "aria-checked": _vm.checked,
  6246. "aria-disabled": _vm.switchDisabled
  6247. },
  6248. on: {
  6249. click: function($event) {
  6250. $event.preventDefault()
  6251. return _vm.switchValue($event)
  6252. }
  6253. }
  6254. },
  6255. [
  6256. _c("input", {
  6257. ref: "input",
  6258. staticClass: "el-switch__input",
  6259. attrs: {
  6260. type: "checkbox",
  6261. id: _vm.id,
  6262. name: _vm.name,
  6263. "true-value": _vm.activeValue,
  6264. "false-value": _vm.inactiveValue,
  6265. disabled: _vm.switchDisabled
  6266. },
  6267. on: {
  6268. change: _vm.handleChange,
  6269. keydown: function($event) {
  6270. if (
  6271. !("button" in $event) &&
  6272. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6273. ) {
  6274. return null
  6275. }
  6276. return _vm.switchValue($event)
  6277. }
  6278. }
  6279. }),
  6280. _vm.inactiveIconClass || _vm.inactiveText
  6281. ? _c(
  6282. "span",
  6283. {
  6284. class: [
  6285. "el-switch__label",
  6286. "el-switch__label--left",
  6287. !_vm.checked ? "is-active" : ""
  6288. ]
  6289. },
  6290. [
  6291. _vm.inactiveIconClass
  6292. ? _c("i", { class: [_vm.inactiveIconClass] })
  6293. : _vm._e(),
  6294. !_vm.inactiveIconClass && _vm.inactiveText
  6295. ? _c("span", { attrs: { "aria-hidden": _vm.checked } }, [
  6296. _vm._v(_vm._s(_vm.inactiveText))
  6297. ])
  6298. : _vm._e()
  6299. ]
  6300. )
  6301. : _vm._e(),
  6302. _c("span", {
  6303. ref: "core",
  6304. staticClass: "el-switch__core",
  6305. style: { width: _vm.coreWidth + "px" }
  6306. }),
  6307. _vm.activeIconClass || _vm.activeText
  6308. ? _c(
  6309. "span",
  6310. {
  6311. class: [
  6312. "el-switch__label",
  6313. "el-switch__label--right",
  6314. _vm.checked ? "is-active" : ""
  6315. ]
  6316. },
  6317. [
  6318. _vm.activeIconClass
  6319. ? _c("i", { class: [_vm.activeIconClass] })
  6320. : _vm._e(),
  6321. !_vm.activeIconClass && _vm.activeText
  6322. ? _c("span", { attrs: { "aria-hidden": !_vm.checked } }, [
  6323. _vm._v(_vm._s(_vm.activeText))
  6324. ])
  6325. : _vm._e()
  6326. ]
  6327. )
  6328. : _vm._e()
  6329. ]
  6330. )
  6331. }
  6332. var componentvue_type_template_id_2dcd8fbb_staticRenderFns = []
  6333. componentvue_type_template_id_2dcd8fbb_render._withStripped = true
  6334. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  6335. // 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&
  6336. //
  6337. //
  6338. //
  6339. //
  6340. //
  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. /* harmony default export */ var switch_src_componentvue_type_script_lang_js_ = ({
  6374. name: 'ElSwitch',
  6375. mixins: [focus_default()('input'), migrating_default.a, emitter_default.a],
  6376. inject: {
  6377. elForm: {
  6378. default: ''
  6379. }
  6380. },
  6381. props: {
  6382. value: {
  6383. type: [Boolean, String, Number],
  6384. default: false
  6385. },
  6386. disabled: {
  6387. type: Boolean,
  6388. default: false
  6389. },
  6390. width: {
  6391. type: Number,
  6392. default: 40
  6393. },
  6394. activeIconClass: {
  6395. type: String,
  6396. default: ''
  6397. },
  6398. inactiveIconClass: {
  6399. type: String,
  6400. default: ''
  6401. },
  6402. activeText: String,
  6403. inactiveText: String,
  6404. activeColor: {
  6405. type: String,
  6406. default: ''
  6407. },
  6408. inactiveColor: {
  6409. type: String,
  6410. default: ''
  6411. },
  6412. activeValue: {
  6413. type: [Boolean, String, Number],
  6414. default: true
  6415. },
  6416. inactiveValue: {
  6417. type: [Boolean, String, Number],
  6418. default: false
  6419. },
  6420. name: {
  6421. type: String,
  6422. default: ''
  6423. },
  6424. validateEvent: {
  6425. type: Boolean,
  6426. default: true
  6427. },
  6428. id: String
  6429. },
  6430. data: function data() {
  6431. return {
  6432. coreWidth: this.width
  6433. };
  6434. },
  6435. created: function created() {
  6436. if (!~[this.activeValue, this.inactiveValue].indexOf(this.value)) {
  6437. this.$emit('input', this.inactiveValue);
  6438. }
  6439. },
  6440. computed: {
  6441. checked: function checked() {
  6442. return this.value === this.activeValue;
  6443. },
  6444. switchDisabled: function switchDisabled() {
  6445. return this.disabled || (this.elForm || {}).disabled;
  6446. }
  6447. },
  6448. watch: {
  6449. checked: function checked() {
  6450. this.$refs.input.checked = this.checked;
  6451. if (this.activeColor || this.inactiveColor) {
  6452. this.setBackgroundColor();
  6453. }
  6454. if (this.validateEvent) {
  6455. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  6456. }
  6457. }
  6458. },
  6459. methods: {
  6460. handleChange: function handleChange(event) {
  6461. var _this = this;
  6462. var val = this.checked ? this.inactiveValue : this.activeValue;
  6463. this.$emit('input', val);
  6464. this.$emit('change', val);
  6465. this.$nextTick(function () {
  6466. // set input's checked property
  6467. // in case parent refuses to change component's value
  6468. if (_this.$refs.input) {
  6469. _this.$refs.input.checked = _this.checked;
  6470. }
  6471. });
  6472. },
  6473. setBackgroundColor: function setBackgroundColor() {
  6474. var newColor = this.checked ? this.activeColor : this.inactiveColor;
  6475. this.$refs.core.style.borderColor = newColor;
  6476. this.$refs.core.style.backgroundColor = newColor;
  6477. },
  6478. switchValue: function switchValue() {
  6479. !this.switchDisabled && this.handleChange();
  6480. },
  6481. getMigratingConfig: function getMigratingConfig() {
  6482. return {
  6483. props: {
  6484. 'on-color': 'on-color is renamed to active-color.',
  6485. 'off-color': 'off-color is renamed to inactive-color.',
  6486. 'on-text': 'on-text is renamed to active-text.',
  6487. 'off-text': 'off-text is renamed to inactive-text.',
  6488. 'on-value': 'on-value is renamed to active-value.',
  6489. 'off-value': 'off-value is renamed to inactive-value.',
  6490. 'on-icon-class': 'on-icon-class is renamed to active-icon-class.',
  6491. 'off-icon-class': 'off-icon-class is renamed to inactive-icon-class.'
  6492. }
  6493. };
  6494. }
  6495. },
  6496. mounted: function mounted() {
  6497. /* istanbul ignore if */
  6498. this.coreWidth = this.width || 40;
  6499. if (this.activeColor || this.inactiveColor) {
  6500. this.setBackgroundColor();
  6501. }
  6502. this.$refs.input.checked = this.checked;
  6503. }
  6504. });
  6505. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=script&lang=js&
  6506. /* harmony default export */ var packages_switch_src_componentvue_type_script_lang_js_ = (switch_src_componentvue_type_script_lang_js_);
  6507. // CONCATENATED MODULE: ./packages/switch/src/component.vue
  6508. /* normalize component */
  6509. var src_component_component = normalizeComponent(
  6510. packages_switch_src_componentvue_type_script_lang_js_,
  6511. componentvue_type_template_id_2dcd8fbb_render,
  6512. componentvue_type_template_id_2dcd8fbb_staticRenderFns,
  6513. false,
  6514. null,
  6515. null,
  6516. null
  6517. )
  6518. /* hot reload */
  6519. if (false) { var src_component_api; }
  6520. src_component_component.options.__file = "packages/switch/src/component.vue"
  6521. /* harmony default export */ var switch_src_component = (src_component_component.exports);
  6522. // CONCATENATED MODULE: ./packages/switch/index.js
  6523. /* istanbul ignore next */
  6524. switch_src_component.install = function (Vue) {
  6525. Vue.component(switch_src_component.name, switch_src_component);
  6526. };
  6527. /* harmony default export */ var packages_switch = (switch_src_component);
  6528. // 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&
  6529. var selectvue_type_template_id_0e4aade6_render = function() {
  6530. var _vm = this
  6531. var _h = _vm.$createElement
  6532. var _c = _vm._self._c || _h
  6533. return _c(
  6534. "div",
  6535. {
  6536. directives: [
  6537. {
  6538. name: "clickoutside",
  6539. rawName: "v-clickoutside",
  6540. value: _vm.handleClose,
  6541. expression: "handleClose"
  6542. }
  6543. ],
  6544. staticClass: "el-select",
  6545. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  6546. on: {
  6547. click: function($event) {
  6548. $event.stopPropagation()
  6549. return _vm.toggleMenu($event)
  6550. }
  6551. }
  6552. },
  6553. [
  6554. _vm.multiple
  6555. ? _c(
  6556. "div",
  6557. {
  6558. ref: "tags",
  6559. staticClass: "el-select__tags",
  6560. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  6561. },
  6562. [
  6563. _vm.collapseTags && _vm.selected.length
  6564. ? _c(
  6565. "span",
  6566. [
  6567. _c(
  6568. "el-tag",
  6569. {
  6570. attrs: {
  6571. closable: !_vm.selectDisabled,
  6572. size: _vm.collapseTagSize,
  6573. hit: _vm.selected[0].hitState,
  6574. type: "info",
  6575. "disable-transitions": ""
  6576. },
  6577. on: {
  6578. close: function($event) {
  6579. _vm.deleteTag($event, _vm.selected[0])
  6580. }
  6581. }
  6582. },
  6583. [
  6584. _c("span", { staticClass: "el-select__tags-text" }, [
  6585. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  6586. ])
  6587. ]
  6588. ),
  6589. _vm.selected.length > 1
  6590. ? _c(
  6591. "el-tag",
  6592. {
  6593. attrs: {
  6594. closable: false,
  6595. size: _vm.collapseTagSize,
  6596. type: "info",
  6597. "disable-transitions": ""
  6598. }
  6599. },
  6600. [
  6601. _c(
  6602. "span",
  6603. { staticClass: "el-select__tags-text" },
  6604. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  6605. )
  6606. ]
  6607. )
  6608. : _vm._e()
  6609. ],
  6610. 1
  6611. )
  6612. : _vm._e(),
  6613. !_vm.collapseTags
  6614. ? _c(
  6615. "transition-group",
  6616. { on: { "after-leave": _vm.resetInputHeight } },
  6617. _vm._l(_vm.selected, function(item) {
  6618. return _c(
  6619. "el-tag",
  6620. {
  6621. key: _vm.getValueKey(item),
  6622. attrs: {
  6623. closable: !_vm.selectDisabled,
  6624. size: _vm.collapseTagSize,
  6625. hit: item.hitState,
  6626. type: "info",
  6627. "disable-transitions": ""
  6628. },
  6629. on: {
  6630. close: function($event) {
  6631. _vm.deleteTag($event, item)
  6632. }
  6633. }
  6634. },
  6635. [
  6636. _c("span", { staticClass: "el-select__tags-text" }, [
  6637. _vm._v(_vm._s(item.currentLabel))
  6638. ])
  6639. ]
  6640. )
  6641. }),
  6642. 1
  6643. )
  6644. : _vm._e(),
  6645. _vm.filterable
  6646. ? _c("input", {
  6647. directives: [
  6648. {
  6649. name: "model",
  6650. rawName: "v-model",
  6651. value: _vm.query,
  6652. expression: "query"
  6653. }
  6654. ],
  6655. ref: "input",
  6656. staticClass: "el-select__input",
  6657. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  6658. style: {
  6659. "flex-grow": "1",
  6660. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  6661. "max-width": _vm.inputWidth - 42 + "px"
  6662. },
  6663. attrs: {
  6664. type: "text",
  6665. disabled: _vm.selectDisabled,
  6666. autocomplete: _vm.autoComplete || _vm.autocomplete
  6667. },
  6668. domProps: { value: _vm.query },
  6669. on: {
  6670. focus: _vm.handleFocus,
  6671. blur: function($event) {
  6672. _vm.softFocus = false
  6673. },
  6674. keyup: _vm.managePlaceholder,
  6675. keydown: [
  6676. _vm.resetInputState,
  6677. function($event) {
  6678. if (
  6679. !("button" in $event) &&
  6680. _vm._k($event.keyCode, "down", 40, $event.key, [
  6681. "Down",
  6682. "ArrowDown"
  6683. ])
  6684. ) {
  6685. return null
  6686. }
  6687. $event.preventDefault()
  6688. _vm.handleNavigate("next")
  6689. },
  6690. function($event) {
  6691. if (
  6692. !("button" in $event) &&
  6693. _vm._k($event.keyCode, "up", 38, $event.key, [
  6694. "Up",
  6695. "ArrowUp"
  6696. ])
  6697. ) {
  6698. return null
  6699. }
  6700. $event.preventDefault()
  6701. _vm.handleNavigate("prev")
  6702. },
  6703. function($event) {
  6704. if (
  6705. !("button" in $event) &&
  6706. _vm._k(
  6707. $event.keyCode,
  6708. "enter",
  6709. 13,
  6710. $event.key,
  6711. "Enter"
  6712. )
  6713. ) {
  6714. return null
  6715. }
  6716. $event.preventDefault()
  6717. return _vm.selectOption($event)
  6718. },
  6719. function($event) {
  6720. if (
  6721. !("button" in $event) &&
  6722. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6723. "Esc",
  6724. "Escape"
  6725. ])
  6726. ) {
  6727. return null
  6728. }
  6729. $event.stopPropagation()
  6730. $event.preventDefault()
  6731. _vm.visible = false
  6732. },
  6733. function($event) {
  6734. if (
  6735. !("button" in $event) &&
  6736. _vm._k(
  6737. $event.keyCode,
  6738. "delete",
  6739. [8, 46],
  6740. $event.key,
  6741. ["Backspace", "Delete", "Del"]
  6742. )
  6743. ) {
  6744. return null
  6745. }
  6746. return _vm.deletePrevTag($event)
  6747. },
  6748. function($event) {
  6749. if (
  6750. !("button" in $event) &&
  6751. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  6752. ) {
  6753. return null
  6754. }
  6755. _vm.visible = false
  6756. }
  6757. ],
  6758. compositionstart: _vm.handleComposition,
  6759. compositionupdate: _vm.handleComposition,
  6760. compositionend: _vm.handleComposition,
  6761. input: [
  6762. function($event) {
  6763. if ($event.target.composing) {
  6764. return
  6765. }
  6766. _vm.query = $event.target.value
  6767. },
  6768. _vm.debouncedQueryChange
  6769. ]
  6770. }
  6771. })
  6772. : _vm._e()
  6773. ],
  6774. 1
  6775. )
  6776. : _vm._e(),
  6777. _c(
  6778. "el-input",
  6779. {
  6780. ref: "reference",
  6781. class: { "is-focus": _vm.visible },
  6782. attrs: {
  6783. type: "text",
  6784. placeholder: _vm.currentPlaceholder,
  6785. name: _vm.name,
  6786. id: _vm.id,
  6787. autocomplete: _vm.autoComplete || _vm.autocomplete,
  6788. size: _vm.selectSize,
  6789. disabled: _vm.selectDisabled,
  6790. readonly: _vm.readonly,
  6791. "validate-event": false,
  6792. tabindex: _vm.multiple && _vm.filterable ? "-1" : null
  6793. },
  6794. on: {
  6795. focus: _vm.handleFocus,
  6796. blur: _vm.handleBlur,
  6797. input: _vm.debouncedOnInputChange,
  6798. compositionstart: _vm.handleComposition,
  6799. compositionupdate: _vm.handleComposition,
  6800. compositionend: _vm.handleComposition
  6801. },
  6802. nativeOn: {
  6803. keydown: [
  6804. function($event) {
  6805. if (
  6806. !("button" in $event) &&
  6807. _vm._k($event.keyCode, "down", 40, $event.key, [
  6808. "Down",
  6809. "ArrowDown"
  6810. ])
  6811. ) {
  6812. return null
  6813. }
  6814. $event.stopPropagation()
  6815. $event.preventDefault()
  6816. _vm.handleNavigate("next")
  6817. },
  6818. function($event) {
  6819. if (
  6820. !("button" in $event) &&
  6821. _vm._k($event.keyCode, "up", 38, $event.key, [
  6822. "Up",
  6823. "ArrowUp"
  6824. ])
  6825. ) {
  6826. return null
  6827. }
  6828. $event.stopPropagation()
  6829. $event.preventDefault()
  6830. _vm.handleNavigate("prev")
  6831. },
  6832. function($event) {
  6833. if (
  6834. !("button" in $event) &&
  6835. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6836. ) {
  6837. return null
  6838. }
  6839. $event.preventDefault()
  6840. return _vm.selectOption($event)
  6841. },
  6842. function($event) {
  6843. if (
  6844. !("button" in $event) &&
  6845. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6846. "Esc",
  6847. "Escape"
  6848. ])
  6849. ) {
  6850. return null
  6851. }
  6852. $event.stopPropagation()
  6853. $event.preventDefault()
  6854. _vm.visible = false
  6855. },
  6856. function($event) {
  6857. if (
  6858. !("button" in $event) &&
  6859. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  6860. ) {
  6861. return null
  6862. }
  6863. _vm.visible = false
  6864. }
  6865. ],
  6866. mouseenter: function($event) {
  6867. _vm.inputHovering = true
  6868. },
  6869. mouseleave: function($event) {
  6870. _vm.inputHovering = false
  6871. }
  6872. },
  6873. model: {
  6874. value: _vm.selectedLabel,
  6875. callback: function($$v) {
  6876. _vm.selectedLabel = $$v
  6877. },
  6878. expression: "selectedLabel"
  6879. }
  6880. },
  6881. [
  6882. _vm.$slots.prefix
  6883. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  6884. : _vm._e(),
  6885. _c("template", { slot: "suffix" }, [
  6886. _c("i", {
  6887. directives: [
  6888. {
  6889. name: "show",
  6890. rawName: "v-show",
  6891. value: !_vm.showClose,
  6892. expression: "!showClose"
  6893. }
  6894. ],
  6895. class: [
  6896. "el-select__caret",
  6897. "el-input__icon",
  6898. "el-icon-" + _vm.iconClass
  6899. ]
  6900. }),
  6901. _vm.showClose
  6902. ? _c("i", {
  6903. staticClass:
  6904. "el-select__caret el-input__icon el-icon-circle-close",
  6905. on: { click: _vm.handleClearClick }
  6906. })
  6907. : _vm._e()
  6908. ])
  6909. ],
  6910. 2
  6911. ),
  6912. _c(
  6913. "transition",
  6914. {
  6915. attrs: { name: "el-zoom-in-top" },
  6916. on: {
  6917. "before-enter": _vm.handleMenuEnter,
  6918. "after-leave": _vm.doDestroy
  6919. }
  6920. },
  6921. [
  6922. _c(
  6923. "el-select-menu",
  6924. {
  6925. directives: [
  6926. {
  6927. name: "show",
  6928. rawName: "v-show",
  6929. value: _vm.visible && _vm.emptyText !== false,
  6930. expression: "visible && emptyText !== false"
  6931. }
  6932. ],
  6933. ref: "popper",
  6934. attrs: { "append-to-body": _vm.popperAppendToBody }
  6935. },
  6936. [
  6937. _c(
  6938. "el-scrollbar",
  6939. {
  6940. directives: [
  6941. {
  6942. name: "show",
  6943. rawName: "v-show",
  6944. value: _vm.options.length > 0 && !_vm.loading,
  6945. expression: "options.length > 0 && !loading"
  6946. }
  6947. ],
  6948. ref: "scrollbar",
  6949. class: {
  6950. "is-empty":
  6951. !_vm.allowCreate &&
  6952. _vm.query &&
  6953. _vm.filteredOptionsCount === 0
  6954. },
  6955. attrs: {
  6956. tag: "ul",
  6957. "wrap-class": "el-select-dropdown__wrap",
  6958. "view-class": "el-select-dropdown__list"
  6959. }
  6960. },
  6961. [
  6962. _vm.showNewOption
  6963. ? _c("el-option", {
  6964. attrs: { value: _vm.query, created: "" }
  6965. })
  6966. : _vm._e(),
  6967. _vm._t("default")
  6968. ],
  6969. 2
  6970. ),
  6971. _vm.emptyText &&
  6972. (!_vm.allowCreate ||
  6973. _vm.loading ||
  6974. (_vm.allowCreate && _vm.options.length === 0))
  6975. ? [
  6976. _vm.$slots.empty
  6977. ? _vm._t("empty")
  6978. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  6979. _vm._v(
  6980. "\n " +
  6981. _vm._s(_vm.emptyText) +
  6982. "\n "
  6983. )
  6984. ])
  6985. ]
  6986. : _vm._e()
  6987. ],
  6988. 2
  6989. )
  6990. ],
  6991. 1
  6992. )
  6993. ],
  6994. 1
  6995. )
  6996. }
  6997. var selectvue_type_template_id_0e4aade6_staticRenderFns = []
  6998. selectvue_type_template_id_0e4aade6_render._withStripped = true
  6999. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  7000. // 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&
  7001. var select_dropdownvue_type_template_id_06828748_render = function() {
  7002. var _vm = this
  7003. var _h = _vm.$createElement
  7004. var _c = _vm._self._c || _h
  7005. return _c(
  7006. "div",
  7007. {
  7008. staticClass: "el-select-dropdown el-popper",
  7009. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  7010. style: { minWidth: _vm.minWidth }
  7011. },
  7012. [_vm._t("default")],
  7013. 2
  7014. )
  7015. }
  7016. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  7017. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  7018. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  7019. // 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&
  7020. //
  7021. //
  7022. //
  7023. //
  7024. //
  7025. //
  7026. //
  7027. //
  7028. //
  7029. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  7030. name: 'ElSelectDropdown',
  7031. componentName: 'ElSelectDropdown',
  7032. mixins: [vue_popper_default.a],
  7033. props: {
  7034. placement: {
  7035. default: 'bottom-start'
  7036. },
  7037. boundariesPadding: {
  7038. default: 0
  7039. },
  7040. popperOptions: {
  7041. default: function _default() {
  7042. return {
  7043. gpuAcceleration: false
  7044. };
  7045. }
  7046. },
  7047. visibleArrow: {
  7048. default: true
  7049. },
  7050. appendToBody: {
  7051. type: Boolean,
  7052. default: true
  7053. }
  7054. },
  7055. data: function data() {
  7056. return {
  7057. minWidth: ''
  7058. };
  7059. },
  7060. computed: {
  7061. popperClass: function popperClass() {
  7062. return this.$parent.popperClass;
  7063. }
  7064. },
  7065. watch: {
  7066. '$parent.inputWidth': function $parentInputWidth() {
  7067. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  7068. }
  7069. },
  7070. mounted: function mounted() {
  7071. var _this = this;
  7072. this.referenceElm = this.$parent.$refs.reference.$el;
  7073. this.$parent.popperElm = this.popperElm = this.$el;
  7074. this.$on('updatePopper', function () {
  7075. if (_this.$parent.visible) _this.updatePopper();
  7076. });
  7077. this.$on('destroyPopper', this.destroyPopper);
  7078. }
  7079. });
  7080. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  7081. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  7082. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  7083. /* normalize component */
  7084. var select_dropdown_component = normalizeComponent(
  7085. src_select_dropdownvue_type_script_lang_js_,
  7086. select_dropdownvue_type_template_id_06828748_render,
  7087. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  7088. false,
  7089. null,
  7090. null,
  7091. null
  7092. )
  7093. /* hot reload */
  7094. if (false) { var select_dropdown_api; }
  7095. select_dropdown_component.options.__file = "packages/select/src/select-dropdown.vue"
  7096. /* harmony default export */ var select_dropdown = (select_dropdown_component.exports);
  7097. // 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&
  7098. var optionvue_type_template_id_7a44c642_render = function() {
  7099. var _vm = this
  7100. var _h = _vm.$createElement
  7101. var _c = _vm._self._c || _h
  7102. return _c(
  7103. "li",
  7104. {
  7105. directives: [
  7106. {
  7107. name: "show",
  7108. rawName: "v-show",
  7109. value: _vm.visible,
  7110. expression: "visible"
  7111. }
  7112. ],
  7113. staticClass: "el-select-dropdown__item",
  7114. class: {
  7115. selected: _vm.itemSelected,
  7116. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  7117. hover: _vm.hover
  7118. },
  7119. on: {
  7120. mouseenter: _vm.hoverItem,
  7121. click: function($event) {
  7122. $event.stopPropagation()
  7123. return _vm.selectOptionClick($event)
  7124. }
  7125. }
  7126. },
  7127. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  7128. 2
  7129. )
  7130. }
  7131. var optionvue_type_template_id_7a44c642_staticRenderFns = []
  7132. optionvue_type_template_id_7a44c642_render._withStripped = true
  7133. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  7134. // 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&
  7135. 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; };
  7136. //
  7137. //
  7138. //
  7139. //
  7140. //
  7141. //
  7142. //
  7143. //
  7144. //
  7145. //
  7146. //
  7147. //
  7148. //
  7149. //
  7150. //
  7151. //
  7152. //
  7153. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  7154. mixins: [emitter_default.a],
  7155. name: 'ElOption',
  7156. componentName: 'ElOption',
  7157. inject: ['select'],
  7158. props: {
  7159. value: {
  7160. required: true
  7161. },
  7162. label: [String, Number],
  7163. created: Boolean,
  7164. disabled: {
  7165. type: Boolean,
  7166. default: false
  7167. }
  7168. },
  7169. data: function data() {
  7170. return {
  7171. index: -1,
  7172. groupDisabled: false,
  7173. visible: true,
  7174. hitState: false,
  7175. hover: false
  7176. };
  7177. },
  7178. computed: {
  7179. isObject: function isObject() {
  7180. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  7181. },
  7182. currentLabel: function currentLabel() {
  7183. return this.label || (this.isObject ? '' : this.value);
  7184. },
  7185. currentValue: function currentValue() {
  7186. return this.value || this.label || '';
  7187. },
  7188. itemSelected: function itemSelected() {
  7189. if (!this.select.multiple) {
  7190. return this.isEqual(this.value, this.select.value);
  7191. } else {
  7192. return this.contains(this.select.value, this.value);
  7193. }
  7194. },
  7195. limitReached: function limitReached() {
  7196. if (this.select.multiple) {
  7197. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  7198. } else {
  7199. return false;
  7200. }
  7201. }
  7202. },
  7203. watch: {
  7204. currentLabel: function currentLabel() {
  7205. if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
  7206. },
  7207. value: function value(val, oldVal) {
  7208. var _select = this.select,
  7209. remote = _select.remote,
  7210. valueKey = _select.valueKey;
  7211. if (!this.created && !remote) {
  7212. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  7213. return;
  7214. }
  7215. this.dispatch('ElSelect', 'setSelected');
  7216. }
  7217. }
  7218. },
  7219. methods: {
  7220. isEqual: function isEqual(a, b) {
  7221. if (!this.isObject) {
  7222. return a === b;
  7223. } else {
  7224. var valueKey = this.select.valueKey;
  7225. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  7226. }
  7227. },
  7228. contains: function contains() {
  7229. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7230. var target = arguments[1];
  7231. if (!this.isObject) {
  7232. return arr && arr.indexOf(target) > -1;
  7233. } else {
  7234. var valueKey = this.select.valueKey;
  7235. return arr && arr.some(function (item) {
  7236. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  7237. });
  7238. }
  7239. },
  7240. handleGroupDisabled: function handleGroupDisabled(val) {
  7241. this.groupDisabled = val;
  7242. },
  7243. hoverItem: function hoverItem() {
  7244. if (!this.disabled && !this.groupDisabled) {
  7245. this.select.hoverIndex = this.select.options.indexOf(this);
  7246. }
  7247. },
  7248. selectOptionClick: function selectOptionClick() {
  7249. if (this.disabled !== true && this.groupDisabled !== true) {
  7250. this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
  7251. }
  7252. },
  7253. queryChange: function queryChange(query) {
  7254. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  7255. if (!this.visible) {
  7256. this.select.filteredOptionsCount--;
  7257. }
  7258. }
  7259. },
  7260. created: function created() {
  7261. this.select.options.push(this);
  7262. this.select.cachedOptions.push(this);
  7263. this.select.optionsCount++;
  7264. this.select.filteredOptionsCount++;
  7265. this.$on('queryChange', this.queryChange);
  7266. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  7267. },
  7268. beforeDestroy: function beforeDestroy() {
  7269. var _select2 = this.select,
  7270. selected = _select2.selected,
  7271. multiple = _select2.multiple;
  7272. var selectedOptions = multiple ? selected : [selected];
  7273. var index = this.select.cachedOptions.indexOf(this);
  7274. var selectedIndex = selectedOptions.indexOf(this);
  7275. // if option is not selected, remove it from cache
  7276. if (index > -1 && selectedIndex < 0) {
  7277. this.select.cachedOptions.splice(index, 1);
  7278. }
  7279. this.select.onOptionDestroy(this.select.options.indexOf(this));
  7280. }
  7281. });
  7282. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  7283. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  7284. // CONCATENATED MODULE: ./packages/select/src/option.vue
  7285. /* normalize component */
  7286. var option_component = normalizeComponent(
  7287. src_optionvue_type_script_lang_js_,
  7288. optionvue_type_template_id_7a44c642_render,
  7289. optionvue_type_template_id_7a44c642_staticRenderFns,
  7290. false,
  7291. null,
  7292. null,
  7293. null
  7294. )
  7295. /* hot reload */
  7296. if (false) { var option_api; }
  7297. option_component.options.__file = "packages/select/src/option.vue"
  7298. /* harmony default export */ var src_option = (option_component.exports);
  7299. // EXTERNAL MODULE: external "element-ui/lib/tag"
  7300. var tag_ = __webpack_require__(29);
  7301. var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
  7302. // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
  7303. var resize_event_ = __webpack_require__(14);
  7304. // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
  7305. var scroll_into_view_ = __webpack_require__(27);
  7306. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  7307. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  7308. /* harmony default export */ var navigation_mixin = ({
  7309. data: function data() {
  7310. return {
  7311. hoverOption: -1
  7312. };
  7313. },
  7314. computed: {
  7315. optionsAllDisabled: function optionsAllDisabled() {
  7316. return this.options.filter(function (option) {
  7317. return option.visible;
  7318. }).every(function (option) {
  7319. return option.disabled;
  7320. });
  7321. }
  7322. },
  7323. watch: {
  7324. hoverIndex: function hoverIndex(val) {
  7325. var _this = this;
  7326. if (typeof val === 'number' && val > -1) {
  7327. this.hoverOption = this.options[val] || {};
  7328. }
  7329. this.options.forEach(function (option) {
  7330. option.hover = _this.hoverOption === option;
  7331. });
  7332. }
  7333. },
  7334. methods: {
  7335. navigateOptions: function navigateOptions(direction) {
  7336. var _this2 = this;
  7337. if (!this.visible) {
  7338. this.visible = true;
  7339. return;
  7340. }
  7341. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  7342. if (!this.optionsAllDisabled) {
  7343. if (direction === 'next') {
  7344. this.hoverIndex++;
  7345. if (this.hoverIndex === this.options.length) {
  7346. this.hoverIndex = 0;
  7347. }
  7348. } else if (direction === 'prev') {
  7349. this.hoverIndex--;
  7350. if (this.hoverIndex < 0) {
  7351. this.hoverIndex = this.options.length - 1;
  7352. }
  7353. }
  7354. var option = this.options[this.hoverIndex];
  7355. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  7356. this.navigateOptions(direction);
  7357. }
  7358. this.$nextTick(function () {
  7359. return _this2.scrollToOption(_this2.hoverOption);
  7360. });
  7361. }
  7362. }
  7363. }
  7364. });
  7365. // 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&
  7366. //
  7367. //
  7368. //
  7369. //
  7370. //
  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. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  7504. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  7505. name: 'ElSelect',
  7506. componentName: 'ElSelect',
  7507. inject: {
  7508. elForm: {
  7509. default: ''
  7510. },
  7511. elFormItem: {
  7512. default: ''
  7513. }
  7514. },
  7515. provide: function provide() {
  7516. return {
  7517. 'select': this
  7518. };
  7519. },
  7520. computed: {
  7521. _elFormItemSize: function _elFormItemSize() {
  7522. return (this.elFormItem || {}).elFormItemSize;
  7523. },
  7524. readonly: function readonly() {
  7525. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  7526. },
  7527. showClose: function showClose() {
  7528. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  7529. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  7530. return criteria;
  7531. },
  7532. iconClass: function iconClass() {
  7533. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  7534. },
  7535. debounce: function debounce() {
  7536. return this.remote ? 300 : 0;
  7537. },
  7538. emptyText: function emptyText() {
  7539. if (this.loading) {
  7540. return this.loadingText || this.t('el.select.loading');
  7541. } else {
  7542. if (this.remote && this.query === '' && this.options.length === 0) return false;
  7543. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  7544. return this.noMatchText || this.t('el.select.noMatch');
  7545. }
  7546. if (this.options.length === 0) {
  7547. return this.noDataText || this.t('el.select.noData');
  7548. }
  7549. }
  7550. return null;
  7551. },
  7552. showNewOption: function showNewOption() {
  7553. var _this = this;
  7554. var hasExistingOption = this.options.filter(function (option) {
  7555. return !option.created;
  7556. }).some(function (option) {
  7557. return option.currentLabel === _this.query;
  7558. });
  7559. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  7560. },
  7561. selectSize: function selectSize() {
  7562. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  7563. },
  7564. selectDisabled: function selectDisabled() {
  7565. return this.disabled || (this.elForm || {}).disabled;
  7566. },
  7567. collapseTagSize: function collapseTagSize() {
  7568. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  7569. },
  7570. propPlaceholder: function propPlaceholder() {
  7571. return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
  7572. }
  7573. },
  7574. components: {
  7575. ElInput: input_default.a,
  7576. ElSelectMenu: select_dropdown,
  7577. ElOption: src_option,
  7578. ElTag: tag_default.a,
  7579. ElScrollbar: scrollbar_default.a
  7580. },
  7581. directives: { Clickoutside: clickoutside_default.a },
  7582. props: {
  7583. name: String,
  7584. id: String,
  7585. value: {
  7586. required: true
  7587. },
  7588. autocomplete: {
  7589. type: String,
  7590. default: 'off'
  7591. },
  7592. /** @Deprecated in next major version */
  7593. autoComplete: {
  7594. type: String,
  7595. validator: function validator(val) {
  7596. false && false;
  7597. return true;
  7598. }
  7599. },
  7600. automaticDropdown: Boolean,
  7601. size: String,
  7602. disabled: Boolean,
  7603. clearable: Boolean,
  7604. filterable: Boolean,
  7605. allowCreate: Boolean,
  7606. loading: Boolean,
  7607. popperClass: String,
  7608. remote: Boolean,
  7609. loadingText: String,
  7610. noMatchText: String,
  7611. noDataText: String,
  7612. remoteMethod: Function,
  7613. filterMethod: Function,
  7614. multiple: Boolean,
  7615. multipleLimit: {
  7616. type: Number,
  7617. default: 0
  7618. },
  7619. placeholder: {
  7620. type: String,
  7621. required: false
  7622. },
  7623. defaultFirstOption: Boolean,
  7624. reserveKeyword: Boolean,
  7625. valueKey: {
  7626. type: String,
  7627. default: 'value'
  7628. },
  7629. collapseTags: Boolean,
  7630. popperAppendToBody: {
  7631. type: Boolean,
  7632. default: true
  7633. }
  7634. },
  7635. data: function data() {
  7636. return {
  7637. options: [],
  7638. cachedOptions: [],
  7639. createdLabel: null,
  7640. createdSelected: false,
  7641. selected: this.multiple ? [] : {},
  7642. inputLength: 20,
  7643. inputWidth: 0,
  7644. initialInputHeight: 0,
  7645. cachedPlaceHolder: '',
  7646. optionsCount: 0,
  7647. filteredOptionsCount: 0,
  7648. visible: false,
  7649. softFocus: false,
  7650. selectedLabel: '',
  7651. hoverIndex: -1,
  7652. query: '',
  7653. previousQuery: null,
  7654. inputHovering: false,
  7655. currentPlaceholder: '',
  7656. menuVisibleOnFocus: false,
  7657. isOnComposition: false,
  7658. isSilentBlur: false
  7659. };
  7660. },
  7661. watch: {
  7662. selectDisabled: function selectDisabled() {
  7663. var _this2 = this;
  7664. this.$nextTick(function () {
  7665. _this2.resetInputHeight();
  7666. });
  7667. },
  7668. propPlaceholder: function propPlaceholder(val) {
  7669. this.cachedPlaceHolder = this.currentPlaceholder = val;
  7670. },
  7671. value: function value(val, oldVal) {
  7672. if (this.multiple) {
  7673. this.resetInputHeight();
  7674. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  7675. this.currentPlaceholder = '';
  7676. } else {
  7677. this.currentPlaceholder = this.cachedPlaceHolder;
  7678. }
  7679. if (this.filterable && !this.reserveKeyword) {
  7680. this.query = '';
  7681. this.handleQueryChange(this.query);
  7682. }
  7683. }
  7684. this.setSelected();
  7685. if (this.filterable && !this.multiple) {
  7686. this.inputLength = 20;
  7687. }
  7688. if (!Object(util_["valueEquals"])(val, oldVal)) {
  7689. this.dispatch('ElFormItem', 'el.form.change', val);
  7690. }
  7691. },
  7692. visible: function visible(val) {
  7693. var _this3 = this;
  7694. if (!val) {
  7695. this.broadcast('ElSelectDropdown', 'destroyPopper');
  7696. if (this.$refs.input) {
  7697. this.$refs.input.blur();
  7698. }
  7699. this.query = '';
  7700. this.previousQuery = null;
  7701. this.selectedLabel = '';
  7702. this.inputLength = 20;
  7703. this.menuVisibleOnFocus = false;
  7704. this.resetHoverIndex();
  7705. this.$nextTick(function () {
  7706. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  7707. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  7708. }
  7709. });
  7710. if (!this.multiple) {
  7711. if (this.selected) {
  7712. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  7713. this.selectedLabel = this.createdLabel;
  7714. } else {
  7715. this.selectedLabel = this.selected.currentLabel;
  7716. }
  7717. if (this.filterable) this.query = this.selectedLabel;
  7718. }
  7719. if (this.filterable) {
  7720. this.currentPlaceholder = this.cachedPlaceHolder;
  7721. }
  7722. }
  7723. } else {
  7724. this.broadcast('ElSelectDropdown', 'updatePopper');
  7725. if (this.filterable) {
  7726. this.query = this.remote ? '' : this.selectedLabel;
  7727. this.handleQueryChange(this.query);
  7728. if (this.multiple) {
  7729. this.$refs.input.focus();
  7730. } else {
  7731. if (!this.remote) {
  7732. this.broadcast('ElOption', 'queryChange', '');
  7733. this.broadcast('ElOptionGroup', 'queryChange');
  7734. }
  7735. if (this.selectedLabel) {
  7736. this.currentPlaceholder = this.selectedLabel;
  7737. this.selectedLabel = '';
  7738. }
  7739. }
  7740. }
  7741. }
  7742. this.$emit('visible-change', val);
  7743. },
  7744. options: function options() {
  7745. var _this4 = this;
  7746. if (this.$isServer) return;
  7747. this.$nextTick(function () {
  7748. _this4.broadcast('ElSelectDropdown', 'updatePopper');
  7749. });
  7750. if (this.multiple) {
  7751. this.resetInputHeight();
  7752. }
  7753. var inputs = this.$el.querySelectorAll('input');
  7754. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  7755. this.setSelected();
  7756. }
  7757. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7758. this.checkDefaultFirstOption();
  7759. }
  7760. }
  7761. },
  7762. methods: {
  7763. handleNavigate: function handleNavigate(direction) {
  7764. if (this.isOnComposition) return;
  7765. this.navigateOptions(direction);
  7766. },
  7767. handleComposition: function handleComposition(event) {
  7768. var _this5 = this;
  7769. var text = event.target.value;
  7770. if (event.type === 'compositionend') {
  7771. this.isOnComposition = false;
  7772. this.$nextTick(function (_) {
  7773. return _this5.handleQueryChange(text);
  7774. });
  7775. } else {
  7776. var lastCharacter = text[text.length - 1] || '';
  7777. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  7778. }
  7779. },
  7780. handleQueryChange: function handleQueryChange(val) {
  7781. var _this6 = this;
  7782. if (this.previousQuery === val || this.isOnComposition) return;
  7783. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  7784. this.previousQuery = val;
  7785. return;
  7786. }
  7787. this.previousQuery = val;
  7788. this.$nextTick(function () {
  7789. if (_this6.visible) _this6.broadcast('ElSelectDropdown', 'updatePopper');
  7790. });
  7791. this.hoverIndex = -1;
  7792. if (this.multiple && this.filterable) {
  7793. this.$nextTick(function () {
  7794. var length = _this6.$refs.input.value.length * 15 + 20;
  7795. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  7796. _this6.managePlaceholder();
  7797. _this6.resetInputHeight();
  7798. });
  7799. }
  7800. if (this.remote && typeof this.remoteMethod === 'function') {
  7801. this.hoverIndex = -1;
  7802. this.remoteMethod(val);
  7803. } else if (typeof this.filterMethod === 'function') {
  7804. this.filterMethod(val);
  7805. this.broadcast('ElOptionGroup', 'queryChange');
  7806. } else {
  7807. this.filteredOptionsCount = this.optionsCount;
  7808. this.broadcast('ElOption', 'queryChange', val);
  7809. this.broadcast('ElOptionGroup', 'queryChange');
  7810. }
  7811. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7812. this.checkDefaultFirstOption();
  7813. }
  7814. },
  7815. scrollToOption: function scrollToOption(option) {
  7816. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  7817. if (this.$refs.popper && target) {
  7818. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  7819. scroll_into_view_default()(menu, target);
  7820. }
  7821. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  7822. },
  7823. handleMenuEnter: function handleMenuEnter() {
  7824. var _this7 = this;
  7825. this.$nextTick(function () {
  7826. return _this7.scrollToOption(_this7.selected);
  7827. });
  7828. },
  7829. emitChange: function emitChange(val) {
  7830. if (!Object(util_["valueEquals"])(this.value, val)) {
  7831. this.$emit('change', val);
  7832. }
  7833. },
  7834. getOption: function getOption(value) {
  7835. var option = void 0;
  7836. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  7837. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  7838. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
  7839. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  7840. var cachedOption = this.cachedOptions[i];
  7841. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  7842. if (isEqual) {
  7843. option = cachedOption;
  7844. break;
  7845. }
  7846. }
  7847. if (option) return option;
  7848. var label = !isObject && !isNull && !isUndefined ? String(value) : '';
  7849. var newOption = {
  7850. value: value,
  7851. currentLabel: label
  7852. };
  7853. if (this.multiple) {
  7854. newOption.hitState = false;
  7855. }
  7856. return newOption;
  7857. },
  7858. setSelected: function setSelected() {
  7859. var _this8 = this;
  7860. if (!this.multiple) {
  7861. var option = this.getOption(this.value);
  7862. if (option.created) {
  7863. this.createdLabel = option.currentLabel;
  7864. this.createdSelected = true;
  7865. } else {
  7866. this.createdSelected = false;
  7867. }
  7868. this.selectedLabel = option.currentLabel;
  7869. this.selected = option;
  7870. if (this.filterable) this.query = this.selectedLabel;
  7871. return;
  7872. }
  7873. var result = [];
  7874. if (Array.isArray(this.value)) {
  7875. this.value.forEach(function (value) {
  7876. result.push(_this8.getOption(value));
  7877. });
  7878. }
  7879. this.selected = result;
  7880. this.$nextTick(function () {
  7881. _this8.resetInputHeight();
  7882. });
  7883. },
  7884. handleFocus: function handleFocus(event) {
  7885. if (!this.softFocus) {
  7886. if (this.automaticDropdown || this.filterable) {
  7887. if (this.filterable && !this.visible) {
  7888. this.menuVisibleOnFocus = true;
  7889. }
  7890. this.visible = true;
  7891. }
  7892. this.$emit('focus', event);
  7893. } else {
  7894. this.softFocus = false;
  7895. }
  7896. },
  7897. blur: function blur() {
  7898. this.visible = false;
  7899. this.$refs.reference.blur();
  7900. },
  7901. handleBlur: function handleBlur(event) {
  7902. var _this9 = this;
  7903. setTimeout(function () {
  7904. if (_this9.isSilentBlur) {
  7905. _this9.isSilentBlur = false;
  7906. } else {
  7907. _this9.$emit('blur', event);
  7908. }
  7909. }, 50);
  7910. this.softFocus = false;
  7911. },
  7912. handleClearClick: function handleClearClick(event) {
  7913. this.deleteSelected(event);
  7914. },
  7915. doDestroy: function doDestroy() {
  7916. this.$refs.popper && this.$refs.popper.doDestroy();
  7917. },
  7918. handleClose: function handleClose() {
  7919. this.visible = false;
  7920. },
  7921. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  7922. if (!Array.isArray(this.selected)) return;
  7923. var option = this.selected[this.selected.length - 1];
  7924. if (!option) return;
  7925. if (hit === true || hit === false) {
  7926. option.hitState = hit;
  7927. return hit;
  7928. }
  7929. option.hitState = !option.hitState;
  7930. return option.hitState;
  7931. },
  7932. deletePrevTag: function deletePrevTag(e) {
  7933. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  7934. var value = this.value.slice();
  7935. value.pop();
  7936. this.$emit('input', value);
  7937. this.emitChange(value);
  7938. }
  7939. },
  7940. managePlaceholder: function managePlaceholder() {
  7941. if (this.currentPlaceholder !== '') {
  7942. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  7943. }
  7944. },
  7945. resetInputState: function resetInputState(e) {
  7946. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  7947. this.inputLength = this.$refs.input.value.length * 15 + 20;
  7948. this.resetInputHeight();
  7949. },
  7950. resetInputHeight: function resetInputHeight() {
  7951. var _this10 = this;
  7952. if (this.collapseTags && !this.filterable) return;
  7953. this.$nextTick(function () {
  7954. if (!_this10.$refs.reference) return;
  7955. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  7956. var input = [].filter.call(inputChildNodes, function (item) {
  7957. return item.tagName === 'INPUT';
  7958. })[0];
  7959. var tags = _this10.$refs.tags;
  7960. var tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
  7961. var sizeInMap = _this10.initialInputHeight || 40;
  7962. input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  7963. if (_this10.visible && _this10.emptyText !== false) {
  7964. _this10.broadcast('ElSelectDropdown', 'updatePopper');
  7965. }
  7966. });
  7967. },
  7968. resetHoverIndex: function resetHoverIndex() {
  7969. var _this11 = this;
  7970. setTimeout(function () {
  7971. if (!_this11.multiple) {
  7972. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  7973. } else {
  7974. if (_this11.selected.length > 0) {
  7975. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  7976. return _this11.options.indexOf(item);
  7977. }));
  7978. } else {
  7979. _this11.hoverIndex = -1;
  7980. }
  7981. }
  7982. }, 300);
  7983. },
  7984. handleOptionSelect: function handleOptionSelect(option, byClick) {
  7985. var _this12 = this;
  7986. if (this.multiple) {
  7987. var value = (this.value || []).slice();
  7988. var optionIndex = this.getValueIndex(value, option.value);
  7989. if (optionIndex > -1) {
  7990. value.splice(optionIndex, 1);
  7991. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  7992. value.push(option.value);
  7993. }
  7994. this.$emit('input', value);
  7995. this.emitChange(value);
  7996. if (option.created) {
  7997. this.query = '';
  7998. this.handleQueryChange('');
  7999. this.inputLength = 20;
  8000. }
  8001. if (this.filterable) this.$refs.input.focus();
  8002. } else {
  8003. this.$emit('input', option.value);
  8004. this.emitChange(option.value);
  8005. this.visible = false;
  8006. }
  8007. this.isSilentBlur = byClick;
  8008. this.setSoftFocus();
  8009. if (this.visible) return;
  8010. this.$nextTick(function () {
  8011. _this12.scrollToOption(option);
  8012. });
  8013. },
  8014. setSoftFocus: function setSoftFocus() {
  8015. this.softFocus = true;
  8016. var input = this.$refs.input || this.$refs.reference;
  8017. if (input) {
  8018. input.focus();
  8019. }
  8020. },
  8021. getValueIndex: function getValueIndex() {
  8022. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  8023. var value = arguments[1];
  8024. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  8025. if (!isObject) {
  8026. return arr.indexOf(value);
  8027. } else {
  8028. var valueKey = this.valueKey;
  8029. var index = -1;
  8030. arr.some(function (item, i) {
  8031. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  8032. index = i;
  8033. return true;
  8034. }
  8035. return false;
  8036. });
  8037. return index;
  8038. }
  8039. },
  8040. toggleMenu: function toggleMenu() {
  8041. if (!this.selectDisabled) {
  8042. if (this.menuVisibleOnFocus) {
  8043. this.menuVisibleOnFocus = false;
  8044. } else {
  8045. this.visible = !this.visible;
  8046. }
  8047. if (this.visible) {
  8048. (this.$refs.input || this.$refs.reference).focus();
  8049. }
  8050. }
  8051. },
  8052. selectOption: function selectOption() {
  8053. if (!this.visible) {
  8054. this.toggleMenu();
  8055. } else {
  8056. if (this.options[this.hoverIndex]) {
  8057. this.handleOptionSelect(this.options[this.hoverIndex]);
  8058. }
  8059. }
  8060. },
  8061. deleteSelected: function deleteSelected(event) {
  8062. event.stopPropagation();
  8063. var value = this.multiple ? [] : '';
  8064. this.$emit('input', value);
  8065. this.emitChange(value);
  8066. this.visible = false;
  8067. this.$emit('clear');
  8068. },
  8069. deleteTag: function deleteTag(event, tag) {
  8070. var index = this.selected.indexOf(tag);
  8071. if (index > -1 && !this.selectDisabled) {
  8072. var value = this.value.slice();
  8073. value.splice(index, 1);
  8074. this.$emit('input', value);
  8075. this.emitChange(value);
  8076. this.$emit('remove-tag', tag.value);
  8077. }
  8078. event.stopPropagation();
  8079. },
  8080. onInputChange: function onInputChange() {
  8081. if (this.filterable && this.query !== this.selectedLabel) {
  8082. this.query = this.selectedLabel;
  8083. this.handleQueryChange(this.query);
  8084. }
  8085. },
  8086. onOptionDestroy: function onOptionDestroy(index) {
  8087. if (index > -1) {
  8088. this.optionsCount--;
  8089. this.filteredOptionsCount--;
  8090. this.options.splice(index, 1);
  8091. }
  8092. },
  8093. resetInputWidth: function resetInputWidth() {
  8094. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  8095. },
  8096. handleResize: function handleResize() {
  8097. this.resetInputWidth();
  8098. if (this.multiple) this.resetInputHeight();
  8099. },
  8100. checkDefaultFirstOption: function checkDefaultFirstOption() {
  8101. this.hoverIndex = -1;
  8102. // highlight the created option
  8103. var hasCreated = false;
  8104. for (var i = this.options.length - 1; i >= 0; i--) {
  8105. if (this.options[i].created) {
  8106. hasCreated = true;
  8107. this.hoverIndex = i;
  8108. break;
  8109. }
  8110. }
  8111. if (hasCreated) return;
  8112. for (var _i = 0; _i !== this.options.length; ++_i) {
  8113. var option = this.options[_i];
  8114. if (this.query) {
  8115. // highlight first options that passes the filter
  8116. if (!option.disabled && !option.groupDisabled && option.visible) {
  8117. this.hoverIndex = _i;
  8118. break;
  8119. }
  8120. } else {
  8121. // highlight currently selected option
  8122. if (option.itemSelected) {
  8123. this.hoverIndex = _i;
  8124. break;
  8125. }
  8126. }
  8127. }
  8128. },
  8129. getValueKey: function getValueKey(item) {
  8130. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  8131. return item.value;
  8132. } else {
  8133. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  8134. }
  8135. }
  8136. },
  8137. created: function created() {
  8138. var _this13 = this;
  8139. this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
  8140. if (this.multiple && !Array.isArray(this.value)) {
  8141. this.$emit('input', []);
  8142. }
  8143. if (!this.multiple && Array.isArray(this.value)) {
  8144. this.$emit('input', '');
  8145. }
  8146. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  8147. _this13.onInputChange();
  8148. });
  8149. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  8150. _this13.handleQueryChange(e.target.value);
  8151. });
  8152. this.$on('handleOptionClick', this.handleOptionSelect);
  8153. this.$on('setSelected', this.setSelected);
  8154. },
  8155. mounted: function mounted() {
  8156. var _this14 = this;
  8157. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  8158. this.currentPlaceholder = '';
  8159. }
  8160. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  8161. var reference = this.$refs.reference;
  8162. if (reference && reference.$el) {
  8163. var sizeMap = {
  8164. medium: 36,
  8165. small: 32,
  8166. mini: 28
  8167. };
  8168. var input = reference.$el.querySelector('input');
  8169. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  8170. }
  8171. if (this.remote && this.multiple) {
  8172. this.resetInputHeight();
  8173. }
  8174. this.$nextTick(function () {
  8175. if (reference && reference.$el) {
  8176. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  8177. }
  8178. });
  8179. this.setSelected();
  8180. },
  8181. beforeDestroy: function beforeDestroy() {
  8182. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  8183. }
  8184. });
  8185. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  8186. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  8187. // CONCATENATED MODULE: ./packages/select/src/select.vue
  8188. /* normalize component */
  8189. var select_component = normalizeComponent(
  8190. src_selectvue_type_script_lang_js_,
  8191. selectvue_type_template_id_0e4aade6_render,
  8192. selectvue_type_template_id_0e4aade6_staticRenderFns,
  8193. false,
  8194. null,
  8195. null,
  8196. null
  8197. )
  8198. /* hot reload */
  8199. if (false) { var select_api; }
  8200. select_component.options.__file = "packages/select/src/select.vue"
  8201. /* harmony default export */ var src_select = (select_component.exports);
  8202. // CONCATENATED MODULE: ./packages/select/index.js
  8203. /* istanbul ignore next */
  8204. src_select.install = function (Vue) {
  8205. Vue.component(src_select.name, src_select);
  8206. };
  8207. /* harmony default export */ var packages_select = (src_select);
  8208. // CONCATENATED MODULE: ./packages/option/index.js
  8209. /* istanbul ignore next */
  8210. src_option.install = function (Vue) {
  8211. Vue.component(src_option.name, src_option);
  8212. };
  8213. /* harmony default export */ var packages_option = (src_option);
  8214. // 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&
  8215. var option_groupvue_type_template_id_6685e5de_render = function() {
  8216. var _vm = this
  8217. var _h = _vm.$createElement
  8218. var _c = _vm._self._c || _h
  8219. return _c(
  8220. "ul",
  8221. {
  8222. directives: [
  8223. {
  8224. name: "show",
  8225. rawName: "v-show",
  8226. value: _vm.visible,
  8227. expression: "visible"
  8228. }
  8229. ],
  8230. staticClass: "el-select-group__wrap"
  8231. },
  8232. [
  8233. _c("li", { staticClass: "el-select-group__title" }, [
  8234. _vm._v(_vm._s(_vm.label))
  8235. ]),
  8236. _c("li", [
  8237. _c("ul", { staticClass: "el-select-group" }, [_vm._t("default")], 2)
  8238. ])
  8239. ]
  8240. )
  8241. }
  8242. var option_groupvue_type_template_id_6685e5de_staticRenderFns = []
  8243. option_groupvue_type_template_id_6685e5de_render._withStripped = true
  8244. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=template&id=6685e5de&
  8245. // 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&
  8246. //
  8247. //
  8248. //
  8249. //
  8250. //
  8251. //
  8252. //
  8253. //
  8254. //
  8255. //
  8256. //
  8257. /* harmony default export */ var option_groupvue_type_script_lang_js_ = ({
  8258. mixins: [emitter_default.a],
  8259. name: 'ElOptionGroup',
  8260. componentName: 'ElOptionGroup',
  8261. props: {
  8262. label: String,
  8263. disabled: {
  8264. type: Boolean,
  8265. default: false
  8266. }
  8267. },
  8268. data: function data() {
  8269. return {
  8270. visible: true
  8271. };
  8272. },
  8273. watch: {
  8274. disabled: function disabled(val) {
  8275. this.broadcast('ElOption', 'handleGroupDisabled', val);
  8276. }
  8277. },
  8278. methods: {
  8279. queryChange: function queryChange() {
  8280. this.visible = this.$children && Array.isArray(this.$children) && this.$children.some(function (option) {
  8281. return option.visible === true;
  8282. });
  8283. }
  8284. },
  8285. created: function created() {
  8286. this.$on('queryChange', this.queryChange);
  8287. },
  8288. mounted: function mounted() {
  8289. if (this.disabled) {
  8290. this.broadcast('ElOption', 'handleGroupDisabled', this.disabled);
  8291. }
  8292. }
  8293. });
  8294. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=script&lang=js&
  8295. /* harmony default export */ var src_option_groupvue_type_script_lang_js_ = (option_groupvue_type_script_lang_js_);
  8296. // CONCATENATED MODULE: ./packages/select/src/option-group.vue
  8297. /* normalize component */
  8298. var option_group_component = normalizeComponent(
  8299. src_option_groupvue_type_script_lang_js_,
  8300. option_groupvue_type_template_id_6685e5de_render,
  8301. option_groupvue_type_template_id_6685e5de_staticRenderFns,
  8302. false,
  8303. null,
  8304. null,
  8305. null
  8306. )
  8307. /* hot reload */
  8308. if (false) { var option_group_api; }
  8309. option_group_component.options.__file = "packages/select/src/option-group.vue"
  8310. /* harmony default export */ var option_group = (option_group_component.exports);
  8311. // CONCATENATED MODULE: ./packages/option-group/index.js
  8312. /* istanbul ignore next */
  8313. option_group.install = function (Vue) {
  8314. Vue.component(option_group.name, option_group);
  8315. };
  8316. /* harmony default export */ var packages_option_group = (option_group);
  8317. // 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&
  8318. var buttonvue_type_template_id_ca859fb4_render = function() {
  8319. var _vm = this
  8320. var _h = _vm.$createElement
  8321. var _c = _vm._self._c || _h
  8322. return _c(
  8323. "button",
  8324. {
  8325. staticClass: "el-button",
  8326. class: [
  8327. _vm.type ? "el-button--" + _vm.type : "",
  8328. _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
  8329. {
  8330. "is-disabled": _vm.buttonDisabled,
  8331. "is-loading": _vm.loading,
  8332. "is-plain": _vm.plain,
  8333. "is-round": _vm.round,
  8334. "is-circle": _vm.circle
  8335. }
  8336. ],
  8337. attrs: {
  8338. disabled: _vm.buttonDisabled || _vm.loading,
  8339. autofocus: _vm.autofocus,
  8340. type: _vm.nativeType
  8341. },
  8342. on: { click: _vm.handleClick }
  8343. },
  8344. [
  8345. _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
  8346. _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
  8347. _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e()
  8348. ]
  8349. )
  8350. }
  8351. var buttonvue_type_template_id_ca859fb4_staticRenderFns = []
  8352. buttonvue_type_template_id_ca859fb4_render._withStripped = true
  8353. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  8354. // 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&
  8355. //
  8356. //
  8357. //
  8358. //
  8359. //
  8360. //
  8361. //
  8362. //
  8363. //
  8364. //
  8365. //
  8366. //
  8367. //
  8368. //
  8369. //
  8370. //
  8371. //
  8372. //
  8373. //
  8374. //
  8375. //
  8376. //
  8377. //
  8378. //
  8379. /* harmony default export */ var buttonvue_type_script_lang_js_ = ({
  8380. name: 'ElButton',
  8381. inject: {
  8382. elForm: {
  8383. default: ''
  8384. },
  8385. elFormItem: {
  8386. default: ''
  8387. }
  8388. },
  8389. props: {
  8390. type: {
  8391. type: String,
  8392. default: 'default'
  8393. },
  8394. size: String,
  8395. icon: {
  8396. type: String,
  8397. default: ''
  8398. },
  8399. nativeType: {
  8400. type: String,
  8401. default: 'button'
  8402. },
  8403. loading: Boolean,
  8404. disabled: Boolean,
  8405. plain: Boolean,
  8406. autofocus: Boolean,
  8407. round: Boolean,
  8408. circle: Boolean
  8409. },
  8410. computed: {
  8411. _elFormItemSize: function _elFormItemSize() {
  8412. return (this.elFormItem || {}).elFormItemSize;
  8413. },
  8414. buttonSize: function buttonSize() {
  8415. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  8416. },
  8417. buttonDisabled: function buttonDisabled() {
  8418. return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
  8419. }
  8420. },
  8421. methods: {
  8422. handleClick: function handleClick(evt) {
  8423. this.$emit('click', evt);
  8424. }
  8425. }
  8426. });
  8427. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
  8428. /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
  8429. // CONCATENATED MODULE: ./packages/button/src/button.vue
  8430. /* normalize component */
  8431. var button_component = normalizeComponent(
  8432. src_buttonvue_type_script_lang_js_,
  8433. buttonvue_type_template_id_ca859fb4_render,
  8434. buttonvue_type_template_id_ca859fb4_staticRenderFns,
  8435. false,
  8436. null,
  8437. null,
  8438. null
  8439. )
  8440. /* hot reload */
  8441. if (false) { var button_api; }
  8442. button_component.options.__file = "packages/button/src/button.vue"
  8443. /* harmony default export */ var src_button = (button_component.exports);
  8444. // CONCATENATED MODULE: ./packages/button/index.js
  8445. /* istanbul ignore next */
  8446. src_button.install = function (Vue) {
  8447. Vue.component(src_button.name, src_button);
  8448. };
  8449. /* harmony default export */ var packages_button = (src_button);
  8450. // 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&
  8451. var button_groupvue_type_template_id_3d8661d0_render = function() {
  8452. var _vm = this
  8453. var _h = _vm.$createElement
  8454. var _c = _vm._self._c || _h
  8455. return _c("div", { staticClass: "el-button-group" }, [_vm._t("default")], 2)
  8456. }
  8457. var button_groupvue_type_template_id_3d8661d0_staticRenderFns = []
  8458. button_groupvue_type_template_id_3d8661d0_render._withStripped = true
  8459. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=template&id=3d8661d0&
  8460. // 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&
  8461. //
  8462. //
  8463. //
  8464. //
  8465. //
  8466. /* harmony default export */ var button_groupvue_type_script_lang_js_ = ({
  8467. name: 'ElButtonGroup'
  8468. });
  8469. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=script&lang=js&
  8470. /* harmony default export */ var src_button_groupvue_type_script_lang_js_ = (button_groupvue_type_script_lang_js_);
  8471. // CONCATENATED MODULE: ./packages/button/src/button-group.vue
  8472. /* normalize component */
  8473. var button_group_component = normalizeComponent(
  8474. src_button_groupvue_type_script_lang_js_,
  8475. button_groupvue_type_template_id_3d8661d0_render,
  8476. button_groupvue_type_template_id_3d8661d0_staticRenderFns,
  8477. false,
  8478. null,
  8479. null,
  8480. null
  8481. )
  8482. /* hot reload */
  8483. if (false) { var button_group_api; }
  8484. button_group_component.options.__file = "packages/button/src/button-group.vue"
  8485. /* harmony default export */ var button_group = (button_group_component.exports);
  8486. // CONCATENATED MODULE: ./packages/button-group/index.js
  8487. /* istanbul ignore next */
  8488. button_group.install = function (Vue) {
  8489. Vue.component(button_group.name, button_group);
  8490. };
  8491. /* harmony default export */ var packages_button_group = (button_group);
  8492. // 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&
  8493. var tablevue_type_template_id_493fe34e_render = function() {
  8494. var _vm = this
  8495. var _h = _vm.$createElement
  8496. var _c = _vm._self._c || _h
  8497. return _c(
  8498. "div",
  8499. {
  8500. staticClass: "el-table",
  8501. class: [
  8502. {
  8503. "el-table--fit": _vm.fit,
  8504. "el-table--striped": _vm.stripe,
  8505. "el-table--border": _vm.border || _vm.isGroup,
  8506. "el-table--hidden": _vm.isHidden,
  8507. "el-table--group": _vm.isGroup,
  8508. "el-table--fluid-height": _vm.maxHeight,
  8509. "el-table--scrollable-x": _vm.layout.scrollX,
  8510. "el-table--scrollable-y": _vm.layout.scrollY,
  8511. "el-table--enable-row-hover": !_vm.store.states.isComplex,
  8512. "el-table--enable-row-transition":
  8513. (_vm.store.states.data || []).length !== 0 &&
  8514. (_vm.store.states.data || []).length < 100
  8515. },
  8516. _vm.tableSize ? "el-table--" + _vm.tableSize : ""
  8517. ],
  8518. on: {
  8519. mouseleave: function($event) {
  8520. _vm.handleMouseLeave($event)
  8521. }
  8522. }
  8523. },
  8524. [
  8525. _c(
  8526. "div",
  8527. { ref: "hiddenColumns", staticClass: "hidden-columns" },
  8528. [_vm._t("default")],
  8529. 2
  8530. ),
  8531. _vm.showHeader
  8532. ? _c(
  8533. "div",
  8534. {
  8535. directives: [
  8536. {
  8537. name: "mousewheel",
  8538. rawName: "v-mousewheel",
  8539. value: _vm.handleHeaderFooterMousewheel,
  8540. expression: "handleHeaderFooterMousewheel"
  8541. }
  8542. ],
  8543. ref: "headerWrapper",
  8544. staticClass: "el-table__header-wrapper"
  8545. },
  8546. [
  8547. _c("table-header", {
  8548. ref: "tableHeader",
  8549. style: {
  8550. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8551. },
  8552. attrs: {
  8553. store: _vm.store,
  8554. border: _vm.border,
  8555. "default-sort": _vm.defaultSort
  8556. }
  8557. })
  8558. ],
  8559. 1
  8560. )
  8561. : _vm._e(),
  8562. _c(
  8563. "div",
  8564. {
  8565. ref: "bodyWrapper",
  8566. staticClass: "el-table__body-wrapper",
  8567. class: [
  8568. _vm.layout.scrollX
  8569. ? "is-scrolling-" + _vm.scrollPosition
  8570. : "is-scrolling-none"
  8571. ],
  8572. style: [_vm.bodyHeight]
  8573. },
  8574. [
  8575. _c("table-body", {
  8576. style: {
  8577. width: _vm.bodyWidth
  8578. },
  8579. attrs: {
  8580. context: _vm.context,
  8581. store: _vm.store,
  8582. stripe: _vm.stripe,
  8583. "row-class-name": _vm.rowClassName,
  8584. "row-style": _vm.rowStyle,
  8585. highlight: _vm.highlightCurrentRow
  8586. }
  8587. }),
  8588. !_vm.data || _vm.data.length === 0
  8589. ? _c(
  8590. "div",
  8591. {
  8592. ref: "emptyBlock",
  8593. staticClass: "el-table__empty-block",
  8594. style: _vm.emptyBlockStyle
  8595. },
  8596. [
  8597. _c(
  8598. "span",
  8599. { staticClass: "el-table__empty-text" },
  8600. [
  8601. _vm._t("empty", [
  8602. _vm._v(
  8603. _vm._s(_vm.emptyText || _vm.t("el.table.emptyText"))
  8604. )
  8605. ])
  8606. ],
  8607. 2
  8608. )
  8609. ]
  8610. )
  8611. : _vm._e(),
  8612. _vm.$slots.append
  8613. ? _c(
  8614. "div",
  8615. {
  8616. ref: "appendWrapper",
  8617. staticClass: "el-table__append-wrapper"
  8618. },
  8619. [_vm._t("append")],
  8620. 2
  8621. )
  8622. : _vm._e()
  8623. ],
  8624. 1
  8625. ),
  8626. _vm.showSummary
  8627. ? _c(
  8628. "div",
  8629. {
  8630. directives: [
  8631. {
  8632. name: "show",
  8633. rawName: "v-show",
  8634. value: _vm.data && _vm.data.length > 0,
  8635. expression: "data && data.length > 0"
  8636. },
  8637. {
  8638. name: "mousewheel",
  8639. rawName: "v-mousewheel",
  8640. value: _vm.handleHeaderFooterMousewheel,
  8641. expression: "handleHeaderFooterMousewheel"
  8642. }
  8643. ],
  8644. ref: "footerWrapper",
  8645. staticClass: "el-table__footer-wrapper"
  8646. },
  8647. [
  8648. _c("table-footer", {
  8649. style: {
  8650. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8651. },
  8652. attrs: {
  8653. store: _vm.store,
  8654. border: _vm.border,
  8655. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8656. "summary-method": _vm.summaryMethod,
  8657. "default-sort": _vm.defaultSort
  8658. }
  8659. })
  8660. ],
  8661. 1
  8662. )
  8663. : _vm._e(),
  8664. _vm.fixedColumns.length > 0
  8665. ? _c(
  8666. "div",
  8667. {
  8668. directives: [
  8669. {
  8670. name: "mousewheel",
  8671. rawName: "v-mousewheel",
  8672. value: _vm.handleFixedMousewheel,
  8673. expression: "handleFixedMousewheel"
  8674. }
  8675. ],
  8676. ref: "fixedWrapper",
  8677. staticClass: "el-table__fixed",
  8678. style: [
  8679. {
  8680. width: _vm.layout.fixedWidth
  8681. ? _vm.layout.fixedWidth + "px"
  8682. : ""
  8683. },
  8684. _vm.fixedHeight
  8685. ]
  8686. },
  8687. [
  8688. _vm.showHeader
  8689. ? _c(
  8690. "div",
  8691. {
  8692. ref: "fixedHeaderWrapper",
  8693. staticClass: "el-table__fixed-header-wrapper"
  8694. },
  8695. [
  8696. _c("table-header", {
  8697. ref: "fixedTableHeader",
  8698. style: {
  8699. width: _vm.bodyWidth
  8700. },
  8701. attrs: {
  8702. fixed: "left",
  8703. border: _vm.border,
  8704. store: _vm.store
  8705. }
  8706. })
  8707. ],
  8708. 1
  8709. )
  8710. : _vm._e(),
  8711. _c(
  8712. "div",
  8713. {
  8714. ref: "fixedBodyWrapper",
  8715. staticClass: "el-table__fixed-body-wrapper",
  8716. style: [
  8717. {
  8718. top: _vm.layout.headerHeight + "px"
  8719. },
  8720. _vm.fixedBodyHeight
  8721. ]
  8722. },
  8723. [
  8724. _c("table-body", {
  8725. style: {
  8726. width: _vm.bodyWidth
  8727. },
  8728. attrs: {
  8729. fixed: "left",
  8730. store: _vm.store,
  8731. stripe: _vm.stripe,
  8732. highlight: _vm.highlightCurrentRow,
  8733. "row-class-name": _vm.rowClassName,
  8734. "row-style": _vm.rowStyle
  8735. }
  8736. }),
  8737. _vm.$slots.append
  8738. ? _c("div", {
  8739. staticClass: "el-table__append-gutter",
  8740. style: { height: _vm.layout.appendHeight + "px" }
  8741. })
  8742. : _vm._e()
  8743. ],
  8744. 1
  8745. ),
  8746. _vm.showSummary
  8747. ? _c(
  8748. "div",
  8749. {
  8750. directives: [
  8751. {
  8752. name: "show",
  8753. rawName: "v-show",
  8754. value: _vm.data && _vm.data.length > 0,
  8755. expression: "data && data.length > 0"
  8756. }
  8757. ],
  8758. ref: "fixedFooterWrapper",
  8759. staticClass: "el-table__fixed-footer-wrapper"
  8760. },
  8761. [
  8762. _c("table-footer", {
  8763. style: {
  8764. width: _vm.bodyWidth
  8765. },
  8766. attrs: {
  8767. fixed: "left",
  8768. border: _vm.border,
  8769. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8770. "summary-method": _vm.summaryMethod,
  8771. store: _vm.store
  8772. }
  8773. })
  8774. ],
  8775. 1
  8776. )
  8777. : _vm._e()
  8778. ]
  8779. )
  8780. : _vm._e(),
  8781. _vm.rightFixedColumns.length > 0
  8782. ? _c(
  8783. "div",
  8784. {
  8785. directives: [
  8786. {
  8787. name: "mousewheel",
  8788. rawName: "v-mousewheel",
  8789. value: _vm.handleFixedMousewheel,
  8790. expression: "handleFixedMousewheel"
  8791. }
  8792. ],
  8793. ref: "rightFixedWrapper",
  8794. staticClass: "el-table__fixed-right",
  8795. style: [
  8796. {
  8797. width: _vm.layout.rightFixedWidth
  8798. ? _vm.layout.rightFixedWidth + "px"
  8799. : "",
  8800. right: _vm.layout.scrollY
  8801. ? (_vm.border
  8802. ? _vm.layout.gutterWidth
  8803. : _vm.layout.gutterWidth || 0) + "px"
  8804. : ""
  8805. },
  8806. _vm.fixedHeight
  8807. ]
  8808. },
  8809. [
  8810. _vm.showHeader
  8811. ? _c(
  8812. "div",
  8813. {
  8814. ref: "rightFixedHeaderWrapper",
  8815. staticClass: "el-table__fixed-header-wrapper"
  8816. },
  8817. [
  8818. _c("table-header", {
  8819. ref: "rightFixedTableHeader",
  8820. style: {
  8821. width: _vm.bodyWidth
  8822. },
  8823. attrs: {
  8824. fixed: "right",
  8825. border: _vm.border,
  8826. store: _vm.store
  8827. }
  8828. })
  8829. ],
  8830. 1
  8831. )
  8832. : _vm._e(),
  8833. _c(
  8834. "div",
  8835. {
  8836. ref: "rightFixedBodyWrapper",
  8837. staticClass: "el-table__fixed-body-wrapper",
  8838. style: [
  8839. {
  8840. top: _vm.layout.headerHeight + "px"
  8841. },
  8842. _vm.fixedBodyHeight
  8843. ]
  8844. },
  8845. [
  8846. _c("table-body", {
  8847. style: {
  8848. width: _vm.bodyWidth
  8849. },
  8850. attrs: {
  8851. fixed: "right",
  8852. store: _vm.store,
  8853. stripe: _vm.stripe,
  8854. "row-class-name": _vm.rowClassName,
  8855. "row-style": _vm.rowStyle,
  8856. highlight: _vm.highlightCurrentRow
  8857. }
  8858. }),
  8859. _vm.$slots.append
  8860. ? _c("div", {
  8861. staticClass: "el-table__append-gutter",
  8862. style: { height: _vm.layout.appendHeight + "px" }
  8863. })
  8864. : _vm._e()
  8865. ],
  8866. 1
  8867. ),
  8868. _vm.showSummary
  8869. ? _c(
  8870. "div",
  8871. {
  8872. directives: [
  8873. {
  8874. name: "show",
  8875. rawName: "v-show",
  8876. value: _vm.data && _vm.data.length > 0,
  8877. expression: "data && data.length > 0"
  8878. }
  8879. ],
  8880. ref: "rightFixedFooterWrapper",
  8881. staticClass: "el-table__fixed-footer-wrapper"
  8882. },
  8883. [
  8884. _c("table-footer", {
  8885. style: {
  8886. width: _vm.bodyWidth
  8887. },
  8888. attrs: {
  8889. fixed: "right",
  8890. border: _vm.border,
  8891. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8892. "summary-method": _vm.summaryMethod,
  8893. store: _vm.store
  8894. }
  8895. })
  8896. ],
  8897. 1
  8898. )
  8899. : _vm._e()
  8900. ]
  8901. )
  8902. : _vm._e(),
  8903. _vm.rightFixedColumns.length > 0
  8904. ? _c("div", {
  8905. ref: "rightFixedPatch",
  8906. staticClass: "el-table__fixed-right-patch",
  8907. style: {
  8908. width: _vm.layout.scrollY ? _vm.layout.gutterWidth + "px" : "0",
  8909. height: _vm.layout.headerHeight + "px"
  8910. }
  8911. })
  8912. : _vm._e(),
  8913. _c("div", {
  8914. directives: [
  8915. {
  8916. name: "show",
  8917. rawName: "v-show",
  8918. value: _vm.resizeProxyVisible,
  8919. expression: "resizeProxyVisible"
  8920. }
  8921. ],
  8922. ref: "resizeProxy",
  8923. staticClass: "el-table__column-resize-proxy"
  8924. })
  8925. ]
  8926. )
  8927. }
  8928. var tablevue_type_template_id_493fe34e_staticRenderFns = []
  8929. tablevue_type_template_id_493fe34e_render._withStripped = true
  8930. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=493fe34e&
  8931. // EXTERNAL MODULE: external "element-ui/lib/checkbox"
  8932. var checkbox_ = __webpack_require__(17);
  8933. var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
  8934. // EXTERNAL MODULE: external "throttle-debounce"
  8935. var external_throttle_debounce_ = __webpack_require__(35);
  8936. // EXTERNAL MODULE: external "normalize-wheel"
  8937. var external_normalize_wheel_ = __webpack_require__(38);
  8938. var external_normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(external_normalize_wheel_);
  8939. // CONCATENATED MODULE: ./src/directives/mousewheel.js
  8940. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  8941. var mousewheel_mousewheel = function mousewheel(element, callback) {
  8942. if (element && element.addEventListener) {
  8943. element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function (event) {
  8944. var normalized = external_normalize_wheel_default()(event);
  8945. callback && callback.apply(this, [event, normalized]);
  8946. });
  8947. }
  8948. };
  8949. /* harmony default export */ var directives_mousewheel = ({
  8950. bind: function bind(el, binding) {
  8951. mousewheel_mousewheel(el, binding.value);
  8952. }
  8953. });
  8954. // EXTERNAL MODULE: external "vue"
  8955. var external_vue_ = __webpack_require__(6);
  8956. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  8957. // CONCATENATED MODULE: ./packages/table/src/util.js
  8958. 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; };
  8959. var getCell = function getCell(event) {
  8960. var cell = event.target;
  8961. while (cell && cell.tagName.toUpperCase() !== 'HTML') {
  8962. if (cell.tagName.toUpperCase() === 'TD') {
  8963. return cell;
  8964. }
  8965. cell = cell.parentNode;
  8966. }
  8967. return null;
  8968. };
  8969. var util_isObject = function isObject(obj) {
  8970. return obj !== null && (typeof obj === 'undefined' ? 'undefined' : util_typeof(obj)) === 'object';
  8971. };
  8972. var util_orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
  8973. if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
  8974. return array;
  8975. }
  8976. if (typeof reverse === 'string') {
  8977. reverse = reverse === 'descending' ? -1 : 1;
  8978. } else {
  8979. reverse = reverse && reverse < 0 ? -1 : 1;
  8980. }
  8981. var getKey = sortMethod ? null : function (value, index) {
  8982. if (sortBy) {
  8983. if (!Array.isArray(sortBy)) {
  8984. sortBy = [sortBy];
  8985. }
  8986. return sortBy.map(function (by) {
  8987. if (typeof by === 'string') {
  8988. return Object(util_["getValueByPath"])(value, by);
  8989. } else {
  8990. return by(value, index, array);
  8991. }
  8992. });
  8993. }
  8994. if (sortKey !== '$key') {
  8995. if (util_isObject(value) && '$value' in value) value = value.$value;
  8996. }
  8997. return [util_isObject(value) ? Object(util_["getValueByPath"])(value, sortKey) : value];
  8998. };
  8999. var compare = function compare(a, b) {
  9000. if (sortMethod) {
  9001. return sortMethod(a.value, b.value);
  9002. }
  9003. for (var i = 0, len = a.key.length; i < len; i++) {
  9004. if (a.key[i] < b.key[i]) {
  9005. return -1;
  9006. }
  9007. if (a.key[i] > b.key[i]) {
  9008. return 1;
  9009. }
  9010. }
  9011. return 0;
  9012. };
  9013. return array.map(function (value, index) {
  9014. return {
  9015. value: value,
  9016. index: index,
  9017. key: getKey ? getKey(value, index) : null
  9018. };
  9019. }).sort(function (a, b) {
  9020. var order = compare(a, b);
  9021. if (!order) {
  9022. // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
  9023. order = a.index - b.index;
  9024. }
  9025. return order * reverse;
  9026. }).map(function (item) {
  9027. return item.value;
  9028. });
  9029. };
  9030. var getColumnById = function getColumnById(table, columnId) {
  9031. var column = null;
  9032. table.columns.forEach(function (item) {
  9033. if (item.id === columnId) {
  9034. column = item;
  9035. }
  9036. });
  9037. return column;
  9038. };
  9039. var getColumnByKey = function getColumnByKey(table, columnKey) {
  9040. var column = null;
  9041. for (var i = 0; i < table.columns.length; i++) {
  9042. var item = table.columns[i];
  9043. if (item.columnKey === columnKey) {
  9044. column = item;
  9045. break;
  9046. }
  9047. }
  9048. return column;
  9049. };
  9050. var getColumnByCell = function getColumnByCell(table, cell) {
  9051. var matches = (cell.className || '').match(/el-table_[^\s]+/gm);
  9052. if (matches) {
  9053. return getColumnById(table, matches[0]);
  9054. }
  9055. return null;
  9056. };
  9057. var getRowIdentity = function getRowIdentity(row, rowKey) {
  9058. if (!row) throw new Error('row is required when get row identity');
  9059. if (typeof rowKey === 'string') {
  9060. if (rowKey.indexOf('.') < 0) {
  9061. return row[rowKey];
  9062. }
  9063. var key = rowKey.split('.');
  9064. var current = row;
  9065. for (var i = 0; i < key.length; i++) {
  9066. current = current[key[i]];
  9067. }
  9068. return current;
  9069. } else if (typeof rowKey === 'function') {
  9070. return rowKey.call(null, row);
  9071. }
  9072. };
  9073. var getKeysMap = function getKeysMap(array, rowKey) {
  9074. var arrayMap = {};
  9075. (array || []).forEach(function (row, index) {
  9076. arrayMap[getRowIdentity(row, rowKey)] = { row: row, index: index };
  9077. });
  9078. return arrayMap;
  9079. };
  9080. function hasOwn(obj, key) {
  9081. return Object.prototype.hasOwnProperty.call(obj, key);
  9082. }
  9083. function mergeOptions(defaults, config) {
  9084. var options = {};
  9085. var key = void 0;
  9086. for (key in defaults) {
  9087. options[key] = defaults[key];
  9088. }
  9089. for (key in config) {
  9090. if (hasOwn(config, key)) {
  9091. var value = config[key];
  9092. if (typeof value !== 'undefined') {
  9093. options[key] = value;
  9094. }
  9095. }
  9096. }
  9097. return options;
  9098. }
  9099. function parseWidth(width) {
  9100. if (width !== undefined) {
  9101. width = parseInt(width, 10);
  9102. if (isNaN(width)) {
  9103. width = null;
  9104. }
  9105. }
  9106. return width;
  9107. }
  9108. function parseMinWidth(minWidth) {
  9109. if (typeof minWidth !== 'undefined') {
  9110. minWidth = parseWidth(minWidth);
  9111. if (isNaN(minWidth)) {
  9112. minWidth = 80;
  9113. }
  9114. }
  9115. return minWidth;
  9116. };
  9117. function parseHeight(height) {
  9118. if (typeof height === 'number') {
  9119. return height;
  9120. }
  9121. if (typeof height === 'string') {
  9122. if (/^\d+(?:px)?$/.test(height)) {
  9123. return parseInt(height, 10);
  9124. } else {
  9125. return height;
  9126. }
  9127. }
  9128. return null;
  9129. }
  9130. // https://github.com/reduxjs/redux/blob/master/src/compose.js
  9131. function compose() {
  9132. for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
  9133. funcs[_key] = arguments[_key];
  9134. }
  9135. if (funcs.length === 0) {
  9136. return function (arg) {
  9137. return arg;
  9138. };
  9139. }
  9140. if (funcs.length === 1) {
  9141. return funcs[0];
  9142. }
  9143. return funcs.reduce(function (a, b) {
  9144. return function () {
  9145. return a(b.apply(undefined, arguments));
  9146. };
  9147. });
  9148. }
  9149. function toggleRowStatus(statusArr, row, newVal) {
  9150. var changed = false;
  9151. var index = statusArr.indexOf(row);
  9152. var included = index !== -1;
  9153. var addRow = function addRow() {
  9154. statusArr.push(row);
  9155. changed = true;
  9156. };
  9157. var removeRow = function removeRow() {
  9158. statusArr.splice(index, 1);
  9159. changed = true;
  9160. };
  9161. if (typeof newVal === 'boolean') {
  9162. if (newVal && !included) {
  9163. addRow();
  9164. } else if (!newVal && included) {
  9165. removeRow();
  9166. }
  9167. } else {
  9168. if (included) {
  9169. removeRow();
  9170. } else {
  9171. addRow();
  9172. }
  9173. }
  9174. return changed;
  9175. }
  9176. function walkTreeNode(root, cb) {
  9177. var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
  9178. var lazyKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'hasChildren';
  9179. var isNil = function isNil(array) {
  9180. return !(Array.isArray(array) && array.length);
  9181. };
  9182. function _walker(parent, children, level) {
  9183. cb(parent, children, level);
  9184. children.forEach(function (item) {
  9185. if (item[lazyKey]) {
  9186. cb(item, null, level + 1);
  9187. return;
  9188. }
  9189. var children = item[childrenKey];
  9190. if (!isNil(children)) {
  9191. _walker(item, children, level + 1);
  9192. }
  9193. });
  9194. }
  9195. root.forEach(function (item) {
  9196. if (item[lazyKey]) {
  9197. cb(item, null, 0);
  9198. return;
  9199. }
  9200. var children = item[childrenKey];
  9201. if (!isNil(children)) {
  9202. _walker(item, children, 0);
  9203. }
  9204. });
  9205. }
  9206. // CONCATENATED MODULE: ./packages/table/src/store/expand.js
  9207. /* harmony default export */ var expand = ({
  9208. data: function data() {
  9209. return {
  9210. states: {
  9211. defaultExpandAll: false,
  9212. expandRows: []
  9213. }
  9214. };
  9215. },
  9216. methods: {
  9217. updateExpandRows: function updateExpandRows() {
  9218. var _states = this.states,
  9219. _states$data = _states.data,
  9220. data = _states$data === undefined ? [] : _states$data,
  9221. rowKey = _states.rowKey,
  9222. defaultExpandAll = _states.defaultExpandAll,
  9223. expandRows = _states.expandRows;
  9224. if (defaultExpandAll) {
  9225. this.states.expandRows = data.slice();
  9226. } else if (rowKey) {
  9227. // TODO:这里的代码可以优化
  9228. var expandRowsMap = getKeysMap(expandRows, rowKey);
  9229. this.states.expandRows = data.reduce(function (prev, row) {
  9230. var rowId = getRowIdentity(row, rowKey);
  9231. var rowInfo = expandRowsMap[rowId];
  9232. if (rowInfo) {
  9233. prev.push(row);
  9234. }
  9235. return prev;
  9236. }, []);
  9237. } else {
  9238. this.states.expandRows = [];
  9239. }
  9240. },
  9241. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  9242. var changed = toggleRowStatus(this.states.expandRows, row, expanded);
  9243. if (changed) {
  9244. this.table.$emit('expand-change', row, this.states.expandRows.slice());
  9245. this.scheduleLayout();
  9246. }
  9247. },
  9248. setExpandRowKeys: function setExpandRowKeys(rowKeys) {
  9249. this.assertRowKey();
  9250. // TODO:这里的代码可以优化
  9251. var _states2 = this.states,
  9252. data = _states2.data,
  9253. rowKey = _states2.rowKey;
  9254. var keysMap = getKeysMap(data, rowKey);
  9255. this.states.expandRows = rowKeys.reduce(function (prev, cur) {
  9256. var info = keysMap[cur];
  9257. if (info) {
  9258. prev.push(info.row);
  9259. }
  9260. return prev;
  9261. }, []);
  9262. },
  9263. isRowExpanded: function isRowExpanded(row) {
  9264. var _states3 = this.states,
  9265. _states3$expandRows = _states3.expandRows,
  9266. expandRows = _states3$expandRows === undefined ? [] : _states3$expandRows,
  9267. rowKey = _states3.rowKey;
  9268. if (rowKey) {
  9269. var expandMap = getKeysMap(expandRows, rowKey);
  9270. return !!expandMap[getRowIdentity(row, rowKey)];
  9271. }
  9272. return expandRows.indexOf(row) !== -1;
  9273. }
  9274. }
  9275. });
  9276. // CONCATENATED MODULE: ./packages/table/src/store/current.js
  9277. /* harmony default export */ var store_current = ({
  9278. data: function data() {
  9279. return {
  9280. states: {
  9281. // 不可响应的,设置 currentRowKey 时,data 不一定存在,也许无法算出正确的 currentRow
  9282. // 把该值缓存一下,当用户点击修改 currentRow 时,把该值重置为 null
  9283. _currentRowKey: null,
  9284. currentRow: null
  9285. }
  9286. };
  9287. },
  9288. methods: {
  9289. setCurrentRowKey: function setCurrentRowKey(key) {
  9290. this.assertRowKey();
  9291. this.states._currentRowKey = key;
  9292. this.setCurrentRowByKey(key);
  9293. },
  9294. restoreCurrentRowKey: function restoreCurrentRowKey() {
  9295. this.states._currentRowKey = null;
  9296. },
  9297. setCurrentRowByKey: function setCurrentRowByKey(key) {
  9298. var states = this.states;
  9299. var _states$data = states.data,
  9300. data = _states$data === undefined ? [] : _states$data,
  9301. rowKey = states.rowKey;
  9302. var currentRow = null;
  9303. if (rowKey) {
  9304. currentRow = Object(util_["arrayFind"])(data, function (item) {
  9305. return getRowIdentity(item, rowKey) === key;
  9306. });
  9307. }
  9308. states.currentRow = currentRow;
  9309. },
  9310. updateCurrentRow: function updateCurrentRow(currentRow) {
  9311. var states = this.states,
  9312. table = this.table;
  9313. var oldCurrentRow = states.currentRow;
  9314. if (currentRow && currentRow !== oldCurrentRow) {
  9315. states.currentRow = currentRow;
  9316. table.$emit('current-change', currentRow, oldCurrentRow);
  9317. return;
  9318. }
  9319. if (!currentRow && oldCurrentRow) {
  9320. states.currentRow = null;
  9321. table.$emit('current-change', null, oldCurrentRow);
  9322. }
  9323. },
  9324. updateCurrentRowData: function updateCurrentRowData() {
  9325. var states = this.states,
  9326. table = this.table;
  9327. var rowKey = states.rowKey,
  9328. _currentRowKey = states._currentRowKey;
  9329. // data 为 null 时,解构时的默认值会被忽略
  9330. var data = states.data || [];
  9331. var oldCurrentRow = states.currentRow;
  9332. // 当 currentRow 不在 data 中时尝试更新数据
  9333. if (data.indexOf(oldCurrentRow) === -1 && oldCurrentRow) {
  9334. if (rowKey) {
  9335. var currentRowKey = getRowIdentity(oldCurrentRow, rowKey);
  9336. this.setCurrentRowByKey(currentRowKey);
  9337. } else {
  9338. states.currentRow = null;
  9339. }
  9340. if (states.currentRow === null) {
  9341. table.$emit('current-change', null, oldCurrentRow);
  9342. }
  9343. } else if (_currentRowKey) {
  9344. // 把初始时下设置的 rowKey 转化成 rowData
  9345. this.setCurrentRowByKey(_currentRowKey);
  9346. this.restoreCurrentRowKey();
  9347. }
  9348. }
  9349. }
  9350. });
  9351. // CONCATENATED MODULE: ./packages/table/src/store/tree.js
  9352. 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; };
  9353. /* harmony default export */ var tree = ({
  9354. data: function data() {
  9355. return {
  9356. states: {
  9357. // defaultExpandAll 存在于 expand.js 中,这里不重复添加
  9358. // 在展开行中,expandRowKeys 会被转化成 expandRows,expandRowKeys 这个属性只是记录了 TreeTable 行的展开
  9359. // TODO: 拆分为独立的 TreeTable,统一用法
  9360. expandRowKeys: [],
  9361. treeData: {},
  9362. indent: 16,
  9363. lazy: false,
  9364. lazyTreeNodeMap: {},
  9365. lazyColumnIdentifier: 'hasChildren',
  9366. childrenColumnName: 'children'
  9367. }
  9368. };
  9369. },
  9370. computed: {
  9371. // 嵌入型的数据,watch 无法是检测到变化 https://github.com/ElemeFE/element/issues/14998
  9372. // TODO: 使用 computed 解决该问题,是否会造成性能问题?
  9373. // @return { id: { level, children } }
  9374. normalizedData: function normalizedData() {
  9375. if (!this.states.rowKey) return {};
  9376. var data = this.states.data || [];
  9377. return this.normalize(data);
  9378. },
  9379. // @return { id: { children } }
  9380. // 针对懒加载的情形,不处理嵌套数据
  9381. normalizedLazyNode: function normalizedLazyNode() {
  9382. var _states = this.states,
  9383. rowKey = _states.rowKey,
  9384. lazyTreeNodeMap = _states.lazyTreeNodeMap,
  9385. lazyColumnIdentifier = _states.lazyColumnIdentifier;
  9386. var keys = Object.keys(lazyTreeNodeMap);
  9387. var res = {};
  9388. if (!keys.length) return res;
  9389. keys.forEach(function (key) {
  9390. if (lazyTreeNodeMap[key].length) {
  9391. var item = { children: [] };
  9392. lazyTreeNodeMap[key].forEach(function (row) {
  9393. var currentRowKey = getRowIdentity(row, rowKey);
  9394. item.children.push(currentRowKey);
  9395. if (row[lazyColumnIdentifier] && !res[currentRowKey]) {
  9396. res[currentRowKey] = { children: [] };
  9397. }
  9398. });
  9399. res[key] = item;
  9400. }
  9401. });
  9402. return res;
  9403. }
  9404. },
  9405. watch: {
  9406. normalizedData: 'updateTreeData',
  9407. normalizedLazyNode: 'updateTreeData'
  9408. },
  9409. methods: {
  9410. normalize: function normalize(data) {
  9411. var _states2 = this.states,
  9412. childrenColumnName = _states2.childrenColumnName,
  9413. lazyColumnIdentifier = _states2.lazyColumnIdentifier,
  9414. rowKey = _states2.rowKey,
  9415. lazy = _states2.lazy;
  9416. var res = {};
  9417. walkTreeNode(data, function (parent, children, level) {
  9418. var parentId = getRowIdentity(parent, rowKey);
  9419. if (Array.isArray(children)) {
  9420. res[parentId] = {
  9421. children: children.map(function (row) {
  9422. return getRowIdentity(row, rowKey);
  9423. }),
  9424. level: level
  9425. };
  9426. } else if (lazy) {
  9427. // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点
  9428. res[parentId] = {
  9429. children: [],
  9430. lazy: true,
  9431. level: level
  9432. };
  9433. }
  9434. }, childrenColumnName, lazyColumnIdentifier);
  9435. return res;
  9436. },
  9437. updateTreeData: function updateTreeData() {
  9438. var nested = this.normalizedData;
  9439. var normalizedLazyNode = this.normalizedLazyNode;
  9440. var keys = Object.keys(nested);
  9441. var newTreeData = {};
  9442. if (keys.length) {
  9443. var _states3 = this.states,
  9444. oldTreeData = _states3.treeData,
  9445. defaultExpandAll = _states3.defaultExpandAll,
  9446. expandRowKeys = _states3.expandRowKeys,
  9447. lazy = _states3.lazy;
  9448. var rootLazyRowKeys = [];
  9449. var getExpanded = function getExpanded(oldValue, key) {
  9450. var included = defaultExpandAll || expandRowKeys && expandRowKeys.indexOf(key) !== -1;
  9451. return !!(oldValue && oldValue.expanded || included);
  9452. };
  9453. // 合并 expanded 与 display,确保数据刷新后,状态不变
  9454. keys.forEach(function (key) {
  9455. var oldValue = oldTreeData[key];
  9456. var newValue = _extends({}, nested[key]);
  9457. newValue.expanded = getExpanded(oldValue, key);
  9458. if (newValue.lazy) {
  9459. var _ref = oldValue || {},
  9460. _ref$loaded = _ref.loaded,
  9461. loaded = _ref$loaded === undefined ? false : _ref$loaded,
  9462. _ref$loading = _ref.loading,
  9463. loading = _ref$loading === undefined ? false : _ref$loading;
  9464. newValue.loaded = !!loaded;
  9465. newValue.loading = !!loading;
  9466. rootLazyRowKeys.push(key);
  9467. }
  9468. newTreeData[key] = newValue;
  9469. });
  9470. // 根据懒加载数据更新 treeData
  9471. var lazyKeys = Object.keys(normalizedLazyNode);
  9472. if (lazy && lazyKeys.length && rootLazyRowKeys.length) {
  9473. lazyKeys.forEach(function (key) {
  9474. var oldValue = oldTreeData[key];
  9475. var lazyNodeChildren = normalizedLazyNode[key].children;
  9476. if (rootLazyRowKeys.indexOf(key) !== -1) {
  9477. // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组
  9478. if (newTreeData[key].children.length !== 0) {
  9479. throw new Error('[ElTable]children must be an empty array.');
  9480. }
  9481. newTreeData[key].children = lazyNodeChildren;
  9482. } else {
  9483. var _ref2 = oldValue || {},
  9484. _ref2$loaded = _ref2.loaded,
  9485. loaded = _ref2$loaded === undefined ? false : _ref2$loaded,
  9486. _ref2$loading = _ref2.loading,
  9487. loading = _ref2$loading === undefined ? false : _ref2$loading;
  9488. newTreeData[key] = {
  9489. lazy: true,
  9490. loaded: !!loaded,
  9491. loading: !!loading,
  9492. expanded: getExpanded(oldValue, key),
  9493. children: lazyNodeChildren,
  9494. level: ''
  9495. };
  9496. }
  9497. });
  9498. }
  9499. }
  9500. this.states.treeData = newTreeData;
  9501. this.updateTableScrollY();
  9502. },
  9503. updateTreeExpandKeys: function updateTreeExpandKeys(value) {
  9504. this.states.expandRowKeys = value;
  9505. this.updateTreeData();
  9506. },
  9507. toggleTreeExpansion: function toggleTreeExpansion(row, expanded) {
  9508. this.assertRowKey();
  9509. var _states4 = this.states,
  9510. rowKey = _states4.rowKey,
  9511. treeData = _states4.treeData;
  9512. var id = getRowIdentity(row, rowKey);
  9513. var data = id && treeData[id];
  9514. if (id && data && 'expanded' in data) {
  9515. var oldExpanded = data.expanded;
  9516. expanded = typeof expanded === 'undefined' ? !data.expanded : expanded;
  9517. treeData[id].expanded = expanded;
  9518. if (oldExpanded !== expanded) {
  9519. this.table.$emit('expand-change', row, expanded);
  9520. }
  9521. this.updateTableScrollY();
  9522. }
  9523. },
  9524. loadOrToggle: function loadOrToggle(row) {
  9525. this.assertRowKey();
  9526. var _states5 = this.states,
  9527. lazy = _states5.lazy,
  9528. treeData = _states5.treeData,
  9529. rowKey = _states5.rowKey;
  9530. var id = getRowIdentity(row, rowKey);
  9531. var data = treeData[id];
  9532. if (lazy && data && 'loaded' in data && !data.loaded) {
  9533. this.loadData(row, id, data);
  9534. } else {
  9535. this.toggleTreeExpansion(row);
  9536. }
  9537. },
  9538. loadData: function loadData(row, key, treeNode) {
  9539. var _this = this;
  9540. var load = this.table.load;
  9541. var rawTreeData = this.states.treeData;
  9542. if (load && !rawTreeData[key].loaded) {
  9543. rawTreeData[key].loading = true;
  9544. load(row, treeNode, function (data) {
  9545. if (!Array.isArray(data)) {
  9546. throw new Error('[ElTable] data must be an array');
  9547. }
  9548. var _states6 = _this.states,
  9549. lazyTreeNodeMap = _states6.lazyTreeNodeMap,
  9550. treeData = _states6.treeData;
  9551. treeData[key].loading = false;
  9552. treeData[key].loaded = true;
  9553. treeData[key].expanded = true;
  9554. if (data.length) {
  9555. _this.$set(lazyTreeNodeMap, key, data);
  9556. }
  9557. _this.table.$emit('expand-change', row, true);
  9558. });
  9559. }
  9560. }
  9561. }
  9562. });
  9563. // CONCATENATED MODULE: ./packages/table/src/store/watcher.js
  9564. var watcher_sortData = function sortData(data, states) {
  9565. var sortingColumn = states.sortingColumn;
  9566. if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
  9567. return data;
  9568. }
  9569. return util_orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  9570. };
  9571. var doFlattenColumns = function doFlattenColumns(columns) {
  9572. var result = [];
  9573. columns.forEach(function (column) {
  9574. if (column.children) {
  9575. result.push.apply(result, doFlattenColumns(column.children));
  9576. } else {
  9577. result.push(column);
  9578. }
  9579. });
  9580. return result;
  9581. };
  9582. /* harmony default export */ var watcher = (external_vue_default.a.extend({
  9583. data: function data() {
  9584. return {
  9585. states: {
  9586. // 3.0 版本后要求必须设置该属性
  9587. rowKey: null,
  9588. // 渲染的数据来源,是对 table 中的 data 过滤排序后的结果
  9589. data: [],
  9590. // 是否包含固定列
  9591. isComplex: false,
  9592. // 列
  9593. _columns: [], // 不可响应的
  9594. originColumns: [],
  9595. columns: [],
  9596. fixedColumns: [],
  9597. rightFixedColumns: [],
  9598. leafColumns: [],
  9599. fixedLeafColumns: [],
  9600. rightFixedLeafColumns: [],
  9601. leafColumnsLength: 0,
  9602. fixedLeafColumnsLength: 0,
  9603. rightFixedLeafColumnsLength: 0,
  9604. // 选择
  9605. isAllSelected: false,
  9606. selection: [],
  9607. reserveSelection: false,
  9608. selectOnIndeterminate: false,
  9609. selectable: null,
  9610. // 过滤
  9611. filters: {}, // 不可响应的
  9612. filteredData: null,
  9613. // 排序
  9614. sortingColumn: null,
  9615. sortProp: null,
  9616. sortOrder: null,
  9617. hoverRow: null
  9618. }
  9619. };
  9620. },
  9621. mixins: [expand, store_current, tree],
  9622. methods: {
  9623. // 检查 rowKey 是否存在
  9624. assertRowKey: function assertRowKey() {
  9625. var rowKey = this.states.rowKey;
  9626. if (!rowKey) throw new Error('[ElTable] prop row-key is required');
  9627. },
  9628. // 更新列
  9629. updateColumns: function updateColumns() {
  9630. var states = this.states;
  9631. var _columns = states._columns || [];
  9632. states.fixedColumns = _columns.filter(function (column) {
  9633. return column.fixed === true || column.fixed === 'left';
  9634. });
  9635. states.rightFixedColumns = _columns.filter(function (column) {
  9636. return column.fixed === 'right';
  9637. });
  9638. if (states.fixedColumns.length > 0 && _columns[0] && _columns[0].type === 'selection' && !_columns[0].fixed) {
  9639. _columns[0].fixed = true;
  9640. states.fixedColumns.unshift(_columns[0]);
  9641. }
  9642. var notFixedColumns = _columns.filter(function (column) {
  9643. return !column.fixed;
  9644. });
  9645. states.originColumns = [].concat(states.fixedColumns).concat(notFixedColumns).concat(states.rightFixedColumns);
  9646. var leafColumns = doFlattenColumns(notFixedColumns);
  9647. var fixedLeafColumns = doFlattenColumns(states.fixedColumns);
  9648. var rightFixedLeafColumns = doFlattenColumns(states.rightFixedColumns);
  9649. states.leafColumnsLength = leafColumns.length;
  9650. states.fixedLeafColumnsLength = fixedLeafColumns.length;
  9651. states.rightFixedLeafColumnsLength = rightFixedLeafColumns.length;
  9652. states.columns = [].concat(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  9653. states.isComplex = states.fixedColumns.length > 0 || states.rightFixedColumns.length > 0;
  9654. },
  9655. // 更新 DOM
  9656. scheduleLayout: function scheduleLayout(needUpdateColumns) {
  9657. if (needUpdateColumns) {
  9658. this.updateColumns();
  9659. }
  9660. this.table.debouncedUpdateLayout();
  9661. },
  9662. // 选择
  9663. isSelected: function isSelected(row) {
  9664. var _states$selection = this.states.selection,
  9665. selection = _states$selection === undefined ? [] : _states$selection;
  9666. return selection.indexOf(row) > -1;
  9667. },
  9668. clearSelection: function clearSelection() {
  9669. var states = this.states;
  9670. states.isAllSelected = false;
  9671. var oldSelection = states.selection;
  9672. if (oldSelection.length) {
  9673. states.selection = [];
  9674. this.table.$emit('selection-change', []);
  9675. }
  9676. },
  9677. cleanSelection: function cleanSelection() {
  9678. var states = this.states;
  9679. var data = states.data,
  9680. rowKey = states.rowKey,
  9681. selection = states.selection;
  9682. var deleted = void 0;
  9683. if (rowKey) {
  9684. deleted = [];
  9685. var selectedMap = getKeysMap(selection, rowKey);
  9686. var dataMap = getKeysMap(data, rowKey);
  9687. for (var key in selectedMap) {
  9688. if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
  9689. deleted.push(selectedMap[key].row);
  9690. }
  9691. }
  9692. } else {
  9693. deleted = selection.filter(function (item) {
  9694. return data.indexOf(item) === -1;
  9695. });
  9696. }
  9697. if (deleted.length) {
  9698. var newSelection = selection.filter(function (item) {
  9699. return deleted.indexOf(item) === -1;
  9700. });
  9701. states.selection = newSelection;
  9702. this.table.$emit('selection-change', newSelection.slice());
  9703. }
  9704. },
  9705. toggleRowSelection: function toggleRowSelection(row, selected) {
  9706. var emitChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9707. var changed = toggleRowStatus(this.states.selection, row, selected);
  9708. if (changed) {
  9709. var newSelection = (this.states.selection || []).slice();
  9710. // 调用 API 修改选中值,不触发 select 事件
  9711. if (emitChange) {
  9712. this.table.$emit('select', newSelection, row);
  9713. }
  9714. this.table.$emit('selection-change', newSelection);
  9715. }
  9716. },
  9717. _toggleAllSelection: function _toggleAllSelection() {
  9718. var states = this.states;
  9719. var _states$data = states.data,
  9720. data = _states$data === undefined ? [] : _states$data,
  9721. selection = states.selection;
  9722. // when only some rows are selected (but not all), select or deselect all of them
  9723. // depending on the value of selectOnIndeterminate
  9724. var value = states.selectOnIndeterminate ? !states.isAllSelected : !(states.isAllSelected || selection.length);
  9725. states.isAllSelected = value;
  9726. var selectionChanged = false;
  9727. data.forEach(function (row, index) {
  9728. if (states.selectable) {
  9729. if (states.selectable.call(null, row, index) && toggleRowStatus(selection, row, value)) {
  9730. selectionChanged = true;
  9731. }
  9732. } else {
  9733. if (toggleRowStatus(selection, row, value)) {
  9734. selectionChanged = true;
  9735. }
  9736. }
  9737. });
  9738. if (selectionChanged) {
  9739. this.table.$emit('selection-change', selection ? selection.slice() : []);
  9740. }
  9741. this.table.$emit('select-all', selection);
  9742. },
  9743. updateSelectionByRowKey: function updateSelectionByRowKey() {
  9744. var states = this.states;
  9745. var selection = states.selection,
  9746. rowKey = states.rowKey,
  9747. data = states.data;
  9748. var selectedMap = getKeysMap(selection, rowKey);
  9749. data.forEach(function (row) {
  9750. var rowId = getRowIdentity(row, rowKey);
  9751. var rowInfo = selectedMap[rowId];
  9752. if (rowInfo) {
  9753. selection[rowInfo.index] = row;
  9754. }
  9755. });
  9756. },
  9757. updateAllSelected: function updateAllSelected() {
  9758. var states = this.states;
  9759. var selection = states.selection,
  9760. rowKey = states.rowKey,
  9761. selectable = states.selectable;
  9762. // data 为 null 时,解构时的默认值会被忽略
  9763. var data = states.data || [];
  9764. if (data.length === 0) {
  9765. states.isAllSelected = false;
  9766. return;
  9767. }
  9768. var selectedMap = void 0;
  9769. if (rowKey) {
  9770. selectedMap = getKeysMap(selection, rowKey);
  9771. }
  9772. var isSelected = function isSelected(row) {
  9773. if (selectedMap) {
  9774. return !!selectedMap[getRowIdentity(row, rowKey)];
  9775. } else {
  9776. return selection.indexOf(row) !== -1;
  9777. }
  9778. };
  9779. var isAllSelected = true;
  9780. var selectedCount = 0;
  9781. for (var i = 0, j = data.length; i < j; i++) {
  9782. var item = data[i];
  9783. var isRowSelectable = selectable && selectable.call(null, item, i);
  9784. if (!isSelected(item)) {
  9785. if (!selectable || isRowSelectable) {
  9786. isAllSelected = false;
  9787. break;
  9788. }
  9789. } else {
  9790. selectedCount++;
  9791. }
  9792. }
  9793. if (selectedCount === 0) isAllSelected = false;
  9794. states.isAllSelected = isAllSelected;
  9795. },
  9796. // 过滤与排序
  9797. updateFilters: function updateFilters(columns, values) {
  9798. if (!Array.isArray(columns)) {
  9799. columns = [columns];
  9800. }
  9801. var states = this.states;
  9802. var filters = {};
  9803. columns.forEach(function (col) {
  9804. states.filters[col.id] = values;
  9805. filters[col.columnKey || col.id] = values;
  9806. });
  9807. return filters;
  9808. },
  9809. updateSort: function updateSort(column, prop, order) {
  9810. if (this.states.sortingColumn && this.states.sortingColumn !== column) {
  9811. this.states.sortingColumn.order = null;
  9812. }
  9813. this.states.sortingColumn = column;
  9814. this.states.sortProp = prop;
  9815. this.states.sortOrder = order;
  9816. },
  9817. execFilter: function execFilter() {
  9818. var _this = this;
  9819. var states = this.states;
  9820. var _data = states._data,
  9821. filters = states.filters;
  9822. var data = _data;
  9823. Object.keys(filters).forEach(function (columnId) {
  9824. var values = states.filters[columnId];
  9825. if (!values || values.length === 0) return;
  9826. var column = getColumnById(_this.states, columnId);
  9827. if (column && column.filterMethod) {
  9828. data = data.filter(function (row) {
  9829. return values.some(function (value) {
  9830. return column.filterMethod.call(null, value, row, column);
  9831. });
  9832. });
  9833. }
  9834. });
  9835. states.filteredData = data;
  9836. },
  9837. execSort: function execSort() {
  9838. var states = this.states;
  9839. states.data = watcher_sortData(states.filteredData, states);
  9840. },
  9841. // 根据 filters 与 sort 去过滤 data
  9842. execQuery: function execQuery(ignore) {
  9843. if (!(ignore && ignore.filter)) {
  9844. this.execFilter();
  9845. }
  9846. this.execSort();
  9847. },
  9848. clearFilter: function clearFilter(columnKeys) {
  9849. var states = this.states;
  9850. var _table$$refs = this.table.$refs,
  9851. tableHeader = _table$$refs.tableHeader,
  9852. fixedTableHeader = _table$$refs.fixedTableHeader,
  9853. rightFixedTableHeader = _table$$refs.rightFixedTableHeader;
  9854. var panels = {};
  9855. if (tableHeader) panels = merge_default()(panels, tableHeader.filterPanels);
  9856. if (fixedTableHeader) panels = merge_default()(panels, fixedTableHeader.filterPanels);
  9857. if (rightFixedTableHeader) panels = merge_default()(panels, rightFixedTableHeader.filterPanels);
  9858. var keys = Object.keys(panels);
  9859. if (!keys.length) return;
  9860. if (typeof columnKeys === 'string') {
  9861. columnKeys = [columnKeys];
  9862. }
  9863. if (Array.isArray(columnKeys)) {
  9864. var columns = columnKeys.map(function (key) {
  9865. return getColumnByKey(states, key);
  9866. });
  9867. keys.forEach(function (key) {
  9868. var column = columns.find(function (col) {
  9869. return col.id === key;
  9870. });
  9871. if (column) {
  9872. // TODO: 优化这里的代码
  9873. panels[key].filteredValue = [];
  9874. }
  9875. });
  9876. this.commit('filterChange', {
  9877. column: columns,
  9878. values: [],
  9879. silent: true,
  9880. multi: true
  9881. });
  9882. } else {
  9883. keys.forEach(function (key) {
  9884. // TODO: 优化这里的代码
  9885. panels[key].filteredValue = [];
  9886. });
  9887. states.filters = {};
  9888. this.commit('filterChange', {
  9889. column: {},
  9890. values: [],
  9891. silent: true
  9892. });
  9893. }
  9894. },
  9895. clearSort: function clearSort() {
  9896. var states = this.states;
  9897. if (!states.sortingColumn) return;
  9898. this.updateSort(null, null, null);
  9899. this.commit('changeSortCondition', {
  9900. silent: true
  9901. });
  9902. },
  9903. // 适配层,expand-row-keys 在 Expand 与 TreeTable 中都有使用
  9904. setExpandRowKeysAdapter: function setExpandRowKeysAdapter(val) {
  9905. // 这里会触发额外的计算,但为了兼容性,暂时这么做
  9906. this.setExpandRowKeys(val);
  9907. this.updateTreeExpandKeys(val);
  9908. },
  9909. // 展开行与 TreeTable 都要使用
  9910. toggleRowExpansionAdapter: function toggleRowExpansionAdapter(row, expanded) {
  9911. var hasExpandColumn = this.states.columns.some(function (_ref) {
  9912. var type = _ref.type;
  9913. return type === 'expand';
  9914. });
  9915. if (hasExpandColumn) {
  9916. this.toggleRowExpansion(row, expanded);
  9917. } else {
  9918. this.toggleTreeExpansion(row, expanded);
  9919. }
  9920. }
  9921. }
  9922. }));
  9923. // CONCATENATED MODULE: ./packages/table/src/store/index.js
  9924. watcher.prototype.mutations = {
  9925. setData: function setData(states, data) {
  9926. var dataInstanceChanged = states._data !== data;
  9927. states._data = data;
  9928. this.execQuery();
  9929. // 数据变化,更新部分数据。
  9930. // 没有使用 computed,而是手动更新部分数据 https://github.com/vuejs/vue/issues/6660#issuecomment-331417140
  9931. this.updateCurrentRowData();
  9932. this.updateExpandRows();
  9933. if (states.reserveSelection) {
  9934. this.assertRowKey();
  9935. this.updateSelectionByRowKey();
  9936. } else {
  9937. if (dataInstanceChanged) {
  9938. this.clearSelection();
  9939. } else {
  9940. this.cleanSelection();
  9941. }
  9942. }
  9943. this.updateAllSelected();
  9944. this.updateTableScrollY();
  9945. },
  9946. insertColumn: function insertColumn(states, column, index, parent) {
  9947. var array = states._columns;
  9948. if (parent) {
  9949. array = parent.children;
  9950. if (!array) array = parent.children = [];
  9951. }
  9952. if (typeof index !== 'undefined') {
  9953. array.splice(index, 0, column);
  9954. } else {
  9955. array.push(column);
  9956. }
  9957. if (column.type === 'selection') {
  9958. states.selectable = column.selectable;
  9959. states.reserveSelection = column.reserveSelection;
  9960. }
  9961. if (this.table.$ready) {
  9962. this.updateColumns(); // hack for dynamics insert column
  9963. this.scheduleLayout();
  9964. }
  9965. },
  9966. removeColumn: function removeColumn(states, column, parent) {
  9967. var array = states._columns;
  9968. if (parent) {
  9969. array = parent.children;
  9970. if (!array) array = parent.children = [];
  9971. }
  9972. if (array) {
  9973. array.splice(array.indexOf(column), 1);
  9974. }
  9975. if (this.table.$ready) {
  9976. this.updateColumns(); // hack for dynamics remove column
  9977. this.scheduleLayout();
  9978. }
  9979. },
  9980. sort: function sort(states, options) {
  9981. var prop = options.prop,
  9982. order = options.order,
  9983. init = options.init;
  9984. if (prop) {
  9985. var column = Object(util_["arrayFind"])(states.columns, function (column) {
  9986. return column.property === prop;
  9987. });
  9988. if (column) {
  9989. column.order = order;
  9990. this.updateSort(column, prop, order);
  9991. this.commit('changeSortCondition', { init: init });
  9992. }
  9993. }
  9994. },
  9995. changeSortCondition: function changeSortCondition(states, options) {
  9996. // 修复 pr https://github.com/ElemeFE/element/pull/15012 导致的 bug
  9997. var column = states.sortingColumn,
  9998. prop = states.sortProp,
  9999. order = states.sortOrder;
  10000. if (order === null) {
  10001. states.sortingColumn = null;
  10002. states.sortProp = null;
  10003. }
  10004. var ingore = { filter: true };
  10005. this.execQuery(ingore);
  10006. if (!options || !(options.silent || options.init)) {
  10007. this.table.$emit('sort-change', {
  10008. column: column,
  10009. prop: prop,
  10010. order: order
  10011. });
  10012. }
  10013. this.updateTableScrollY();
  10014. },
  10015. filterChange: function filterChange(states, options) {
  10016. var column = options.column,
  10017. values = options.values,
  10018. silent = options.silent;
  10019. var newFilters = this.updateFilters(column, values);
  10020. this.execQuery();
  10021. if (!silent) {
  10022. this.table.$emit('filter-change', newFilters);
  10023. }
  10024. this.updateTableScrollY();
  10025. },
  10026. toggleAllSelection: function toggleAllSelection() {
  10027. this.toggleAllSelection();
  10028. },
  10029. rowSelectedChanged: function rowSelectedChanged(states, row) {
  10030. this.toggleRowSelection(row);
  10031. this.updateAllSelected();
  10032. },
  10033. setHoverRow: function setHoverRow(states, row) {
  10034. states.hoverRow = row;
  10035. },
  10036. setCurrentRow: function setCurrentRow(states, row) {
  10037. this.updateCurrentRow(row);
  10038. }
  10039. };
  10040. watcher.prototype.commit = function (name) {
  10041. var mutations = this.mutations;
  10042. if (mutations[name]) {
  10043. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  10044. args[_key - 1] = arguments[_key];
  10045. }
  10046. mutations[name].apply(this, [this.states].concat(args));
  10047. } else {
  10048. throw new Error('Action not found: ' + name);
  10049. }
  10050. };
  10051. watcher.prototype.updateTableScrollY = function () {
  10052. external_vue_default.a.nextTick(this.table.updateScrollY);
  10053. };
  10054. /* harmony default export */ var src_store = (watcher);
  10055. // CONCATENATED MODULE: ./packages/table/src/store/helper.js
  10056. function createStore(table) {
  10057. var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10058. if (!table) {
  10059. throw new Error('Table is required.');
  10060. }
  10061. var store = new src_store();
  10062. store.table = table;
  10063. // fix https://github.com/ElemeFE/element/issues/14075
  10064. // related pr https://github.com/ElemeFE/element/pull/14146
  10065. store.toggleAllSelection = debounce_default()(10, store._toggleAllSelection);
  10066. Object.keys(initialState).forEach(function (key) {
  10067. store.states[key] = initialState[key];
  10068. });
  10069. return store;
  10070. }
  10071. function mapStates(mapper) {
  10072. var res = {};
  10073. Object.keys(mapper).forEach(function (key) {
  10074. var value = mapper[key];
  10075. var fn = void 0;
  10076. if (typeof value === 'string') {
  10077. fn = function fn() {
  10078. return this.store.states[value];
  10079. };
  10080. } else if (typeof value === 'function') {
  10081. fn = function fn() {
  10082. return value.call(this, this.store.states);
  10083. };
  10084. } else {
  10085. console.error('invalid value type');
  10086. }
  10087. if (fn) {
  10088. res[key] = fn;
  10089. }
  10090. });
  10091. return res;
  10092. };
  10093. // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
  10094. var scrollbar_width_ = __webpack_require__(30);
  10095. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  10096. // CONCATENATED MODULE: ./packages/table/src/table-layout.js
  10097. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10098. var table_layout_TableLayout = function () {
  10099. function TableLayout(options) {
  10100. _classCallCheck(this, TableLayout);
  10101. this.observers = [];
  10102. this.table = null;
  10103. this.store = null;
  10104. this.columns = null;
  10105. this.fit = true;
  10106. this.showHeader = true;
  10107. this.height = null;
  10108. this.scrollX = false;
  10109. this.scrollY = false;
  10110. this.bodyWidth = null;
  10111. this.fixedWidth = null;
  10112. this.rightFixedWidth = null;
  10113. this.tableHeight = null;
  10114. this.headerHeight = 44; // Table Header Height
  10115. this.appendHeight = 0; // Append Slot Height
  10116. this.footerHeight = 44; // Table Footer Height
  10117. this.viewportHeight = null; // Table Height - Scroll Bar Height
  10118. this.bodyHeight = null; // Table Height - Table Header Height
  10119. this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
  10120. this.gutterWidth = scrollbar_width_default()();
  10121. for (var name in options) {
  10122. if (options.hasOwnProperty(name)) {
  10123. this[name] = options[name];
  10124. }
  10125. }
  10126. if (!this.table) {
  10127. throw new Error('table is required for Table Layout');
  10128. }
  10129. if (!this.store) {
  10130. throw new Error('store is required for Table Layout');
  10131. }
  10132. }
  10133. TableLayout.prototype.updateScrollY = function updateScrollY() {
  10134. var height = this.height;
  10135. if (height === null) return false;
  10136. var bodyWrapper = this.table.bodyWrapper;
  10137. if (this.table.$el && bodyWrapper) {
  10138. var body = bodyWrapper.querySelector('.el-table__body');
  10139. var prevScrollY = this.scrollY;
  10140. var scrollY = body.offsetHeight > this.bodyHeight;
  10141. this.scrollY = scrollY;
  10142. return prevScrollY !== scrollY;
  10143. }
  10144. return false;
  10145. };
  10146. TableLayout.prototype.setHeight = function setHeight(value) {
  10147. var _this = this;
  10148. var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'height';
  10149. if (external_vue_default.a.prototype.$isServer) return;
  10150. var el = this.table.$el;
  10151. value = parseHeight(value);
  10152. this.height = value;
  10153. if (!el && (value || value === 0)) return external_vue_default.a.nextTick(function () {
  10154. return _this.setHeight(value, prop);
  10155. });
  10156. if (typeof value === 'number') {
  10157. el.style[prop] = value + 'px';
  10158. this.updateElsHeight();
  10159. } else if (typeof value === 'string') {
  10160. el.style[prop] = value;
  10161. this.updateElsHeight();
  10162. }
  10163. };
  10164. TableLayout.prototype.setMaxHeight = function setMaxHeight(value) {
  10165. this.setHeight(value, 'max-height');
  10166. };
  10167. TableLayout.prototype.getFlattenColumns = function getFlattenColumns() {
  10168. var flattenColumns = [];
  10169. var columns = this.table.columns;
  10170. columns.forEach(function (column) {
  10171. if (column.isColumnGroup) {
  10172. flattenColumns.push.apply(flattenColumns, column.columns);
  10173. } else {
  10174. flattenColumns.push(column);
  10175. }
  10176. });
  10177. return flattenColumns;
  10178. };
  10179. TableLayout.prototype.updateElsHeight = function updateElsHeight() {
  10180. var _this2 = this;
  10181. if (!this.table.$ready) return external_vue_default.a.nextTick(function () {
  10182. return _this2.updateElsHeight();
  10183. });
  10184. var _table$$refs = this.table.$refs,
  10185. headerWrapper = _table$$refs.headerWrapper,
  10186. appendWrapper = _table$$refs.appendWrapper,
  10187. footerWrapper = _table$$refs.footerWrapper;
  10188. this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0;
  10189. if (this.showHeader && !headerWrapper) return;
  10190. // fix issue (https://github.com/ElemeFE/element/pull/16956)
  10191. var headerTrElm = headerWrapper ? headerWrapper.querySelector('.el-table__header tr') : null;
  10192. var noneHeader = this.headerDisplayNone(headerTrElm);
  10193. var headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
  10194. if (this.showHeader && !noneHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
  10195. return external_vue_default.a.nextTick(function () {
  10196. return _this2.updateElsHeight();
  10197. });
  10198. }
  10199. var tableHeight = this.tableHeight = this.table.$el.clientHeight;
  10200. var footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0;
  10201. if (this.height !== null) {
  10202. this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
  10203. }
  10204. this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight;
  10205. var noData = !(this.store.states.data && this.store.states.data.length);
  10206. this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
  10207. this.updateScrollY();
  10208. this.notifyObservers('scrollable');
  10209. };
  10210. TableLayout.prototype.headerDisplayNone = function headerDisplayNone(elm) {
  10211. if (!elm) return true;
  10212. var headerChild = elm;
  10213. while (headerChild.tagName !== 'DIV') {
  10214. if (getComputedStyle(headerChild).display === 'none') {
  10215. return true;
  10216. }
  10217. headerChild = headerChild.parentElement;
  10218. }
  10219. return false;
  10220. };
  10221. TableLayout.prototype.updateColumnsWidth = function updateColumnsWidth() {
  10222. if (external_vue_default.a.prototype.$isServer) return;
  10223. var fit = this.fit;
  10224. var bodyWidth = this.table.$el.clientWidth;
  10225. var bodyMinWidth = 0;
  10226. var flattenColumns = this.getFlattenColumns();
  10227. var flexColumns = flattenColumns.filter(function (column) {
  10228. return typeof column.width !== 'number';
  10229. });
  10230. flattenColumns.forEach(function (column) {
  10231. // Clean those columns whose width changed from flex to unflex
  10232. if (typeof column.width === 'number' && column.realWidth) column.realWidth = null;
  10233. });
  10234. if (flexColumns.length > 0 && fit) {
  10235. flattenColumns.forEach(function (column) {
  10236. bodyMinWidth += column.width || column.minWidth || 80;
  10237. });
  10238. var scrollYWidth = this.scrollY ? this.gutterWidth : 0;
  10239. if (bodyMinWidth <= bodyWidth - scrollYWidth) {
  10240. // DON'T HAVE SCROLL BAR
  10241. this.scrollX = false;
  10242. var totalFlexWidth = bodyWidth - scrollYWidth - bodyMinWidth;
  10243. if (flexColumns.length === 1) {
  10244. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth;
  10245. } else {
  10246. var allColumnsWidth = flexColumns.reduce(function (prev, column) {
  10247. return prev + (column.minWidth || 80);
  10248. }, 0);
  10249. var flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
  10250. var noneFirstWidth = 0;
  10251. flexColumns.forEach(function (column, index) {
  10252. if (index === 0) return;
  10253. var flexWidth = Math.floor((column.minWidth || 80) * flexWidthPerPixel);
  10254. noneFirstWidth += flexWidth;
  10255. column.realWidth = (column.minWidth || 80) + flexWidth;
  10256. });
  10257. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  10258. }
  10259. } else {
  10260. // HAVE HORIZONTAL SCROLL BAR
  10261. this.scrollX = true;
  10262. flexColumns.forEach(function (column) {
  10263. column.realWidth = column.minWidth;
  10264. });
  10265. }
  10266. this.bodyWidth = Math.max(bodyMinWidth, bodyWidth);
  10267. this.table.resizeState.width = this.bodyWidth;
  10268. } else {
  10269. flattenColumns.forEach(function (column) {
  10270. if (!column.width && !column.minWidth) {
  10271. column.realWidth = 80;
  10272. } else {
  10273. column.realWidth = column.width || column.minWidth;
  10274. }
  10275. bodyMinWidth += column.realWidth;
  10276. });
  10277. this.scrollX = bodyMinWidth > bodyWidth;
  10278. this.bodyWidth = bodyMinWidth;
  10279. }
  10280. var fixedColumns = this.store.states.fixedColumns;
  10281. if (fixedColumns.length > 0) {
  10282. var fixedWidth = 0;
  10283. fixedColumns.forEach(function (column) {
  10284. fixedWidth += column.realWidth || column.width;
  10285. });
  10286. this.fixedWidth = fixedWidth;
  10287. }
  10288. var rightFixedColumns = this.store.states.rightFixedColumns;
  10289. if (rightFixedColumns.length > 0) {
  10290. var rightFixedWidth = 0;
  10291. rightFixedColumns.forEach(function (column) {
  10292. rightFixedWidth += column.realWidth || column.width;
  10293. });
  10294. this.rightFixedWidth = rightFixedWidth;
  10295. }
  10296. this.notifyObservers('columns');
  10297. };
  10298. TableLayout.prototype.addObserver = function addObserver(observer) {
  10299. this.observers.push(observer);
  10300. };
  10301. TableLayout.prototype.removeObserver = function removeObserver(observer) {
  10302. var index = this.observers.indexOf(observer);
  10303. if (index !== -1) {
  10304. this.observers.splice(index, 1);
  10305. }
  10306. };
  10307. TableLayout.prototype.notifyObservers = function notifyObservers(event) {
  10308. var _this3 = this;
  10309. var observers = this.observers;
  10310. observers.forEach(function (observer) {
  10311. switch (event) {
  10312. case 'columns':
  10313. observer.onColumnsChange(_this3);
  10314. break;
  10315. case 'scrollable':
  10316. observer.onScrollableChange(_this3);
  10317. break;
  10318. default:
  10319. throw new Error('Table Layout don\'t have event ' + event + '.');
  10320. }
  10321. });
  10322. };
  10323. return TableLayout;
  10324. }();
  10325. /* harmony default export */ var table_layout = (table_layout_TableLayout);
  10326. // CONCATENATED MODULE: ./packages/table/src/layout-observer.js
  10327. /* harmony default export */ var layout_observer = ({
  10328. created: function created() {
  10329. this.tableLayout.addObserver(this);
  10330. },
  10331. destroyed: function destroyed() {
  10332. this.tableLayout.removeObserver(this);
  10333. },
  10334. computed: {
  10335. tableLayout: function tableLayout() {
  10336. var layout = this.layout;
  10337. if (!layout && this.table) {
  10338. layout = this.table.layout;
  10339. }
  10340. if (!layout) {
  10341. throw new Error('Can not find table layout.');
  10342. }
  10343. return layout;
  10344. }
  10345. },
  10346. mounted: function mounted() {
  10347. this.onColumnsChange(this.tableLayout);
  10348. this.onScrollableChange(this.tableLayout);
  10349. },
  10350. updated: function updated() {
  10351. if (this.__updated__) return;
  10352. this.onColumnsChange(this.tableLayout);
  10353. this.onScrollableChange(this.tableLayout);
  10354. this.__updated__ = true;
  10355. },
  10356. methods: {
  10357. onColumnsChange: function onColumnsChange(layout) {
  10358. var cols = this.$el.querySelectorAll('colgroup > col');
  10359. if (!cols.length) return;
  10360. var flattenColumns = layout.getFlattenColumns();
  10361. var columnsMap = {};
  10362. flattenColumns.forEach(function (column) {
  10363. columnsMap[column.id] = column;
  10364. });
  10365. for (var i = 0, j = cols.length; i < j; i++) {
  10366. var col = cols[i];
  10367. var name = col.getAttribute('name');
  10368. var column = columnsMap[name];
  10369. if (column) {
  10370. col.setAttribute('width', column.realWidth || column.width);
  10371. }
  10372. }
  10373. },
  10374. onScrollableChange: function onScrollableChange(layout) {
  10375. var cols = this.$el.querySelectorAll('colgroup > col[name=gutter]');
  10376. for (var i = 0, j = cols.length; i < j; i++) {
  10377. var col = cols[i];
  10378. col.setAttribute('width', layout.scrollY ? layout.gutterWidth : '0');
  10379. }
  10380. var ths = this.$el.querySelectorAll('th.gutter');
  10381. for (var _i = 0, _j = ths.length; _i < _j; _i++) {
  10382. var th = ths[_i];
  10383. th.style.width = layout.scrollY ? layout.gutterWidth + 'px' : '0';
  10384. th.style.display = layout.scrollY ? '' : 'none';
  10385. }
  10386. }
  10387. }
  10388. });
  10389. // CONCATENATED MODULE: ./packages/table/src/table-row.js
  10390. 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; };
  10391. /* harmony default export */ var table_row = ({
  10392. name: 'ElTableRow',
  10393. props: ['columns', 'row', 'index', 'isSelected', 'isExpanded', 'store', 'context', 'firstDefaultColumnIndex', 'treeRowData', 'treeIndent', 'columnsHidden', 'getSpan', 'getColspanRealWidth', 'getCellStyle', 'getCellClass', 'handleCellMouseLeave', 'handleCellMouseEnter', 'fixed'],
  10394. render: function render() {
  10395. var _this = this;
  10396. var h = arguments[0];
  10397. var columns = this.columns,
  10398. row = this.row,
  10399. $index = this.index,
  10400. store = this.store,
  10401. context = this.context,
  10402. firstDefaultColumnIndex = this.firstDefaultColumnIndex,
  10403. treeRowData = this.treeRowData,
  10404. treeIndent = this.treeIndent,
  10405. _columnsHidden = this.columnsHidden,
  10406. columnsHidden = _columnsHidden === undefined ? [] : _columnsHidden,
  10407. isSelected = this.isSelected,
  10408. isExpanded = this.isExpanded;
  10409. return h('tr', [columns.map(function (column, cellIndex) {
  10410. var _getSpan = _this.getSpan(row, column, $index, cellIndex),
  10411. rowspan = _getSpan.rowspan,
  10412. colspan = _getSpan.colspan;
  10413. if (!rowspan || !colspan) {
  10414. return null;
  10415. }
  10416. var columnData = table_row_extends({}, column);
  10417. columnData.realWidth = _this.getColspanRealWidth(columns, colspan, cellIndex);
  10418. var data = {
  10419. store: store,
  10420. isSelected: isSelected,
  10421. isExpanded: isExpanded,
  10422. _self: context,
  10423. column: columnData,
  10424. row: row,
  10425. $index: $index
  10426. };
  10427. if (cellIndex === firstDefaultColumnIndex && treeRowData) {
  10428. data.treeNode = {
  10429. indent: treeRowData.level * treeIndent,
  10430. level: treeRowData.level
  10431. };
  10432. if (typeof treeRowData.expanded === 'boolean') {
  10433. data.treeNode.expanded = treeRowData.expanded;
  10434. // 表明是懒加载
  10435. if ('loading' in treeRowData) {
  10436. data.treeNode.loading = treeRowData.loading;
  10437. }
  10438. if ('noLazyChildren' in treeRowData) {
  10439. data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  10440. }
  10441. }
  10442. }
  10443. return h(
  10444. 'td',
  10445. {
  10446. style: _this.getCellStyle($index, cellIndex, row, column),
  10447. 'class': _this.getCellClass($index, cellIndex, row, column),
  10448. attrs: { rowspan: rowspan,
  10449. colspan: colspan
  10450. },
  10451. on: {
  10452. 'mouseenter': function mouseenter($event) {
  10453. return _this.handleCellMouseEnter($event, row);
  10454. },
  10455. 'mouseleave': _this.handleCellMouseLeave
  10456. }
  10457. },
  10458. [column.renderCell.call(_this._renderProxy, _this.$createElement, data, columnsHidden[cellIndex])]
  10459. );
  10460. })]);
  10461. }
  10462. });
  10463. // CONCATENATED MODULE: ./packages/table/src/table-body.js
  10464. 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; };
  10465. 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; };
  10466. /* harmony default export */ var table_body = ({
  10467. name: 'ElTableBody',
  10468. mixins: [layout_observer],
  10469. components: {
  10470. ElCheckbox: checkbox_default.a,
  10471. ElTooltip: tooltip_default.a,
  10472. TableRow: table_row
  10473. },
  10474. props: {
  10475. store: {
  10476. required: true
  10477. },
  10478. stripe: Boolean,
  10479. context: {},
  10480. rowClassName: [String, Function],
  10481. rowStyle: [Object, Function],
  10482. fixed: String,
  10483. highlight: Boolean
  10484. },
  10485. render: function render(h) {
  10486. var _this = this;
  10487. var data = this.data || [];
  10488. return h(
  10489. 'table',
  10490. {
  10491. 'class': 'el-table__body',
  10492. attrs: { cellspacing: '0',
  10493. cellpadding: '0',
  10494. border: '0' }
  10495. },
  10496. [h('colgroup', [this.columns.map(function (column) {
  10497. return h('col', {
  10498. attrs: { name: column.id },
  10499. key: column.id });
  10500. })]), h('tbody', [data.reduce(function (acc, row) {
  10501. return acc.concat(_this.wrappedRowRender(row, acc.length));
  10502. }, []), h('el-tooltip', {
  10503. attrs: { effect: this.table.tooltipEffect, placement: 'top', content: this.tooltipContent },
  10504. ref: 'tooltip' })])]
  10505. );
  10506. },
  10507. computed: table_body_extends({
  10508. table: function table() {
  10509. return this.$parent;
  10510. }
  10511. }, mapStates({
  10512. data: 'data',
  10513. columns: 'columns',
  10514. treeIndent: 'indent',
  10515. leftFixedLeafCount: 'fixedLeafColumnsLength',
  10516. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  10517. columnsCount: function columnsCount(states) {
  10518. return states.columns.length;
  10519. },
  10520. leftFixedCount: function leftFixedCount(states) {
  10521. return states.fixedColumns.length;
  10522. },
  10523. rightFixedCount: function rightFixedCount(states) {
  10524. return states.rightFixedColumns.length;
  10525. },
  10526. hasExpandColumn: function hasExpandColumn(states) {
  10527. return states.columns.some(function (_ref) {
  10528. var type = _ref.type;
  10529. return type === 'expand';
  10530. });
  10531. }
  10532. }), {
  10533. columnsHidden: function columnsHidden() {
  10534. var _this2 = this;
  10535. return this.columns.map(function (column, index) {
  10536. return _this2.isColumnHidden(index);
  10537. });
  10538. },
  10539. firstDefaultColumnIndex: function firstDefaultColumnIndex() {
  10540. return Object(util_["arrayFindIndex"])(this.columns, function (_ref2) {
  10541. var type = _ref2.type;
  10542. return type === 'default';
  10543. });
  10544. }
  10545. }),
  10546. watch: {
  10547. // don't trigger getter of currentRow in getCellClass. see https://jsfiddle.net/oe2b4hqt/
  10548. // update DOM manually. see https://github.com/ElemeFE/element/pull/13954/files#diff-9b450c00d0a9dec0ffad5a3176972e40
  10549. 'store.states.hoverRow': function storeStatesHoverRow(newVal, oldVal) {
  10550. var _this3 = this;
  10551. if (!this.store.states.isComplex || this.$isServer) return;
  10552. var raf = window.requestAnimationFrame;
  10553. if (!raf) {
  10554. raf = function raf(fn) {
  10555. return setTimeout(fn, 16);
  10556. };
  10557. }
  10558. raf(function () {
  10559. var rows = _this3.$el.querySelectorAll('.el-table__row');
  10560. var oldRow = rows[oldVal];
  10561. var newRow = rows[newVal];
  10562. if (oldRow) {
  10563. Object(dom_["removeClass"])(oldRow, 'hover-row');
  10564. }
  10565. if (newRow) {
  10566. Object(dom_["addClass"])(newRow, 'hover-row');
  10567. }
  10568. });
  10569. }
  10570. },
  10571. data: function data() {
  10572. return {
  10573. tooltipContent: ''
  10574. };
  10575. },
  10576. created: function created() {
  10577. this.activateTooltip = debounce_default()(50, function (tooltip) {
  10578. return tooltip.handleShowPopper();
  10579. });
  10580. },
  10581. methods: {
  10582. getKeyOfRow: function getKeyOfRow(row, index) {
  10583. var rowKey = this.table.rowKey;
  10584. if (rowKey) {
  10585. return getRowIdentity(row, rowKey);
  10586. }
  10587. return index;
  10588. },
  10589. isColumnHidden: function isColumnHidden(index) {
  10590. if (this.fixed === true || this.fixed === 'left') {
  10591. return index >= this.leftFixedLeafCount;
  10592. } else if (this.fixed === 'right') {
  10593. return index < this.columnsCount - this.rightFixedLeafCount;
  10594. } else {
  10595. return index < this.leftFixedLeafCount || index >= this.columnsCount - this.rightFixedLeafCount;
  10596. }
  10597. },
  10598. getSpan: function getSpan(row, column, rowIndex, columnIndex) {
  10599. var rowspan = 1;
  10600. var colspan = 1;
  10601. var fn = this.table.spanMethod;
  10602. if (typeof fn === 'function') {
  10603. var result = fn({
  10604. row: row,
  10605. column: column,
  10606. rowIndex: rowIndex,
  10607. columnIndex: columnIndex
  10608. });
  10609. if (Array.isArray(result)) {
  10610. rowspan = result[0];
  10611. colspan = result[1];
  10612. } else if ((typeof result === 'undefined' ? 'undefined' : table_body_typeof(result)) === 'object') {
  10613. rowspan = result.rowspan;
  10614. colspan = result.colspan;
  10615. }
  10616. }
  10617. return { rowspan: rowspan, colspan: colspan };
  10618. },
  10619. getRowStyle: function getRowStyle(row, rowIndex) {
  10620. var rowStyle = this.table.rowStyle;
  10621. if (typeof rowStyle === 'function') {
  10622. return rowStyle.call(null, {
  10623. row: row,
  10624. rowIndex: rowIndex
  10625. });
  10626. }
  10627. return rowStyle || null;
  10628. },
  10629. getRowClass: function getRowClass(row, rowIndex) {
  10630. var classes = ['el-table__row'];
  10631. if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
  10632. classes.push('current-row');
  10633. }
  10634. if (this.stripe && rowIndex % 2 === 1) {
  10635. classes.push('el-table__row--striped');
  10636. }
  10637. var rowClassName = this.table.rowClassName;
  10638. if (typeof rowClassName === 'string') {
  10639. classes.push(rowClassName);
  10640. } else if (typeof rowClassName === 'function') {
  10641. classes.push(rowClassName.call(null, {
  10642. row: row,
  10643. rowIndex: rowIndex
  10644. }));
  10645. }
  10646. if (this.store.states.expandRows.indexOf(row) > -1) {
  10647. classes.push('expanded');
  10648. }
  10649. return classes;
  10650. },
  10651. getCellStyle: function getCellStyle(rowIndex, columnIndex, row, column) {
  10652. var cellStyle = this.table.cellStyle;
  10653. if (typeof cellStyle === 'function') {
  10654. return cellStyle.call(null, {
  10655. rowIndex: rowIndex,
  10656. columnIndex: columnIndex,
  10657. row: row,
  10658. column: column
  10659. });
  10660. }
  10661. return cellStyle;
  10662. },
  10663. getCellClass: function getCellClass(rowIndex, columnIndex, row, column) {
  10664. var classes = [column.id, column.align, column.className];
  10665. if (this.isColumnHidden(columnIndex)) {
  10666. classes.push('is-hidden');
  10667. }
  10668. var cellClassName = this.table.cellClassName;
  10669. if (typeof cellClassName === 'string') {
  10670. classes.push(cellClassName);
  10671. } else if (typeof cellClassName === 'function') {
  10672. classes.push(cellClassName.call(null, {
  10673. rowIndex: rowIndex,
  10674. columnIndex: columnIndex,
  10675. row: row,
  10676. column: column
  10677. }));
  10678. }
  10679. classes.push('el-table__cell');
  10680. return classes.join(' ');
  10681. },
  10682. getColspanRealWidth: function getColspanRealWidth(columns, colspan, index) {
  10683. if (colspan < 1) {
  10684. return columns[index].realWidth;
  10685. }
  10686. var widthArr = columns.map(function (_ref3) {
  10687. var realWidth = _ref3.realWidth;
  10688. return realWidth;
  10689. }).slice(index, index + colspan);
  10690. return widthArr.reduce(function (acc, width) {
  10691. return acc + width;
  10692. }, -1);
  10693. },
  10694. handleCellMouseEnter: function handleCellMouseEnter(event, row) {
  10695. var table = this.table;
  10696. var cell = getCell(event);
  10697. if (cell) {
  10698. var column = getColumnByCell(table, cell);
  10699. var hoverState = table.hoverState = { cell: cell, column: column, row: row };
  10700. table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
  10701. }
  10702. // 判断是否text-overflow, 如果是就显示tooltip
  10703. var cellChild = event.target.querySelector('.cell');
  10704. if (!(Object(dom_["hasClass"])(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
  10705. return;
  10706. }
  10707. // use range width instead of scrollWidth to determine whether the text is overflowing
  10708. // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
  10709. var range = document.createRange();
  10710. range.setStart(cellChild, 0);
  10711. range.setEnd(cellChild, cellChild.childNodes.length);
  10712. var rangeWidth = range.getBoundingClientRect().width;
  10713. var padding = (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingLeft'), 10) || 0) + (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingRight'), 10) || 0);
  10714. if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
  10715. var tooltip = this.$refs.tooltip;
  10716. // TODO 会引起整个 Table 的重新渲染,需要优化
  10717. this.tooltipContent = cell.innerText || cell.textContent;
  10718. tooltip.referenceElm = cell;
  10719. tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
  10720. tooltip.doDestroy();
  10721. tooltip.setExpectedState(true);
  10722. this.activateTooltip(tooltip);
  10723. }
  10724. },
  10725. handleCellMouseLeave: function handleCellMouseLeave(event) {
  10726. var tooltip = this.$refs.tooltip;
  10727. if (tooltip) {
  10728. tooltip.setExpectedState(false);
  10729. tooltip.handleClosePopper();
  10730. }
  10731. var cell = getCell(event);
  10732. if (!cell) return;
  10733. var oldHoverState = this.table.hoverState || {};
  10734. this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
  10735. },
  10736. handleMouseEnter: debounce_default()(30, function (index) {
  10737. this.store.commit('setHoverRow', index);
  10738. }),
  10739. handleMouseLeave: debounce_default()(30, function () {
  10740. this.store.commit('setHoverRow', null);
  10741. }),
  10742. handleContextMenu: function handleContextMenu(event, row) {
  10743. this.handleEvent(event, row, 'contextmenu');
  10744. },
  10745. handleDoubleClick: function handleDoubleClick(event, row) {
  10746. this.handleEvent(event, row, 'dblclick');
  10747. },
  10748. handleClick: function handleClick(event, row) {
  10749. this.store.commit('setCurrentRow', row);
  10750. this.handleEvent(event, row, 'click');
  10751. },
  10752. handleEvent: function handleEvent(event, row, name) {
  10753. var table = this.table;
  10754. var cell = getCell(event);
  10755. var column = void 0;
  10756. if (cell) {
  10757. column = getColumnByCell(table, cell);
  10758. if (column) {
  10759. table.$emit('cell-' + name, row, column, cell, event);
  10760. }
  10761. }
  10762. table.$emit('row-' + name, row, column, event);
  10763. },
  10764. rowRender: function rowRender(row, $index, treeRowData) {
  10765. var _this4 = this;
  10766. var h = this.$createElement;
  10767. var treeIndent = this.treeIndent,
  10768. columns = this.columns,
  10769. firstDefaultColumnIndex = this.firstDefaultColumnIndex;
  10770. var rowClasses = this.getRowClass(row, $index);
  10771. var display = true;
  10772. if (treeRowData) {
  10773. rowClasses.push('el-table__row--level-' + treeRowData.level);
  10774. display = treeRowData.display;
  10775. }
  10776. // 指令 v-show 会覆盖 row-style 中 display
  10777. // 使用 :style 代替 v-show https://github.com/ElemeFE/element/issues/16995
  10778. var displayStyle = display ? null : {
  10779. display: 'none'
  10780. };
  10781. return h(table_row, {
  10782. style: [displayStyle, this.getRowStyle(row, $index)],
  10783. 'class': rowClasses,
  10784. key: this.getKeyOfRow(row, $index),
  10785. nativeOn: {
  10786. 'dblclick': function dblclick($event) {
  10787. return _this4.handleDoubleClick($event, row);
  10788. },
  10789. 'click': function click($event) {
  10790. return _this4.handleClick($event, row);
  10791. },
  10792. 'contextmenu': function contextmenu($event) {
  10793. return _this4.handleContextMenu($event, row);
  10794. },
  10795. 'mouseenter': function mouseenter(_) {
  10796. return _this4.handleMouseEnter($index);
  10797. },
  10798. 'mouseleave': this.handleMouseLeave
  10799. },
  10800. attrs: {
  10801. columns: columns,
  10802. row: row,
  10803. index: $index,
  10804. store: this.store,
  10805. context: this.context || this.table.$vnode.context,
  10806. firstDefaultColumnIndex: firstDefaultColumnIndex,
  10807. treeRowData: treeRowData,
  10808. treeIndent: treeIndent,
  10809. columnsHidden: this.columnsHidden,
  10810. getSpan: this.getSpan,
  10811. getColspanRealWidth: this.getColspanRealWidth,
  10812. getCellStyle: this.getCellStyle,
  10813. getCellClass: this.getCellClass,
  10814. handleCellMouseEnter: this.handleCellMouseEnter,
  10815. handleCellMouseLeave: this.handleCellMouseLeave,
  10816. isSelected: this.store.isSelected(row),
  10817. isExpanded: this.store.states.expandRows.indexOf(row) > -1,
  10818. fixed: this.fixed
  10819. }
  10820. });
  10821. },
  10822. wrappedRowRender: function wrappedRowRender(row, $index) {
  10823. var _this5 = this;
  10824. var h = this.$createElement;
  10825. var store = this.store;
  10826. var isRowExpanded = store.isRowExpanded,
  10827. assertRowKey = store.assertRowKey;
  10828. var _store$states = store.states,
  10829. treeData = _store$states.treeData,
  10830. lazyTreeNodeMap = _store$states.lazyTreeNodeMap,
  10831. childrenColumnName = _store$states.childrenColumnName,
  10832. rowKey = _store$states.rowKey;
  10833. if (this.hasExpandColumn && isRowExpanded(row)) {
  10834. var renderExpanded = this.table.renderExpanded;
  10835. var tr = this.rowRender(row, $index);
  10836. if (!renderExpanded) {
  10837. console.error('[Element Error]renderExpanded is required.');
  10838. return tr;
  10839. }
  10840. // 使用二维数组,避免修改 $index
  10841. return [[tr, h(
  10842. 'tr',
  10843. { key: 'expanded-row__' + tr.key },
  10844. [h(
  10845. 'td',
  10846. {
  10847. attrs: { colspan: this.columnsCount },
  10848. 'class': 'el-table__cell el-table__expanded-cell' },
  10849. [renderExpanded(this.$createElement, { row: row, $index: $index, store: this.store })]
  10850. )]
  10851. )]];
  10852. } else if (Object.keys(treeData).length) {
  10853. assertRowKey();
  10854. // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算
  10855. // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作
  10856. var key = getRowIdentity(row, rowKey);
  10857. var cur = treeData[key];
  10858. var treeRowData = null;
  10859. if (cur) {
  10860. treeRowData = {
  10861. expanded: cur.expanded,
  10862. level: cur.level,
  10863. display: true
  10864. };
  10865. if (typeof cur.lazy === 'boolean') {
  10866. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10867. treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10868. }
  10869. treeRowData.loading = cur.loading;
  10870. }
  10871. }
  10872. var tmp = [this.rowRender(row, $index, treeRowData)];
  10873. // 渲染嵌套数据
  10874. if (cur) {
  10875. // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index
  10876. var i = 0;
  10877. var traverse = function traverse(children, parent) {
  10878. if (!(children && children.length && parent)) return;
  10879. children.forEach(function (node) {
  10880. // 父节点的 display 状态影响子节点的显示状态
  10881. var innerTreeRowData = {
  10882. display: parent.display && parent.expanded,
  10883. level: parent.level + 1
  10884. };
  10885. var childKey = getRowIdentity(node, rowKey);
  10886. if (childKey === undefined || childKey === null) {
  10887. throw new Error('for nested data item, row-key is required.');
  10888. }
  10889. cur = table_body_extends({}, treeData[childKey]);
  10890. // 对于当前节点,分成有无子节点两种情况。
  10891. // 如果包含子节点的,设置 expanded 属性。
  10892. // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。
  10893. if (cur) {
  10894. innerTreeRowData.expanded = cur.expanded;
  10895. // 懒加载的某些节点,level 未知
  10896. cur.level = cur.level || innerTreeRowData.level;
  10897. cur.display = !!(cur.expanded && innerTreeRowData.display);
  10898. if (typeof cur.lazy === 'boolean') {
  10899. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10900. innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10901. }
  10902. innerTreeRowData.loading = cur.loading;
  10903. }
  10904. }
  10905. i++;
  10906. tmp.push(_this5.rowRender(node, $index + i, innerTreeRowData));
  10907. if (cur) {
  10908. var _nodes = lazyTreeNodeMap[childKey] || node[childrenColumnName];
  10909. traverse(_nodes, cur);
  10910. }
  10911. });
  10912. };
  10913. // 对于 root 节点,display 一定为 true
  10914. cur.display = true;
  10915. var nodes = lazyTreeNodeMap[key] || row[childrenColumnName];
  10916. traverse(nodes, cur);
  10917. }
  10918. return tmp;
  10919. } else {
  10920. return this.rowRender(row, $index);
  10921. }
  10922. }
  10923. }
  10924. });
  10925. // 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&
  10926. var filter_panelvue_type_template_id_7f2c919f_render = function() {
  10927. var _vm = this
  10928. var _h = _vm.$createElement
  10929. var _c = _vm._self._c || _h
  10930. return _c("transition", { attrs: { name: "el-zoom-in-top" } }, [
  10931. _vm.multiple
  10932. ? _c(
  10933. "div",
  10934. {
  10935. directives: [
  10936. {
  10937. name: "clickoutside",
  10938. rawName: "v-clickoutside",
  10939. value: _vm.handleOutsideClick,
  10940. expression: "handleOutsideClick"
  10941. },
  10942. {
  10943. name: "show",
  10944. rawName: "v-show",
  10945. value: _vm.showPopper,
  10946. expression: "showPopper"
  10947. }
  10948. ],
  10949. staticClass: "el-table-filter"
  10950. },
  10951. [
  10952. _c(
  10953. "div",
  10954. { staticClass: "el-table-filter__content" },
  10955. [
  10956. _c(
  10957. "el-scrollbar",
  10958. { attrs: { "wrap-class": "el-table-filter__wrap" } },
  10959. [
  10960. _c(
  10961. "el-checkbox-group",
  10962. {
  10963. staticClass: "el-table-filter__checkbox-group",
  10964. model: {
  10965. value: _vm.filteredValue,
  10966. callback: function($$v) {
  10967. _vm.filteredValue = $$v
  10968. },
  10969. expression: "filteredValue"
  10970. }
  10971. },
  10972. _vm._l(_vm.filters, function(filter) {
  10973. return _c(
  10974. "el-checkbox",
  10975. { key: filter.value, attrs: { label: filter.value } },
  10976. [_vm._v(_vm._s(filter.text))]
  10977. )
  10978. }),
  10979. 1
  10980. )
  10981. ],
  10982. 1
  10983. )
  10984. ],
  10985. 1
  10986. ),
  10987. _c("div", { staticClass: "el-table-filter__bottom" }, [
  10988. _c(
  10989. "button",
  10990. {
  10991. class: { "is-disabled": _vm.filteredValue.length === 0 },
  10992. attrs: { disabled: _vm.filteredValue.length === 0 },
  10993. on: { click: _vm.handleConfirm }
  10994. },
  10995. [_vm._v(_vm._s(_vm.t("el.table.confirmFilter")))]
  10996. ),
  10997. _c("button", { on: { click: _vm.handleReset } }, [
  10998. _vm._v(_vm._s(_vm.t("el.table.resetFilter")))
  10999. ])
  11000. ])
  11001. ]
  11002. )
  11003. : _c(
  11004. "div",
  11005. {
  11006. directives: [
  11007. {
  11008. name: "clickoutside",
  11009. rawName: "v-clickoutside",
  11010. value: _vm.handleOutsideClick,
  11011. expression: "handleOutsideClick"
  11012. },
  11013. {
  11014. name: "show",
  11015. rawName: "v-show",
  11016. value: _vm.showPopper,
  11017. expression: "showPopper"
  11018. }
  11019. ],
  11020. staticClass: "el-table-filter"
  11021. },
  11022. [
  11023. _c(
  11024. "ul",
  11025. { staticClass: "el-table-filter__list" },
  11026. [
  11027. _c(
  11028. "li",
  11029. {
  11030. staticClass: "el-table-filter__list-item",
  11031. class: {
  11032. "is-active":
  11033. _vm.filterValue === undefined ||
  11034. _vm.filterValue === null
  11035. },
  11036. on: {
  11037. click: function($event) {
  11038. _vm.handleSelect(null)
  11039. }
  11040. }
  11041. },
  11042. [_vm._v(_vm._s(_vm.t("el.table.clearFilter")))]
  11043. ),
  11044. _vm._l(_vm.filters, function(filter) {
  11045. return _c(
  11046. "li",
  11047. {
  11048. key: filter.value,
  11049. staticClass: "el-table-filter__list-item",
  11050. class: { "is-active": _vm.isActive(filter) },
  11051. attrs: { label: filter.value },
  11052. on: {
  11053. click: function($event) {
  11054. _vm.handleSelect(filter.value)
  11055. }
  11056. }
  11057. },
  11058. [_vm._v(_vm._s(filter.text))]
  11059. )
  11060. })
  11061. ],
  11062. 2
  11063. )
  11064. ]
  11065. )
  11066. ])
  11067. }
  11068. var filter_panelvue_type_template_id_7f2c919f_staticRenderFns = []
  11069. filter_panelvue_type_template_id_7f2c919f_render._withStripped = true
  11070. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=template&id=7f2c919f&
  11071. // CONCATENATED MODULE: ./packages/table/src/dropdown.js
  11072. var dropdowns = [];
  11073. !external_vue_default.a.prototype.$isServer && document.addEventListener('click', function (event) {
  11074. dropdowns.forEach(function (dropdown) {
  11075. var target = event.target;
  11076. if (!dropdown || !dropdown.$el) return;
  11077. if (target === dropdown.$el || dropdown.$el.contains(target)) {
  11078. return;
  11079. }
  11080. dropdown.handleOutsideClick && dropdown.handleOutsideClick(event);
  11081. });
  11082. });
  11083. /* harmony default export */ var src_dropdown = ({
  11084. open: function open(instance) {
  11085. if (instance) {
  11086. dropdowns.push(instance);
  11087. }
  11088. },
  11089. close: function close(instance) {
  11090. var index = dropdowns.indexOf(instance);
  11091. if (index !== -1) {
  11092. dropdowns.splice(instance, 1);
  11093. }
  11094. }
  11095. });
  11096. // EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
  11097. var checkbox_group_ = __webpack_require__(31);
  11098. var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
  11099. // 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&
  11100. //
  11101. //
  11102. //
  11103. //
  11104. //
  11105. //
  11106. //
  11107. //
  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. /* harmony default export */ var filter_panelvue_type_script_lang_js_ = ({
  11145. name: 'ElTableFilterPanel',
  11146. mixins: [vue_popper_default.a, locale_default.a],
  11147. directives: {
  11148. Clickoutside: clickoutside_default.a
  11149. },
  11150. components: {
  11151. ElCheckbox: checkbox_default.a,
  11152. ElCheckboxGroup: checkbox_group_default.a,
  11153. ElScrollbar: scrollbar_default.a
  11154. },
  11155. props: {
  11156. placement: {
  11157. type: String,
  11158. default: 'bottom-end'
  11159. }
  11160. },
  11161. methods: {
  11162. isActive: function isActive(filter) {
  11163. return filter.value === this.filterValue;
  11164. },
  11165. handleOutsideClick: function handleOutsideClick() {
  11166. var _this = this;
  11167. setTimeout(function () {
  11168. _this.showPopper = false;
  11169. }, 16);
  11170. },
  11171. handleConfirm: function handleConfirm() {
  11172. this.confirmFilter(this.filteredValue);
  11173. this.handleOutsideClick();
  11174. },
  11175. handleReset: function handleReset() {
  11176. this.filteredValue = [];
  11177. this.confirmFilter(this.filteredValue);
  11178. this.handleOutsideClick();
  11179. },
  11180. handleSelect: function handleSelect(filterValue) {
  11181. this.filterValue = filterValue;
  11182. if (typeof filterValue !== 'undefined' && filterValue !== null) {
  11183. this.confirmFilter(this.filteredValue);
  11184. } else {
  11185. this.confirmFilter([]);
  11186. }
  11187. this.handleOutsideClick();
  11188. },
  11189. confirmFilter: function confirmFilter(filteredValue) {
  11190. this.table.store.commit('filterChange', {
  11191. column: this.column,
  11192. values: filteredValue
  11193. });
  11194. this.table.store.updateAllSelected();
  11195. }
  11196. },
  11197. data: function data() {
  11198. return {
  11199. table: null,
  11200. cell: null,
  11201. column: null
  11202. };
  11203. },
  11204. computed: {
  11205. filters: function filters() {
  11206. return this.column && this.column.filters;
  11207. },
  11208. filterValue: {
  11209. get: function get() {
  11210. return (this.column.filteredValue || [])[0];
  11211. },
  11212. set: function set(value) {
  11213. if (this.filteredValue) {
  11214. if (typeof value !== 'undefined' && value !== null) {
  11215. this.filteredValue.splice(0, 1, value);
  11216. } else {
  11217. this.filteredValue.splice(0, 1);
  11218. }
  11219. }
  11220. }
  11221. },
  11222. filteredValue: {
  11223. get: function get() {
  11224. if (this.column) {
  11225. return this.column.filteredValue || [];
  11226. }
  11227. return [];
  11228. },
  11229. set: function set(value) {
  11230. if (this.column) {
  11231. this.column.filteredValue = value;
  11232. }
  11233. }
  11234. },
  11235. multiple: function multiple() {
  11236. if (this.column) {
  11237. return this.column.filterMultiple;
  11238. }
  11239. return true;
  11240. }
  11241. },
  11242. mounted: function mounted() {
  11243. var _this2 = this;
  11244. this.popperElm = this.$el;
  11245. this.referenceElm = this.cell;
  11246. this.table.bodyWrapper.addEventListener('scroll', function () {
  11247. _this2.updatePopper();
  11248. });
  11249. this.$watch('showPopper', function (value) {
  11250. if (_this2.column) _this2.column.filterOpened = value;
  11251. if (value) {
  11252. src_dropdown.open(_this2);
  11253. } else {
  11254. src_dropdown.close(_this2);
  11255. }
  11256. });
  11257. },
  11258. watch: {
  11259. showPopper: function showPopper(val) {
  11260. if (val === true && parseInt(this.popperJS._popper.style.zIndex, 10) < popup_["PopupManager"].zIndex) {
  11261. this.popperJS._popper.style.zIndex = popup_["PopupManager"].nextZIndex();
  11262. }
  11263. }
  11264. }
  11265. });
  11266. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=script&lang=js&
  11267. /* harmony default export */ var src_filter_panelvue_type_script_lang_js_ = (filter_panelvue_type_script_lang_js_);
  11268. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue
  11269. /* normalize component */
  11270. var filter_panel_component = normalizeComponent(
  11271. src_filter_panelvue_type_script_lang_js_,
  11272. filter_panelvue_type_template_id_7f2c919f_render,
  11273. filter_panelvue_type_template_id_7f2c919f_staticRenderFns,
  11274. false,
  11275. null,
  11276. null,
  11277. null
  11278. )
  11279. /* hot reload */
  11280. if (false) { var filter_panel_api; }
  11281. filter_panel_component.options.__file = "packages/table/src/filter-panel.vue"
  11282. /* harmony default export */ var filter_panel = (filter_panel_component.exports);
  11283. // CONCATENATED MODULE: ./packages/table/src/table-header.js
  11284. 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; };
  11285. var getAllColumns = function getAllColumns(columns) {
  11286. var result = [];
  11287. columns.forEach(function (column) {
  11288. if (column.children) {
  11289. result.push(column);
  11290. result.push.apply(result, getAllColumns(column.children));
  11291. } else {
  11292. result.push(column);
  11293. }
  11294. });
  11295. return result;
  11296. };
  11297. var convertToRows = function convertToRows(originColumns) {
  11298. var maxLevel = 1;
  11299. var traverse = function traverse(column, parent) {
  11300. if (parent) {
  11301. column.level = parent.level + 1;
  11302. if (maxLevel < column.level) {
  11303. maxLevel = column.level;
  11304. }
  11305. }
  11306. if (column.children) {
  11307. var colSpan = 0;
  11308. column.children.forEach(function (subColumn) {
  11309. traverse(subColumn, column);
  11310. colSpan += subColumn.colSpan;
  11311. });
  11312. column.colSpan = colSpan;
  11313. } else {
  11314. column.colSpan = 1;
  11315. }
  11316. };
  11317. originColumns.forEach(function (column) {
  11318. column.level = 1;
  11319. traverse(column);
  11320. });
  11321. var rows = [];
  11322. for (var i = 0; i < maxLevel; i++) {
  11323. rows.push([]);
  11324. }
  11325. var allColumns = getAllColumns(originColumns);
  11326. allColumns.forEach(function (column) {
  11327. if (!column.children) {
  11328. column.rowSpan = maxLevel - column.level + 1;
  11329. } else {
  11330. column.rowSpan = 1;
  11331. }
  11332. rows[column.level - 1].push(column);
  11333. });
  11334. return rows;
  11335. };
  11336. /* harmony default export */ var table_header = ({
  11337. name: 'ElTableHeader',
  11338. mixins: [layout_observer],
  11339. render: function render(h) {
  11340. var _this = this;
  11341. var originColumns = this.store.states.originColumns;
  11342. var columnRows = convertToRows(originColumns, this.columns);
  11343. // 是否拥有多级表头
  11344. var isGroup = columnRows.length > 1;
  11345. if (isGroup) this.$parent.isGroup = true;
  11346. return h(
  11347. 'table',
  11348. {
  11349. 'class': 'el-table__header',
  11350. attrs: { cellspacing: '0',
  11351. cellpadding: '0',
  11352. border: '0' }
  11353. },
  11354. [h('colgroup', [this.columns.map(function (column) {
  11355. return h('col', {
  11356. attrs: { name: column.id },
  11357. key: column.id });
  11358. }), this.hasGutter ? h('col', {
  11359. attrs: { name: 'gutter' }
  11360. }) : '']), h(
  11361. 'thead',
  11362. { 'class': [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] },
  11363. [this._l(columnRows, function (columns, rowIndex) {
  11364. return h(
  11365. 'tr',
  11366. {
  11367. style: _this.getHeaderRowStyle(rowIndex),
  11368. 'class': _this.getHeaderRowClass(rowIndex)
  11369. },
  11370. [columns.map(function (column, cellIndex) {
  11371. return h(
  11372. 'th',
  11373. {
  11374. attrs: {
  11375. colspan: column.colSpan,
  11376. rowspan: column.rowSpan
  11377. },
  11378. on: {
  11379. 'mousemove': function mousemove($event) {
  11380. return _this.handleMouseMove($event, column);
  11381. },
  11382. 'mouseout': _this.handleMouseOut,
  11383. 'mousedown': function mousedown($event) {
  11384. return _this.handleMouseDown($event, column);
  11385. },
  11386. 'click': function click($event) {
  11387. return _this.handleHeaderClick($event, column);
  11388. },
  11389. 'contextmenu': function contextmenu($event) {
  11390. return _this.handleHeaderContextMenu($event, column);
  11391. }
  11392. },
  11393. style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
  11394. 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
  11395. key: column.id },
  11396. [h(
  11397. 'div',
  11398. { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
  11399. [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(
  11400. 'span',
  11401. {
  11402. 'class': 'caret-wrapper',
  11403. on: {
  11404. 'click': function click($event) {
  11405. return _this.handleSortClick($event, column);
  11406. }
  11407. }
  11408. },
  11409. [h('i', { 'class': 'sort-caret ascending',
  11410. on: {
  11411. 'click': function click($event) {
  11412. return _this.handleSortClick($event, column, 'ascending');
  11413. }
  11414. }
  11415. }), h('i', { 'class': 'sort-caret descending',
  11416. on: {
  11417. 'click': function click($event) {
  11418. return _this.handleSortClick($event, column, 'descending');
  11419. }
  11420. }
  11421. })]
  11422. ) : '', column.filterable ? h(
  11423. 'span',
  11424. {
  11425. 'class': 'el-table__column-filter-trigger',
  11426. on: {
  11427. 'click': function click($event) {
  11428. return _this.handleFilterClick($event, column);
  11429. }
  11430. }
  11431. },
  11432. [h('i', { 'class': ['el-icon-arrow-down', column.filterOpened ? 'el-icon-arrow-up' : ''] })]
  11433. ) : '']
  11434. )]
  11435. );
  11436. }), _this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : '']
  11437. );
  11438. })]
  11439. )]
  11440. );
  11441. },
  11442. props: {
  11443. fixed: String,
  11444. store: {
  11445. required: true
  11446. },
  11447. border: Boolean,
  11448. defaultSort: {
  11449. type: Object,
  11450. default: function _default() {
  11451. return {
  11452. prop: '',
  11453. order: ''
  11454. };
  11455. }
  11456. }
  11457. },
  11458. components: {
  11459. ElCheckbox: checkbox_default.a
  11460. },
  11461. computed: table_header_extends({
  11462. table: function table() {
  11463. return this.$parent;
  11464. },
  11465. hasGutter: function hasGutter() {
  11466. return !this.fixed && this.tableLayout.gutterWidth;
  11467. }
  11468. }, mapStates({
  11469. columns: 'columns',
  11470. isAllSelected: 'isAllSelected',
  11471. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11472. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11473. columnsCount: function columnsCount(states) {
  11474. return states.columns.length;
  11475. },
  11476. leftFixedCount: function leftFixedCount(states) {
  11477. return states.fixedColumns.length;
  11478. },
  11479. rightFixedCount: function rightFixedCount(states) {
  11480. return states.rightFixedColumns.length;
  11481. }
  11482. })),
  11483. created: function created() {
  11484. this.filterPanels = {};
  11485. },
  11486. mounted: function mounted() {
  11487. var _this2 = this;
  11488. // nextTick 是有必要的 https://github.com/ElemeFE/element/pull/11311
  11489. this.$nextTick(function () {
  11490. var _defaultSort = _this2.defaultSort,
  11491. prop = _defaultSort.prop,
  11492. order = _defaultSort.order;
  11493. var init = true;
  11494. _this2.store.commit('sort', { prop: prop, order: order, init: init });
  11495. });
  11496. },
  11497. beforeDestroy: function beforeDestroy() {
  11498. var panels = this.filterPanels;
  11499. for (var prop in panels) {
  11500. if (panels.hasOwnProperty(prop) && panels[prop]) {
  11501. panels[prop].$destroy(true);
  11502. }
  11503. }
  11504. },
  11505. methods: {
  11506. isCellHidden: function isCellHidden(index, columns) {
  11507. var start = 0;
  11508. for (var i = 0; i < index; i++) {
  11509. start += columns[i].colSpan;
  11510. }
  11511. var after = start + columns[index].colSpan - 1;
  11512. if (this.fixed === true || this.fixed === 'left') {
  11513. return after >= this.leftFixedLeafCount;
  11514. } else if (this.fixed === 'right') {
  11515. return start < this.columnsCount - this.rightFixedLeafCount;
  11516. } else {
  11517. return after < this.leftFixedLeafCount || start >= this.columnsCount - this.rightFixedLeafCount;
  11518. }
  11519. },
  11520. getHeaderRowStyle: function getHeaderRowStyle(rowIndex) {
  11521. var headerRowStyle = this.table.headerRowStyle;
  11522. if (typeof headerRowStyle === 'function') {
  11523. return headerRowStyle.call(null, { rowIndex: rowIndex });
  11524. }
  11525. return headerRowStyle;
  11526. },
  11527. getHeaderRowClass: function getHeaderRowClass(rowIndex) {
  11528. var classes = [];
  11529. var headerRowClassName = this.table.headerRowClassName;
  11530. if (typeof headerRowClassName === 'string') {
  11531. classes.push(headerRowClassName);
  11532. } else if (typeof headerRowClassName === 'function') {
  11533. classes.push(headerRowClassName.call(null, { rowIndex: rowIndex }));
  11534. }
  11535. return classes.join(' ');
  11536. },
  11537. getHeaderCellStyle: function getHeaderCellStyle(rowIndex, columnIndex, row, column) {
  11538. var headerCellStyle = this.table.headerCellStyle;
  11539. if (typeof headerCellStyle === 'function') {
  11540. return headerCellStyle.call(null, {
  11541. rowIndex: rowIndex,
  11542. columnIndex: columnIndex,
  11543. row: row,
  11544. column: column
  11545. });
  11546. }
  11547. return headerCellStyle;
  11548. },
  11549. getHeaderCellClass: function getHeaderCellClass(rowIndex, columnIndex, row, column) {
  11550. var classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];
  11551. if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
  11552. classes.push('is-hidden');
  11553. }
  11554. if (!column.children) {
  11555. classes.push('is-leaf');
  11556. }
  11557. if (column.sortable) {
  11558. classes.push('is-sortable');
  11559. }
  11560. var headerCellClassName = this.table.headerCellClassName;
  11561. if (typeof headerCellClassName === 'string') {
  11562. classes.push(headerCellClassName);
  11563. } else if (typeof headerCellClassName === 'function') {
  11564. classes.push(headerCellClassName.call(null, {
  11565. rowIndex: rowIndex,
  11566. columnIndex: columnIndex,
  11567. row: row,
  11568. column: column
  11569. }));
  11570. }
  11571. classes.push('el-table__cell');
  11572. return classes.join(' ');
  11573. },
  11574. toggleAllSelection: function toggleAllSelection() {
  11575. this.store.commit('toggleAllSelection');
  11576. },
  11577. handleFilterClick: function handleFilterClick(event, column) {
  11578. event.stopPropagation();
  11579. var target = event.target;
  11580. var cell = target.tagName === 'TH' ? target : target.parentNode;
  11581. if (Object(dom_["hasClass"])(cell, 'noclick')) return;
  11582. cell = cell.querySelector('.el-table__column-filter-trigger') || cell;
  11583. var table = this.$parent;
  11584. var filterPanel = this.filterPanels[column.id];
  11585. if (filterPanel && column.filterOpened) {
  11586. filterPanel.showPopper = false;
  11587. return;
  11588. }
  11589. if (!filterPanel) {
  11590. filterPanel = new external_vue_default.a(filter_panel);
  11591. this.filterPanels[column.id] = filterPanel;
  11592. if (column.filterPlacement) {
  11593. filterPanel.placement = column.filterPlacement;
  11594. }
  11595. filterPanel.table = table;
  11596. filterPanel.cell = cell;
  11597. filterPanel.column = column;
  11598. !this.$isServer && filterPanel.$mount(document.createElement('div'));
  11599. }
  11600. setTimeout(function () {
  11601. filterPanel.showPopper = true;
  11602. }, 16);
  11603. },
  11604. handleHeaderClick: function handleHeaderClick(event, column) {
  11605. if (!column.filters && column.sortable) {
  11606. this.handleSortClick(event, column);
  11607. } else if (column.filterable && !column.sortable) {
  11608. this.handleFilterClick(event, column);
  11609. }
  11610. this.$parent.$emit('header-click', column, event);
  11611. },
  11612. handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
  11613. this.$parent.$emit('header-contextmenu', column, event);
  11614. },
  11615. handleMouseDown: function handleMouseDown(event, column) {
  11616. var _this3 = this;
  11617. if (this.$isServer) return;
  11618. if (column.children && column.children.length > 0) return;
  11619. /* istanbul ignore if */
  11620. if (this.draggingColumn && this.border) {
  11621. this.dragging = true;
  11622. this.$parent.resizeProxyVisible = true;
  11623. var table = this.$parent;
  11624. var tableEl = table.$el;
  11625. var tableLeft = tableEl.getBoundingClientRect().left;
  11626. var columnEl = this.$el.querySelector('th.' + column.id);
  11627. var columnRect = columnEl.getBoundingClientRect();
  11628. var minLeft = columnRect.left - tableLeft + 30;
  11629. Object(dom_["addClass"])(columnEl, 'noclick');
  11630. this.dragState = {
  11631. startMouseLeft: event.clientX,
  11632. startLeft: columnRect.right - tableLeft,
  11633. startColumnLeft: columnRect.left - tableLeft,
  11634. tableLeft: tableLeft
  11635. };
  11636. var resizeProxy = table.$refs.resizeProxy;
  11637. resizeProxy.style.left = this.dragState.startLeft + 'px';
  11638. document.onselectstart = function () {
  11639. return false;
  11640. };
  11641. document.ondragstart = function () {
  11642. return false;
  11643. };
  11644. var handleMouseMove = function handleMouseMove(event) {
  11645. var deltaLeft = event.clientX - _this3.dragState.startMouseLeft;
  11646. var proxyLeft = _this3.dragState.startLeft + deltaLeft;
  11647. resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
  11648. };
  11649. var handleMouseUp = function handleMouseUp() {
  11650. if (_this3.dragging) {
  11651. var _dragState = _this3.dragState,
  11652. startColumnLeft = _dragState.startColumnLeft,
  11653. startLeft = _dragState.startLeft;
  11654. var finalLeft = parseInt(resizeProxy.style.left, 10);
  11655. var columnWidth = finalLeft - startColumnLeft;
  11656. column.width = column.realWidth = columnWidth;
  11657. table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
  11658. _this3.store.scheduleLayout();
  11659. document.body.style.cursor = '';
  11660. _this3.dragging = false;
  11661. _this3.draggingColumn = null;
  11662. _this3.dragState = {};
  11663. table.resizeProxyVisible = false;
  11664. }
  11665. document.removeEventListener('mousemove', handleMouseMove);
  11666. document.removeEventListener('mouseup', handleMouseUp);
  11667. document.onselectstart = null;
  11668. document.ondragstart = null;
  11669. setTimeout(function () {
  11670. Object(dom_["removeClass"])(columnEl, 'noclick');
  11671. }, 0);
  11672. };
  11673. document.addEventListener('mousemove', handleMouseMove);
  11674. document.addEventListener('mouseup', handleMouseUp);
  11675. }
  11676. },
  11677. handleMouseMove: function handleMouseMove(event, column) {
  11678. if (column.children && column.children.length > 0) return;
  11679. var target = event.target;
  11680. while (target && target.tagName !== 'TH') {
  11681. target = target.parentNode;
  11682. }
  11683. if (!column || !column.resizable) return;
  11684. if (!this.dragging && this.border) {
  11685. var rect = target.getBoundingClientRect();
  11686. var bodyStyle = document.body.style;
  11687. if (rect.width > 12 && rect.right - event.pageX < 8) {
  11688. bodyStyle.cursor = 'col-resize';
  11689. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11690. target.style.cursor = 'col-resize';
  11691. }
  11692. this.draggingColumn = column;
  11693. } else if (!this.dragging) {
  11694. bodyStyle.cursor = '';
  11695. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11696. target.style.cursor = 'pointer';
  11697. }
  11698. this.draggingColumn = null;
  11699. }
  11700. }
  11701. },
  11702. handleMouseOut: function handleMouseOut() {
  11703. if (this.$isServer) return;
  11704. document.body.style.cursor = '';
  11705. },
  11706. toggleOrder: function toggleOrder(_ref) {
  11707. var order = _ref.order,
  11708. sortOrders = _ref.sortOrders;
  11709. if (order === '') return sortOrders[0];
  11710. var index = sortOrders.indexOf(order || null);
  11711. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  11712. },
  11713. handleSortClick: function handleSortClick(event, column, givenOrder) {
  11714. event.stopPropagation();
  11715. var order = column.order === givenOrder ? null : givenOrder || this.toggleOrder(column);
  11716. var target = event.target;
  11717. while (target && target.tagName !== 'TH') {
  11718. target = target.parentNode;
  11719. }
  11720. if (target && target.tagName === 'TH') {
  11721. if (Object(dom_["hasClass"])(target, 'noclick')) {
  11722. Object(dom_["removeClass"])(target, 'noclick');
  11723. return;
  11724. }
  11725. }
  11726. if (!column.sortable) return;
  11727. var states = this.store.states;
  11728. var sortProp = states.sortProp;
  11729. var sortOrder = void 0;
  11730. var sortingColumn = states.sortingColumn;
  11731. if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
  11732. if (sortingColumn) {
  11733. sortingColumn.order = null;
  11734. }
  11735. states.sortingColumn = column;
  11736. sortProp = column.property;
  11737. }
  11738. if (!order) {
  11739. sortOrder = column.order = null;
  11740. } else {
  11741. sortOrder = column.order = order;
  11742. }
  11743. states.sortProp = sortProp;
  11744. states.sortOrder = sortOrder;
  11745. this.store.commit('changeSortCondition');
  11746. }
  11747. },
  11748. data: function data() {
  11749. return {
  11750. draggingColumn: null,
  11751. dragging: false,
  11752. dragState: {}
  11753. };
  11754. }
  11755. });
  11756. // CONCATENATED MODULE: ./packages/table/src/table-footer.js
  11757. 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; };
  11758. /* harmony default export */ var table_footer = ({
  11759. name: 'ElTableFooter',
  11760. mixins: [layout_observer],
  11761. render: function render(h) {
  11762. var _this = this;
  11763. var sums = [];
  11764. if (this.summaryMethod) {
  11765. sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
  11766. } else {
  11767. this.columns.forEach(function (column, index) {
  11768. if (index === 0) {
  11769. sums[index] = _this.sumText;
  11770. return;
  11771. }
  11772. var values = _this.store.states.data.map(function (item) {
  11773. return Number(item[column.property]);
  11774. });
  11775. var precisions = [];
  11776. var notNumber = true;
  11777. values.forEach(function (value) {
  11778. if (!isNaN(value)) {
  11779. notNumber = false;
  11780. var decimal = ('' + value).split('.')[1];
  11781. precisions.push(decimal ? decimal.length : 0);
  11782. }
  11783. });
  11784. var precision = Math.max.apply(null, precisions);
  11785. if (!notNumber) {
  11786. sums[index] = values.reduce(function (prev, curr) {
  11787. var value = Number(curr);
  11788. if (!isNaN(value)) {
  11789. return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  11790. } else {
  11791. return prev;
  11792. }
  11793. }, 0);
  11794. } else {
  11795. sums[index] = '';
  11796. }
  11797. });
  11798. }
  11799. return h(
  11800. 'table',
  11801. {
  11802. 'class': 'el-table__footer',
  11803. attrs: { cellspacing: '0',
  11804. cellpadding: '0',
  11805. border: '0' }
  11806. },
  11807. [h('colgroup', [this.columns.map(function (column) {
  11808. return h('col', {
  11809. attrs: { name: column.id },
  11810. key: column.id });
  11811. }), this.hasGutter ? h('col', {
  11812. attrs: { name: 'gutter' }
  11813. }) : '']), h(
  11814. 'tbody',
  11815. { 'class': [{ 'has-gutter': this.hasGutter }] },
  11816. [h('tr', [this.columns.map(function (column, cellIndex) {
  11817. return h(
  11818. 'td',
  11819. {
  11820. key: cellIndex,
  11821. attrs: { colspan: column.colSpan,
  11822. rowspan: column.rowSpan
  11823. },
  11824. 'class': [].concat(_this.getRowClasses(column, cellIndex), ['el-table__cell']) },
  11825. [h(
  11826. 'div',
  11827. { 'class': ['cell', column.labelClassName] },
  11828. [sums[cellIndex]]
  11829. )]
  11830. );
  11831. }), this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : ''])]
  11832. )]
  11833. );
  11834. },
  11835. props: {
  11836. fixed: String,
  11837. store: {
  11838. required: true
  11839. },
  11840. summaryMethod: Function,
  11841. sumText: String,
  11842. border: Boolean,
  11843. defaultSort: {
  11844. type: Object,
  11845. default: function _default() {
  11846. return {
  11847. prop: '',
  11848. order: ''
  11849. };
  11850. }
  11851. }
  11852. },
  11853. computed: table_footer_extends({
  11854. table: function table() {
  11855. return this.$parent;
  11856. },
  11857. hasGutter: function hasGutter() {
  11858. return !this.fixed && this.tableLayout.gutterWidth;
  11859. }
  11860. }, mapStates({
  11861. columns: 'columns',
  11862. isAllSelected: 'isAllSelected',
  11863. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11864. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11865. columnsCount: function columnsCount(states) {
  11866. return states.columns.length;
  11867. },
  11868. leftFixedCount: function leftFixedCount(states) {
  11869. return states.fixedColumns.length;
  11870. },
  11871. rightFixedCount: function rightFixedCount(states) {
  11872. return states.rightFixedColumns.length;
  11873. }
  11874. })),
  11875. methods: {
  11876. isCellHidden: function isCellHidden(index, columns, column) {
  11877. if (this.fixed === true || this.fixed === 'left') {
  11878. return index >= this.leftFixedLeafCount;
  11879. } else if (this.fixed === 'right') {
  11880. var before = 0;
  11881. for (var i = 0; i < index; i++) {
  11882. before += columns[i].colSpan;
  11883. }
  11884. return before < this.columnsCount - this.rightFixedLeafCount;
  11885. } else if (!this.fixed && column.fixed) {
  11886. // hide cell when footer instance is not fixed and column is fixed
  11887. return true;
  11888. } else {
  11889. return index < this.leftFixedCount || index >= this.columnsCount - this.rightFixedCount;
  11890. }
  11891. },
  11892. getRowClasses: function getRowClasses(column, cellIndex) {
  11893. var classes = [column.id, column.align, column.labelClassName];
  11894. if (column.className) {
  11895. classes.push(column.className);
  11896. }
  11897. if (this.isCellHidden(cellIndex, this.columns, column)) {
  11898. classes.push('is-hidden');
  11899. }
  11900. if (!column.children) {
  11901. classes.push('is-leaf');
  11902. }
  11903. return classes;
  11904. }
  11905. }
  11906. });
  11907. // 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&
  11908. 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; };
  11909. //
  11910. //
  11911. //
  11912. //
  11913. //
  11914. //
  11915. //
  11916. //
  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. var tableIdSeed = 1;
  12124. /* harmony default export */ var tablevue_type_script_lang_js_ = ({
  12125. name: 'ElTable',
  12126. mixins: [locale_default.a, migrating_default.a],
  12127. directives: {
  12128. Mousewheel: directives_mousewheel
  12129. },
  12130. props: {
  12131. data: {
  12132. type: Array,
  12133. default: function _default() {
  12134. return [];
  12135. }
  12136. },
  12137. size: String,
  12138. width: [String, Number],
  12139. height: [String, Number],
  12140. maxHeight: [String, Number],
  12141. fit: {
  12142. type: Boolean,
  12143. default: true
  12144. },
  12145. stripe: Boolean,
  12146. border: Boolean,
  12147. rowKey: [String, Function],
  12148. context: {},
  12149. showHeader: {
  12150. type: Boolean,
  12151. default: true
  12152. },
  12153. showSummary: Boolean,
  12154. sumText: String,
  12155. summaryMethod: Function,
  12156. rowClassName: [String, Function],
  12157. rowStyle: [Object, Function],
  12158. cellClassName: [String, Function],
  12159. cellStyle: [Object, Function],
  12160. headerRowClassName: [String, Function],
  12161. headerRowStyle: [Object, Function],
  12162. headerCellClassName: [String, Function],
  12163. headerCellStyle: [Object, Function],
  12164. highlightCurrentRow: Boolean,
  12165. currentRowKey: [String, Number],
  12166. emptyText: String,
  12167. expandRowKeys: Array,
  12168. defaultExpandAll: Boolean,
  12169. defaultSort: Object,
  12170. tooltipEffect: String,
  12171. spanMethod: Function,
  12172. selectOnIndeterminate: {
  12173. type: Boolean,
  12174. default: true
  12175. },
  12176. indent: {
  12177. type: Number,
  12178. default: 16
  12179. },
  12180. treeProps: {
  12181. type: Object,
  12182. default: function _default() {
  12183. return {
  12184. hasChildren: 'hasChildren',
  12185. children: 'children'
  12186. };
  12187. }
  12188. },
  12189. lazy: Boolean,
  12190. load: Function
  12191. },
  12192. components: {
  12193. TableHeader: table_header,
  12194. TableFooter: table_footer,
  12195. TableBody: table_body,
  12196. ElCheckbox: checkbox_default.a
  12197. },
  12198. methods: {
  12199. getMigratingConfig: function getMigratingConfig() {
  12200. return {
  12201. events: {
  12202. expand: 'expand is renamed to expand-change'
  12203. }
  12204. };
  12205. },
  12206. setCurrentRow: function setCurrentRow(row) {
  12207. this.store.commit('setCurrentRow', row);
  12208. },
  12209. toggleRowSelection: function toggleRowSelection(row, selected) {
  12210. this.store.toggleRowSelection(row, selected, false);
  12211. this.store.updateAllSelected();
  12212. },
  12213. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  12214. this.store.toggleRowExpansionAdapter(row, expanded);
  12215. },
  12216. clearSelection: function clearSelection() {
  12217. this.store.clearSelection();
  12218. },
  12219. clearFilter: function clearFilter(columnKeys) {
  12220. this.store.clearFilter(columnKeys);
  12221. },
  12222. clearSort: function clearSort() {
  12223. this.store.clearSort();
  12224. },
  12225. handleMouseLeave: function handleMouseLeave() {
  12226. this.store.commit('setHoverRow', null);
  12227. if (this.hoverState) this.hoverState = null;
  12228. },
  12229. updateScrollY: function updateScrollY() {
  12230. var changed = this.layout.updateScrollY();
  12231. if (changed) {
  12232. this.layout.notifyObservers('scrollable');
  12233. this.layout.updateColumnsWidth();
  12234. }
  12235. },
  12236. handleFixedMousewheel: function handleFixedMousewheel(event, data) {
  12237. var bodyWrapper = this.bodyWrapper;
  12238. if (Math.abs(data.spinY) > 0) {
  12239. var currentScrollTop = bodyWrapper.scrollTop;
  12240. if (data.pixelY < 0 && currentScrollTop !== 0) {
  12241. event.preventDefault();
  12242. }
  12243. if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
  12244. event.preventDefault();
  12245. }
  12246. bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
  12247. } else {
  12248. bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
  12249. }
  12250. },
  12251. handleHeaderFooterMousewheel: function handleHeaderFooterMousewheel(event, data) {
  12252. var pixelX = data.pixelX,
  12253. pixelY = data.pixelY;
  12254. if (Math.abs(pixelX) >= Math.abs(pixelY)) {
  12255. this.bodyWrapper.scrollLeft += data.pixelX / 5;
  12256. }
  12257. },
  12258. // TODO 使用 CSS transform
  12259. syncPostion: Object(external_throttle_debounce_["throttle"])(20, function () {
  12260. var _bodyWrapper = this.bodyWrapper,
  12261. scrollLeft = _bodyWrapper.scrollLeft,
  12262. scrollTop = _bodyWrapper.scrollTop,
  12263. offsetWidth = _bodyWrapper.offsetWidth,
  12264. scrollWidth = _bodyWrapper.scrollWidth;
  12265. var _$refs = this.$refs,
  12266. headerWrapper = _$refs.headerWrapper,
  12267. footerWrapper = _$refs.footerWrapper,
  12268. fixedBodyWrapper = _$refs.fixedBodyWrapper,
  12269. rightFixedBodyWrapper = _$refs.rightFixedBodyWrapper;
  12270. if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
  12271. if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
  12272. if (fixedBodyWrapper) fixedBodyWrapper.scrollTop = scrollTop;
  12273. if (rightFixedBodyWrapper) rightFixedBodyWrapper.scrollTop = scrollTop;
  12274. var maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
  12275. if (scrollLeft >= maxScrollLeftPosition) {
  12276. this.scrollPosition = 'right';
  12277. } else if (scrollLeft === 0) {
  12278. this.scrollPosition = 'left';
  12279. } else {
  12280. this.scrollPosition = 'middle';
  12281. }
  12282. }),
  12283. bindEvents: function bindEvents() {
  12284. this.bodyWrapper.addEventListener('scroll', this.syncPostion, { passive: true });
  12285. if (this.fit) {
  12286. Object(resize_event_["addResizeListener"])(this.$el, this.resizeListener);
  12287. }
  12288. },
  12289. unbindEvents: function unbindEvents() {
  12290. this.bodyWrapper.removeEventListener('scroll', this.syncPostion, { passive: true });
  12291. if (this.fit) {
  12292. Object(resize_event_["removeResizeListener"])(this.$el, this.resizeListener);
  12293. }
  12294. },
  12295. resizeListener: function resizeListener() {
  12296. if (!this.$ready) return;
  12297. var shouldUpdateLayout = false;
  12298. var el = this.$el;
  12299. var _resizeState = this.resizeState,
  12300. oldWidth = _resizeState.width,
  12301. oldHeight = _resizeState.height;
  12302. var width = el.offsetWidth;
  12303. if (oldWidth !== width) {
  12304. shouldUpdateLayout = true;
  12305. }
  12306. var height = el.offsetHeight;
  12307. if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
  12308. shouldUpdateLayout = true;
  12309. }
  12310. if (shouldUpdateLayout) {
  12311. this.resizeState.width = width;
  12312. this.resizeState.height = height;
  12313. this.doLayout();
  12314. }
  12315. },
  12316. doLayout: function doLayout() {
  12317. if (this.shouldUpdateHeight) {
  12318. this.layout.updateElsHeight();
  12319. }
  12320. this.layout.updateColumnsWidth();
  12321. },
  12322. sort: function sort(prop, order) {
  12323. this.store.commit('sort', { prop: prop, order: order });
  12324. },
  12325. toggleAllSelection: function toggleAllSelection() {
  12326. this.store.commit('toggleAllSelection');
  12327. }
  12328. },
  12329. computed: tablevue_type_script_lang_js_extends({
  12330. tableSize: function tableSize() {
  12331. return this.size || (this.$ELEMENT || {}).size;
  12332. },
  12333. bodyWrapper: function bodyWrapper() {
  12334. return this.$refs.bodyWrapper;
  12335. },
  12336. shouldUpdateHeight: function shouldUpdateHeight() {
  12337. return this.height || this.maxHeight || this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0;
  12338. },
  12339. bodyWidth: function bodyWidth() {
  12340. var _layout = this.layout,
  12341. bodyWidth = _layout.bodyWidth,
  12342. scrollY = _layout.scrollY,
  12343. gutterWidth = _layout.gutterWidth;
  12344. return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
  12345. },
  12346. bodyHeight: function bodyHeight() {
  12347. var _layout2 = this.layout,
  12348. _layout2$headerHeight = _layout2.headerHeight,
  12349. headerHeight = _layout2$headerHeight === undefined ? 0 : _layout2$headerHeight,
  12350. bodyHeight = _layout2.bodyHeight,
  12351. _layout2$footerHeight = _layout2.footerHeight,
  12352. footerHeight = _layout2$footerHeight === undefined ? 0 : _layout2$footerHeight;
  12353. if (this.height) {
  12354. return {
  12355. height: bodyHeight ? bodyHeight + 'px' : ''
  12356. };
  12357. } else if (this.maxHeight) {
  12358. var maxHeight = parseHeight(this.maxHeight);
  12359. if (typeof maxHeight === 'number') {
  12360. return {
  12361. 'max-height': maxHeight - footerHeight - (this.showHeader ? headerHeight : 0) + 'px'
  12362. };
  12363. }
  12364. }
  12365. return {};
  12366. },
  12367. fixedBodyHeight: function fixedBodyHeight() {
  12368. if (this.height) {
  12369. return {
  12370. height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
  12371. };
  12372. } else if (this.maxHeight) {
  12373. var maxHeight = parseHeight(this.maxHeight);
  12374. if (typeof maxHeight === 'number') {
  12375. maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
  12376. if (this.showHeader) {
  12377. maxHeight -= this.layout.headerHeight;
  12378. }
  12379. maxHeight -= this.layout.footerHeight;
  12380. return {
  12381. 'max-height': maxHeight + 'px'
  12382. };
  12383. }
  12384. }
  12385. return {};
  12386. },
  12387. fixedHeight: function fixedHeight() {
  12388. if (this.maxHeight) {
  12389. if (this.showSummary) {
  12390. return {
  12391. bottom: 0
  12392. };
  12393. }
  12394. return {
  12395. bottom: this.layout.scrollX && this.data.length ? this.layout.gutterWidth + 'px' : ''
  12396. };
  12397. } else {
  12398. if (this.showSummary) {
  12399. return {
  12400. height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
  12401. };
  12402. }
  12403. return {
  12404. height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
  12405. };
  12406. }
  12407. },
  12408. emptyBlockStyle: function emptyBlockStyle() {
  12409. if (this.data && this.data.length) return null;
  12410. var height = '100%';
  12411. if (this.layout.appendHeight) {
  12412. height = 'calc(100% - ' + this.layout.appendHeight + 'px)';
  12413. }
  12414. return {
  12415. width: this.bodyWidth,
  12416. height: height
  12417. };
  12418. }
  12419. }, mapStates({
  12420. selection: 'selection',
  12421. columns: 'columns',
  12422. tableData: 'data',
  12423. fixedColumns: 'fixedColumns',
  12424. rightFixedColumns: 'rightFixedColumns'
  12425. })),
  12426. watch: {
  12427. height: {
  12428. immediate: true,
  12429. handler: function handler(value) {
  12430. this.layout.setHeight(value);
  12431. }
  12432. },
  12433. maxHeight: {
  12434. immediate: true,
  12435. handler: function handler(value) {
  12436. this.layout.setMaxHeight(value);
  12437. }
  12438. },
  12439. currentRowKey: {
  12440. immediate: true,
  12441. handler: function handler(value) {
  12442. if (!this.rowKey) return;
  12443. this.store.setCurrentRowKey(value);
  12444. }
  12445. },
  12446. data: {
  12447. immediate: true,
  12448. handler: function handler(value) {
  12449. this.store.commit('setData', value);
  12450. }
  12451. },
  12452. expandRowKeys: {
  12453. immediate: true,
  12454. handler: function handler(newVal) {
  12455. if (newVal) {
  12456. this.store.setExpandRowKeysAdapter(newVal);
  12457. }
  12458. }
  12459. }
  12460. },
  12461. created: function created() {
  12462. var _this = this;
  12463. this.tableId = 'el-table_' + tableIdSeed++;
  12464. this.debouncedUpdateLayout = Object(external_throttle_debounce_["debounce"])(50, function () {
  12465. return _this.doLayout();
  12466. });
  12467. },
  12468. mounted: function mounted() {
  12469. var _this2 = this;
  12470. this.bindEvents();
  12471. this.store.updateColumns();
  12472. this.doLayout();
  12473. this.resizeState = {
  12474. width: this.$el.offsetWidth,
  12475. height: this.$el.offsetHeight
  12476. };
  12477. // init filters
  12478. this.store.states.columns.forEach(function (column) {
  12479. if (column.filteredValue && column.filteredValue.length) {
  12480. _this2.store.commit('filterChange', {
  12481. column: column,
  12482. values: column.filteredValue,
  12483. silent: true
  12484. });
  12485. }
  12486. });
  12487. this.$ready = true;
  12488. },
  12489. destroyed: function destroyed() {
  12490. this.unbindEvents();
  12491. },
  12492. data: function data() {
  12493. var _treeProps = this.treeProps,
  12494. _treeProps$hasChildre = _treeProps.hasChildren,
  12495. hasChildren = _treeProps$hasChildre === undefined ? 'hasChildren' : _treeProps$hasChildre,
  12496. _treeProps$children = _treeProps.children,
  12497. children = _treeProps$children === undefined ? 'children' : _treeProps$children;
  12498. this.store = createStore(this, {
  12499. rowKey: this.rowKey,
  12500. defaultExpandAll: this.defaultExpandAll,
  12501. selectOnIndeterminate: this.selectOnIndeterminate,
  12502. // TreeTable 的相关配置
  12503. indent: this.indent,
  12504. lazy: this.lazy,
  12505. lazyColumnIdentifier: hasChildren,
  12506. childrenColumnName: children
  12507. });
  12508. var layout = new table_layout({
  12509. store: this.store,
  12510. table: this,
  12511. fit: this.fit,
  12512. showHeader: this.showHeader
  12513. });
  12514. return {
  12515. layout: layout,
  12516. isHidden: false,
  12517. renderExpanded: null,
  12518. resizeProxyVisible: false,
  12519. resizeState: {
  12520. width: null,
  12521. height: null
  12522. },
  12523. // 是否拥有多级表头
  12524. isGroup: false,
  12525. scrollPosition: 'left'
  12526. };
  12527. }
  12528. });
  12529. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=script&lang=js&
  12530. /* harmony default export */ var src_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_);
  12531. // CONCATENATED MODULE: ./packages/table/src/table.vue
  12532. /* normalize component */
  12533. var table_component = normalizeComponent(
  12534. src_tablevue_type_script_lang_js_,
  12535. tablevue_type_template_id_493fe34e_render,
  12536. tablevue_type_template_id_493fe34e_staticRenderFns,
  12537. false,
  12538. null,
  12539. null,
  12540. null
  12541. )
  12542. /* hot reload */
  12543. if (false) { var table_api; }
  12544. table_component.options.__file = "packages/table/src/table.vue"
  12545. /* harmony default export */ var src_table = (table_component.exports);
  12546. // CONCATENATED MODULE: ./packages/table/index.js
  12547. /* istanbul ignore next */
  12548. src_table.install = function (Vue) {
  12549. Vue.component(src_table.name, src_table);
  12550. };
  12551. /* harmony default export */ var packages_table = (src_table);
  12552. // CONCATENATED MODULE: ./packages/table/src/config.js
  12553. var cellStarts = {
  12554. default: {
  12555. order: ''
  12556. },
  12557. selection: {
  12558. width: 48,
  12559. minWidth: 48,
  12560. realWidth: 48,
  12561. order: '',
  12562. className: 'el-table-column--selection'
  12563. },
  12564. expand: {
  12565. width: 48,
  12566. minWidth: 48,
  12567. realWidth: 48,
  12568. order: ''
  12569. },
  12570. index: {
  12571. width: 48,
  12572. minWidth: 48,
  12573. realWidth: 48,
  12574. order: ''
  12575. }
  12576. };
  12577. // 这些选项不应该被覆盖
  12578. var cellForced = {
  12579. selection: {
  12580. renderHeader: function renderHeader(h, _ref) {
  12581. var store = _ref.store;
  12582. return h('el-checkbox', {
  12583. attrs: {
  12584. disabled: store.states.data && store.states.data.length === 0,
  12585. indeterminate: store.states.selection.length > 0 && !this.isAllSelected,
  12586. value: this.isAllSelected },
  12587. on: {
  12588. 'input': this.toggleAllSelection
  12589. }
  12590. });
  12591. },
  12592. renderCell: function renderCell(h, _ref2) {
  12593. var row = _ref2.row,
  12594. column = _ref2.column,
  12595. isSelected = _ref2.isSelected,
  12596. store = _ref2.store,
  12597. $index = _ref2.$index;
  12598. return h('el-checkbox', {
  12599. nativeOn: {
  12600. 'click': function click(event) {
  12601. return event.stopPropagation();
  12602. }
  12603. },
  12604. attrs: {
  12605. value: isSelected,
  12606. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false
  12607. },
  12608. on: {
  12609. 'input': function input() {
  12610. store.commit('rowSelectedChanged', row);
  12611. }
  12612. }
  12613. });
  12614. },
  12615. sortable: false,
  12616. resizable: false
  12617. },
  12618. index: {
  12619. renderHeader: function renderHeader(h, _ref3) {
  12620. var column = _ref3.column;
  12621. return column.label || '#';
  12622. },
  12623. renderCell: function renderCell(h, _ref4) {
  12624. var $index = _ref4.$index,
  12625. column = _ref4.column;
  12626. var i = $index + 1;
  12627. var index = column.index;
  12628. if (typeof index === 'number') {
  12629. i = $index + index;
  12630. } else if (typeof index === 'function') {
  12631. i = index($index);
  12632. }
  12633. return h('div', [i]);
  12634. },
  12635. sortable: false
  12636. },
  12637. expand: {
  12638. renderHeader: function renderHeader(h, _ref5) {
  12639. var column = _ref5.column;
  12640. return column.label || '';
  12641. },
  12642. renderCell: function renderCell(h, _ref6) {
  12643. var row = _ref6.row,
  12644. store = _ref6.store,
  12645. isExpanded = _ref6.isExpanded;
  12646. var classes = ['el-table__expand-icon'];
  12647. if (isExpanded) {
  12648. classes.push('el-table__expand-icon--expanded');
  12649. }
  12650. var callback = function callback(e) {
  12651. e.stopPropagation();
  12652. store.toggleRowExpansion(row);
  12653. };
  12654. return h(
  12655. 'div',
  12656. { 'class': classes,
  12657. on: {
  12658. 'click': callback
  12659. }
  12660. },
  12661. [h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  12662. );
  12663. },
  12664. sortable: false,
  12665. resizable: false,
  12666. className: 'el-table__expand-column'
  12667. }
  12668. };
  12669. function defaultRenderCell(h, _ref7) {
  12670. var row = _ref7.row,
  12671. column = _ref7.column,
  12672. $index = _ref7.$index;
  12673. var property = column.property;
  12674. var value = property && Object(util_["getPropByPath"])(row, property).v;
  12675. if (column && column.formatter) {
  12676. return column.formatter(row, column, value, $index);
  12677. }
  12678. return value;
  12679. }
  12680. function treeCellPrefix(h, _ref8) {
  12681. var row = _ref8.row,
  12682. treeNode = _ref8.treeNode,
  12683. store = _ref8.store;
  12684. if (!treeNode) return null;
  12685. var ele = [];
  12686. var callback = function callback(e) {
  12687. e.stopPropagation();
  12688. store.loadOrToggle(row);
  12689. };
  12690. if (treeNode.indent) {
  12691. ele.push(h('span', { 'class': 'el-table__indent', style: { 'padding-left': treeNode.indent + 'px' } }));
  12692. }
  12693. if (typeof treeNode.expanded === 'boolean' && !treeNode.noLazyChildren) {
  12694. var expandClasses = ['el-table__expand-icon', treeNode.expanded ? 'el-table__expand-icon--expanded' : ''];
  12695. var iconClasses = ['el-icon-arrow-right'];
  12696. if (treeNode.loading) {
  12697. iconClasses = ['el-icon-loading'];
  12698. }
  12699. ele.push(h(
  12700. 'div',
  12701. { 'class': expandClasses,
  12702. on: {
  12703. 'click': callback
  12704. }
  12705. },
  12706. [h('i', { 'class': iconClasses })]
  12707. ));
  12708. } else {
  12709. ele.push(h('span', { 'class': 'el-table__placeholder' }));
  12710. }
  12711. return ele;
  12712. }
  12713. // CONCATENATED MODULE: ./packages/table/src/table-column.js
  12714. 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; };
  12715. var columnIdSeed = 1;
  12716. /* harmony default export */ var table_column = ({
  12717. name: 'ElTableColumn',
  12718. props: {
  12719. type: {
  12720. type: String,
  12721. default: 'default'
  12722. },
  12723. label: String,
  12724. className: String,
  12725. labelClassName: String,
  12726. property: String,
  12727. prop: String,
  12728. width: {},
  12729. minWidth: {},
  12730. renderHeader: Function,
  12731. sortable: {
  12732. type: [Boolean, String],
  12733. default: false
  12734. },
  12735. sortMethod: Function,
  12736. sortBy: [String, Function, Array],
  12737. resizable: {
  12738. type: Boolean,
  12739. default: true
  12740. },
  12741. columnKey: String,
  12742. align: String,
  12743. headerAlign: String,
  12744. showTooltipWhenOverflow: Boolean,
  12745. showOverflowTooltip: Boolean,
  12746. fixed: [Boolean, String],
  12747. formatter: Function,
  12748. selectable: Function,
  12749. reserveSelection: Boolean,
  12750. filterMethod: Function,
  12751. filteredValue: Array,
  12752. filters: Array,
  12753. filterPlacement: String,
  12754. filterMultiple: {
  12755. type: Boolean,
  12756. default: true
  12757. },
  12758. index: [Number, Function],
  12759. sortOrders: {
  12760. type: Array,
  12761. default: function _default() {
  12762. return ['ascending', 'descending', null];
  12763. },
  12764. validator: function validator(val) {
  12765. return val.every(function (order) {
  12766. return ['ascending', 'descending', null].indexOf(order) > -1;
  12767. });
  12768. }
  12769. }
  12770. },
  12771. data: function data() {
  12772. return {
  12773. isSubColumn: false,
  12774. columns: []
  12775. };
  12776. },
  12777. computed: {
  12778. owner: function owner() {
  12779. var parent = this.$parent;
  12780. while (parent && !parent.tableId) {
  12781. parent = parent.$parent;
  12782. }
  12783. return parent;
  12784. },
  12785. columnOrTableParent: function columnOrTableParent() {
  12786. var parent = this.$parent;
  12787. while (parent && !parent.tableId && !parent.columnId) {
  12788. parent = parent.$parent;
  12789. }
  12790. return parent;
  12791. },
  12792. realWidth: function realWidth() {
  12793. return parseWidth(this.width);
  12794. },
  12795. realMinWidth: function realMinWidth() {
  12796. return parseMinWidth(this.minWidth);
  12797. },
  12798. realAlign: function realAlign() {
  12799. return this.align ? 'is-' + this.align : null;
  12800. },
  12801. realHeaderAlign: function realHeaderAlign() {
  12802. return this.headerAlign ? 'is-' + this.headerAlign : this.realAlign;
  12803. }
  12804. },
  12805. methods: {
  12806. getPropsData: function getPropsData() {
  12807. var _this = this;
  12808. for (var _len = arguments.length, props = Array(_len), _key = 0; _key < _len; _key++) {
  12809. props[_key] = arguments[_key];
  12810. }
  12811. return props.reduce(function (prev, cur) {
  12812. if (Array.isArray(cur)) {
  12813. cur.forEach(function (key) {
  12814. prev[key] = _this[key];
  12815. });
  12816. }
  12817. return prev;
  12818. }, {});
  12819. },
  12820. getColumnElIndex: function getColumnElIndex(children, child) {
  12821. return [].indexOf.call(children, child);
  12822. },
  12823. setColumnWidth: function setColumnWidth(column) {
  12824. if (this.realWidth) {
  12825. column.width = this.realWidth;
  12826. }
  12827. if (this.realMinWidth) {
  12828. column.minWidth = this.realMinWidth;
  12829. }
  12830. if (!column.minWidth) {
  12831. column.minWidth = 80;
  12832. }
  12833. column.realWidth = column.width === undefined ? column.minWidth : column.width;
  12834. return column;
  12835. },
  12836. setColumnForcedProps: function setColumnForcedProps(column) {
  12837. // 对于特定类型的 column,某些属性不允许设置
  12838. var type = column.type;
  12839. var source = cellForced[type] || {};
  12840. Object.keys(source).forEach(function (prop) {
  12841. var value = source[prop];
  12842. if (value !== undefined) {
  12843. column[prop] = prop === 'className' ? column[prop] + ' ' + value : value;
  12844. }
  12845. });
  12846. return column;
  12847. },
  12848. setColumnRenders: function setColumnRenders(column) {
  12849. var _this2 = this;
  12850. var h = this.$createElement;
  12851. // renderHeader 属性不推荐使用。
  12852. if (this.renderHeader) {
  12853. console.warn('[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.');
  12854. } else if (column.type !== 'selection') {
  12855. column.renderHeader = function (h, scope) {
  12856. var renderHeader = _this2.$scopedSlots.header;
  12857. return renderHeader ? renderHeader(scope) : column.label;
  12858. };
  12859. }
  12860. var originRenderCell = column.renderCell;
  12861. // TODO: 这里的实现调整
  12862. if (column.type === 'expand') {
  12863. // 对于展开行,renderCell 不允许配置的。在上一步中已经设置过,这里需要简单封装一下。
  12864. column.renderCell = function (h, data) {
  12865. return h(
  12866. 'div',
  12867. { 'class': 'cell' },
  12868. [originRenderCell(h, data)]
  12869. );
  12870. };
  12871. this.owner.renderExpanded = function (h, data) {
  12872. return _this2.$scopedSlots.default ? _this2.$scopedSlots.default(data) : _this2.$slots.default;
  12873. };
  12874. } else {
  12875. originRenderCell = originRenderCell || defaultRenderCell;
  12876. // 对 renderCell 进行包装
  12877. column.renderCell = function (h, data) {
  12878. var children = null;
  12879. if (_this2.$scopedSlots.default) {
  12880. children = _this2.$scopedSlots.default(data);
  12881. } else {
  12882. children = originRenderCell(h, data);
  12883. }
  12884. var prefix = treeCellPrefix(h, data);
  12885. var props = {
  12886. class: 'cell',
  12887. style: {}
  12888. };
  12889. if (column.showOverflowTooltip) {
  12890. props.class += ' el-tooltip';
  12891. props.style = { width: (data.column.realWidth || data.column.width) - 1 + 'px' };
  12892. }
  12893. return h(
  12894. 'div',
  12895. props,
  12896. [prefix, children]
  12897. );
  12898. };
  12899. }
  12900. return column;
  12901. },
  12902. registerNormalWatchers: function registerNormalWatchers() {
  12903. var _this3 = this;
  12904. var props = ['label', 'property', 'filters', 'filterMultiple', 'sortable', 'index', 'formatter', 'className', 'labelClassName', 'showOverflowTooltip'];
  12905. // 一些属性具有别名
  12906. var aliases = {
  12907. prop: 'property',
  12908. realAlign: 'align',
  12909. realHeaderAlign: 'headerAlign',
  12910. realWidth: 'width'
  12911. };
  12912. var allAliases = props.reduce(function (prev, cur) {
  12913. prev[cur] = cur;
  12914. return prev;
  12915. }, aliases);
  12916. Object.keys(allAliases).forEach(function (key) {
  12917. var columnKey = aliases[key];
  12918. _this3.$watch(key, function (newVal) {
  12919. _this3.columnConfig[columnKey] = newVal;
  12920. });
  12921. });
  12922. },
  12923. registerComplexWatchers: function registerComplexWatchers() {
  12924. var _this4 = this;
  12925. var props = ['fixed'];
  12926. var aliases = {
  12927. realWidth: 'width',
  12928. realMinWidth: 'minWidth'
  12929. };
  12930. var allAliases = props.reduce(function (prev, cur) {
  12931. prev[cur] = cur;
  12932. return prev;
  12933. }, aliases);
  12934. Object.keys(allAliases).forEach(function (key) {
  12935. var columnKey = aliases[key];
  12936. _this4.$watch(key, function (newVal) {
  12937. _this4.columnConfig[columnKey] = newVal;
  12938. var updateColumns = columnKey === 'fixed';
  12939. _this4.owner.store.scheduleLayout(updateColumns);
  12940. });
  12941. });
  12942. }
  12943. },
  12944. components: {
  12945. ElCheckbox: checkbox_default.a
  12946. },
  12947. beforeCreate: function beforeCreate() {
  12948. this.row = {};
  12949. this.column = {};
  12950. this.$index = 0;
  12951. this.columnId = '';
  12952. },
  12953. created: function created() {
  12954. var parent = this.columnOrTableParent;
  12955. this.isSubColumn = this.owner !== parent;
  12956. this.columnId = (parent.tableId || parent.columnId) + '_column_' + columnIdSeed++;
  12957. var type = this.type || 'default';
  12958. var sortable = this.sortable === '' ? true : this.sortable;
  12959. var defaults = table_column_extends({}, cellStarts[type], {
  12960. id: this.columnId,
  12961. type: type,
  12962. property: this.prop || this.property,
  12963. align: this.realAlign,
  12964. headerAlign: this.realHeaderAlign,
  12965. showOverflowTooltip: this.showOverflowTooltip || this.showTooltipWhenOverflow,
  12966. // filter 相关属性
  12967. filterable: this.filters || this.filterMethod,
  12968. filteredValue: [],
  12969. filterPlacement: '',
  12970. isColumnGroup: false,
  12971. filterOpened: false,
  12972. // sort 相关属性
  12973. sortable: sortable,
  12974. // index 列
  12975. index: this.index
  12976. });
  12977. var basicProps = ['columnKey', 'label', 'className', 'labelClassName', 'type', 'renderHeader', 'formatter', 'fixed', 'resizable'];
  12978. var sortProps = ['sortMethod', 'sortBy', 'sortOrders'];
  12979. var selectProps = ['selectable', 'reserveSelection'];
  12980. var filterProps = ['filterMethod', 'filters', 'filterMultiple', 'filterOpened', 'filteredValue', 'filterPlacement'];
  12981. var column = this.getPropsData(basicProps, sortProps, selectProps, filterProps);
  12982. column = mergeOptions(defaults, column);
  12983. // 注意 compose 中函数执行的顺序是从右到左
  12984. var chains = compose(this.setColumnRenders, this.setColumnWidth, this.setColumnForcedProps);
  12985. column = chains(column);
  12986. this.columnConfig = column;
  12987. // 注册 watcher
  12988. this.registerNormalWatchers();
  12989. this.registerComplexWatchers();
  12990. },
  12991. mounted: function mounted() {
  12992. var owner = this.owner;
  12993. var parent = this.columnOrTableParent;
  12994. var children = this.isSubColumn ? parent.$el.children : parent.$refs.hiddenColumns.children;
  12995. var columnIndex = this.getColumnElIndex(children, this.$el);
  12996. owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
  12997. },
  12998. destroyed: function destroyed() {
  12999. if (!this.$parent) return;
  13000. var parent = this.$parent;
  13001. this.owner.store.commit('removeColumn', this.columnConfig, this.isSubColumn ? parent.columnConfig : null);
  13002. },
  13003. render: function render(h) {
  13004. // slots 也要渲染,需要计算合并表头
  13005. return h('div', this.$slots.default);
  13006. }
  13007. });
  13008. // CONCATENATED MODULE: ./packages/table-column/index.js
  13009. /* istanbul ignore next */
  13010. table_column.install = function (Vue) {
  13011. Vue.component(table_column.name, table_column);
  13012. };
  13013. /* harmony default export */ var packages_table_column = (table_column);
  13014. // 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&
  13015. var pickervue_type_template_id_79ae069f_render = function() {
  13016. var _vm = this
  13017. var _h = _vm.$createElement
  13018. var _c = _vm._self._c || _h
  13019. return !_vm.ranged
  13020. ? _c(
  13021. "el-input",
  13022. _vm._b(
  13023. {
  13024. directives: [
  13025. {
  13026. name: "clickoutside",
  13027. rawName: "v-clickoutside",
  13028. value: _vm.handleClose,
  13029. expression: "handleClose"
  13030. }
  13031. ],
  13032. ref: "reference",
  13033. staticClass: "el-date-editor",
  13034. class: "el-date-editor--" + _vm.type,
  13035. attrs: {
  13036. readonly:
  13037. !_vm.editable ||
  13038. _vm.readonly ||
  13039. _vm.type === "dates" ||
  13040. _vm.type === "week",
  13041. disabled: _vm.pickerDisabled,
  13042. size: _vm.pickerSize,
  13043. name: _vm.name,
  13044. placeholder: _vm.placeholder,
  13045. value: _vm.displayValue,
  13046. validateEvent: false
  13047. },
  13048. on: {
  13049. focus: _vm.handleFocus,
  13050. input: function(value) {
  13051. return (_vm.userInput = value)
  13052. },
  13053. change: _vm.handleChange
  13054. },
  13055. nativeOn: {
  13056. keydown: function($event) {
  13057. return _vm.handleKeydown($event)
  13058. },
  13059. mouseenter: function($event) {
  13060. return _vm.handleMouseEnter($event)
  13061. },
  13062. mouseleave: function($event) {
  13063. _vm.showClose = false
  13064. }
  13065. }
  13066. },
  13067. "el-input",
  13068. _vm.firstInputId,
  13069. false
  13070. ),
  13071. [
  13072. _c("i", {
  13073. staticClass: "el-input__icon",
  13074. class: _vm.triggerClass,
  13075. attrs: { slot: "prefix" },
  13076. on: { click: _vm.handleFocus },
  13077. slot: "prefix"
  13078. }),
  13079. _vm.haveTrigger
  13080. ? _c("i", {
  13081. staticClass: "el-input__icon",
  13082. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13083. attrs: { slot: "suffix" },
  13084. on: { click: _vm.handleClickIcon },
  13085. slot: "suffix"
  13086. })
  13087. : _vm._e()
  13088. ]
  13089. )
  13090. : _c(
  13091. "div",
  13092. {
  13093. directives: [
  13094. {
  13095. name: "clickoutside",
  13096. rawName: "v-clickoutside",
  13097. value: _vm.handleClose,
  13098. expression: "handleClose"
  13099. }
  13100. ],
  13101. ref: "reference",
  13102. staticClass: "el-date-editor el-range-editor el-input__inner",
  13103. class: [
  13104. "el-date-editor--" + _vm.type,
  13105. _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
  13106. _vm.pickerDisabled ? "is-disabled" : "",
  13107. _vm.pickerVisible ? "is-active" : ""
  13108. ],
  13109. on: {
  13110. click: _vm.handleRangeClick,
  13111. mouseenter: _vm.handleMouseEnter,
  13112. mouseleave: function($event) {
  13113. _vm.showClose = false
  13114. },
  13115. keydown: _vm.handleKeydown
  13116. }
  13117. },
  13118. [
  13119. _c("i", {
  13120. class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
  13121. }),
  13122. _c(
  13123. "input",
  13124. _vm._b(
  13125. {
  13126. staticClass: "el-range-input",
  13127. attrs: {
  13128. autocomplete: "off",
  13129. placeholder: _vm.startPlaceholder,
  13130. disabled: _vm.pickerDisabled,
  13131. readonly: !_vm.editable || _vm.readonly,
  13132. name: _vm.name && _vm.name[0]
  13133. },
  13134. domProps: { value: _vm.displayValue && _vm.displayValue[0] },
  13135. on: {
  13136. input: _vm.handleStartInput,
  13137. change: _vm.handleStartChange,
  13138. focus: _vm.handleFocus
  13139. }
  13140. },
  13141. "input",
  13142. _vm.firstInputId,
  13143. false
  13144. )
  13145. ),
  13146. _vm._t("range-separator", [
  13147. _c("span", { staticClass: "el-range-separator" }, [
  13148. _vm._v(_vm._s(_vm.rangeSeparator))
  13149. ])
  13150. ]),
  13151. _c(
  13152. "input",
  13153. _vm._b(
  13154. {
  13155. staticClass: "el-range-input",
  13156. attrs: {
  13157. autocomplete: "off",
  13158. placeholder: _vm.endPlaceholder,
  13159. disabled: _vm.pickerDisabled,
  13160. readonly: !_vm.editable || _vm.readonly,
  13161. name: _vm.name && _vm.name[1]
  13162. },
  13163. domProps: { value: _vm.displayValue && _vm.displayValue[1] },
  13164. on: {
  13165. input: _vm.handleEndInput,
  13166. change: _vm.handleEndChange,
  13167. focus: _vm.handleFocus
  13168. }
  13169. },
  13170. "input",
  13171. _vm.secondInputId,
  13172. false
  13173. )
  13174. ),
  13175. _vm.haveTrigger
  13176. ? _c("i", {
  13177. staticClass: "el-input__icon el-range__close-icon",
  13178. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13179. on: { click: _vm.handleClickIcon }
  13180. })
  13181. : _vm._e()
  13182. ],
  13183. 2
  13184. )
  13185. }
  13186. var pickervue_type_template_id_79ae069f_staticRenderFns = []
  13187. pickervue_type_template_id_79ae069f_render._withStripped = true
  13188. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
  13189. // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
  13190. var date_util_ = __webpack_require__(0);
  13191. // 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&
  13192. //
  13193. //
  13194. //
  13195. //
  13196. //
  13197. //
  13198. //
  13199. //
  13200. //
  13201. //
  13202. //
  13203. //
  13204. //
  13205. //
  13206. //
  13207. //
  13208. //
  13209. //
  13210. //
  13211. //
  13212. //
  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. var NewPopper = {
  13278. props: {
  13279. appendToBody: vue_popper_default.a.props.appendToBody,
  13280. offset: vue_popper_default.a.props.offset,
  13281. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  13282. arrowOffset: vue_popper_default.a.props.arrowOffset
  13283. },
  13284. methods: vue_popper_default.a.methods,
  13285. data: function data() {
  13286. return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
  13287. },
  13288. beforeDestroy: vue_popper_default.a.beforeDestroy
  13289. };
  13290. var DEFAULT_FORMATS = {
  13291. date: 'yyyy-MM-dd',
  13292. month: 'yyyy-MM',
  13293. datetime: 'yyyy-MM-dd HH:mm:ss',
  13294. time: 'HH:mm:ss',
  13295. week: 'yyyywWW',
  13296. timerange: 'HH:mm:ss',
  13297. daterange: 'yyyy-MM-dd',
  13298. monthrange: 'yyyy-MM',
  13299. datetimerange: 'yyyy-MM-dd HH:mm:ss',
  13300. year: 'yyyy'
  13301. };
  13302. var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates'];
  13303. var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
  13304. if (format === 'timestamp') return value.getTime();
  13305. return Object(date_util_["formatDate"])(value, format);
  13306. };
  13307. var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
  13308. if (format === 'timestamp') return new Date(Number(text));
  13309. return Object(date_util_["parseDate"])(text, format);
  13310. };
  13311. var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
  13312. if (Array.isArray(value) && value.length === 2) {
  13313. var start = value[0];
  13314. var end = value[1];
  13315. if (start && end) {
  13316. return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
  13317. }
  13318. }
  13319. return '';
  13320. };
  13321. var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
  13322. if (!Array.isArray(array)) {
  13323. array = array.split(separator);
  13324. }
  13325. if (array.length === 2) {
  13326. var range1 = array[0];
  13327. var range2 = array[1];
  13328. return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
  13329. }
  13330. return [];
  13331. };
  13332. var TYPE_VALUE_RESOLVER_MAP = {
  13333. default: {
  13334. formatter: function formatter(value) {
  13335. if (!value) return '';
  13336. return '' + value;
  13337. },
  13338. parser: function parser(text) {
  13339. if (text === undefined || text === '') return null;
  13340. return text;
  13341. }
  13342. },
  13343. week: {
  13344. formatter: function formatter(value, format) {
  13345. var week = Object(date_util_["getWeekNumber"])(value);
  13346. var month = value.getMonth();
  13347. var trueDate = new Date(value);
  13348. if (week === 1 && month === 11) {
  13349. trueDate.setHours(0, 0, 0, 0);
  13350. trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
  13351. }
  13352. var date = Object(date_util_["formatDate"])(trueDate, format);
  13353. date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
  13354. return date;
  13355. },
  13356. parser: function parser(text, format) {
  13357. // parse as if a normal date
  13358. return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
  13359. }
  13360. },
  13361. date: {
  13362. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13363. parser: pickervue_type_script_lang_js_DATE_PARSER
  13364. },
  13365. datetime: {
  13366. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13367. parser: pickervue_type_script_lang_js_DATE_PARSER
  13368. },
  13369. daterange: {
  13370. formatter: RANGE_FORMATTER,
  13371. parser: RANGE_PARSER
  13372. },
  13373. monthrange: {
  13374. formatter: RANGE_FORMATTER,
  13375. parser: RANGE_PARSER
  13376. },
  13377. datetimerange: {
  13378. formatter: RANGE_FORMATTER,
  13379. parser: RANGE_PARSER
  13380. },
  13381. timerange: {
  13382. formatter: RANGE_FORMATTER,
  13383. parser: RANGE_PARSER
  13384. },
  13385. time: {
  13386. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13387. parser: pickervue_type_script_lang_js_DATE_PARSER
  13388. },
  13389. month: {
  13390. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13391. parser: pickervue_type_script_lang_js_DATE_PARSER
  13392. },
  13393. year: {
  13394. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13395. parser: pickervue_type_script_lang_js_DATE_PARSER
  13396. },
  13397. number: {
  13398. formatter: function formatter(value) {
  13399. if (!value) return '';
  13400. return '' + value;
  13401. },
  13402. parser: function parser(text) {
  13403. var result = Number(text);
  13404. if (!isNaN(text)) {
  13405. return result;
  13406. } else {
  13407. return null;
  13408. }
  13409. }
  13410. },
  13411. dates: {
  13412. formatter: function formatter(value, format) {
  13413. return value.map(function (date) {
  13414. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13415. });
  13416. },
  13417. parser: function parser(value, format) {
  13418. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13419. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13420. });
  13421. }
  13422. }
  13423. };
  13424. var PLACEMENT_MAP = {
  13425. left: 'bottom-start',
  13426. center: 'bottom',
  13427. right: 'bottom-end'
  13428. };
  13429. var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
  13430. var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  13431. if (!value) return null;
  13432. var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
  13433. var format = customFormat || DEFAULT_FORMATS[type];
  13434. return parser(value, format, rangeSeparator);
  13435. };
  13436. var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
  13437. if (!value) return null;
  13438. var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
  13439. var format = customFormat || DEFAULT_FORMATS[type];
  13440. return formatter(value, format);
  13441. };
  13442. /*
  13443. * Considers:
  13444. * 1. Date object
  13445. * 2. date string
  13446. * 3. array of 1 or 2
  13447. */
  13448. var valueEquals = function valueEquals(a, b) {
  13449. // considers Date object and string
  13450. var dateEquals = function dateEquals(a, b) {
  13451. var aIsDate = a instanceof Date;
  13452. var bIsDate = b instanceof Date;
  13453. if (aIsDate && bIsDate) {
  13454. return a.getTime() === b.getTime();
  13455. }
  13456. if (!aIsDate && !bIsDate) {
  13457. return a === b;
  13458. }
  13459. return false;
  13460. };
  13461. var aIsArray = a instanceof Array;
  13462. var bIsArray = b instanceof Array;
  13463. if (aIsArray && bIsArray) {
  13464. if (a.length !== b.length) {
  13465. return false;
  13466. }
  13467. return a.every(function (item, index) {
  13468. return dateEquals(item, b[index]);
  13469. });
  13470. }
  13471. if (!aIsArray && !bIsArray) {
  13472. return dateEquals(a, b);
  13473. }
  13474. return false;
  13475. };
  13476. var isString = function isString(val) {
  13477. return typeof val === 'string' || val instanceof String;
  13478. };
  13479. var pickervue_type_script_lang_js_validator = function validator(val) {
  13480. // either: String, Array of String, null / undefined
  13481. return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
  13482. };
  13483. /* harmony default export */ var pickervue_type_script_lang_js_ = ({
  13484. mixins: [emitter_default.a, NewPopper],
  13485. inject: {
  13486. elForm: {
  13487. default: ''
  13488. },
  13489. elFormItem: {
  13490. default: ''
  13491. }
  13492. },
  13493. props: {
  13494. size: String,
  13495. format: String,
  13496. valueFormat: String,
  13497. readonly: Boolean,
  13498. placeholder: String,
  13499. startPlaceholder: String,
  13500. endPlaceholder: String,
  13501. prefixIcon: String,
  13502. clearIcon: {
  13503. type: String,
  13504. default: 'el-icon-circle-close'
  13505. },
  13506. name: {
  13507. default: '',
  13508. validator: pickervue_type_script_lang_js_validator
  13509. },
  13510. disabled: Boolean,
  13511. clearable: {
  13512. type: Boolean,
  13513. default: true
  13514. },
  13515. id: {
  13516. default: '',
  13517. validator: pickervue_type_script_lang_js_validator
  13518. },
  13519. popperClass: String,
  13520. editable: {
  13521. type: Boolean,
  13522. default: true
  13523. },
  13524. align: {
  13525. type: String,
  13526. default: 'left'
  13527. },
  13528. value: {},
  13529. defaultValue: {},
  13530. defaultTime: {},
  13531. rangeSeparator: {
  13532. default: '-'
  13533. },
  13534. pickerOptions: {},
  13535. unlinkPanels: Boolean,
  13536. validateEvent: {
  13537. type: Boolean,
  13538. default: true
  13539. }
  13540. },
  13541. components: { ElInput: input_default.a },
  13542. directives: { Clickoutside: clickoutside_default.a },
  13543. data: function data() {
  13544. return {
  13545. pickerVisible: false,
  13546. showClose: false,
  13547. userInput: null,
  13548. valueOnOpen: null, // value when picker opens, used to determine whether to emit change
  13549. unwatchPickerOptions: null
  13550. };
  13551. },
  13552. watch: {
  13553. pickerVisible: function pickerVisible(val) {
  13554. if (this.readonly || this.pickerDisabled) return;
  13555. if (val) {
  13556. this.showPicker();
  13557. this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
  13558. } else {
  13559. this.hidePicker();
  13560. this.emitChange(this.value);
  13561. this.userInput = null;
  13562. if (this.validateEvent) {
  13563. this.dispatch('ElFormItem', 'el.form.blur');
  13564. }
  13565. this.$emit('blur', this);
  13566. this.blur();
  13567. }
  13568. },
  13569. parsedValue: {
  13570. immediate: true,
  13571. handler: function handler(val) {
  13572. if (this.picker) {
  13573. this.picker.value = val;
  13574. }
  13575. }
  13576. },
  13577. defaultValue: function defaultValue(val) {
  13578. // NOTE: should eventually move to jsx style picker + panel ?
  13579. if (this.picker) {
  13580. this.picker.defaultValue = val;
  13581. }
  13582. },
  13583. value: function value(val, oldVal) {
  13584. if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
  13585. this.dispatch('ElFormItem', 'el.form.change', val);
  13586. }
  13587. }
  13588. },
  13589. computed: {
  13590. ranged: function ranged() {
  13591. return this.type.indexOf('range') > -1;
  13592. },
  13593. reference: function reference() {
  13594. var reference = this.$refs.reference;
  13595. return reference.$el || reference;
  13596. },
  13597. refInput: function refInput() {
  13598. if (this.reference) {
  13599. return [].slice.call(this.reference.querySelectorAll('input'));
  13600. }
  13601. return [];
  13602. },
  13603. valueIsEmpty: function valueIsEmpty() {
  13604. var val = this.value;
  13605. if (Array.isArray(val)) {
  13606. for (var i = 0, len = val.length; i < len; i++) {
  13607. if (val[i]) {
  13608. return false;
  13609. }
  13610. }
  13611. } else {
  13612. if (val) {
  13613. return false;
  13614. }
  13615. }
  13616. return true;
  13617. },
  13618. triggerClass: function triggerClass() {
  13619. return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
  13620. },
  13621. selectionMode: function selectionMode() {
  13622. if (this.type === 'week') {
  13623. return 'week';
  13624. } else if (this.type === 'month') {
  13625. return 'month';
  13626. } else if (this.type === 'year') {
  13627. return 'year';
  13628. } else if (this.type === 'dates') {
  13629. return 'dates';
  13630. }
  13631. return 'day';
  13632. },
  13633. haveTrigger: function haveTrigger() {
  13634. if (typeof this.showTrigger !== 'undefined') {
  13635. return this.showTrigger;
  13636. }
  13637. return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
  13638. },
  13639. displayValue: function displayValue() {
  13640. var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
  13641. if (Array.isArray(this.userInput)) {
  13642. return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
  13643. } else if (this.userInput !== null) {
  13644. return this.userInput;
  13645. } else if (formattedValue) {
  13646. return this.type === 'dates' ? formattedValue.join(', ') : formattedValue;
  13647. } else {
  13648. return '';
  13649. }
  13650. },
  13651. parsedValue: function parsedValue() {
  13652. if (!this.value) return this.value; // component value is not set
  13653. if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
  13654. var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
  13655. if (valueIsDateObject) {
  13656. return this.value;
  13657. }
  13658. if (this.valueFormat) {
  13659. return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
  13660. }
  13661. // NOTE: deal with common but incorrect usage, should remove in next major version
  13662. // user might provide string / timestamp without value-format, coerce them into date (or array of date)
  13663. return Array.isArray(this.value) ? this.value.map(function (val) {
  13664. return new Date(val);
  13665. }) : new Date(this.value);
  13666. },
  13667. _elFormItemSize: function _elFormItemSize() {
  13668. return (this.elFormItem || {}).elFormItemSize;
  13669. },
  13670. pickerSize: function pickerSize() {
  13671. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  13672. },
  13673. pickerDisabled: function pickerDisabled() {
  13674. return this.disabled || (this.elForm || {}).disabled;
  13675. },
  13676. firstInputId: function firstInputId() {
  13677. var obj = {};
  13678. var id = void 0;
  13679. if (this.ranged) {
  13680. id = this.id && this.id[0];
  13681. } else {
  13682. id = this.id;
  13683. }
  13684. if (id) obj.id = id;
  13685. return obj;
  13686. },
  13687. secondInputId: function secondInputId() {
  13688. var obj = {};
  13689. var id = void 0;
  13690. if (this.ranged) {
  13691. id = this.id && this.id[1];
  13692. }
  13693. if (id) obj.id = id;
  13694. return obj;
  13695. }
  13696. },
  13697. created: function created() {
  13698. // vue-popper
  13699. this.popperOptions = {
  13700. boundariesPadding: 0,
  13701. gpuAcceleration: false
  13702. };
  13703. this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
  13704. this.$on('fieldReset', this.handleFieldReset);
  13705. },
  13706. methods: {
  13707. focus: function focus() {
  13708. if (!this.ranged) {
  13709. this.$refs.reference.focus();
  13710. } else {
  13711. this.handleFocus();
  13712. }
  13713. },
  13714. blur: function blur() {
  13715. this.refInput.forEach(function (input) {
  13716. return input.blur();
  13717. });
  13718. },
  13719. // {parse, formatTo} Value deals maps component value with internal Date
  13720. parseValue: function parseValue(value) {
  13721. var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
  13722. if (this.valueFormat && !isParsed) {
  13723. return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
  13724. } else {
  13725. return value;
  13726. }
  13727. },
  13728. formatToValue: function formatToValue(date) {
  13729. var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
  13730. if (this.valueFormat && isFormattable) {
  13731. return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
  13732. } else {
  13733. return date;
  13734. }
  13735. },
  13736. // {parse, formatTo} String deals with user input
  13737. parseString: function parseString(value) {
  13738. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13739. return parseAsFormatAndType(value, this.format, type);
  13740. },
  13741. formatToString: function formatToString(value) {
  13742. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13743. return formatAsFormatAndType(value, this.format, type);
  13744. },
  13745. handleMouseEnter: function handleMouseEnter() {
  13746. if (this.readonly || this.pickerDisabled) return;
  13747. if (!this.valueIsEmpty && this.clearable) {
  13748. this.showClose = true;
  13749. }
  13750. },
  13751. handleChange: function handleChange() {
  13752. if (this.userInput) {
  13753. var value = this.parseString(this.displayValue);
  13754. if (value) {
  13755. this.picker.value = value;
  13756. if (this.isValidValue(value)) {
  13757. this.emitInput(value);
  13758. this.userInput = null;
  13759. }
  13760. }
  13761. }
  13762. if (this.userInput === '') {
  13763. this.emitInput(null);
  13764. this.emitChange(null);
  13765. this.userInput = null;
  13766. }
  13767. },
  13768. handleStartInput: function handleStartInput(event) {
  13769. if (this.userInput) {
  13770. this.userInput = [event.target.value, this.userInput[1]];
  13771. } else {
  13772. this.userInput = [event.target.value, null];
  13773. }
  13774. },
  13775. handleEndInput: function handleEndInput(event) {
  13776. if (this.userInput) {
  13777. this.userInput = [this.userInput[0], event.target.value];
  13778. } else {
  13779. this.userInput = [null, event.target.value];
  13780. }
  13781. },
  13782. handleStartChange: function handleStartChange(event) {
  13783. var value = this.parseString(this.userInput && this.userInput[0]);
  13784. if (value) {
  13785. this.userInput = [this.formatToString(value), this.displayValue[1]];
  13786. var newValue = [value, this.picker.value && this.picker.value[1]];
  13787. this.picker.value = newValue;
  13788. if (this.isValidValue(newValue)) {
  13789. this.emitInput(newValue);
  13790. this.userInput = null;
  13791. }
  13792. }
  13793. },
  13794. handleEndChange: function handleEndChange(event) {
  13795. var value = this.parseString(this.userInput && this.userInput[1]);
  13796. if (value) {
  13797. this.userInput = [this.displayValue[0], this.formatToString(value)];
  13798. var newValue = [this.picker.value && this.picker.value[0], value];
  13799. this.picker.value = newValue;
  13800. if (this.isValidValue(newValue)) {
  13801. this.emitInput(newValue);
  13802. this.userInput = null;
  13803. }
  13804. }
  13805. },
  13806. handleClickIcon: function handleClickIcon(event) {
  13807. if (this.readonly || this.pickerDisabled) return;
  13808. if (this.showClose) {
  13809. this.valueOnOpen = this.value;
  13810. event.stopPropagation();
  13811. this.emitInput(null);
  13812. this.emitChange(null);
  13813. this.showClose = false;
  13814. if (this.picker && typeof this.picker.handleClear === 'function') {
  13815. this.picker.handleClear();
  13816. }
  13817. } else {
  13818. this.pickerVisible = !this.pickerVisible;
  13819. }
  13820. },
  13821. handleClose: function handleClose() {
  13822. if (!this.pickerVisible) return;
  13823. this.pickerVisible = false;
  13824. if (this.type === 'dates') {
  13825. // restore to former value
  13826. var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
  13827. this.emitInput(oldValue);
  13828. }
  13829. },
  13830. handleFieldReset: function handleFieldReset(initialValue) {
  13831. this.userInput = initialValue === '' ? null : initialValue;
  13832. },
  13833. handleFocus: function handleFocus() {
  13834. var type = this.type;
  13835. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13836. this.pickerVisible = true;
  13837. }
  13838. this.$emit('focus', this);
  13839. },
  13840. handleKeydown: function handleKeydown(event) {
  13841. var _this = this;
  13842. var keyCode = event.keyCode;
  13843. // ESC
  13844. if (keyCode === 27) {
  13845. this.pickerVisible = false;
  13846. event.stopPropagation();
  13847. return;
  13848. }
  13849. // Tab
  13850. if (keyCode === 9) {
  13851. if (!this.ranged) {
  13852. this.handleChange();
  13853. this.pickerVisible = this.picker.visible = false;
  13854. this.blur();
  13855. event.stopPropagation();
  13856. } else {
  13857. // user may change focus between two input
  13858. setTimeout(function () {
  13859. if (_this.refInput.indexOf(document.activeElement) === -1) {
  13860. _this.pickerVisible = false;
  13861. _this.blur();
  13862. event.stopPropagation();
  13863. }
  13864. }, 0);
  13865. }
  13866. return;
  13867. }
  13868. // Enter
  13869. if (keyCode === 13) {
  13870. if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
  13871. this.handleChange();
  13872. this.pickerVisible = this.picker.visible = false;
  13873. this.blur();
  13874. }
  13875. event.stopPropagation();
  13876. return;
  13877. }
  13878. // if user is typing, do not let picker handle key input
  13879. if (this.userInput) {
  13880. event.stopPropagation();
  13881. return;
  13882. }
  13883. // delegate other keys to panel
  13884. if (this.picker && this.picker.handleKeydown) {
  13885. this.picker.handleKeydown(event);
  13886. }
  13887. },
  13888. handleRangeClick: function handleRangeClick() {
  13889. var type = this.type;
  13890. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13891. this.pickerVisible = true;
  13892. }
  13893. this.$emit('focus', this);
  13894. },
  13895. hidePicker: function hidePicker() {
  13896. if (this.picker) {
  13897. this.picker.resetView && this.picker.resetView();
  13898. this.pickerVisible = this.picker.visible = false;
  13899. this.destroyPopper();
  13900. }
  13901. },
  13902. showPicker: function showPicker() {
  13903. var _this2 = this;
  13904. if (this.$isServer) return;
  13905. if (!this.picker) {
  13906. this.mountPicker();
  13907. }
  13908. this.pickerVisible = this.picker.visible = true;
  13909. this.updatePopper();
  13910. this.picker.value = this.parsedValue;
  13911. this.picker.resetView && this.picker.resetView();
  13912. this.$nextTick(function () {
  13913. _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
  13914. });
  13915. },
  13916. mountPicker: function mountPicker() {
  13917. var _this3 = this;
  13918. this.picker = new external_vue_default.a(this.panel).$mount();
  13919. this.picker.defaultValue = this.defaultValue;
  13920. this.picker.defaultTime = this.defaultTime;
  13921. this.picker.popperClass = this.popperClass;
  13922. this.popperElm = this.picker.$el;
  13923. this.picker.width = this.reference.getBoundingClientRect().width;
  13924. this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
  13925. this.picker.selectionMode = this.selectionMode;
  13926. this.picker.unlinkPanels = this.unlinkPanels;
  13927. this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
  13928. this.$watch('format', function (format) {
  13929. _this3.picker.format = format;
  13930. });
  13931. var updateOptions = function updateOptions() {
  13932. var options = _this3.pickerOptions;
  13933. if (options && options.selectableRange) {
  13934. var ranges = options.selectableRange;
  13935. var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
  13936. var format = DEFAULT_FORMATS.timerange;
  13937. ranges = Array.isArray(ranges) ? ranges : [ranges];
  13938. _this3.picker.selectableRange = ranges.map(function (range) {
  13939. return parser(range, format, _this3.rangeSeparator);
  13940. });
  13941. }
  13942. for (var option in options) {
  13943. if (options.hasOwnProperty(option) &&
  13944. // 忽略 time-picker 的该配置项
  13945. option !== 'selectableRange') {
  13946. _this3.picker[option] = options[option];
  13947. }
  13948. }
  13949. // main format must prevail over undocumented pickerOptions.format
  13950. if (_this3.format) {
  13951. _this3.picker.format = _this3.format;
  13952. }
  13953. };
  13954. updateOptions();
  13955. this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
  13956. return updateOptions();
  13957. }, { deep: true });
  13958. this.$el.appendChild(this.picker.$el);
  13959. this.picker.resetView && this.picker.resetView();
  13960. this.picker.$on('dodestroy', this.doDestroy);
  13961. this.picker.$on('pick', function () {
  13962. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  13963. var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13964. _this3.userInput = null;
  13965. _this3.pickerVisible = _this3.picker.visible = visible;
  13966. _this3.emitInput(date);
  13967. _this3.picker.resetView && _this3.picker.resetView();
  13968. });
  13969. this.picker.$on('select-range', function (start, end, pos) {
  13970. if (_this3.refInput.length === 0) return;
  13971. if (!pos || pos === 'min') {
  13972. _this3.refInput[0].setSelectionRange(start, end);
  13973. _this3.refInput[0].focus();
  13974. } else if (pos === 'max') {
  13975. _this3.refInput[1].setSelectionRange(start, end);
  13976. _this3.refInput[1].focus();
  13977. }
  13978. });
  13979. },
  13980. unmountPicker: function unmountPicker() {
  13981. if (this.picker) {
  13982. this.picker.$destroy();
  13983. this.picker.$off();
  13984. if (typeof this.unwatchPickerOptions === 'function') {
  13985. this.unwatchPickerOptions();
  13986. }
  13987. this.picker.$el.parentNode.removeChild(this.picker.$el);
  13988. }
  13989. },
  13990. emitChange: function emitChange(val) {
  13991. // determine user real change only
  13992. if (!valueEquals(val, this.valueOnOpen)) {
  13993. this.$emit('change', val);
  13994. this.valueOnOpen = val;
  13995. if (this.validateEvent) {
  13996. this.dispatch('ElFormItem', 'el.form.change', val);
  13997. }
  13998. }
  13999. },
  14000. emitInput: function emitInput(val) {
  14001. var formatted = this.formatToValue(val);
  14002. if (!valueEquals(this.value, formatted)) {
  14003. this.$emit('input', formatted);
  14004. }
  14005. },
  14006. isValidValue: function isValidValue(value) {
  14007. if (!this.picker) {
  14008. this.mountPicker();
  14009. }
  14010. if (this.picker.isValidValue) {
  14011. return value && this.picker.isValidValue(value);
  14012. } else {
  14013. return true;
  14014. }
  14015. }
  14016. }
  14017. });
  14018. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
  14019. /* harmony default export */ var src_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
  14020. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
  14021. /* normalize component */
  14022. var picker_component = normalizeComponent(
  14023. src_pickervue_type_script_lang_js_,
  14024. pickervue_type_template_id_79ae069f_render,
  14025. pickervue_type_template_id_79ae069f_staticRenderFns,
  14026. false,
  14027. null,
  14028. null,
  14029. null
  14030. )
  14031. /* hot reload */
  14032. if (false) { var picker_api; }
  14033. picker_component.options.__file = "packages/date-picker/src/picker.vue"
  14034. /* harmony default export */ var picker = (picker_component.exports);
  14035. // 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&
  14036. var datevue_type_template_id_2440d4ea_render = function() {
  14037. var _vm = this
  14038. var _h = _vm.$createElement
  14039. var _c = _vm._self._c || _h
  14040. return _c(
  14041. "transition",
  14042. {
  14043. attrs: { name: "el-zoom-in-top" },
  14044. on: { "after-enter": _vm.handleEnter, "after-leave": _vm.handleLeave }
  14045. },
  14046. [
  14047. _c(
  14048. "div",
  14049. {
  14050. directives: [
  14051. {
  14052. name: "show",
  14053. rawName: "v-show",
  14054. value: _vm.visible,
  14055. expression: "visible"
  14056. }
  14057. ],
  14058. staticClass: "el-picker-panel el-date-picker el-popper",
  14059. class: [
  14060. {
  14061. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  14062. "has-time": _vm.showTime
  14063. },
  14064. _vm.popperClass
  14065. ]
  14066. },
  14067. [
  14068. _c(
  14069. "div",
  14070. { staticClass: "el-picker-panel__body-wrapper" },
  14071. [
  14072. _vm._t("sidebar"),
  14073. _vm.shortcuts
  14074. ? _c(
  14075. "div",
  14076. { staticClass: "el-picker-panel__sidebar" },
  14077. _vm._l(_vm.shortcuts, function(shortcut, key) {
  14078. return _c(
  14079. "button",
  14080. {
  14081. key: key,
  14082. staticClass: "el-picker-panel__shortcut",
  14083. attrs: { type: "button" },
  14084. on: {
  14085. click: function($event) {
  14086. _vm.handleShortcutClick(shortcut)
  14087. }
  14088. }
  14089. },
  14090. [_vm._v(_vm._s(shortcut.text))]
  14091. )
  14092. }),
  14093. 0
  14094. )
  14095. : _vm._e(),
  14096. _c("div", { staticClass: "el-picker-panel__body" }, [
  14097. _vm.showTime
  14098. ? _c("div", { staticClass: "el-date-picker__time-header" }, [
  14099. _c(
  14100. "span",
  14101. { staticClass: "el-date-picker__editor-wrap" },
  14102. [
  14103. _c("el-input", {
  14104. attrs: {
  14105. placeholder: _vm.t("el.datepicker.selectDate"),
  14106. value: _vm.visibleDate,
  14107. size: "small"
  14108. },
  14109. on: {
  14110. input: function(val) {
  14111. return (_vm.userInputDate = val)
  14112. },
  14113. change: _vm.handleVisibleDateChange
  14114. }
  14115. })
  14116. ],
  14117. 1
  14118. ),
  14119. _c(
  14120. "span",
  14121. {
  14122. directives: [
  14123. {
  14124. name: "clickoutside",
  14125. rawName: "v-clickoutside",
  14126. value: _vm.handleTimePickClose,
  14127. expression: "handleTimePickClose"
  14128. }
  14129. ],
  14130. staticClass: "el-date-picker__editor-wrap"
  14131. },
  14132. [
  14133. _c("el-input", {
  14134. ref: "input",
  14135. attrs: {
  14136. placeholder: _vm.t("el.datepicker.selectTime"),
  14137. value: _vm.visibleTime,
  14138. size: "small"
  14139. },
  14140. on: {
  14141. focus: function($event) {
  14142. _vm.timePickerVisible = true
  14143. },
  14144. input: function(val) {
  14145. return (_vm.userInputTime = val)
  14146. },
  14147. change: _vm.handleVisibleTimeChange
  14148. }
  14149. }),
  14150. _c("time-picker", {
  14151. ref: "timepicker",
  14152. attrs: {
  14153. "time-arrow-control": _vm.arrowControl,
  14154. visible: _vm.timePickerVisible
  14155. },
  14156. on: {
  14157. pick: _vm.handleTimePick,
  14158. mounted: _vm.proxyTimePickerDataProperties
  14159. }
  14160. })
  14161. ],
  14162. 1
  14163. )
  14164. ])
  14165. : _vm._e(),
  14166. _c(
  14167. "div",
  14168. {
  14169. directives: [
  14170. {
  14171. name: "show",
  14172. rawName: "v-show",
  14173. value: _vm.currentView !== "time",
  14174. expression: "currentView !== 'time'"
  14175. }
  14176. ],
  14177. staticClass: "el-date-picker__header",
  14178. class: {
  14179. "el-date-picker__header--bordered":
  14180. _vm.currentView === "year" ||
  14181. _vm.currentView === "month"
  14182. }
  14183. },
  14184. [
  14185. _c("button", {
  14186. staticClass:
  14187. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",
  14188. attrs: {
  14189. type: "button",
  14190. "aria-label": _vm.t("el.datepicker.prevYear")
  14191. },
  14192. on: { click: _vm.prevYear }
  14193. }),
  14194. _c("button", {
  14195. directives: [
  14196. {
  14197. name: "show",
  14198. rawName: "v-show",
  14199. value: _vm.currentView === "date",
  14200. expression: "currentView === 'date'"
  14201. }
  14202. ],
  14203. staticClass:
  14204. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",
  14205. attrs: {
  14206. type: "button",
  14207. "aria-label": _vm.t("el.datepicker.prevMonth")
  14208. },
  14209. on: { click: _vm.prevMonth }
  14210. }),
  14211. _c(
  14212. "span",
  14213. {
  14214. staticClass: "el-date-picker__header-label",
  14215. attrs: { role: "button" },
  14216. on: { click: _vm.showYearPicker }
  14217. },
  14218. [_vm._v(_vm._s(_vm.yearLabel))]
  14219. ),
  14220. _c(
  14221. "span",
  14222. {
  14223. directives: [
  14224. {
  14225. name: "show",
  14226. rawName: "v-show",
  14227. value: _vm.currentView === "date",
  14228. expression: "currentView === 'date'"
  14229. }
  14230. ],
  14231. staticClass: "el-date-picker__header-label",
  14232. class: { active: _vm.currentView === "month" },
  14233. attrs: { role: "button" },
  14234. on: { click: _vm.showMonthPicker }
  14235. },
  14236. [
  14237. _vm._v(
  14238. _vm._s(_vm.t("el.datepicker.month" + (_vm.month + 1)))
  14239. )
  14240. ]
  14241. ),
  14242. _c("button", {
  14243. staticClass:
  14244. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",
  14245. attrs: {
  14246. type: "button",
  14247. "aria-label": _vm.t("el.datepicker.nextYear")
  14248. },
  14249. on: { click: _vm.nextYear }
  14250. }),
  14251. _c("button", {
  14252. directives: [
  14253. {
  14254. name: "show",
  14255. rawName: "v-show",
  14256. value: _vm.currentView === "date",
  14257. expression: "currentView === 'date'"
  14258. }
  14259. ],
  14260. staticClass:
  14261. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",
  14262. attrs: {
  14263. type: "button",
  14264. "aria-label": _vm.t("el.datepicker.nextMonth")
  14265. },
  14266. on: { click: _vm.nextMonth }
  14267. })
  14268. ]
  14269. ),
  14270. _c(
  14271. "div",
  14272. { staticClass: "el-picker-panel__content" },
  14273. [
  14274. _c("date-table", {
  14275. directives: [
  14276. {
  14277. name: "show",
  14278. rawName: "v-show",
  14279. value: _vm.currentView === "date",
  14280. expression: "currentView === 'date'"
  14281. }
  14282. ],
  14283. attrs: {
  14284. "selection-mode": _vm.selectionMode,
  14285. "first-day-of-week": _vm.firstDayOfWeek,
  14286. value: _vm.value,
  14287. "default-value": _vm.defaultValue
  14288. ? new Date(_vm.defaultValue)
  14289. : null,
  14290. date: _vm.date,
  14291. "cell-class-name": _vm.cellClassName,
  14292. "disabled-date": _vm.disabledDate
  14293. },
  14294. on: { pick: _vm.handleDatePick }
  14295. }),
  14296. _c("year-table", {
  14297. directives: [
  14298. {
  14299. name: "show",
  14300. rawName: "v-show",
  14301. value: _vm.currentView === "year",
  14302. expression: "currentView === 'year'"
  14303. }
  14304. ],
  14305. attrs: {
  14306. value: _vm.value,
  14307. "default-value": _vm.defaultValue
  14308. ? new Date(_vm.defaultValue)
  14309. : null,
  14310. date: _vm.date,
  14311. "disabled-date": _vm.disabledDate
  14312. },
  14313. on: { pick: _vm.handleYearPick }
  14314. }),
  14315. _c("month-table", {
  14316. directives: [
  14317. {
  14318. name: "show",
  14319. rawName: "v-show",
  14320. value: _vm.currentView === "month",
  14321. expression: "currentView === 'month'"
  14322. }
  14323. ],
  14324. attrs: {
  14325. value: _vm.value,
  14326. "default-value": _vm.defaultValue
  14327. ? new Date(_vm.defaultValue)
  14328. : null,
  14329. date: _vm.date,
  14330. "disabled-date": _vm.disabledDate
  14331. },
  14332. on: { pick: _vm.handleMonthPick }
  14333. })
  14334. ],
  14335. 1
  14336. )
  14337. ])
  14338. ],
  14339. 2
  14340. ),
  14341. _c(
  14342. "div",
  14343. {
  14344. directives: [
  14345. {
  14346. name: "show",
  14347. rawName: "v-show",
  14348. value: _vm.footerVisible && _vm.currentView === "date",
  14349. expression: "footerVisible && currentView === 'date'"
  14350. }
  14351. ],
  14352. staticClass: "el-picker-panel__footer"
  14353. },
  14354. [
  14355. _c(
  14356. "el-button",
  14357. {
  14358. directives: [
  14359. {
  14360. name: "show",
  14361. rawName: "v-show",
  14362. value: _vm.selectionMode !== "dates",
  14363. expression: "selectionMode !== 'dates'"
  14364. }
  14365. ],
  14366. staticClass: "el-picker-panel__link-btn",
  14367. attrs: { size: "mini", type: "text" },
  14368. on: { click: _vm.changeToNow }
  14369. },
  14370. [
  14371. _vm._v(
  14372. "\n " +
  14373. _vm._s(_vm.t("el.datepicker.now")) +
  14374. "\n "
  14375. )
  14376. ]
  14377. ),
  14378. _c(
  14379. "el-button",
  14380. {
  14381. staticClass: "el-picker-panel__link-btn",
  14382. attrs: { plain: "", size: "mini" },
  14383. on: { click: _vm.confirm }
  14384. },
  14385. [
  14386. _vm._v(
  14387. "\n " +
  14388. _vm._s(_vm.t("el.datepicker.confirm")) +
  14389. "\n "
  14390. )
  14391. ]
  14392. )
  14393. ],
  14394. 1
  14395. )
  14396. ]
  14397. )
  14398. ]
  14399. )
  14400. }
  14401. var datevue_type_template_id_2440d4ea_staticRenderFns = []
  14402. datevue_type_template_id_2440d4ea_render._withStripped = true
  14403. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=template&id=2440d4ea&
  14404. // 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&
  14405. var timevue_type_template_id_3d939089_render = function() {
  14406. var _vm = this
  14407. var _h = _vm.$createElement
  14408. var _c = _vm._self._c || _h
  14409. return _c(
  14410. "transition",
  14411. {
  14412. attrs: { name: "el-zoom-in-top" },
  14413. on: {
  14414. "after-leave": function($event) {
  14415. _vm.$emit("dodestroy")
  14416. }
  14417. }
  14418. },
  14419. [
  14420. _c(
  14421. "div",
  14422. {
  14423. directives: [
  14424. {
  14425. name: "show",
  14426. rawName: "v-show",
  14427. value: _vm.visible,
  14428. expression: "visible"
  14429. }
  14430. ],
  14431. staticClass: "el-time-panel el-popper",
  14432. class: _vm.popperClass
  14433. },
  14434. [
  14435. _c(
  14436. "div",
  14437. {
  14438. staticClass: "el-time-panel__content",
  14439. class: { "has-seconds": _vm.showSeconds }
  14440. },
  14441. [
  14442. _c("time-spinner", {
  14443. ref: "spinner",
  14444. attrs: {
  14445. "arrow-control": _vm.useArrow,
  14446. "show-seconds": _vm.showSeconds,
  14447. "am-pm-mode": _vm.amPmMode,
  14448. date: _vm.date
  14449. },
  14450. on: {
  14451. change: _vm.handleChange,
  14452. "select-range": _vm.setSelectionRange
  14453. }
  14454. })
  14455. ],
  14456. 1
  14457. ),
  14458. _c("div", { staticClass: "el-time-panel__footer" }, [
  14459. _c(
  14460. "button",
  14461. {
  14462. staticClass: "el-time-panel__btn cancel",
  14463. attrs: { type: "button" },
  14464. on: { click: _vm.handleCancel }
  14465. },
  14466. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  14467. ),
  14468. _c(
  14469. "button",
  14470. {
  14471. staticClass: "el-time-panel__btn",
  14472. class: { confirm: !_vm.disabled },
  14473. attrs: { type: "button" },
  14474. on: {
  14475. click: function($event) {
  14476. _vm.handleConfirm()
  14477. }
  14478. }
  14479. },
  14480. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  14481. )
  14482. ])
  14483. ]
  14484. )
  14485. ]
  14486. )
  14487. }
  14488. var timevue_type_template_id_3d939089_staticRenderFns = []
  14489. timevue_type_template_id_3d939089_render._withStripped = true
  14490. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
  14491. // 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&
  14492. var time_spinnervue_type_template_id_1facadeb_render = function() {
  14493. var _vm = this
  14494. var _h = _vm.$createElement
  14495. var _c = _vm._self._c || _h
  14496. return _c(
  14497. "div",
  14498. {
  14499. staticClass: "el-time-spinner",
  14500. class: { "has-seconds": _vm.showSeconds }
  14501. },
  14502. [
  14503. !_vm.arrowControl
  14504. ? [
  14505. _c(
  14506. "el-scrollbar",
  14507. {
  14508. ref: "hours",
  14509. staticClass: "el-time-spinner__wrapper",
  14510. attrs: {
  14511. "wrap-style": "max-height: inherit;",
  14512. "view-class": "el-time-spinner__list",
  14513. noresize: "",
  14514. tag: "ul"
  14515. },
  14516. nativeOn: {
  14517. mouseenter: function($event) {
  14518. _vm.emitSelectRange("hours")
  14519. },
  14520. mousemove: function($event) {
  14521. _vm.adjustCurrentSpinner("hours")
  14522. }
  14523. }
  14524. },
  14525. _vm._l(_vm.hoursList, function(disabled, hour) {
  14526. return _c(
  14527. "li",
  14528. {
  14529. key: hour,
  14530. staticClass: "el-time-spinner__item",
  14531. class: { active: hour === _vm.hours, disabled: disabled },
  14532. on: {
  14533. click: function($event) {
  14534. _vm.handleClick("hours", {
  14535. value: hour,
  14536. disabled: disabled
  14537. })
  14538. }
  14539. }
  14540. },
  14541. [
  14542. _vm._v(
  14543. _vm._s(
  14544. ("0" + (_vm.amPmMode ? hour % 12 || 12 : hour)).slice(
  14545. -2
  14546. )
  14547. ) + _vm._s(_vm.amPm(hour))
  14548. )
  14549. ]
  14550. )
  14551. }),
  14552. 0
  14553. ),
  14554. _c(
  14555. "el-scrollbar",
  14556. {
  14557. ref: "minutes",
  14558. staticClass: "el-time-spinner__wrapper",
  14559. attrs: {
  14560. "wrap-style": "max-height: inherit;",
  14561. "view-class": "el-time-spinner__list",
  14562. noresize: "",
  14563. tag: "ul"
  14564. },
  14565. nativeOn: {
  14566. mouseenter: function($event) {
  14567. _vm.emitSelectRange("minutes")
  14568. },
  14569. mousemove: function($event) {
  14570. _vm.adjustCurrentSpinner("minutes")
  14571. }
  14572. }
  14573. },
  14574. _vm._l(_vm.minutesList, function(enabled, key) {
  14575. return _c(
  14576. "li",
  14577. {
  14578. key: key,
  14579. staticClass: "el-time-spinner__item",
  14580. class: { active: key === _vm.minutes, disabled: !enabled },
  14581. on: {
  14582. click: function($event) {
  14583. _vm.handleClick("minutes", {
  14584. value: key,
  14585. disabled: false
  14586. })
  14587. }
  14588. }
  14589. },
  14590. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14591. )
  14592. }),
  14593. 0
  14594. ),
  14595. _c(
  14596. "el-scrollbar",
  14597. {
  14598. directives: [
  14599. {
  14600. name: "show",
  14601. rawName: "v-show",
  14602. value: _vm.showSeconds,
  14603. expression: "showSeconds"
  14604. }
  14605. ],
  14606. ref: "seconds",
  14607. staticClass: "el-time-spinner__wrapper",
  14608. attrs: {
  14609. "wrap-style": "max-height: inherit;",
  14610. "view-class": "el-time-spinner__list",
  14611. noresize: "",
  14612. tag: "ul"
  14613. },
  14614. nativeOn: {
  14615. mouseenter: function($event) {
  14616. _vm.emitSelectRange("seconds")
  14617. },
  14618. mousemove: function($event) {
  14619. _vm.adjustCurrentSpinner("seconds")
  14620. }
  14621. }
  14622. },
  14623. _vm._l(60, function(second, key) {
  14624. return _c(
  14625. "li",
  14626. {
  14627. key: key,
  14628. staticClass: "el-time-spinner__item",
  14629. class: { active: key === _vm.seconds },
  14630. on: {
  14631. click: function($event) {
  14632. _vm.handleClick("seconds", {
  14633. value: key,
  14634. disabled: false
  14635. })
  14636. }
  14637. }
  14638. },
  14639. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14640. )
  14641. }),
  14642. 0
  14643. )
  14644. ]
  14645. : _vm._e(),
  14646. _vm.arrowControl
  14647. ? [
  14648. _c(
  14649. "div",
  14650. {
  14651. staticClass: "el-time-spinner__wrapper is-arrow",
  14652. on: {
  14653. mouseenter: function($event) {
  14654. _vm.emitSelectRange("hours")
  14655. }
  14656. }
  14657. },
  14658. [
  14659. _c("i", {
  14660. directives: [
  14661. {
  14662. name: "repeat-click",
  14663. rawName: "v-repeat-click",
  14664. value: _vm.decrease,
  14665. expression: "decrease"
  14666. }
  14667. ],
  14668. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14669. }),
  14670. _c("i", {
  14671. directives: [
  14672. {
  14673. name: "repeat-click",
  14674. rawName: "v-repeat-click",
  14675. value: _vm.increase,
  14676. expression: "increase"
  14677. }
  14678. ],
  14679. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14680. }),
  14681. _c(
  14682. "ul",
  14683. { ref: "hours", staticClass: "el-time-spinner__list" },
  14684. _vm._l(_vm.arrowHourList, function(hour, key) {
  14685. return _c(
  14686. "li",
  14687. {
  14688. key: key,
  14689. staticClass: "el-time-spinner__item",
  14690. class: {
  14691. active: hour === _vm.hours,
  14692. disabled: _vm.hoursList[hour]
  14693. }
  14694. },
  14695. [
  14696. _vm._v(
  14697. _vm._s(
  14698. hour === undefined
  14699. ? ""
  14700. : (
  14701. "0" + (_vm.amPmMode ? hour % 12 || 12 : hour)
  14702. ).slice(-2) + _vm.amPm(hour)
  14703. )
  14704. )
  14705. ]
  14706. )
  14707. }),
  14708. 0
  14709. )
  14710. ]
  14711. ),
  14712. _c(
  14713. "div",
  14714. {
  14715. staticClass: "el-time-spinner__wrapper is-arrow",
  14716. on: {
  14717. mouseenter: function($event) {
  14718. _vm.emitSelectRange("minutes")
  14719. }
  14720. }
  14721. },
  14722. [
  14723. _c("i", {
  14724. directives: [
  14725. {
  14726. name: "repeat-click",
  14727. rawName: "v-repeat-click",
  14728. value: _vm.decrease,
  14729. expression: "decrease"
  14730. }
  14731. ],
  14732. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14733. }),
  14734. _c("i", {
  14735. directives: [
  14736. {
  14737. name: "repeat-click",
  14738. rawName: "v-repeat-click",
  14739. value: _vm.increase,
  14740. expression: "increase"
  14741. }
  14742. ],
  14743. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14744. }),
  14745. _c(
  14746. "ul",
  14747. { ref: "minutes", staticClass: "el-time-spinner__list" },
  14748. _vm._l(_vm.arrowMinuteList, function(minute, key) {
  14749. return _c(
  14750. "li",
  14751. {
  14752. key: key,
  14753. staticClass: "el-time-spinner__item",
  14754. class: { active: minute === _vm.minutes }
  14755. },
  14756. [
  14757. _vm._v(
  14758. "\n " +
  14759. _vm._s(
  14760. minute === undefined
  14761. ? ""
  14762. : ("0" + minute).slice(-2)
  14763. ) +
  14764. "\n "
  14765. )
  14766. ]
  14767. )
  14768. }),
  14769. 0
  14770. )
  14771. ]
  14772. ),
  14773. _vm.showSeconds
  14774. ? _c(
  14775. "div",
  14776. {
  14777. staticClass: "el-time-spinner__wrapper is-arrow",
  14778. on: {
  14779. mouseenter: function($event) {
  14780. _vm.emitSelectRange("seconds")
  14781. }
  14782. }
  14783. },
  14784. [
  14785. _c("i", {
  14786. directives: [
  14787. {
  14788. name: "repeat-click",
  14789. rawName: "v-repeat-click",
  14790. value: _vm.decrease,
  14791. expression: "decrease"
  14792. }
  14793. ],
  14794. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14795. }),
  14796. _c("i", {
  14797. directives: [
  14798. {
  14799. name: "repeat-click",
  14800. rawName: "v-repeat-click",
  14801. value: _vm.increase,
  14802. expression: "increase"
  14803. }
  14804. ],
  14805. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14806. }),
  14807. _c(
  14808. "ul",
  14809. { ref: "seconds", staticClass: "el-time-spinner__list" },
  14810. _vm._l(_vm.arrowSecondList, function(second, key) {
  14811. return _c(
  14812. "li",
  14813. {
  14814. key: key,
  14815. staticClass: "el-time-spinner__item",
  14816. class: { active: second === _vm.seconds }
  14817. },
  14818. [
  14819. _vm._v(
  14820. "\n " +
  14821. _vm._s(
  14822. second === undefined
  14823. ? ""
  14824. : ("0" + second).slice(-2)
  14825. ) +
  14826. "\n "
  14827. )
  14828. ]
  14829. )
  14830. }),
  14831. 0
  14832. )
  14833. ]
  14834. )
  14835. : _vm._e()
  14836. ]
  14837. : _vm._e()
  14838. ],
  14839. 2
  14840. )
  14841. }
  14842. var time_spinnervue_type_template_id_1facadeb_staticRenderFns = []
  14843. time_spinnervue_type_template_id_1facadeb_render._withStripped = true
  14844. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
  14845. // 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&
  14846. //
  14847. //
  14848. //
  14849. //
  14850. //
  14851. //
  14852. //
  14853. //
  14854. //
  14855. //
  14856. //
  14857. //
  14858. //
  14859. //
  14860. //
  14861. //
  14862. //
  14863. //
  14864. //
  14865. //
  14866. //
  14867. //
  14868. //
  14869. //
  14870. //
  14871. //
  14872. //
  14873. //
  14874. //
  14875. //
  14876. //
  14877. //
  14878. //
  14879. //
  14880. //
  14881. //
  14882. //
  14883. //
  14884. //
  14885. //
  14886. //
  14887. //
  14888. //
  14889. //
  14890. //
  14891. //
  14892. //
  14893. //
  14894. //
  14895. //
  14896. //
  14897. //
  14898. //
  14899. //
  14900. //
  14901. //
  14902. //
  14903. //
  14904. //
  14905. //
  14906. //
  14907. //
  14908. //
  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. /* harmony default export */ var time_spinnervue_type_script_lang_js_ = ({
  14949. components: { ElScrollbar: scrollbar_default.a },
  14950. directives: {
  14951. repeatClick: repeat_click
  14952. },
  14953. props: {
  14954. date: {},
  14955. defaultValue: {}, // reserved for future use
  14956. showSeconds: {
  14957. type: Boolean,
  14958. default: true
  14959. },
  14960. arrowControl: Boolean,
  14961. amPmMode: {
  14962. type: String,
  14963. default: '' // 'a': am/pm; 'A': AM/PM
  14964. }
  14965. },
  14966. computed: {
  14967. hours: function hours() {
  14968. return this.date.getHours();
  14969. },
  14970. minutes: function minutes() {
  14971. return this.date.getMinutes();
  14972. },
  14973. seconds: function seconds() {
  14974. return this.date.getSeconds();
  14975. },
  14976. hoursList: function hoursList() {
  14977. return Object(date_util_["getRangeHours"])(this.selectableRange);
  14978. },
  14979. minutesList: function minutesList() {
  14980. return Object(date_util_["getRangeMinutes"])(this.selectableRange, this.hours);
  14981. },
  14982. arrowHourList: function arrowHourList() {
  14983. var hours = this.hours;
  14984. return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
  14985. },
  14986. arrowMinuteList: function arrowMinuteList() {
  14987. var minutes = this.minutes;
  14988. return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
  14989. },
  14990. arrowSecondList: function arrowSecondList() {
  14991. var seconds = this.seconds;
  14992. return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
  14993. }
  14994. },
  14995. data: function data() {
  14996. return {
  14997. selectableRange: [],
  14998. currentScrollbar: null
  14999. };
  15000. },
  15001. mounted: function mounted() {
  15002. var _this = this;
  15003. this.$nextTick(function () {
  15004. !_this.arrowControl && _this.bindScrollEvent();
  15005. });
  15006. },
  15007. methods: {
  15008. increase: function increase() {
  15009. this.scrollDown(1);
  15010. },
  15011. decrease: function decrease() {
  15012. this.scrollDown(-1);
  15013. },
  15014. modifyDateField: function modifyDateField(type, value) {
  15015. switch (type) {
  15016. case 'hours':
  15017. this.$emit('change', Object(date_util_["modifyTime"])(this.date, value, this.minutes, this.seconds));break;
  15018. case 'minutes':
  15019. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, value, this.seconds));break;
  15020. case 'seconds':
  15021. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, this.minutes, value));break;
  15022. }
  15023. },
  15024. handleClick: function handleClick(type, _ref) {
  15025. var value = _ref.value,
  15026. disabled = _ref.disabled;
  15027. if (!disabled) {
  15028. this.modifyDateField(type, value);
  15029. this.emitSelectRange(type);
  15030. this.adjustSpinner(type, value);
  15031. }
  15032. },
  15033. emitSelectRange: function emitSelectRange(type) {
  15034. if (type === 'hours') {
  15035. this.$emit('select-range', 0, 2);
  15036. } else if (type === 'minutes') {
  15037. this.$emit('select-range', 3, 5);
  15038. } else if (type === 'seconds') {
  15039. this.$emit('select-range', 6, 8);
  15040. }
  15041. this.currentScrollbar = type;
  15042. },
  15043. bindScrollEvent: function bindScrollEvent() {
  15044. var _this2 = this;
  15045. var bindFunction = function bindFunction(type) {
  15046. _this2.$refs[type].wrap.onscroll = function (e) {
  15047. // TODO: scroll is emitted when set scrollTop programatically
  15048. // should find better solutions in the future!
  15049. _this2.handleScroll(type, e);
  15050. };
  15051. };
  15052. bindFunction('hours');
  15053. bindFunction('minutes');
  15054. bindFunction('seconds');
  15055. },
  15056. handleScroll: function handleScroll(type) {
  15057. 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);
  15058. this.modifyDateField(type, value);
  15059. },
  15060. // NOTE: used by datetime / date-range panel
  15061. // renamed from adjustScrollTop
  15062. // should try to refactory it
  15063. adjustSpinners: function adjustSpinners() {
  15064. this.adjustSpinner('hours', this.hours);
  15065. this.adjustSpinner('minutes', this.minutes);
  15066. this.adjustSpinner('seconds', this.seconds);
  15067. },
  15068. adjustCurrentSpinner: function adjustCurrentSpinner(type) {
  15069. this.adjustSpinner(type, this[type]);
  15070. },
  15071. adjustSpinner: function adjustSpinner(type, value) {
  15072. if (this.arrowControl) return;
  15073. var el = this.$refs[type].wrap;
  15074. if (el) {
  15075. el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
  15076. }
  15077. },
  15078. scrollDown: function scrollDown(step) {
  15079. var _this3 = this;
  15080. if (!this.currentScrollbar) {
  15081. this.emitSelectRange('hours');
  15082. }
  15083. var label = this.currentScrollbar;
  15084. var hoursList = this.hoursList;
  15085. var now = this[label];
  15086. if (this.currentScrollbar === 'hours') {
  15087. var total = Math.abs(step);
  15088. step = step > 0 ? 1 : -1;
  15089. var length = hoursList.length;
  15090. while (length-- && total) {
  15091. now = (now + step + hoursList.length) % hoursList.length;
  15092. if (hoursList[now]) {
  15093. continue;
  15094. }
  15095. total--;
  15096. }
  15097. if (hoursList[now]) return;
  15098. } else {
  15099. now = (now + step + 60) % 60;
  15100. }
  15101. this.modifyDateField(label, now);
  15102. this.adjustSpinner(label, now);
  15103. this.$nextTick(function () {
  15104. return _this3.emitSelectRange(_this3.currentScrollbar);
  15105. });
  15106. },
  15107. amPm: function amPm(hour) {
  15108. var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
  15109. if (!shouldShowAmPm) return '';
  15110. var isCapital = this.amPmMode === 'A';
  15111. var content = hour < 12 ? ' am' : ' pm';
  15112. if (isCapital) content = content.toUpperCase();
  15113. return content;
  15114. },
  15115. typeItemHeight: function typeItemHeight(type) {
  15116. return this.$refs[type].$el.querySelector('li').offsetHeight;
  15117. },
  15118. scrollBarHeight: function scrollBarHeight(type) {
  15119. return this.$refs[type].$el.offsetHeight;
  15120. }
  15121. }
  15122. });
  15123. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
  15124. /* harmony default export */ var basic_time_spinnervue_type_script_lang_js_ = (time_spinnervue_type_script_lang_js_);
  15125. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue
  15126. /* normalize component */
  15127. var time_spinner_component = normalizeComponent(
  15128. basic_time_spinnervue_type_script_lang_js_,
  15129. time_spinnervue_type_template_id_1facadeb_render,
  15130. time_spinnervue_type_template_id_1facadeb_staticRenderFns,
  15131. false,
  15132. null,
  15133. null,
  15134. null
  15135. )
  15136. /* hot reload */
  15137. if (false) { var time_spinner_api; }
  15138. time_spinner_component.options.__file = "packages/date-picker/src/basic/time-spinner.vue"
  15139. /* harmony default export */ var time_spinner = (time_spinner_component.exports);
  15140. // 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&
  15141. //
  15142. //
  15143. //
  15144. //
  15145. //
  15146. //
  15147. //
  15148. //
  15149. //
  15150. //
  15151. //
  15152. //
  15153. //
  15154. //
  15155. //
  15156. //
  15157. //
  15158. //
  15159. //
  15160. //
  15161. //
  15162. //
  15163. //
  15164. //
  15165. //
  15166. //
  15167. //
  15168. //
  15169. //
  15170. //
  15171. //
  15172. //
  15173. /* harmony default export */ var timevue_type_script_lang_js_ = ({
  15174. mixins: [locale_default.a],
  15175. components: {
  15176. TimeSpinner: time_spinner
  15177. },
  15178. props: {
  15179. visible: Boolean,
  15180. timeArrowControl: Boolean
  15181. },
  15182. watch: {
  15183. visible: function visible(val) {
  15184. var _this = this;
  15185. if (val) {
  15186. this.oldValue = this.value;
  15187. this.$nextTick(function () {
  15188. return _this.$refs.spinner.emitSelectRange('hours');
  15189. });
  15190. } else {
  15191. this.needInitAdjust = true;
  15192. }
  15193. },
  15194. value: function value(newVal) {
  15195. var _this2 = this;
  15196. var date = void 0;
  15197. if (newVal instanceof Date) {
  15198. date = Object(date_util_["limitTimeRange"])(newVal, this.selectableRange, this.format);
  15199. } else if (!newVal) {
  15200. date = this.defaultValue ? new Date(this.defaultValue) : new Date();
  15201. }
  15202. this.date = date;
  15203. if (this.visible && this.needInitAdjust) {
  15204. this.$nextTick(function (_) {
  15205. return _this2.adjustSpinners();
  15206. });
  15207. this.needInitAdjust = false;
  15208. }
  15209. },
  15210. selectableRange: function selectableRange(val) {
  15211. this.$refs.spinner.selectableRange = val;
  15212. },
  15213. defaultValue: function defaultValue(val) {
  15214. if (!Object(date_util_["isDate"])(this.value)) {
  15215. this.date = val ? new Date(val) : new Date();
  15216. }
  15217. }
  15218. },
  15219. data: function data() {
  15220. return {
  15221. popperClass: '',
  15222. format: 'HH:mm:ss',
  15223. value: '',
  15224. defaultValue: null,
  15225. date: new Date(),
  15226. oldValue: new Date(),
  15227. selectableRange: [],
  15228. selectionRange: [0, 2],
  15229. disabled: false,
  15230. arrowControl: false,
  15231. needInitAdjust: true
  15232. };
  15233. },
  15234. computed: {
  15235. showSeconds: function showSeconds() {
  15236. return (this.format || '').indexOf('ss') !== -1;
  15237. },
  15238. useArrow: function useArrow() {
  15239. return this.arrowControl || this.timeArrowControl || false;
  15240. },
  15241. amPmMode: function amPmMode() {
  15242. if ((this.format || '').indexOf('A') !== -1) return 'A';
  15243. if ((this.format || '').indexOf('a') !== -1) return 'a';
  15244. return '';
  15245. }
  15246. },
  15247. methods: {
  15248. handleCancel: function handleCancel() {
  15249. this.$emit('pick', this.oldValue, false);
  15250. },
  15251. handleChange: function handleChange(date) {
  15252. // this.visible avoids edge cases, when use scrolls during panel closing animation
  15253. if (this.visible) {
  15254. this.date = Object(date_util_["clearMilliseconds"])(date);
  15255. // if date is out of range, do not emit
  15256. if (this.isValidValue(this.date)) {
  15257. this.$emit('pick', this.date, true);
  15258. }
  15259. }
  15260. },
  15261. setSelectionRange: function setSelectionRange(start, end) {
  15262. this.$emit('select-range', start, end);
  15263. this.selectionRange = [start, end];
  15264. },
  15265. handleConfirm: function handleConfirm() {
  15266. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  15267. var first = arguments[1];
  15268. if (first) return;
  15269. var date = Object(date_util_["clearMilliseconds"])(Object(date_util_["limitTimeRange"])(this.date, this.selectableRange, this.format));
  15270. this.$emit('pick', date, visible, first);
  15271. },
  15272. handleKeydown: function handleKeydown(event) {
  15273. var keyCode = event.keyCode;
  15274. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  15275. // Left or Right
  15276. if (keyCode === 37 || keyCode === 39) {
  15277. var step = mapping[keyCode];
  15278. this.changeSelectionRange(step);
  15279. event.preventDefault();
  15280. return;
  15281. }
  15282. // Up or Down
  15283. if (keyCode === 38 || keyCode === 40) {
  15284. var _step = mapping[keyCode];
  15285. this.$refs.spinner.scrollDown(_step);
  15286. event.preventDefault();
  15287. return;
  15288. }
  15289. },
  15290. isValidValue: function isValidValue(date) {
  15291. return Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format);
  15292. },
  15293. adjustSpinners: function adjustSpinners() {
  15294. return this.$refs.spinner.adjustSpinners();
  15295. },
  15296. changeSelectionRange: function changeSelectionRange(step) {
  15297. var list = [0, 3].concat(this.showSeconds ? [6] : []);
  15298. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  15299. var index = list.indexOf(this.selectionRange[0]);
  15300. var next = (index + step + list.length) % list.length;
  15301. this.$refs.spinner.emitSelectRange(mapping[next]);
  15302. }
  15303. },
  15304. mounted: function mounted() {
  15305. var _this3 = this;
  15306. this.$nextTick(function () {
  15307. return _this3.handleConfirm(true, true);
  15308. });
  15309. this.$emit('mounted');
  15310. }
  15311. });
  15312. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
  15313. /* harmony default export */ var panel_timevue_type_script_lang_js_ = (timevue_type_script_lang_js_);
  15314. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue
  15315. /* normalize component */
  15316. var time_component = normalizeComponent(
  15317. panel_timevue_type_script_lang_js_,
  15318. timevue_type_template_id_3d939089_render,
  15319. timevue_type_template_id_3d939089_staticRenderFns,
  15320. false,
  15321. null,
  15322. null,
  15323. null
  15324. )
  15325. /* hot reload */
  15326. if (false) { var time_api; }
  15327. time_component.options.__file = "packages/date-picker/src/panel/time.vue"
  15328. /* harmony default export */ var panel_time = (time_component.exports);
  15329. // 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&
  15330. var year_tablevue_type_template_id_c86ab5e0_render = function() {
  15331. var _vm = this
  15332. var _h = _vm.$createElement
  15333. var _c = _vm._self._c || _h
  15334. return _c(
  15335. "table",
  15336. { staticClass: "el-year-table", on: { click: _vm.handleYearTableClick } },
  15337. [
  15338. _c("tbody", [
  15339. _c("tr", [
  15340. _c(
  15341. "td",
  15342. {
  15343. staticClass: "available",
  15344. class: _vm.getCellStyle(_vm.startYear + 0)
  15345. },
  15346. [_c("a", { staticClass: "cell" }, [_vm._v(_vm._s(_vm.startYear))])]
  15347. ),
  15348. _c(
  15349. "td",
  15350. {
  15351. staticClass: "available",
  15352. class: _vm.getCellStyle(_vm.startYear + 1)
  15353. },
  15354. [
  15355. _c("a", { staticClass: "cell" }, [
  15356. _vm._v(_vm._s(_vm.startYear + 1))
  15357. ])
  15358. ]
  15359. ),
  15360. _c(
  15361. "td",
  15362. {
  15363. staticClass: "available",
  15364. class: _vm.getCellStyle(_vm.startYear + 2)
  15365. },
  15366. [
  15367. _c("a", { staticClass: "cell" }, [
  15368. _vm._v(_vm._s(_vm.startYear + 2))
  15369. ])
  15370. ]
  15371. ),
  15372. _c(
  15373. "td",
  15374. {
  15375. staticClass: "available",
  15376. class: _vm.getCellStyle(_vm.startYear + 3)
  15377. },
  15378. [
  15379. _c("a", { staticClass: "cell" }, [
  15380. _vm._v(_vm._s(_vm.startYear + 3))
  15381. ])
  15382. ]
  15383. )
  15384. ]),
  15385. _c("tr", [
  15386. _c(
  15387. "td",
  15388. {
  15389. staticClass: "available",
  15390. class: _vm.getCellStyle(_vm.startYear + 4)
  15391. },
  15392. [
  15393. _c("a", { staticClass: "cell" }, [
  15394. _vm._v(_vm._s(_vm.startYear + 4))
  15395. ])
  15396. ]
  15397. ),
  15398. _c(
  15399. "td",
  15400. {
  15401. staticClass: "available",
  15402. class: _vm.getCellStyle(_vm.startYear + 5)
  15403. },
  15404. [
  15405. _c("a", { staticClass: "cell" }, [
  15406. _vm._v(_vm._s(_vm.startYear + 5))
  15407. ])
  15408. ]
  15409. ),
  15410. _c(
  15411. "td",
  15412. {
  15413. staticClass: "available",
  15414. class: _vm.getCellStyle(_vm.startYear + 6)
  15415. },
  15416. [
  15417. _c("a", { staticClass: "cell" }, [
  15418. _vm._v(_vm._s(_vm.startYear + 6))
  15419. ])
  15420. ]
  15421. ),
  15422. _c(
  15423. "td",
  15424. {
  15425. staticClass: "available",
  15426. class: _vm.getCellStyle(_vm.startYear + 7)
  15427. },
  15428. [
  15429. _c("a", { staticClass: "cell" }, [
  15430. _vm._v(_vm._s(_vm.startYear + 7))
  15431. ])
  15432. ]
  15433. )
  15434. ]),
  15435. _c("tr", [
  15436. _c(
  15437. "td",
  15438. {
  15439. staticClass: "available",
  15440. class: _vm.getCellStyle(_vm.startYear + 8)
  15441. },
  15442. [
  15443. _c("a", { staticClass: "cell" }, [
  15444. _vm._v(_vm._s(_vm.startYear + 8))
  15445. ])
  15446. ]
  15447. ),
  15448. _c(
  15449. "td",
  15450. {
  15451. staticClass: "available",
  15452. class: _vm.getCellStyle(_vm.startYear + 9)
  15453. },
  15454. [
  15455. _c("a", { staticClass: "cell" }, [
  15456. _vm._v(_vm._s(_vm.startYear + 9))
  15457. ])
  15458. ]
  15459. ),
  15460. _c("td"),
  15461. _c("td")
  15462. ])
  15463. ])
  15464. ]
  15465. )
  15466. }
  15467. var year_tablevue_type_template_id_c86ab5e0_staticRenderFns = []
  15468. year_tablevue_type_template_id_c86ab5e0_render._withStripped = true
  15469. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=template&id=c86ab5e0&
  15470. // 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&
  15471. //
  15472. //
  15473. //
  15474. //
  15475. //
  15476. //
  15477. //
  15478. //
  15479. //
  15480. //
  15481. //
  15482. //
  15483. //
  15484. //
  15485. //
  15486. //
  15487. //
  15488. //
  15489. //
  15490. //
  15491. //
  15492. //
  15493. //
  15494. //
  15495. //
  15496. //
  15497. //
  15498. //
  15499. //
  15500. //
  15501. //
  15502. //
  15503. //
  15504. //
  15505. //
  15506. //
  15507. //
  15508. //
  15509. //
  15510. //
  15511. //
  15512. //
  15513. //
  15514. //
  15515. //
  15516. var year_tablevue_type_script_lang_js_datesInYear = function datesInYear(year) {
  15517. var numOfDays = Object(date_util_["getDayCountOfYear"])(year);
  15518. var firstDay = new Date(year, 0, 1);
  15519. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15520. return Object(date_util_["nextDate"])(firstDay, n);
  15521. });
  15522. };
  15523. /* harmony default export */ var year_tablevue_type_script_lang_js_ = ({
  15524. props: {
  15525. disabledDate: {},
  15526. value: {},
  15527. defaultValue: {
  15528. validator: function validator(val) {
  15529. // null or valid Date Object
  15530. return val === null || val instanceof Date && Object(date_util_["isDate"])(val);
  15531. }
  15532. },
  15533. date: {}
  15534. },
  15535. computed: {
  15536. startYear: function startYear() {
  15537. return Math.floor(this.date.getFullYear() / 10) * 10;
  15538. }
  15539. },
  15540. methods: {
  15541. getCellStyle: function getCellStyle(year) {
  15542. var style = {};
  15543. var today = new Date();
  15544. style.disabled = typeof this.disabledDate === 'function' ? year_tablevue_type_script_lang_js_datesInYear(year).every(this.disabledDate) : false;
  15545. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15546. return date.getFullYear() === year;
  15547. }) >= 0;
  15548. style.today = today.getFullYear() === year;
  15549. style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
  15550. return style;
  15551. },
  15552. handleYearTableClick: function handleYearTableClick(event) {
  15553. var target = event.target;
  15554. if (target.tagName === 'A') {
  15555. if (Object(dom_["hasClass"])(target.parentNode, 'disabled')) return;
  15556. var year = target.textContent || target.innerText;
  15557. this.$emit('pick', Number(year));
  15558. }
  15559. }
  15560. }
  15561. });
  15562. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=script&lang=js&
  15563. /* harmony default export */ var basic_year_tablevue_type_script_lang_js_ = (year_tablevue_type_script_lang_js_);
  15564. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue
  15565. /* normalize component */
  15566. var year_table_component = normalizeComponent(
  15567. basic_year_tablevue_type_script_lang_js_,
  15568. year_tablevue_type_template_id_c86ab5e0_render,
  15569. year_tablevue_type_template_id_c86ab5e0_staticRenderFns,
  15570. false,
  15571. null,
  15572. null,
  15573. null
  15574. )
  15575. /* hot reload */
  15576. if (false) { var year_table_api; }
  15577. year_table_component.options.__file = "packages/date-picker/src/basic/year-table.vue"
  15578. /* harmony default export */ var year_table = (year_table_component.exports);
  15579. // 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&
  15580. var month_tablevue_type_template_id_654d4f42_render = function() {
  15581. var _vm = this
  15582. var _h = _vm.$createElement
  15583. var _c = _vm._self._c || _h
  15584. return _c(
  15585. "table",
  15586. {
  15587. staticClass: "el-month-table",
  15588. on: { click: _vm.handleMonthTableClick, mousemove: _vm.handleMouseMove }
  15589. },
  15590. [
  15591. _c(
  15592. "tbody",
  15593. _vm._l(_vm.rows, function(row, key) {
  15594. return _c(
  15595. "tr",
  15596. { key: key },
  15597. _vm._l(row, function(cell, key) {
  15598. return _c("td", { key: key, class: _vm.getCellStyle(cell) }, [
  15599. _c("div", [
  15600. _c("a", { staticClass: "cell" }, [
  15601. _vm._v(
  15602. _vm._s(
  15603. _vm.t("el.datepicker.months." + _vm.months[cell.text])
  15604. )
  15605. )
  15606. ])
  15607. ])
  15608. ])
  15609. }),
  15610. 0
  15611. )
  15612. }),
  15613. 0
  15614. )
  15615. ]
  15616. )
  15617. }
  15618. var month_tablevue_type_template_id_654d4f42_staticRenderFns = []
  15619. month_tablevue_type_template_id_654d4f42_render._withStripped = true
  15620. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=template&id=654d4f42&
  15621. // 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&
  15622. //
  15623. //
  15624. //
  15625. //
  15626. //
  15627. //
  15628. //
  15629. //
  15630. //
  15631. //
  15632. //
  15633. //
  15634. //
  15635. //
  15636. var month_tablevue_type_script_lang_js_datesInMonth = function datesInMonth(year, month) {
  15637. var numOfDays = Object(date_util_["getDayCountOfMonth"])(year, month);
  15638. var firstDay = new Date(year, month, 1);
  15639. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15640. return Object(date_util_["nextDate"])(firstDay, n);
  15641. });
  15642. };
  15643. var clearDate = function clearDate(date) {
  15644. return new Date(date.getFullYear(), date.getMonth());
  15645. };
  15646. var getMonthTimestamp = function getMonthTimestamp(time) {
  15647. if (typeof time === 'number' || typeof time === 'string') {
  15648. return clearDate(new Date(time)).getTime();
  15649. } else if (time instanceof Date) {
  15650. return clearDate(time).getTime();
  15651. } else {
  15652. return NaN;
  15653. }
  15654. };
  15655. /* harmony default export */ var month_tablevue_type_script_lang_js_ = ({
  15656. props: {
  15657. disabledDate: {},
  15658. value: {},
  15659. selectionMode: {
  15660. default: 'month'
  15661. },
  15662. minDate: {},
  15663. maxDate: {},
  15664. defaultValue: {
  15665. validator: function validator(val) {
  15666. // null or valid Date Object
  15667. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  15668. }
  15669. },
  15670. date: {},
  15671. rangeState: {
  15672. default: function _default() {
  15673. return {
  15674. endDate: null,
  15675. selecting: false
  15676. };
  15677. }
  15678. }
  15679. },
  15680. mixins: [locale_default.a],
  15681. watch: {
  15682. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  15683. this.markRange(this.minDate, newVal);
  15684. },
  15685. minDate: function minDate(newVal, oldVal) {
  15686. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15687. this.markRange(this.minDate, this.maxDate);
  15688. }
  15689. },
  15690. maxDate: function maxDate(newVal, oldVal) {
  15691. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15692. this.markRange(this.minDate, this.maxDate);
  15693. }
  15694. }
  15695. },
  15696. data: function data() {
  15697. return {
  15698. months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],
  15699. tableRows: [[], [], []],
  15700. lastRow: null,
  15701. lastColumn: null
  15702. };
  15703. },
  15704. methods: {
  15705. cellMatchesDate: function cellMatchesDate(cell, date) {
  15706. var value = new Date(date);
  15707. return this.date.getFullYear() === value.getFullYear() && Number(cell.text) === value.getMonth();
  15708. },
  15709. getCellStyle: function getCellStyle(cell) {
  15710. var _this = this;
  15711. var style = {};
  15712. var year = this.date.getFullYear();
  15713. var today = new Date();
  15714. var month = cell.text;
  15715. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  15716. style.disabled = typeof this.disabledDate === 'function' ? month_tablevue_type_script_lang_js_datesInMonth(year, month).every(this.disabledDate) : false;
  15717. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15718. return date.getFullYear() === year && date.getMonth() === month;
  15719. }) >= 0;
  15720. style.today = today.getFullYear() === year && today.getMonth() === month;
  15721. style.default = defaultValue.some(function (date) {
  15722. return _this.cellMatchesDate(cell, date);
  15723. });
  15724. if (cell.inRange) {
  15725. style['in-range'] = true;
  15726. if (cell.start) {
  15727. style['start-date'] = true;
  15728. }
  15729. if (cell.end) {
  15730. style['end-date'] = true;
  15731. }
  15732. }
  15733. return style;
  15734. },
  15735. getMonthOfCell: function getMonthOfCell(month) {
  15736. var year = this.date.getFullYear();
  15737. return new Date(year, month, 1);
  15738. },
  15739. markRange: function markRange(minDate, maxDate) {
  15740. minDate = getMonthTimestamp(minDate);
  15741. maxDate = getMonthTimestamp(maxDate) || minDate;
  15742. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  15743. minDate = _ref[0];
  15744. maxDate = _ref[1];
  15745. var rows = this.rows;
  15746. for (var i = 0, k = rows.length; i < k; i++) {
  15747. var row = rows[i];
  15748. for (var j = 0, l = row.length; j < l; j++) {
  15749. var cell = row[j];
  15750. var index = i * 4 + j;
  15751. var time = new Date(this.date.getFullYear(), index).getTime();
  15752. cell.inRange = minDate && time >= minDate && time <= maxDate;
  15753. cell.start = minDate && time === minDate;
  15754. cell.end = maxDate && time === maxDate;
  15755. }
  15756. }
  15757. },
  15758. handleMouseMove: function handleMouseMove(event) {
  15759. if (!this.rangeState.selecting) return;
  15760. var target = event.target;
  15761. if (target.tagName === 'A') {
  15762. target = target.parentNode.parentNode;
  15763. }
  15764. if (target.tagName === 'DIV') {
  15765. target = target.parentNode;
  15766. }
  15767. if (target.tagName !== 'TD') return;
  15768. var row = target.parentNode.rowIndex;
  15769. var column = target.cellIndex;
  15770. // can not select disabled date
  15771. if (this.rows[row][column].disabled) return;
  15772. // only update rangeState when mouse moves to a new cell
  15773. // this avoids frequent Date object creation and improves performance
  15774. if (row !== this.lastRow || column !== this.lastColumn) {
  15775. this.lastRow = row;
  15776. this.lastColumn = column;
  15777. this.$emit('changerange', {
  15778. minDate: this.minDate,
  15779. maxDate: this.maxDate,
  15780. rangeState: {
  15781. selecting: true,
  15782. endDate: this.getMonthOfCell(row * 4 + column)
  15783. }
  15784. });
  15785. }
  15786. },
  15787. handleMonthTableClick: function handleMonthTableClick(event) {
  15788. var target = event.target;
  15789. if (target.tagName === 'A') {
  15790. target = target.parentNode.parentNode;
  15791. }
  15792. if (target.tagName === 'DIV') {
  15793. target = target.parentNode;
  15794. }
  15795. if (target.tagName !== 'TD') return;
  15796. if (Object(dom_["hasClass"])(target, 'disabled')) return;
  15797. var column = target.cellIndex;
  15798. var row = target.parentNode.rowIndex;
  15799. var month = row * 4 + column;
  15800. var newDate = this.getMonthOfCell(month);
  15801. if (this.selectionMode === 'range') {
  15802. if (!this.rangeState.selecting) {
  15803. this.$emit('pick', { minDate: newDate, maxDate: null });
  15804. this.rangeState.selecting = true;
  15805. } else {
  15806. if (newDate >= this.minDate) {
  15807. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  15808. } else {
  15809. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  15810. }
  15811. this.rangeState.selecting = false;
  15812. }
  15813. } else {
  15814. this.$emit('pick', month);
  15815. }
  15816. }
  15817. },
  15818. computed: {
  15819. rows: function rows() {
  15820. var _this2 = this;
  15821. // TODO: refactory rows / getCellClasses
  15822. var rows = this.tableRows;
  15823. var disabledDate = this.disabledDate;
  15824. var selectedDate = [];
  15825. var now = getMonthTimestamp(new Date());
  15826. for (var i = 0; i < 3; i++) {
  15827. var row = rows[i];
  15828. var _loop = function _loop(j) {
  15829. var cell = row[j];
  15830. if (!cell) {
  15831. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  15832. }
  15833. cell.type = 'normal';
  15834. var index = i * 4 + j;
  15835. var time = new Date(_this2.date.getFullYear(), index).getTime();
  15836. cell.inRange = time >= getMonthTimestamp(_this2.minDate) && time <= getMonthTimestamp(_this2.maxDate);
  15837. cell.start = _this2.minDate && time === getMonthTimestamp(_this2.minDate);
  15838. cell.end = _this2.maxDate && time === getMonthTimestamp(_this2.maxDate);
  15839. var isToday = time === now;
  15840. if (isToday) {
  15841. cell.type = 'today';
  15842. }
  15843. cell.text = index;
  15844. var cellDate = new Date(time);
  15845. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  15846. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  15847. return date.getTime() === cellDate.getTime();
  15848. });
  15849. _this2.$set(row, j, cell);
  15850. };
  15851. for (var j = 0; j < 4; j++) {
  15852. _loop(j);
  15853. }
  15854. }
  15855. return rows;
  15856. }
  15857. }
  15858. });
  15859. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=script&lang=js&
  15860. /* harmony default export */ var basic_month_tablevue_type_script_lang_js_ = (month_tablevue_type_script_lang_js_);
  15861. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue
  15862. /* normalize component */
  15863. var month_table_component = normalizeComponent(
  15864. basic_month_tablevue_type_script_lang_js_,
  15865. month_tablevue_type_template_id_654d4f42_render,
  15866. month_tablevue_type_template_id_654d4f42_staticRenderFns,
  15867. false,
  15868. null,
  15869. null,
  15870. null
  15871. )
  15872. /* hot reload */
  15873. if (false) { var month_table_api; }
  15874. month_table_component.options.__file = "packages/date-picker/src/basic/month-table.vue"
  15875. /* harmony default export */ var month_table = (month_table_component.exports);
  15876. // 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&
  15877. var date_tablevue_type_template_id_5d1f3341_render = function() {
  15878. var _vm = this
  15879. var _h = _vm.$createElement
  15880. var _c = _vm._self._c || _h
  15881. return _c(
  15882. "table",
  15883. {
  15884. staticClass: "el-date-table",
  15885. class: { "is-week-mode": _vm.selectionMode === "week" },
  15886. attrs: { cellspacing: "0", cellpadding: "0" },
  15887. on: { click: _vm.handleClick, mousemove: _vm.handleMouseMove }
  15888. },
  15889. [
  15890. _c(
  15891. "tbody",
  15892. [
  15893. _c(
  15894. "tr",
  15895. [
  15896. _vm.showWeekNumber
  15897. ? _c("th", [_vm._v(_vm._s(_vm.t("el.datepicker.week")))])
  15898. : _vm._e(),
  15899. _vm._l(_vm.WEEKS, function(week, key) {
  15900. return _c("th", { key: key }, [
  15901. _vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))
  15902. ])
  15903. })
  15904. ],
  15905. 2
  15906. ),
  15907. _vm._l(_vm.rows, function(row, key) {
  15908. return _c(
  15909. "tr",
  15910. {
  15911. key: key,
  15912. staticClass: "el-date-table__row",
  15913. class: { current: _vm.isWeekActive(row[1]) }
  15914. },
  15915. _vm._l(row, function(cell, key) {
  15916. return _c("td", { key: key, class: _vm.getCellClasses(cell) }, [
  15917. _c("div", [
  15918. _c("span", [
  15919. _vm._v("\n " + _vm._s(cell.text) + "\n ")
  15920. ])
  15921. ])
  15922. ])
  15923. }),
  15924. 0
  15925. )
  15926. })
  15927. ],
  15928. 2
  15929. )
  15930. ]
  15931. )
  15932. }
  15933. var date_tablevue_type_template_id_5d1f3341_staticRenderFns = []
  15934. date_tablevue_type_template_id_5d1f3341_render._withStripped = true
  15935. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=template&id=5d1f3341&
  15936. // 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&
  15937. //
  15938. //
  15939. //
  15940. //
  15941. //
  15942. //
  15943. //
  15944. //
  15945. //
  15946. //
  15947. //
  15948. //
  15949. //
  15950. //
  15951. //
  15952. //
  15953. //
  15954. //
  15955. //
  15956. //
  15957. //
  15958. //
  15959. //
  15960. //
  15961. //
  15962. //
  15963. //
  15964. //
  15965. //
  15966. //
  15967. //
  15968. //
  15969. //
  15970. var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
  15971. var date_tablevue_type_script_lang_js_getDateTimestamp = function getDateTimestamp(time) {
  15972. if (typeof time === 'number' || typeof time === 'string') {
  15973. return Object(date_util_["clearTime"])(new Date(time)).getTime();
  15974. } else if (time instanceof Date) {
  15975. return Object(date_util_["clearTime"])(time).getTime();
  15976. } else {
  15977. return NaN;
  15978. }
  15979. };
  15980. // remove the first element that satisfies `pred` from arr
  15981. // return a new array if modification occurs
  15982. // return the original array otherwise
  15983. var date_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  15984. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  15985. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  15986. };
  15987. /* harmony default export */ var date_tablevue_type_script_lang_js_ = ({
  15988. mixins: [locale_default.a],
  15989. props: {
  15990. firstDayOfWeek: {
  15991. default: 7,
  15992. type: Number,
  15993. validator: function validator(val) {
  15994. return val >= 1 && val <= 7;
  15995. }
  15996. },
  15997. value: {},
  15998. defaultValue: {
  15999. validator: function validator(val) {
  16000. // either: null, valid Date object, Array of valid Date objects
  16001. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  16002. }
  16003. },
  16004. date: {},
  16005. selectionMode: {
  16006. default: 'day'
  16007. },
  16008. showWeekNumber: {
  16009. type: Boolean,
  16010. default: false
  16011. },
  16012. disabledDate: {},
  16013. cellClassName: {},
  16014. minDate: {},
  16015. maxDate: {},
  16016. rangeState: {
  16017. default: function _default() {
  16018. return {
  16019. endDate: null,
  16020. selecting: false
  16021. };
  16022. }
  16023. }
  16024. },
  16025. computed: {
  16026. offsetDay: function offsetDay() {
  16027. var week = this.firstDayOfWeek;
  16028. // 周日为界限,左右偏移的天数,3217654 例如周一就是 -1,目的是调整前两行日期的位置
  16029. return week > 3 ? 7 - week : -week;
  16030. },
  16031. WEEKS: function WEEKS() {
  16032. var week = this.firstDayOfWeek;
  16033. return _WEEKS.concat(_WEEKS).slice(week, week + 7);
  16034. },
  16035. year: function year() {
  16036. return this.date.getFullYear();
  16037. },
  16038. month: function month() {
  16039. return this.date.getMonth();
  16040. },
  16041. startDate: function startDate() {
  16042. return Object(date_util_["getStartDateOfMonth"])(this.year, this.month);
  16043. },
  16044. rows: function rows() {
  16045. var _this = this;
  16046. // TODO: refactory rows / getCellClasses
  16047. var date = new Date(this.year, this.month, 1);
  16048. var day = Object(date_util_["getFirstDayOfMonth"])(date); // day of first day
  16049. var dateCountOfMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth());
  16050. var dateCountOfLastMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
  16051. day = day === 0 ? 7 : day;
  16052. var offset = this.offsetDay;
  16053. var rows = this.tableRows;
  16054. var count = 1;
  16055. var startDate = this.startDate;
  16056. var disabledDate = this.disabledDate;
  16057. var cellClassName = this.cellClassName;
  16058. var selectedDate = this.selectionMode === 'dates' ? Object(util_["coerceTruthyValueToArray"])(this.value) : [];
  16059. var now = date_tablevue_type_script_lang_js_getDateTimestamp(new Date());
  16060. for (var i = 0; i < 6; i++) {
  16061. var row = rows[i];
  16062. if (this.showWeekNumber) {
  16063. if (!row[0]) {
  16064. row[0] = { type: 'week', text: Object(date_util_["getWeekNumber"])(Object(date_util_["nextDate"])(startDate, i * 7 + 1)) };
  16065. }
  16066. }
  16067. var _loop = function _loop(j) {
  16068. var cell = row[_this.showWeekNumber ? j + 1 : j];
  16069. if (!cell) {
  16070. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  16071. }
  16072. cell.type = 'normal';
  16073. var index = i * 7 + j;
  16074. var time = Object(date_util_["nextDate"])(startDate, index - offset).getTime();
  16075. cell.inRange = time >= date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate) && time <= date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16076. cell.start = _this.minDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate);
  16077. cell.end = _this.maxDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16078. var isToday = time === now;
  16079. if (isToday) {
  16080. cell.type = 'today';
  16081. }
  16082. if (i >= 0 && i <= 1) {
  16083. var numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
  16084. if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
  16085. cell.text = count++;
  16086. } else {
  16087. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
  16088. cell.type = 'prev-month';
  16089. }
  16090. } else {
  16091. if (count <= dateCountOfMonth) {
  16092. cell.text = count++;
  16093. } else {
  16094. cell.text = count++ - dateCountOfMonth;
  16095. cell.type = 'next-month';
  16096. }
  16097. }
  16098. var cellDate = new Date(time);
  16099. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  16100. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  16101. return date.getTime() === cellDate.getTime();
  16102. });
  16103. cell.customClass = typeof cellClassName === 'function' && cellClassName(cellDate);
  16104. _this.$set(row, _this.showWeekNumber ? j + 1 : j, cell);
  16105. };
  16106. for (var j = 0; j < 7; j++) {
  16107. _loop(j);
  16108. }
  16109. if (this.selectionMode === 'week') {
  16110. var start = this.showWeekNumber ? 1 : 0;
  16111. var end = this.showWeekNumber ? 7 : 6;
  16112. var isWeekActive = this.isWeekActive(row[start + 1]);
  16113. row[start].inRange = isWeekActive;
  16114. row[start].start = isWeekActive;
  16115. row[end].inRange = isWeekActive;
  16116. row[end].end = isWeekActive;
  16117. }
  16118. }
  16119. return rows;
  16120. }
  16121. },
  16122. watch: {
  16123. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  16124. this.markRange(this.minDate, newVal);
  16125. },
  16126. minDate: function minDate(newVal, oldVal) {
  16127. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16128. this.markRange(this.minDate, this.maxDate);
  16129. }
  16130. },
  16131. maxDate: function maxDate(newVal, oldVal) {
  16132. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16133. this.markRange(this.minDate, this.maxDate);
  16134. }
  16135. }
  16136. },
  16137. data: function data() {
  16138. return {
  16139. tableRows: [[], [], [], [], [], []],
  16140. lastRow: null,
  16141. lastColumn: null
  16142. };
  16143. },
  16144. methods: {
  16145. cellMatchesDate: function cellMatchesDate(cell, date) {
  16146. var value = new Date(date);
  16147. return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
  16148. },
  16149. getCellClasses: function getCellClasses(cell) {
  16150. var _this2 = this;
  16151. var selectionMode = this.selectionMode;
  16152. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  16153. var classes = [];
  16154. if ((cell.type === 'normal' || cell.type === 'today') && !cell.disabled) {
  16155. classes.push('available');
  16156. if (cell.type === 'today') {
  16157. classes.push('today');
  16158. }
  16159. } else {
  16160. classes.push(cell.type);
  16161. }
  16162. if (cell.type === 'normal' && defaultValue.some(function (date) {
  16163. return _this2.cellMatchesDate(cell, date);
  16164. })) {
  16165. classes.push('default');
  16166. }
  16167. if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) {
  16168. classes.push('current');
  16169. }
  16170. if (cell.inRange && (cell.type === 'normal' || cell.type === 'today' || this.selectionMode === 'week')) {
  16171. classes.push('in-range');
  16172. if (cell.start) {
  16173. classes.push('start-date');
  16174. }
  16175. if (cell.end) {
  16176. classes.push('end-date');
  16177. }
  16178. }
  16179. if (cell.disabled) {
  16180. classes.push('disabled');
  16181. }
  16182. if (cell.selected) {
  16183. classes.push('selected');
  16184. }
  16185. if (cell.customClass) {
  16186. classes.push(cell.customClass);
  16187. }
  16188. return classes.join(' ');
  16189. },
  16190. getDateOfCell: function getDateOfCell(row, column) {
  16191. var offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
  16192. return Object(date_util_["nextDate"])(this.startDate, offsetFromStart);
  16193. },
  16194. isWeekActive: function isWeekActive(cell) {
  16195. if (this.selectionMode !== 'week') return false;
  16196. var newDate = new Date(this.year, this.month, 1);
  16197. var year = newDate.getFullYear();
  16198. var month = newDate.getMonth();
  16199. if (cell.type === 'prev-month') {
  16200. newDate.setMonth(month === 0 ? 11 : month - 1);
  16201. newDate.setFullYear(month === 0 ? year - 1 : year);
  16202. }
  16203. if (cell.type === 'next-month') {
  16204. newDate.setMonth(month === 11 ? 0 : month + 1);
  16205. newDate.setFullYear(month === 11 ? year + 1 : year);
  16206. }
  16207. newDate.setDate(parseInt(cell.text, 10));
  16208. if (Object(date_util_["isDate"])(this.value)) {
  16209. var dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
  16210. var weekDate = Object(date_util_["prevDate"])(this.value, dayOffset);
  16211. return weekDate.getTime() === newDate.getTime();
  16212. }
  16213. return false;
  16214. },
  16215. markRange: function markRange(minDate, maxDate) {
  16216. minDate = date_tablevue_type_script_lang_js_getDateTimestamp(minDate);
  16217. maxDate = date_tablevue_type_script_lang_js_getDateTimestamp(maxDate) || minDate;
  16218. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  16219. minDate = _ref[0];
  16220. maxDate = _ref[1];
  16221. var startDate = this.startDate;
  16222. var rows = this.rows;
  16223. for (var i = 0, k = rows.length; i < k; i++) {
  16224. var row = rows[i];
  16225. for (var j = 0, l = row.length; j < l; j++) {
  16226. if (this.showWeekNumber && j === 0) continue;
  16227. var _cell = row[j];
  16228. var index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
  16229. var time = Object(date_util_["nextDate"])(startDate, index - this.offsetDay).getTime();
  16230. _cell.inRange = minDate && time >= minDate && time <= maxDate;
  16231. _cell.start = minDate && time === minDate;
  16232. _cell.end = maxDate && time === maxDate;
  16233. }
  16234. }
  16235. },
  16236. handleMouseMove: function handleMouseMove(event) {
  16237. if (!this.rangeState.selecting) return;
  16238. var target = event.target;
  16239. if (target.tagName === 'SPAN') {
  16240. target = target.parentNode.parentNode;
  16241. }
  16242. if (target.tagName === 'DIV') {
  16243. target = target.parentNode;
  16244. }
  16245. if (target.tagName !== 'TD') return;
  16246. var row = target.parentNode.rowIndex - 1;
  16247. var column = target.cellIndex;
  16248. // can not select disabled date
  16249. if (this.rows[row][column].disabled) return;
  16250. // only update rangeState when mouse moves to a new cell
  16251. // this avoids frequent Date object creation and improves performance
  16252. if (row !== this.lastRow || column !== this.lastColumn) {
  16253. this.lastRow = row;
  16254. this.lastColumn = column;
  16255. this.$emit('changerange', {
  16256. minDate: this.minDate,
  16257. maxDate: this.maxDate,
  16258. rangeState: {
  16259. selecting: true,
  16260. endDate: this.getDateOfCell(row, column)
  16261. }
  16262. });
  16263. }
  16264. },
  16265. handleClick: function handleClick(event) {
  16266. var target = event.target;
  16267. if (target.tagName === 'SPAN') {
  16268. target = target.parentNode.parentNode;
  16269. }
  16270. if (target.tagName === 'DIV') {
  16271. target = target.parentNode;
  16272. }
  16273. if (target.tagName !== 'TD') return;
  16274. var row = target.parentNode.rowIndex - 1;
  16275. var column = this.selectionMode === 'week' ? 1 : target.cellIndex;
  16276. var cell = this.rows[row][column];
  16277. if (cell.disabled || cell.type === 'week') return;
  16278. var newDate = this.getDateOfCell(row, column);
  16279. if (this.selectionMode === 'range') {
  16280. if (!this.rangeState.selecting) {
  16281. this.$emit('pick', { minDate: newDate, maxDate: null });
  16282. this.rangeState.selecting = true;
  16283. } else {
  16284. if (newDate >= this.minDate) {
  16285. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  16286. } else {
  16287. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  16288. }
  16289. this.rangeState.selecting = false;
  16290. }
  16291. } else if (this.selectionMode === 'day') {
  16292. this.$emit('pick', newDate);
  16293. } else if (this.selectionMode === 'week') {
  16294. var weekNumber = Object(date_util_["getWeekNumber"])(newDate);
  16295. var value = newDate.getFullYear() + 'w' + weekNumber;
  16296. this.$emit('pick', {
  16297. year: newDate.getFullYear(),
  16298. week: weekNumber,
  16299. value: value,
  16300. date: newDate
  16301. });
  16302. } else if (this.selectionMode === 'dates') {
  16303. var _value = this.value || [];
  16304. var newValue = cell.selected ? date_tablevue_type_script_lang_js_removeFromArray(_value, function (date) {
  16305. return date.getTime() === newDate.getTime();
  16306. }) : [].concat(_value, [newDate]);
  16307. this.$emit('pick', newValue);
  16308. }
  16309. }
  16310. }
  16311. });
  16312. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=script&lang=js&
  16313. /* harmony default export */ var basic_date_tablevue_type_script_lang_js_ = (date_tablevue_type_script_lang_js_);
  16314. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue
  16315. /* normalize component */
  16316. var date_table_component = normalizeComponent(
  16317. basic_date_tablevue_type_script_lang_js_,
  16318. date_tablevue_type_template_id_5d1f3341_render,
  16319. date_tablevue_type_template_id_5d1f3341_staticRenderFns,
  16320. false,
  16321. null,
  16322. null,
  16323. null
  16324. )
  16325. /* hot reload */
  16326. if (false) { var date_table_api; }
  16327. date_table_component.options.__file = "packages/date-picker/src/basic/date-table.vue"
  16328. /* harmony default export */ var date_table = (date_table_component.exports);
  16329. // 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&
  16330. //
  16331. //
  16332. //
  16333. //
  16334. //
  16335. //
  16336. //
  16337. //
  16338. //
  16339. //
  16340. //
  16341. //
  16342. //
  16343. //
  16344. //
  16345. //
  16346. //
  16347. //
  16348. //
  16349. //
  16350. //
  16351. //
  16352. //
  16353. //
  16354. //
  16355. //
  16356. //
  16357. //
  16358. //
  16359. //
  16360. //
  16361. //
  16362. //
  16363. //
  16364. //
  16365. //
  16366. //
  16367. //
  16368. //
  16369. //
  16370. //
  16371. //
  16372. //
  16373. //
  16374. //
  16375. //
  16376. //
  16377. //
  16378. //
  16379. //
  16380. //
  16381. //
  16382. //
  16383. //
  16384. //
  16385. //
  16386. //
  16387. //
  16388. //
  16389. //
  16390. //
  16391. //
  16392. //
  16393. //
  16394. //
  16395. //
  16396. //
  16397. //
  16398. //
  16399. //
  16400. //
  16401. //
  16402. //
  16403. //
  16404. //
  16405. //
  16406. //
  16407. //
  16408. //
  16409. //
  16410. //
  16411. //
  16412. //
  16413. //
  16414. //
  16415. //
  16416. //
  16417. //
  16418. //
  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. /* harmony default export */ var datevue_type_script_lang_js_ = ({
  16475. mixins: [locale_default.a],
  16476. directives: { Clickoutside: clickoutside_default.a },
  16477. watch: {
  16478. showTime: function showTime(val) {
  16479. var _this = this;
  16480. /* istanbul ignore if */
  16481. if (!val) return;
  16482. this.$nextTick(function (_) {
  16483. var inputElm = _this.$refs.input.$el;
  16484. if (inputElm) {
  16485. _this.pickerWidth = inputElm.getBoundingClientRect().width + 10;
  16486. }
  16487. });
  16488. },
  16489. value: function value(val) {
  16490. if (this.selectionMode === 'dates' && this.value) return;
  16491. if (Object(date_util_["isDate"])(val)) {
  16492. this.date = new Date(val);
  16493. } else {
  16494. this.date = this.getDefaultValue();
  16495. }
  16496. },
  16497. defaultValue: function defaultValue(val) {
  16498. if (!Object(date_util_["isDate"])(this.value)) {
  16499. this.date = val ? new Date(val) : new Date();
  16500. }
  16501. },
  16502. timePickerVisible: function timePickerVisible(val) {
  16503. var _this2 = this;
  16504. if (val) this.$nextTick(function () {
  16505. return _this2.$refs.timepicker.adjustSpinners();
  16506. });
  16507. },
  16508. selectionMode: function selectionMode(newVal) {
  16509. if (newVal === 'month') {
  16510. /* istanbul ignore next */
  16511. if (this.currentView !== 'year' || this.currentView !== 'month') {
  16512. this.currentView = 'month';
  16513. }
  16514. } else if (newVal === 'dates') {
  16515. this.currentView = 'date';
  16516. }
  16517. }
  16518. },
  16519. methods: {
  16520. proxyTimePickerDataProperties: function proxyTimePickerDataProperties() {
  16521. var _this3 = this;
  16522. var format = function format(timeFormat) {
  16523. _this3.$refs.timepicker.format = timeFormat;
  16524. };
  16525. var value = function value(_value) {
  16526. _this3.$refs.timepicker.value = _value;
  16527. };
  16528. var date = function date(_date) {
  16529. _this3.$refs.timepicker.date = _date;
  16530. };
  16531. var selectableRange = function selectableRange(_selectableRange) {
  16532. _this3.$refs.timepicker.selectableRange = _selectableRange;
  16533. };
  16534. this.$watch('value', value);
  16535. this.$watch('date', date);
  16536. this.$watch('selectableRange', selectableRange);
  16537. format(this.timeFormat);
  16538. value(this.value);
  16539. date(this.date);
  16540. selectableRange(this.selectableRange);
  16541. },
  16542. handleClear: function handleClear() {
  16543. this.date = this.getDefaultValue();
  16544. this.$emit('pick', null);
  16545. },
  16546. emit: function emit(value) {
  16547. var _this4 = this;
  16548. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  16549. args[_key - 1] = arguments[_key];
  16550. }
  16551. if (!value) {
  16552. this.$emit.apply(this, ['pick', value].concat(args));
  16553. } else if (Array.isArray(value)) {
  16554. var dates = value.map(function (date) {
  16555. return _this4.showTime ? Object(date_util_["clearMilliseconds"])(date) : Object(date_util_["clearTime"])(date);
  16556. });
  16557. this.$emit.apply(this, ['pick', dates].concat(args));
  16558. } else {
  16559. this.$emit.apply(this, ['pick', this.showTime ? Object(date_util_["clearMilliseconds"])(value) : Object(date_util_["clearTime"])(value)].concat(args));
  16560. }
  16561. this.userInputDate = null;
  16562. this.userInputTime = null;
  16563. },
  16564. // resetDate() {
  16565. // this.date = new Date(this.date);
  16566. // },
  16567. showMonthPicker: function showMonthPicker() {
  16568. this.currentView = 'month';
  16569. },
  16570. showYearPicker: function showYearPicker() {
  16571. this.currentView = 'year';
  16572. },
  16573. // XXX: 没用到
  16574. // handleLabelClick() {
  16575. // if (this.currentView === 'date') {
  16576. // this.showMonthPicker();
  16577. // } else if (this.currentView === 'month') {
  16578. // this.showYearPicker();
  16579. // }
  16580. // },
  16581. prevMonth: function prevMonth() {
  16582. this.date = Object(date_util_["prevMonth"])(this.date);
  16583. },
  16584. nextMonth: function nextMonth() {
  16585. this.date = Object(date_util_["nextMonth"])(this.date);
  16586. },
  16587. prevYear: function prevYear() {
  16588. if (this.currentView === 'year') {
  16589. this.date = Object(date_util_["prevYear"])(this.date, 10);
  16590. } else {
  16591. this.date = Object(date_util_["prevYear"])(this.date);
  16592. }
  16593. },
  16594. nextYear: function nextYear() {
  16595. if (this.currentView === 'year') {
  16596. this.date = Object(date_util_["nextYear"])(this.date, 10);
  16597. } else {
  16598. this.date = Object(date_util_["nextYear"])(this.date);
  16599. }
  16600. },
  16601. handleShortcutClick: function handleShortcutClick(shortcut) {
  16602. if (shortcut.onClick) {
  16603. shortcut.onClick(this);
  16604. }
  16605. },
  16606. handleTimePick: function handleTimePick(value, visible, first) {
  16607. if (Object(date_util_["isDate"])(value)) {
  16608. var newDate = this.value ? Object(date_util_["modifyTime"])(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16609. this.date = newDate;
  16610. this.emit(this.date, true);
  16611. } else {
  16612. this.emit(value, true);
  16613. }
  16614. if (!first) {
  16615. this.timePickerVisible = visible;
  16616. }
  16617. },
  16618. handleTimePickClose: function handleTimePickClose() {
  16619. this.timePickerVisible = false;
  16620. },
  16621. handleMonthPick: function handleMonthPick(month) {
  16622. if (this.selectionMode === 'month') {
  16623. this.date = Object(date_util_["modifyDate"])(this.date, this.year, month, 1);
  16624. this.emit(this.date);
  16625. } else {
  16626. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, this.year, month);
  16627. // TODO: should emit intermediate value ??
  16628. // this.emit(this.date);
  16629. this.currentView = 'date';
  16630. }
  16631. },
  16632. handleDatePick: function handleDatePick(value) {
  16633. if (this.selectionMode === 'day') {
  16634. var newDate = this.value ? Object(date_util_["modifyDate"])(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : Object(date_util_["modifyWithTimeString"])(value, this.defaultTime);
  16635. // change default time while out of selectableRange
  16636. if (!this.checkDateWithinRange(newDate)) {
  16637. newDate = Object(date_util_["modifyDate"])(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
  16638. }
  16639. this.date = newDate;
  16640. this.emit(this.date, this.showTime);
  16641. } else if (this.selectionMode === 'week') {
  16642. this.emit(value.date);
  16643. } else if (this.selectionMode === 'dates') {
  16644. this.emit(value, true); // set false to keep panel open
  16645. }
  16646. },
  16647. handleYearPick: function handleYearPick(year) {
  16648. if (this.selectionMode === 'year') {
  16649. this.date = Object(date_util_["modifyDate"])(this.date, year, 0, 1);
  16650. this.emit(this.date);
  16651. } else {
  16652. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, year, this.month);
  16653. // TODO: should emit intermediate value ??
  16654. // this.emit(this.date, true);
  16655. this.currentView = 'month';
  16656. }
  16657. },
  16658. changeToNow: function changeToNow() {
  16659. // NOTE: not a permanent solution
  16660. // consider disable "now" button in the future
  16661. if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
  16662. this.date = new Date();
  16663. this.emit(this.date);
  16664. }
  16665. },
  16666. confirm: function confirm() {
  16667. if (this.selectionMode === 'dates') {
  16668. this.emit(this.value);
  16669. } else {
  16670. // value were emitted in handle{Date,Time}Pick, nothing to update here
  16671. // deal with the scenario where: user opens the picker, then confirm without doing anything
  16672. var value = this.value ? this.value : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16673. this.date = new Date(value); // refresh date
  16674. this.emit(value);
  16675. }
  16676. },
  16677. resetView: function resetView() {
  16678. if (this.selectionMode === 'month') {
  16679. this.currentView = 'month';
  16680. } else if (this.selectionMode === 'year') {
  16681. this.currentView = 'year';
  16682. } else {
  16683. this.currentView = 'date';
  16684. }
  16685. },
  16686. handleEnter: function handleEnter() {
  16687. document.body.addEventListener('keydown', this.handleKeydown);
  16688. },
  16689. handleLeave: function handleLeave() {
  16690. this.$emit('dodestroy');
  16691. document.body.removeEventListener('keydown', this.handleKeydown);
  16692. },
  16693. handleKeydown: function handleKeydown(event) {
  16694. var keyCode = event.keyCode;
  16695. var list = [38, 40, 37, 39];
  16696. if (this.visible && !this.timePickerVisible) {
  16697. if (list.indexOf(keyCode) !== -1) {
  16698. this.handleKeyControl(keyCode);
  16699. event.stopPropagation();
  16700. event.preventDefault();
  16701. }
  16702. if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) {
  16703. // Enter
  16704. this.emit(this.date, false);
  16705. }
  16706. }
  16707. },
  16708. handleKeyControl: function handleKeyControl(keyCode) {
  16709. var mapping = {
  16710. 'year': {
  16711. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16712. return date.setFullYear(date.getFullYear() + step);
  16713. }
  16714. },
  16715. 'month': {
  16716. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16717. return date.setMonth(date.getMonth() + step);
  16718. }
  16719. },
  16720. 'week': {
  16721. 38: -1, 40: 1, 37: -1, 39: 1, offset: function offset(date, step) {
  16722. return date.setDate(date.getDate() + step * 7);
  16723. }
  16724. },
  16725. 'day': {
  16726. 38: -7, 40: 7, 37: -1, 39: 1, offset: function offset(date, step) {
  16727. return date.setDate(date.getDate() + step);
  16728. }
  16729. }
  16730. };
  16731. var mode = this.selectionMode;
  16732. var year = 3.1536e10;
  16733. var now = this.date.getTime();
  16734. var newDate = new Date(this.date.getTime());
  16735. while (Math.abs(now - newDate.getTime()) <= year) {
  16736. var map = mapping[mode];
  16737. map.offset(newDate, map[keyCode]);
  16738. if (typeof this.disabledDate === 'function' && this.disabledDate(newDate)) {
  16739. continue;
  16740. }
  16741. this.date = newDate;
  16742. this.$emit('pick', newDate, true);
  16743. break;
  16744. }
  16745. },
  16746. handleVisibleTimeChange: function handleVisibleTimeChange(value) {
  16747. var time = Object(date_util_["parseDate"])(value, this.timeFormat);
  16748. if (time && this.checkDateWithinRange(time)) {
  16749. this.date = Object(date_util_["modifyDate"])(time, this.year, this.month, this.monthDate);
  16750. this.userInputTime = null;
  16751. this.$refs.timepicker.value = this.date;
  16752. this.timePickerVisible = false;
  16753. this.emit(this.date, true);
  16754. }
  16755. },
  16756. handleVisibleDateChange: function handleVisibleDateChange(value) {
  16757. var date = Object(date_util_["parseDate"])(value, this.dateFormat);
  16758. if (date) {
  16759. if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
  16760. return;
  16761. }
  16762. this.date = Object(date_util_["modifyTime"])(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
  16763. this.userInputDate = null;
  16764. this.resetView();
  16765. this.emit(this.date, true);
  16766. }
  16767. },
  16768. isValidValue: function isValidValue(value) {
  16769. return value && !isNaN(value) && (typeof this.disabledDate === 'function' ? !this.disabledDate(value) : true) && this.checkDateWithinRange(value);
  16770. },
  16771. getDefaultValue: function getDefaultValue() {
  16772. // if default-value is set, return it
  16773. // otherwise, return now (the moment this method gets called)
  16774. return this.defaultValue ? new Date(this.defaultValue) : new Date();
  16775. },
  16776. checkDateWithinRange: function checkDateWithinRange(date) {
  16777. return this.selectableRange.length > 0 ? Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format || 'HH:mm:ss') : true;
  16778. }
  16779. },
  16780. components: {
  16781. TimePicker: panel_time, YearTable: year_table, MonthTable: month_table, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a
  16782. },
  16783. data: function data() {
  16784. return {
  16785. popperClass: '',
  16786. date: new Date(),
  16787. value: '',
  16788. defaultValue: null, // use getDefaultValue() for time computation
  16789. defaultTime: null,
  16790. showTime: false,
  16791. selectionMode: 'day',
  16792. shortcuts: '',
  16793. visible: false,
  16794. currentView: 'date',
  16795. disabledDate: '',
  16796. cellClassName: '',
  16797. selectableRange: [],
  16798. firstDayOfWeek: 7,
  16799. showWeekNumber: false,
  16800. timePickerVisible: false,
  16801. format: '',
  16802. arrowControl: false,
  16803. userInputDate: null,
  16804. userInputTime: null
  16805. };
  16806. },
  16807. computed: {
  16808. year: function year() {
  16809. return this.date.getFullYear();
  16810. },
  16811. month: function month() {
  16812. return this.date.getMonth();
  16813. },
  16814. week: function week() {
  16815. return Object(date_util_["getWeekNumber"])(this.date);
  16816. },
  16817. monthDate: function monthDate() {
  16818. return this.date.getDate();
  16819. },
  16820. footerVisible: function footerVisible() {
  16821. return this.showTime || this.selectionMode === 'dates';
  16822. },
  16823. visibleTime: function visibleTime() {
  16824. if (this.userInputTime !== null) {
  16825. return this.userInputTime;
  16826. } else {
  16827. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.timeFormat);
  16828. }
  16829. },
  16830. visibleDate: function visibleDate() {
  16831. if (this.userInputDate !== null) {
  16832. return this.userInputDate;
  16833. } else {
  16834. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.dateFormat);
  16835. }
  16836. },
  16837. yearLabel: function yearLabel() {
  16838. var yearTranslation = this.t('el.datepicker.year');
  16839. if (this.currentView === 'year') {
  16840. var startYear = Math.floor(this.year / 10) * 10;
  16841. if (yearTranslation) {
  16842. return startYear + ' ' + yearTranslation + ' - ' + (startYear + 9) + ' ' + yearTranslation;
  16843. }
  16844. return startYear + ' - ' + (startYear + 9);
  16845. }
  16846. return this.year + ' ' + yearTranslation;
  16847. },
  16848. timeFormat: function timeFormat() {
  16849. if (this.format) {
  16850. return Object(date_util_["extractTimeFormat"])(this.format);
  16851. } else {
  16852. return 'HH:mm:ss';
  16853. }
  16854. },
  16855. dateFormat: function dateFormat() {
  16856. if (this.format) {
  16857. return Object(date_util_["extractDateFormat"])(this.format);
  16858. } else {
  16859. return 'yyyy-MM-dd';
  16860. }
  16861. }
  16862. }
  16863. });
  16864. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=script&lang=js&
  16865. /* harmony default export */ var panel_datevue_type_script_lang_js_ = (datevue_type_script_lang_js_);
  16866. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue
  16867. /* normalize component */
  16868. var date_component = normalizeComponent(
  16869. panel_datevue_type_script_lang_js_,
  16870. datevue_type_template_id_2440d4ea_render,
  16871. datevue_type_template_id_2440d4ea_staticRenderFns,
  16872. false,
  16873. null,
  16874. null,
  16875. null
  16876. )
  16877. /* hot reload */
  16878. if (false) { var date_api; }
  16879. date_component.options.__file = "packages/date-picker/src/panel/date.vue"
  16880. /* harmony default export */ var panel_date = (date_component.exports);
  16881. // 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&
  16882. var date_rangevue_type_template_id_2652849a_render = function() {
  16883. var _vm = this
  16884. var _h = _vm.$createElement
  16885. var _c = _vm._self._c || _h
  16886. return _c(
  16887. "transition",
  16888. {
  16889. attrs: { name: "el-zoom-in-top" },
  16890. on: {
  16891. "after-leave": function($event) {
  16892. _vm.$emit("dodestroy")
  16893. }
  16894. }
  16895. },
  16896. [
  16897. _c(
  16898. "div",
  16899. {
  16900. directives: [
  16901. {
  16902. name: "show",
  16903. rawName: "v-show",
  16904. value: _vm.visible,
  16905. expression: "visible"
  16906. }
  16907. ],
  16908. staticClass: "el-picker-panel el-date-range-picker el-popper",
  16909. class: [
  16910. {
  16911. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  16912. "has-time": _vm.showTime
  16913. },
  16914. _vm.popperClass
  16915. ]
  16916. },
  16917. [
  16918. _c(
  16919. "div",
  16920. { staticClass: "el-picker-panel__body-wrapper" },
  16921. [
  16922. _vm._t("sidebar"),
  16923. _vm.shortcuts
  16924. ? _c(
  16925. "div",
  16926. { staticClass: "el-picker-panel__sidebar" },
  16927. _vm._l(_vm.shortcuts, function(shortcut, key) {
  16928. return _c(
  16929. "button",
  16930. {
  16931. key: key,
  16932. staticClass: "el-picker-panel__shortcut",
  16933. attrs: { type: "button" },
  16934. on: {
  16935. click: function($event) {
  16936. _vm.handleShortcutClick(shortcut)
  16937. }
  16938. }
  16939. },
  16940. [_vm._v(_vm._s(shortcut.text))]
  16941. )
  16942. }),
  16943. 0
  16944. )
  16945. : _vm._e(),
  16946. _c("div", { staticClass: "el-picker-panel__body" }, [
  16947. _vm.showTime
  16948. ? _c(
  16949. "div",
  16950. { staticClass: "el-date-range-picker__time-header" },
  16951. [
  16952. _c(
  16953. "span",
  16954. { staticClass: "el-date-range-picker__editors-wrap" },
  16955. [
  16956. _c(
  16957. "span",
  16958. {
  16959. staticClass:
  16960. "el-date-range-picker__time-picker-wrap"
  16961. },
  16962. [
  16963. _c("el-input", {
  16964. ref: "minInput",
  16965. staticClass: "el-date-range-picker__editor",
  16966. attrs: {
  16967. size: "small",
  16968. disabled: _vm.rangeState.selecting,
  16969. placeholder: _vm.t(
  16970. "el.datepicker.startDate"
  16971. ),
  16972. value: _vm.minVisibleDate
  16973. },
  16974. on: {
  16975. input: function(val) {
  16976. return _vm.handleDateInput(val, "min")
  16977. },
  16978. change: function(val) {
  16979. return _vm.handleDateChange(val, "min")
  16980. }
  16981. }
  16982. })
  16983. ],
  16984. 1
  16985. ),
  16986. _c(
  16987. "span",
  16988. {
  16989. directives: [
  16990. {
  16991. name: "clickoutside",
  16992. rawName: "v-clickoutside",
  16993. value: _vm.handleMinTimeClose,
  16994. expression: "handleMinTimeClose"
  16995. }
  16996. ],
  16997. staticClass:
  16998. "el-date-range-picker__time-picker-wrap"
  16999. },
  17000. [
  17001. _c("el-input", {
  17002. staticClass: "el-date-range-picker__editor",
  17003. attrs: {
  17004. size: "small",
  17005. disabled: _vm.rangeState.selecting,
  17006. placeholder: _vm.t(
  17007. "el.datepicker.startTime"
  17008. ),
  17009. value: _vm.minVisibleTime
  17010. },
  17011. on: {
  17012. focus: function($event) {
  17013. _vm.minTimePickerVisible = true
  17014. },
  17015. input: function(val) {
  17016. return _vm.handleTimeInput(val, "min")
  17017. },
  17018. change: function(val) {
  17019. return _vm.handleTimeChange(val, "min")
  17020. }
  17021. }
  17022. }),
  17023. _c("time-picker", {
  17024. ref: "minTimePicker",
  17025. attrs: {
  17026. "time-arrow-control": _vm.arrowControl,
  17027. visible: _vm.minTimePickerVisible
  17028. },
  17029. on: {
  17030. pick: _vm.handleMinTimePick,
  17031. mounted: function($event) {
  17032. _vm.$refs.minTimePicker.format =
  17033. _vm.timeFormat
  17034. }
  17035. }
  17036. })
  17037. ],
  17038. 1
  17039. )
  17040. ]
  17041. ),
  17042. _c("span", { staticClass: "el-icon-arrow-right" }),
  17043. _c(
  17044. "span",
  17045. {
  17046. staticClass:
  17047. "el-date-range-picker__editors-wrap is-right"
  17048. },
  17049. [
  17050. _c(
  17051. "span",
  17052. {
  17053. staticClass:
  17054. "el-date-range-picker__time-picker-wrap"
  17055. },
  17056. [
  17057. _c("el-input", {
  17058. staticClass: "el-date-range-picker__editor",
  17059. attrs: {
  17060. size: "small",
  17061. disabled: _vm.rangeState.selecting,
  17062. placeholder: _vm.t("el.datepicker.endDate"),
  17063. value: _vm.maxVisibleDate,
  17064. readonly: !_vm.minDate
  17065. },
  17066. on: {
  17067. input: function(val) {
  17068. return _vm.handleDateInput(val, "max")
  17069. },
  17070. change: function(val) {
  17071. return _vm.handleDateChange(val, "max")
  17072. }
  17073. }
  17074. })
  17075. ],
  17076. 1
  17077. ),
  17078. _c(
  17079. "span",
  17080. {
  17081. directives: [
  17082. {
  17083. name: "clickoutside",
  17084. rawName: "v-clickoutside",
  17085. value: _vm.handleMaxTimeClose,
  17086. expression: "handleMaxTimeClose"
  17087. }
  17088. ],
  17089. staticClass:
  17090. "el-date-range-picker__time-picker-wrap"
  17091. },
  17092. [
  17093. _c("el-input", {
  17094. staticClass: "el-date-range-picker__editor",
  17095. attrs: {
  17096. size: "small",
  17097. disabled: _vm.rangeState.selecting,
  17098. placeholder: _vm.t("el.datepicker.endTime"),
  17099. value: _vm.maxVisibleTime,
  17100. readonly: !_vm.minDate
  17101. },
  17102. on: {
  17103. focus: function($event) {
  17104. _vm.minDate &&
  17105. (_vm.maxTimePickerVisible = true)
  17106. },
  17107. input: function(val) {
  17108. return _vm.handleTimeInput(val, "max")
  17109. },
  17110. change: function(val) {
  17111. return _vm.handleTimeChange(val, "max")
  17112. }
  17113. }
  17114. }),
  17115. _c("time-picker", {
  17116. ref: "maxTimePicker",
  17117. attrs: {
  17118. "time-arrow-control": _vm.arrowControl,
  17119. visible: _vm.maxTimePickerVisible
  17120. },
  17121. on: {
  17122. pick: _vm.handleMaxTimePick,
  17123. mounted: function($event) {
  17124. _vm.$refs.maxTimePicker.format =
  17125. _vm.timeFormat
  17126. }
  17127. }
  17128. })
  17129. ],
  17130. 1
  17131. )
  17132. ]
  17133. )
  17134. ]
  17135. )
  17136. : _vm._e(),
  17137. _c(
  17138. "div",
  17139. {
  17140. staticClass:
  17141. "el-picker-panel__content el-date-range-picker__content is-left"
  17142. },
  17143. [
  17144. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17145. _c("button", {
  17146. staticClass:
  17147. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17148. attrs: { type: "button" },
  17149. on: { click: _vm.leftPrevYear }
  17150. }),
  17151. _c("button", {
  17152. staticClass:
  17153. "el-picker-panel__icon-btn el-icon-arrow-left",
  17154. attrs: { type: "button" },
  17155. on: { click: _vm.leftPrevMonth }
  17156. }),
  17157. _vm.unlinkPanels
  17158. ? _c("button", {
  17159. staticClass:
  17160. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17161. class: { "is-disabled": !_vm.enableYearArrow },
  17162. attrs: {
  17163. type: "button",
  17164. disabled: !_vm.enableYearArrow
  17165. },
  17166. on: { click: _vm.leftNextYear }
  17167. })
  17168. : _vm._e(),
  17169. _vm.unlinkPanels
  17170. ? _c("button", {
  17171. staticClass:
  17172. "el-picker-panel__icon-btn el-icon-arrow-right",
  17173. class: { "is-disabled": !_vm.enableMonthArrow },
  17174. attrs: {
  17175. type: "button",
  17176. disabled: !_vm.enableMonthArrow
  17177. },
  17178. on: { click: _vm.leftNextMonth }
  17179. })
  17180. : _vm._e(),
  17181. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  17182. ]),
  17183. _c("date-table", {
  17184. attrs: {
  17185. "selection-mode": "range",
  17186. date: _vm.leftDate,
  17187. "default-value": _vm.defaultValue,
  17188. "min-date": _vm.minDate,
  17189. "max-date": _vm.maxDate,
  17190. "range-state": _vm.rangeState,
  17191. "disabled-date": _vm.disabledDate,
  17192. "cell-class-name": _vm.cellClassName,
  17193. "first-day-of-week": _vm.firstDayOfWeek
  17194. },
  17195. on: {
  17196. changerange: _vm.handleChangeRange,
  17197. pick: _vm.handleRangePick
  17198. }
  17199. })
  17200. ],
  17201. 1
  17202. ),
  17203. _c(
  17204. "div",
  17205. {
  17206. staticClass:
  17207. "el-picker-panel__content el-date-range-picker__content is-right"
  17208. },
  17209. [
  17210. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17211. _vm.unlinkPanels
  17212. ? _c("button", {
  17213. staticClass:
  17214. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17215. class: { "is-disabled": !_vm.enableYearArrow },
  17216. attrs: {
  17217. type: "button",
  17218. disabled: !_vm.enableYearArrow
  17219. },
  17220. on: { click: _vm.rightPrevYear }
  17221. })
  17222. : _vm._e(),
  17223. _vm.unlinkPanels
  17224. ? _c("button", {
  17225. staticClass:
  17226. "el-picker-panel__icon-btn el-icon-arrow-left",
  17227. class: { "is-disabled": !_vm.enableMonthArrow },
  17228. attrs: {
  17229. type: "button",
  17230. disabled: !_vm.enableMonthArrow
  17231. },
  17232. on: { click: _vm.rightPrevMonth }
  17233. })
  17234. : _vm._e(),
  17235. _c("button", {
  17236. staticClass:
  17237. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17238. attrs: { type: "button" },
  17239. on: { click: _vm.rightNextYear }
  17240. }),
  17241. _c("button", {
  17242. staticClass:
  17243. "el-picker-panel__icon-btn el-icon-arrow-right",
  17244. attrs: { type: "button" },
  17245. on: { click: _vm.rightNextMonth }
  17246. }),
  17247. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  17248. ]),
  17249. _c("date-table", {
  17250. attrs: {
  17251. "selection-mode": "range",
  17252. date: _vm.rightDate,
  17253. "default-value": _vm.defaultValue,
  17254. "min-date": _vm.minDate,
  17255. "max-date": _vm.maxDate,
  17256. "range-state": _vm.rangeState,
  17257. "disabled-date": _vm.disabledDate,
  17258. "cell-class-name": _vm.cellClassName,
  17259. "first-day-of-week": _vm.firstDayOfWeek
  17260. },
  17261. on: {
  17262. changerange: _vm.handleChangeRange,
  17263. pick: _vm.handleRangePick
  17264. }
  17265. })
  17266. ],
  17267. 1
  17268. )
  17269. ])
  17270. ],
  17271. 2
  17272. ),
  17273. _vm.showTime
  17274. ? _c(
  17275. "div",
  17276. { staticClass: "el-picker-panel__footer" },
  17277. [
  17278. _c(
  17279. "el-button",
  17280. {
  17281. staticClass: "el-picker-panel__link-btn",
  17282. attrs: { size: "mini", type: "text" },
  17283. on: { click: _vm.handleClear }
  17284. },
  17285. [
  17286. _vm._v(
  17287. "\n " +
  17288. _vm._s(_vm.t("el.datepicker.clear")) +
  17289. "\n "
  17290. )
  17291. ]
  17292. ),
  17293. _c(
  17294. "el-button",
  17295. {
  17296. staticClass: "el-picker-panel__link-btn",
  17297. attrs: {
  17298. plain: "",
  17299. size: "mini",
  17300. disabled: _vm.btnDisabled
  17301. },
  17302. on: {
  17303. click: function($event) {
  17304. _vm.handleConfirm(false)
  17305. }
  17306. }
  17307. },
  17308. [
  17309. _vm._v(
  17310. "\n " +
  17311. _vm._s(_vm.t("el.datepicker.confirm")) +
  17312. "\n "
  17313. )
  17314. ]
  17315. )
  17316. ],
  17317. 1
  17318. )
  17319. : _vm._e()
  17320. ]
  17321. )
  17322. ]
  17323. )
  17324. }
  17325. var date_rangevue_type_template_id_2652849a_staticRenderFns = []
  17326. date_rangevue_type_template_id_2652849a_render._withStripped = true
  17327. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=template&id=2652849a&
  17328. // 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&
  17329. //
  17330. //
  17331. //
  17332. //
  17333. //
  17334. //
  17335. //
  17336. //
  17337. //
  17338. //
  17339. //
  17340. //
  17341. //
  17342. //
  17343. //
  17344. //
  17345. //
  17346. //
  17347. //
  17348. //
  17349. //
  17350. //
  17351. //
  17352. //
  17353. //
  17354. //
  17355. //
  17356. //
  17357. //
  17358. //
  17359. //
  17360. //
  17361. //
  17362. //
  17363. //
  17364. //
  17365. //
  17366. //
  17367. //
  17368. //
  17369. //
  17370. //
  17371. //
  17372. //
  17373. //
  17374. //
  17375. //
  17376. //
  17377. //
  17378. //
  17379. //
  17380. //
  17381. //
  17382. //
  17383. //
  17384. //
  17385. //
  17386. //
  17387. //
  17388. //
  17389. //
  17390. //
  17391. //
  17392. //
  17393. //
  17394. //
  17395. //
  17396. //
  17397. //
  17398. //
  17399. //
  17400. //
  17401. //
  17402. //
  17403. //
  17404. //
  17405. //
  17406. //
  17407. //
  17408. //
  17409. //
  17410. //
  17411. //
  17412. //
  17413. //
  17414. //
  17415. //
  17416. //
  17417. //
  17418. //
  17419. //
  17420. //
  17421. //
  17422. //
  17423. //
  17424. //
  17425. //
  17426. //
  17427. //
  17428. //
  17429. //
  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. var date_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  17519. if (Array.isArray(defaultValue)) {
  17520. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  17521. } else if (defaultValue) {
  17522. return [new Date(defaultValue), Object(date_util_["nextDate"])(new Date(defaultValue), 1)];
  17523. } else {
  17524. return [new Date(), Object(date_util_["nextDate"])(new Date(), 1)];
  17525. }
  17526. };
  17527. /* harmony default export */ var date_rangevue_type_script_lang_js_ = ({
  17528. mixins: [locale_default.a],
  17529. directives: { Clickoutside: clickoutside_default.a },
  17530. computed: {
  17531. btnDisabled: function btnDisabled() {
  17532. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  17533. },
  17534. leftLabel: function leftLabel() {
  17535. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.leftDate.getMonth() + 1));
  17536. },
  17537. rightLabel: function rightLabel() {
  17538. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.rightDate.getMonth() + 1));
  17539. },
  17540. leftYear: function leftYear() {
  17541. return this.leftDate.getFullYear();
  17542. },
  17543. leftMonth: function leftMonth() {
  17544. return this.leftDate.getMonth();
  17545. },
  17546. leftMonthDate: function leftMonthDate() {
  17547. return this.leftDate.getDate();
  17548. },
  17549. rightYear: function rightYear() {
  17550. return this.rightDate.getFullYear();
  17551. },
  17552. rightMonth: function rightMonth() {
  17553. return this.rightDate.getMonth();
  17554. },
  17555. rightMonthDate: function rightMonthDate() {
  17556. return this.rightDate.getDate();
  17557. },
  17558. minVisibleDate: function minVisibleDate() {
  17559. if (this.dateUserInput.min !== null) return this.dateUserInput.min;
  17560. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.dateFormat);
  17561. return '';
  17562. },
  17563. maxVisibleDate: function maxVisibleDate() {
  17564. if (this.dateUserInput.max !== null) return this.dateUserInput.max;
  17565. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.dateFormat);
  17566. return '';
  17567. },
  17568. minVisibleTime: function minVisibleTime() {
  17569. if (this.timeUserInput.min !== null) return this.timeUserInput.min;
  17570. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.timeFormat);
  17571. return '';
  17572. },
  17573. maxVisibleTime: function maxVisibleTime() {
  17574. if (this.timeUserInput.max !== null) return this.timeUserInput.max;
  17575. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.timeFormat);
  17576. return '';
  17577. },
  17578. timeFormat: function timeFormat() {
  17579. if (this.format) {
  17580. return Object(date_util_["extractTimeFormat"])(this.format);
  17581. } else {
  17582. return 'HH:mm:ss';
  17583. }
  17584. },
  17585. dateFormat: function dateFormat() {
  17586. if (this.format) {
  17587. return Object(date_util_["extractDateFormat"])(this.format);
  17588. } else {
  17589. return 'yyyy-MM-dd';
  17590. }
  17591. },
  17592. enableMonthArrow: function enableMonthArrow() {
  17593. var nextMonth = (this.leftMonth + 1) % 12;
  17594. var yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
  17595. return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
  17596. },
  17597. enableYearArrow: function enableYearArrow() {
  17598. return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
  17599. }
  17600. },
  17601. data: function data() {
  17602. return {
  17603. popperClass: '',
  17604. value: [],
  17605. defaultValue: null,
  17606. defaultTime: null,
  17607. minDate: '',
  17608. maxDate: '',
  17609. leftDate: new Date(),
  17610. rightDate: Object(date_util_["nextMonth"])(new Date()),
  17611. rangeState: {
  17612. endDate: null,
  17613. selecting: false,
  17614. row: null,
  17615. column: null
  17616. },
  17617. showTime: false,
  17618. shortcuts: '',
  17619. visible: '',
  17620. disabledDate: '',
  17621. cellClassName: '',
  17622. firstDayOfWeek: 7,
  17623. minTimePickerVisible: false,
  17624. maxTimePickerVisible: false,
  17625. format: '',
  17626. arrowControl: false,
  17627. unlinkPanels: false,
  17628. dateUserInput: {
  17629. min: null,
  17630. max: null
  17631. },
  17632. timeUserInput: {
  17633. min: null,
  17634. max: null
  17635. }
  17636. };
  17637. },
  17638. watch: {
  17639. minDate: function minDate(val) {
  17640. var _this = this;
  17641. this.dateUserInput.min = null;
  17642. this.timeUserInput.min = null;
  17643. this.$nextTick(function () {
  17644. if (_this.$refs.maxTimePicker && _this.maxDate && _this.maxDate < _this.minDate) {
  17645. var format = 'HH:mm:ss';
  17646. _this.$refs.maxTimePicker.selectableRange = [[Object(date_util_["parseDate"])(Object(date_util_["formatDate"])(_this.minDate, format), format), Object(date_util_["parseDate"])('23:59:59', format)]];
  17647. }
  17648. });
  17649. if (val && this.$refs.minTimePicker) {
  17650. this.$refs.minTimePicker.date = val;
  17651. this.$refs.minTimePicker.value = val;
  17652. }
  17653. },
  17654. maxDate: function maxDate(val) {
  17655. this.dateUserInput.max = null;
  17656. this.timeUserInput.max = null;
  17657. if (val && this.$refs.maxTimePicker) {
  17658. this.$refs.maxTimePicker.date = val;
  17659. this.$refs.maxTimePicker.value = val;
  17660. }
  17661. },
  17662. minTimePickerVisible: function minTimePickerVisible(val) {
  17663. var _this2 = this;
  17664. if (val) {
  17665. this.$nextTick(function () {
  17666. _this2.$refs.minTimePicker.date = _this2.minDate;
  17667. _this2.$refs.minTimePicker.value = _this2.minDate;
  17668. _this2.$refs.minTimePicker.adjustSpinners();
  17669. });
  17670. }
  17671. },
  17672. maxTimePickerVisible: function maxTimePickerVisible(val) {
  17673. var _this3 = this;
  17674. if (val) {
  17675. this.$nextTick(function () {
  17676. _this3.$refs.maxTimePicker.date = _this3.maxDate;
  17677. _this3.$refs.maxTimePicker.value = _this3.maxDate;
  17678. _this3.$refs.maxTimePicker.adjustSpinners();
  17679. });
  17680. }
  17681. },
  17682. value: function value(newVal) {
  17683. if (!newVal) {
  17684. this.minDate = null;
  17685. this.maxDate = null;
  17686. } else if (Array.isArray(newVal)) {
  17687. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  17688. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  17689. if (this.minDate) {
  17690. this.leftDate = this.minDate;
  17691. if (this.unlinkPanels && this.maxDate) {
  17692. var minDateYear = this.minDate.getFullYear();
  17693. var minDateMonth = this.minDate.getMonth();
  17694. var maxDateYear = this.maxDate.getFullYear();
  17695. var maxDateMonth = this.maxDate.getMonth();
  17696. this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? Object(date_util_["nextMonth"])(this.maxDate) : this.maxDate;
  17697. } else {
  17698. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17699. }
  17700. } else {
  17701. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17702. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17703. }
  17704. }
  17705. },
  17706. defaultValue: function defaultValue(val) {
  17707. if (!Array.isArray(this.value)) {
  17708. var _calcDefaultValue = date_rangevue_type_script_lang_js_calcDefaultValue(val),
  17709. left = _calcDefaultValue[0],
  17710. right = _calcDefaultValue[1];
  17711. this.leftDate = left;
  17712. this.rightDate = val && val[1] && this.unlinkPanels ? right : Object(date_util_["nextMonth"])(this.leftDate);
  17713. }
  17714. }
  17715. },
  17716. methods: {
  17717. handleClear: function handleClear() {
  17718. this.minDate = null;
  17719. this.maxDate = null;
  17720. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17721. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17722. this.$emit('pick', null);
  17723. },
  17724. handleChangeRange: function handleChangeRange(val) {
  17725. this.minDate = val.minDate;
  17726. this.maxDate = val.maxDate;
  17727. this.rangeState = val.rangeState;
  17728. },
  17729. handleDateInput: function handleDateInput(value, type) {
  17730. this.dateUserInput[type] = value;
  17731. if (value.length !== this.dateFormat.length) return;
  17732. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17733. if (parsedValue) {
  17734. if (typeof this.disabledDate === 'function' && this.disabledDate(new Date(parsedValue))) {
  17735. return;
  17736. }
  17737. if (type === 'min') {
  17738. this.minDate = Object(date_util_["modifyDate"])(this.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17739. this.leftDate = new Date(parsedValue);
  17740. if (!this.unlinkPanels) {
  17741. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17742. }
  17743. } else {
  17744. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17745. this.rightDate = new Date(parsedValue);
  17746. if (!this.unlinkPanels) {
  17747. this.leftDate = Object(date_util_["prevMonth"])(parsedValue);
  17748. }
  17749. }
  17750. }
  17751. },
  17752. handleDateChange: function handleDateChange(value, type) {
  17753. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17754. if (parsedValue) {
  17755. if (type === 'min') {
  17756. this.minDate = Object(date_util_["modifyDate"])(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17757. if (this.minDate > this.maxDate) {
  17758. this.maxDate = this.minDate;
  17759. }
  17760. } else {
  17761. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17762. if (this.maxDate < this.minDate) {
  17763. this.minDate = this.maxDate;
  17764. }
  17765. }
  17766. }
  17767. },
  17768. handleTimeInput: function handleTimeInput(value, type) {
  17769. var _this4 = this;
  17770. this.timeUserInput[type] = value;
  17771. if (value.length !== this.timeFormat.length) return;
  17772. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17773. if (parsedValue) {
  17774. if (type === 'min') {
  17775. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17776. this.$nextTick(function (_) {
  17777. return _this4.$refs.minTimePicker.adjustSpinners();
  17778. });
  17779. } else {
  17780. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17781. this.$nextTick(function (_) {
  17782. return _this4.$refs.maxTimePicker.adjustSpinners();
  17783. });
  17784. }
  17785. }
  17786. },
  17787. handleTimeChange: function handleTimeChange(value, type) {
  17788. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17789. if (parsedValue) {
  17790. if (type === 'min') {
  17791. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17792. if (this.minDate > this.maxDate) {
  17793. this.maxDate = this.minDate;
  17794. }
  17795. this.$refs.minTimePicker.value = this.minDate;
  17796. this.minTimePickerVisible = false;
  17797. } else {
  17798. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17799. if (this.maxDate < this.minDate) {
  17800. this.minDate = this.maxDate;
  17801. }
  17802. this.$refs.maxTimePicker.value = this.minDate;
  17803. this.maxTimePickerVisible = false;
  17804. }
  17805. }
  17806. },
  17807. handleRangePick: function handleRangePick(val) {
  17808. var _this5 = this;
  17809. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  17810. var defaultTime = this.defaultTime || [];
  17811. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  17812. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  17813. if (this.maxDate === maxDate && this.minDate === minDate) {
  17814. return;
  17815. }
  17816. this.onPick && this.onPick(val);
  17817. this.maxDate = maxDate;
  17818. this.minDate = minDate;
  17819. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  17820. setTimeout(function () {
  17821. _this5.maxDate = maxDate;
  17822. _this5.minDate = minDate;
  17823. }, 10);
  17824. if (!close || this.showTime) return;
  17825. this.handleConfirm();
  17826. },
  17827. handleShortcutClick: function handleShortcutClick(shortcut) {
  17828. if (shortcut.onClick) {
  17829. shortcut.onClick(this);
  17830. }
  17831. },
  17832. handleMinTimePick: function handleMinTimePick(value, visible, first) {
  17833. this.minDate = this.minDate || new Date();
  17834. if (value) {
  17835. this.minDate = Object(date_util_["modifyTime"])(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17836. }
  17837. if (!first) {
  17838. this.minTimePickerVisible = visible;
  17839. }
  17840. if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
  17841. this.maxDate = new Date(this.minDate);
  17842. }
  17843. },
  17844. handleMinTimeClose: function handleMinTimeClose() {
  17845. this.minTimePickerVisible = false;
  17846. },
  17847. handleMaxTimePick: function handleMaxTimePick(value, visible, first) {
  17848. if (this.maxDate && value) {
  17849. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17850. }
  17851. if (!first) {
  17852. this.maxTimePickerVisible = visible;
  17853. }
  17854. if (this.maxDate && this.minDate && this.minDate.getTime() > this.maxDate.getTime()) {
  17855. this.minDate = new Date(this.maxDate);
  17856. }
  17857. },
  17858. handleMaxTimeClose: function handleMaxTimeClose() {
  17859. this.maxTimePickerVisible = false;
  17860. },
  17861. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  17862. leftPrevYear: function leftPrevYear() {
  17863. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  17864. if (!this.unlinkPanels) {
  17865. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17866. }
  17867. },
  17868. leftPrevMonth: function leftPrevMonth() {
  17869. this.leftDate = Object(date_util_["prevMonth"])(this.leftDate);
  17870. if (!this.unlinkPanels) {
  17871. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17872. }
  17873. },
  17874. rightNextYear: function rightNextYear() {
  17875. if (!this.unlinkPanels) {
  17876. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17877. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17878. } else {
  17879. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  17880. }
  17881. },
  17882. rightNextMonth: function rightNextMonth() {
  17883. if (!this.unlinkPanels) {
  17884. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17885. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17886. } else {
  17887. this.rightDate = Object(date_util_["nextMonth"])(this.rightDate);
  17888. }
  17889. },
  17890. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  17891. leftNextYear: function leftNextYear() {
  17892. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17893. },
  17894. leftNextMonth: function leftNextMonth() {
  17895. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17896. },
  17897. rightPrevYear: function rightPrevYear() {
  17898. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  17899. },
  17900. rightPrevMonth: function rightPrevMonth() {
  17901. this.rightDate = Object(date_util_["prevMonth"])(this.rightDate);
  17902. },
  17903. handleConfirm: function handleConfirm() {
  17904. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  17905. if (this.isValidValue([this.minDate, this.maxDate])) {
  17906. this.$emit('pick', [this.minDate, this.maxDate], visible);
  17907. }
  17908. },
  17909. isValidValue: function isValidValue(value) {
  17910. 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);
  17911. },
  17912. resetView: function resetView() {
  17913. // NOTE: this is a hack to reset {min, max}Date on picker open.
  17914. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  17915. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  17916. if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
  17917. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  17918. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  17919. }
  17920. },
  17921. components: { TimePicker: panel_time, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a }
  17922. });
  17923. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=script&lang=js&
  17924. /* harmony default export */ var panel_date_rangevue_type_script_lang_js_ = (date_rangevue_type_script_lang_js_);
  17925. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue
  17926. /* normalize component */
  17927. var date_range_component = normalizeComponent(
  17928. panel_date_rangevue_type_script_lang_js_,
  17929. date_rangevue_type_template_id_2652849a_render,
  17930. date_rangevue_type_template_id_2652849a_staticRenderFns,
  17931. false,
  17932. null,
  17933. null,
  17934. null
  17935. )
  17936. /* hot reload */
  17937. if (false) { var date_range_api; }
  17938. date_range_component.options.__file = "packages/date-picker/src/panel/date-range.vue"
  17939. /* harmony default export */ var date_range = (date_range_component.exports);
  17940. // 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&
  17941. var month_rangevue_type_template_id_f2645fb8_render = function() {
  17942. var _vm = this
  17943. var _h = _vm.$createElement
  17944. var _c = _vm._self._c || _h
  17945. return _c(
  17946. "transition",
  17947. {
  17948. attrs: { name: "el-zoom-in-top" },
  17949. on: {
  17950. "after-leave": function($event) {
  17951. _vm.$emit("dodestroy")
  17952. }
  17953. }
  17954. },
  17955. [
  17956. _c(
  17957. "div",
  17958. {
  17959. directives: [
  17960. {
  17961. name: "show",
  17962. rawName: "v-show",
  17963. value: _vm.visible,
  17964. expression: "visible"
  17965. }
  17966. ],
  17967. staticClass: "el-picker-panel el-date-range-picker el-popper",
  17968. class: [
  17969. {
  17970. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts
  17971. },
  17972. _vm.popperClass
  17973. ]
  17974. },
  17975. [
  17976. _c(
  17977. "div",
  17978. { staticClass: "el-picker-panel__body-wrapper" },
  17979. [
  17980. _vm._t("sidebar"),
  17981. _vm.shortcuts
  17982. ? _c(
  17983. "div",
  17984. { staticClass: "el-picker-panel__sidebar" },
  17985. _vm._l(_vm.shortcuts, function(shortcut, key) {
  17986. return _c(
  17987. "button",
  17988. {
  17989. key: key,
  17990. staticClass: "el-picker-panel__shortcut",
  17991. attrs: { type: "button" },
  17992. on: {
  17993. click: function($event) {
  17994. _vm.handleShortcutClick(shortcut)
  17995. }
  17996. }
  17997. },
  17998. [_vm._v(_vm._s(shortcut.text))]
  17999. )
  18000. }),
  18001. 0
  18002. )
  18003. : _vm._e(),
  18004. _c("div", { staticClass: "el-picker-panel__body" }, [
  18005. _c(
  18006. "div",
  18007. {
  18008. staticClass:
  18009. "el-picker-panel__content el-date-range-picker__content is-left"
  18010. },
  18011. [
  18012. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18013. _c("button", {
  18014. staticClass:
  18015. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18016. attrs: { type: "button" },
  18017. on: { click: _vm.leftPrevYear }
  18018. }),
  18019. _vm.unlinkPanels
  18020. ? _c("button", {
  18021. staticClass:
  18022. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18023. class: { "is-disabled": !_vm.enableYearArrow },
  18024. attrs: {
  18025. type: "button",
  18026. disabled: !_vm.enableYearArrow
  18027. },
  18028. on: { click: _vm.leftNextYear }
  18029. })
  18030. : _vm._e(),
  18031. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  18032. ]),
  18033. _c("month-table", {
  18034. attrs: {
  18035. "selection-mode": "range",
  18036. date: _vm.leftDate,
  18037. "default-value": _vm.defaultValue,
  18038. "min-date": _vm.minDate,
  18039. "max-date": _vm.maxDate,
  18040. "range-state": _vm.rangeState,
  18041. "disabled-date": _vm.disabledDate
  18042. },
  18043. on: {
  18044. changerange: _vm.handleChangeRange,
  18045. pick: _vm.handleRangePick
  18046. }
  18047. })
  18048. ],
  18049. 1
  18050. ),
  18051. _c(
  18052. "div",
  18053. {
  18054. staticClass:
  18055. "el-picker-panel__content el-date-range-picker__content is-right"
  18056. },
  18057. [
  18058. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18059. _vm.unlinkPanels
  18060. ? _c("button", {
  18061. staticClass:
  18062. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18063. class: { "is-disabled": !_vm.enableYearArrow },
  18064. attrs: {
  18065. type: "button",
  18066. disabled: !_vm.enableYearArrow
  18067. },
  18068. on: { click: _vm.rightPrevYear }
  18069. })
  18070. : _vm._e(),
  18071. _c("button", {
  18072. staticClass:
  18073. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18074. attrs: { type: "button" },
  18075. on: { click: _vm.rightNextYear }
  18076. }),
  18077. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  18078. ]),
  18079. _c("month-table", {
  18080. attrs: {
  18081. "selection-mode": "range",
  18082. date: _vm.rightDate,
  18083. "default-value": _vm.defaultValue,
  18084. "min-date": _vm.minDate,
  18085. "max-date": _vm.maxDate,
  18086. "range-state": _vm.rangeState,
  18087. "disabled-date": _vm.disabledDate
  18088. },
  18089. on: {
  18090. changerange: _vm.handleChangeRange,
  18091. pick: _vm.handleRangePick
  18092. }
  18093. })
  18094. ],
  18095. 1
  18096. )
  18097. ])
  18098. ],
  18099. 2
  18100. )
  18101. ]
  18102. )
  18103. ]
  18104. )
  18105. }
  18106. var month_rangevue_type_template_id_f2645fb8_staticRenderFns = []
  18107. month_rangevue_type_template_id_f2645fb8_render._withStripped = true
  18108. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=template&id=f2645fb8&
  18109. // 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&
  18110. //
  18111. //
  18112. //
  18113. //
  18114. //
  18115. //
  18116. //
  18117. //
  18118. //
  18119. //
  18120. //
  18121. //
  18122. //
  18123. //
  18124. //
  18125. //
  18126. //
  18127. //
  18128. //
  18129. //
  18130. //
  18131. //
  18132. //
  18133. //
  18134. //
  18135. //
  18136. //
  18137. //
  18138. //
  18139. //
  18140. //
  18141. //
  18142. //
  18143. //
  18144. //
  18145. //
  18146. //
  18147. //
  18148. //
  18149. //
  18150. //
  18151. //
  18152. //
  18153. //
  18154. //
  18155. //
  18156. //
  18157. //
  18158. //
  18159. //
  18160. //
  18161. //
  18162. //
  18163. //
  18164. //
  18165. //
  18166. //
  18167. //
  18168. //
  18169. //
  18170. //
  18171. //
  18172. //
  18173. //
  18174. //
  18175. //
  18176. //
  18177. //
  18178. //
  18179. //
  18180. //
  18181. //
  18182. //
  18183. //
  18184. //
  18185. //
  18186. //
  18187. //
  18188. //
  18189. var month_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  18190. if (Array.isArray(defaultValue)) {
  18191. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  18192. } else if (defaultValue) {
  18193. return [new Date(defaultValue), Object(date_util_["nextMonth"])(new Date(defaultValue))];
  18194. } else {
  18195. return [new Date(), Object(date_util_["nextMonth"])(new Date())];
  18196. }
  18197. };
  18198. /* harmony default export */ var month_rangevue_type_script_lang_js_ = ({
  18199. mixins: [locale_default.a],
  18200. directives: { Clickoutside: clickoutside_default.a },
  18201. computed: {
  18202. btnDisabled: function btnDisabled() {
  18203. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  18204. },
  18205. leftLabel: function leftLabel() {
  18206. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18207. },
  18208. rightLabel: function rightLabel() {
  18209. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18210. },
  18211. leftYear: function leftYear() {
  18212. return this.leftDate.getFullYear();
  18213. },
  18214. rightYear: function rightYear() {
  18215. return this.rightDate.getFullYear() === this.leftDate.getFullYear() ? this.leftDate.getFullYear() + 1 : this.rightDate.getFullYear();
  18216. },
  18217. enableYearArrow: function enableYearArrow() {
  18218. return this.unlinkPanels && this.rightYear > this.leftYear + 1;
  18219. }
  18220. },
  18221. data: function data() {
  18222. return {
  18223. popperClass: '',
  18224. value: [],
  18225. defaultValue: null,
  18226. defaultTime: null,
  18227. minDate: '',
  18228. maxDate: '',
  18229. leftDate: new Date(),
  18230. rightDate: Object(date_util_["nextYear"])(new Date()),
  18231. rangeState: {
  18232. endDate: null,
  18233. selecting: false,
  18234. row: null,
  18235. column: null
  18236. },
  18237. shortcuts: '',
  18238. visible: '',
  18239. disabledDate: '',
  18240. format: '',
  18241. arrowControl: false,
  18242. unlinkPanels: false
  18243. };
  18244. },
  18245. watch: {
  18246. value: function value(newVal) {
  18247. if (!newVal) {
  18248. this.minDate = null;
  18249. this.maxDate = null;
  18250. } else if (Array.isArray(newVal)) {
  18251. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  18252. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  18253. if (this.minDate) {
  18254. this.leftDate = this.minDate;
  18255. if (this.unlinkPanels && this.maxDate) {
  18256. var minDateYear = this.minDate.getFullYear();
  18257. var maxDateYear = this.maxDate.getFullYear();
  18258. this.rightDate = minDateYear === maxDateYear ? Object(date_util_["nextYear"])(this.maxDate) : this.maxDate;
  18259. } else {
  18260. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18261. }
  18262. } else {
  18263. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18264. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18265. }
  18266. }
  18267. },
  18268. defaultValue: function defaultValue(val) {
  18269. if (!Array.isArray(this.value)) {
  18270. var _calcDefaultValue = month_rangevue_type_script_lang_js_calcDefaultValue(val),
  18271. left = _calcDefaultValue[0],
  18272. right = _calcDefaultValue[1];
  18273. this.leftDate = left;
  18274. this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : Object(date_util_["nextYear"])(this.leftDate);
  18275. }
  18276. }
  18277. },
  18278. methods: {
  18279. handleClear: function handleClear() {
  18280. this.minDate = null;
  18281. this.maxDate = null;
  18282. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18283. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18284. this.$emit('pick', null);
  18285. },
  18286. handleChangeRange: function handleChangeRange(val) {
  18287. this.minDate = val.minDate;
  18288. this.maxDate = val.maxDate;
  18289. this.rangeState = val.rangeState;
  18290. },
  18291. handleRangePick: function handleRangePick(val) {
  18292. var _this = this;
  18293. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  18294. var defaultTime = this.defaultTime || [];
  18295. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  18296. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  18297. if (this.maxDate === maxDate && this.minDate === minDate) {
  18298. return;
  18299. }
  18300. this.onPick && this.onPick(val);
  18301. this.maxDate = maxDate;
  18302. this.minDate = minDate;
  18303. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  18304. setTimeout(function () {
  18305. _this.maxDate = maxDate;
  18306. _this.minDate = minDate;
  18307. }, 10);
  18308. if (!close) return;
  18309. this.handleConfirm();
  18310. },
  18311. handleShortcutClick: function handleShortcutClick(shortcut) {
  18312. if (shortcut.onClick) {
  18313. shortcut.onClick(this);
  18314. }
  18315. },
  18316. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  18317. leftPrevYear: function leftPrevYear() {
  18318. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  18319. if (!this.unlinkPanels) {
  18320. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18321. }
  18322. },
  18323. rightNextYear: function rightNextYear() {
  18324. if (!this.unlinkPanels) {
  18325. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18326. }
  18327. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  18328. },
  18329. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  18330. leftNextYear: function leftNextYear() {
  18331. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18332. },
  18333. rightPrevYear: function rightPrevYear() {
  18334. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18335. },
  18336. handleConfirm: function handleConfirm() {
  18337. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18338. if (this.isValidValue([this.minDate, this.maxDate])) {
  18339. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18340. }
  18341. },
  18342. isValidValue: function isValidValue(value) {
  18343. 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);
  18344. },
  18345. resetView: function resetView() {
  18346. // NOTE: this is a hack to reset {min, max}Date on picker open.
  18347. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  18348. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  18349. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  18350. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  18351. }
  18352. },
  18353. components: { MonthTable: month_table, ElInput: input_default.a, ElButton: button_default.a }
  18354. });
  18355. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=script&lang=js&
  18356. /* harmony default export */ var panel_month_rangevue_type_script_lang_js_ = (month_rangevue_type_script_lang_js_);
  18357. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue
  18358. /* normalize component */
  18359. var month_range_component = normalizeComponent(
  18360. panel_month_rangevue_type_script_lang_js_,
  18361. month_rangevue_type_template_id_f2645fb8_render,
  18362. month_rangevue_type_template_id_f2645fb8_staticRenderFns,
  18363. false,
  18364. null,
  18365. null,
  18366. null
  18367. )
  18368. /* hot reload */
  18369. if (false) { var month_range_api; }
  18370. month_range_component.options.__file = "packages/date-picker/src/panel/month-range.vue"
  18371. /* harmony default export */ var month_range = (month_range_component.exports);
  18372. // CONCATENATED MODULE: ./packages/date-picker/src/picker/date-picker.js
  18373. var date_picker_getPanel = function getPanel(type) {
  18374. if (type === 'daterange' || type === 'datetimerange') {
  18375. return date_range;
  18376. } else if (type === 'monthrange') {
  18377. return month_range;
  18378. }
  18379. return panel_date;
  18380. };
  18381. /* harmony default export */ var date_picker = ({
  18382. mixins: [picker],
  18383. name: 'ElDatePicker',
  18384. props: {
  18385. type: {
  18386. type: String,
  18387. default: 'date'
  18388. },
  18389. timeArrowControl: Boolean
  18390. },
  18391. watch: {
  18392. type: function type(_type) {
  18393. if (this.picker) {
  18394. this.unmountPicker();
  18395. this.panel = date_picker_getPanel(_type);
  18396. this.mountPicker();
  18397. } else {
  18398. this.panel = date_picker_getPanel(_type);
  18399. }
  18400. }
  18401. },
  18402. created: function created() {
  18403. this.panel = date_picker_getPanel(this.type);
  18404. }
  18405. });
  18406. // CONCATENATED MODULE: ./packages/date-picker/index.js
  18407. /* istanbul ignore next */
  18408. date_picker.install = function install(Vue) {
  18409. Vue.component(date_picker.name, date_picker);
  18410. };
  18411. /* harmony default export */ var packages_date_picker = (date_picker);
  18412. // 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&
  18413. var time_selectvue_type_template_id_51ab9320_render = function() {
  18414. var _vm = this
  18415. var _h = _vm.$createElement
  18416. var _c = _vm._self._c || _h
  18417. return _c(
  18418. "transition",
  18419. {
  18420. attrs: { name: "el-zoom-in-top" },
  18421. on: {
  18422. "before-enter": _vm.handleMenuEnter,
  18423. "after-leave": function($event) {
  18424. _vm.$emit("dodestroy")
  18425. }
  18426. }
  18427. },
  18428. [
  18429. _c(
  18430. "div",
  18431. {
  18432. directives: [
  18433. {
  18434. name: "show",
  18435. rawName: "v-show",
  18436. value: _vm.visible,
  18437. expression: "visible"
  18438. }
  18439. ],
  18440. ref: "popper",
  18441. staticClass: "el-picker-panel time-select el-popper",
  18442. class: _vm.popperClass,
  18443. style: { width: _vm.width + "px" }
  18444. },
  18445. [
  18446. _c(
  18447. "el-scrollbar",
  18448. {
  18449. attrs: { noresize: "", "wrap-class": "el-picker-panel__content" }
  18450. },
  18451. _vm._l(_vm.items, function(item) {
  18452. return _c(
  18453. "div",
  18454. {
  18455. key: item.value,
  18456. staticClass: "time-select-item",
  18457. class: {
  18458. selected: _vm.value === item.value,
  18459. disabled: item.disabled,
  18460. default: item.value === _vm.defaultValue
  18461. },
  18462. attrs: { disabled: item.disabled },
  18463. on: {
  18464. click: function($event) {
  18465. _vm.handleClick(item)
  18466. }
  18467. }
  18468. },
  18469. [_vm._v(_vm._s(item.value))]
  18470. )
  18471. }),
  18472. 0
  18473. )
  18474. ],
  18475. 1
  18476. )
  18477. ]
  18478. )
  18479. }
  18480. var time_selectvue_type_template_id_51ab9320_staticRenderFns = []
  18481. time_selectvue_type_template_id_51ab9320_render._withStripped = true
  18482. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=51ab9320&
  18483. // 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&
  18484. //
  18485. //
  18486. //
  18487. //
  18488. //
  18489. //
  18490. //
  18491. //
  18492. //
  18493. //
  18494. //
  18495. //
  18496. //
  18497. //
  18498. //
  18499. //
  18500. //
  18501. //
  18502. //
  18503. //
  18504. var parseTime = function parseTime(time) {
  18505. var values = (time || '').split(':');
  18506. if (values.length >= 2) {
  18507. var hours = parseInt(values[0], 10);
  18508. var minutes = parseInt(values[1], 10);
  18509. return {
  18510. hours: hours,
  18511. minutes: minutes
  18512. };
  18513. }
  18514. /* istanbul ignore next */
  18515. return null;
  18516. };
  18517. var compareTime = function compareTime(time1, time2) {
  18518. var value1 = parseTime(time1);
  18519. var value2 = parseTime(time2);
  18520. var minutes1 = value1.minutes + value1.hours * 60;
  18521. var minutes2 = value2.minutes + value2.hours * 60;
  18522. if (minutes1 === minutes2) {
  18523. return 0;
  18524. }
  18525. return minutes1 > minutes2 ? 1 : -1;
  18526. };
  18527. var formatTime = function formatTime(time) {
  18528. return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
  18529. };
  18530. var nextTime = function nextTime(time, step) {
  18531. var timeValue = parseTime(time);
  18532. var stepValue = parseTime(step);
  18533. var next = {
  18534. hours: timeValue.hours,
  18535. minutes: timeValue.minutes
  18536. };
  18537. next.minutes += stepValue.minutes;
  18538. next.hours += stepValue.hours;
  18539. next.hours += Math.floor(next.minutes / 60);
  18540. next.minutes = next.minutes % 60;
  18541. return formatTime(next);
  18542. };
  18543. /* harmony default export */ var time_selectvue_type_script_lang_js_ = ({
  18544. components: { ElScrollbar: scrollbar_default.a },
  18545. watch: {
  18546. value: function value(val) {
  18547. var _this = this;
  18548. if (!val) return;
  18549. this.$nextTick(function () {
  18550. return _this.scrollToOption();
  18551. });
  18552. }
  18553. },
  18554. methods: {
  18555. handleClick: function handleClick(item) {
  18556. if (!item.disabled) {
  18557. this.$emit('pick', item.value);
  18558. }
  18559. },
  18560. handleClear: function handleClear() {
  18561. this.$emit('pick', null);
  18562. },
  18563. scrollToOption: function scrollToOption() {
  18564. var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
  18565. var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
  18566. scroll_into_view_default()(menu, menu.querySelector(selector));
  18567. },
  18568. handleMenuEnter: function handleMenuEnter() {
  18569. var _this2 = this;
  18570. var selected = this.items.map(function (item) {
  18571. return item.value;
  18572. }).indexOf(this.value) !== -1;
  18573. var hasDefault = this.items.map(function (item) {
  18574. return item.value;
  18575. }).indexOf(this.defaultValue) !== -1;
  18576. var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
  18577. this.$nextTick(function () {
  18578. return _this2.scrollToOption(option);
  18579. });
  18580. },
  18581. scrollDown: function scrollDown(step) {
  18582. var items = this.items;
  18583. var length = items.length;
  18584. var total = items.length;
  18585. var index = items.map(function (item) {
  18586. return item.value;
  18587. }).indexOf(this.value);
  18588. while (total--) {
  18589. index = (index + step + length) % length;
  18590. if (!items[index].disabled) {
  18591. this.$emit('pick', items[index].value, true);
  18592. return;
  18593. }
  18594. }
  18595. },
  18596. isValidValue: function isValidValue(date) {
  18597. return this.items.filter(function (item) {
  18598. return !item.disabled;
  18599. }).map(function (item) {
  18600. return item.value;
  18601. }).indexOf(date) !== -1;
  18602. },
  18603. handleKeydown: function handleKeydown(event) {
  18604. var keyCode = event.keyCode;
  18605. if (keyCode === 38 || keyCode === 40) {
  18606. var mapping = { 40: 1, 38: -1 };
  18607. var offset = mapping[keyCode.toString()];
  18608. this.scrollDown(offset);
  18609. event.stopPropagation();
  18610. return;
  18611. }
  18612. }
  18613. },
  18614. data: function data() {
  18615. return {
  18616. popperClass: '',
  18617. start: '09:00',
  18618. end: '18:00',
  18619. step: '00:30',
  18620. value: '',
  18621. defaultValue: '',
  18622. visible: false,
  18623. minTime: '',
  18624. maxTime: '',
  18625. width: 0
  18626. };
  18627. },
  18628. computed: {
  18629. items: function items() {
  18630. var start = this.start;
  18631. var end = this.end;
  18632. var step = this.step;
  18633. var result = [];
  18634. if (start && end && step) {
  18635. var current = start;
  18636. while (compareTime(current, end) <= 0) {
  18637. result.push({
  18638. value: current,
  18639. disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
  18640. });
  18641. current = nextTime(current, step);
  18642. }
  18643. }
  18644. return result;
  18645. }
  18646. }
  18647. });
  18648. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js&
  18649. /* harmony default export */ var panel_time_selectvue_type_script_lang_js_ = (time_selectvue_type_script_lang_js_);
  18650. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue
  18651. /* normalize component */
  18652. var time_select_component = normalizeComponent(
  18653. panel_time_selectvue_type_script_lang_js_,
  18654. time_selectvue_type_template_id_51ab9320_render,
  18655. time_selectvue_type_template_id_51ab9320_staticRenderFns,
  18656. false,
  18657. null,
  18658. null,
  18659. null
  18660. )
  18661. /* hot reload */
  18662. if (false) { var time_select_api; }
  18663. time_select_component.options.__file = "packages/date-picker/src/panel/time-select.vue"
  18664. /* harmony default export */ var time_select = (time_select_component.exports);
  18665. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-select.js
  18666. /* harmony default export */ var picker_time_select = ({
  18667. mixins: [picker],
  18668. name: 'ElTimeSelect',
  18669. componentName: 'ElTimeSelect',
  18670. props: {
  18671. type: {
  18672. type: String,
  18673. default: 'time-select'
  18674. }
  18675. },
  18676. beforeCreate: function beforeCreate() {
  18677. this.panel = time_select;
  18678. }
  18679. });
  18680. // CONCATENATED MODULE: ./packages/time-select/index.js
  18681. /* istanbul ignore next */
  18682. picker_time_select.install = function (Vue) {
  18683. Vue.component(picker_time_select.name, picker_time_select);
  18684. };
  18685. /* harmony default export */ var packages_time_select = (picker_time_select);
  18686. // 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&
  18687. var time_rangevue_type_template_id_fb28660e_render = function() {
  18688. var _vm = this
  18689. var _h = _vm.$createElement
  18690. var _c = _vm._self._c || _h
  18691. return _c(
  18692. "transition",
  18693. {
  18694. attrs: { name: "el-zoom-in-top" },
  18695. on: {
  18696. "after-leave": function($event) {
  18697. _vm.$emit("dodestroy")
  18698. }
  18699. }
  18700. },
  18701. [
  18702. _c(
  18703. "div",
  18704. {
  18705. directives: [
  18706. {
  18707. name: "show",
  18708. rawName: "v-show",
  18709. value: _vm.visible,
  18710. expression: "visible"
  18711. }
  18712. ],
  18713. staticClass: "el-time-range-picker el-picker-panel el-popper",
  18714. class: _vm.popperClass
  18715. },
  18716. [
  18717. _c("div", { staticClass: "el-time-range-picker__content" }, [
  18718. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18719. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18720. _vm._v(_vm._s(_vm.t("el.datepicker.startTime")))
  18721. ]),
  18722. _c(
  18723. "div",
  18724. {
  18725. staticClass:
  18726. "el-time-range-picker__body el-time-panel__content",
  18727. class: {
  18728. "has-seconds": _vm.showSeconds,
  18729. "is-arrow": _vm.arrowControl
  18730. }
  18731. },
  18732. [
  18733. _c("time-spinner", {
  18734. ref: "minSpinner",
  18735. attrs: {
  18736. "show-seconds": _vm.showSeconds,
  18737. "am-pm-mode": _vm.amPmMode,
  18738. "arrow-control": _vm.arrowControl,
  18739. date: _vm.minDate
  18740. },
  18741. on: {
  18742. change: _vm.handleMinChange,
  18743. "select-range": _vm.setMinSelectionRange
  18744. }
  18745. })
  18746. ],
  18747. 1
  18748. )
  18749. ]),
  18750. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18751. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18752. _vm._v(_vm._s(_vm.t("el.datepicker.endTime")))
  18753. ]),
  18754. _c(
  18755. "div",
  18756. {
  18757. staticClass:
  18758. "el-time-range-picker__body el-time-panel__content",
  18759. class: {
  18760. "has-seconds": _vm.showSeconds,
  18761. "is-arrow": _vm.arrowControl
  18762. }
  18763. },
  18764. [
  18765. _c("time-spinner", {
  18766. ref: "maxSpinner",
  18767. attrs: {
  18768. "show-seconds": _vm.showSeconds,
  18769. "am-pm-mode": _vm.amPmMode,
  18770. "arrow-control": _vm.arrowControl,
  18771. date: _vm.maxDate
  18772. },
  18773. on: {
  18774. change: _vm.handleMaxChange,
  18775. "select-range": _vm.setMaxSelectionRange
  18776. }
  18777. })
  18778. ],
  18779. 1
  18780. )
  18781. ])
  18782. ]),
  18783. _c("div", { staticClass: "el-time-panel__footer" }, [
  18784. _c(
  18785. "button",
  18786. {
  18787. staticClass: "el-time-panel__btn cancel",
  18788. attrs: { type: "button" },
  18789. on: {
  18790. click: function($event) {
  18791. _vm.handleCancel()
  18792. }
  18793. }
  18794. },
  18795. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  18796. ),
  18797. _c(
  18798. "button",
  18799. {
  18800. staticClass: "el-time-panel__btn confirm",
  18801. attrs: { type: "button", disabled: _vm.btnDisabled },
  18802. on: {
  18803. click: function($event) {
  18804. _vm.handleConfirm()
  18805. }
  18806. }
  18807. },
  18808. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  18809. )
  18810. ])
  18811. ]
  18812. )
  18813. ]
  18814. )
  18815. }
  18816. var time_rangevue_type_template_id_fb28660e_staticRenderFns = []
  18817. time_rangevue_type_template_id_fb28660e_render._withStripped = true
  18818. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
  18819. // 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&
  18820. //
  18821. //
  18822. //
  18823. //
  18824. //
  18825. //
  18826. //
  18827. //
  18828. //
  18829. //
  18830. //
  18831. //
  18832. //
  18833. //
  18834. //
  18835. //
  18836. //
  18837. //
  18838. //
  18839. //
  18840. //
  18841. //
  18842. //
  18843. //
  18844. //
  18845. //
  18846. //
  18847. //
  18848. //
  18849. //
  18850. //
  18851. //
  18852. //
  18853. //
  18854. //
  18855. //
  18856. //
  18857. //
  18858. //
  18859. //
  18860. //
  18861. //
  18862. //
  18863. //
  18864. //
  18865. //
  18866. //
  18867. //
  18868. //
  18869. //
  18870. //
  18871. //
  18872. //
  18873. //
  18874. //
  18875. //
  18876. //
  18877. var MIN_TIME = Object(date_util_["parseDate"])('00:00:00', 'HH:mm:ss');
  18878. var MAX_TIME = Object(date_util_["parseDate"])('23:59:59', 'HH:mm:ss');
  18879. var time_rangevue_type_script_lang_js_minTimeOfDay = function minTimeOfDay(date) {
  18880. return Object(date_util_["modifyDate"])(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18881. };
  18882. var time_rangevue_type_script_lang_js_maxTimeOfDay = function maxTimeOfDay(date) {
  18883. return Object(date_util_["modifyDate"])(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18884. };
  18885. // increase time by amount of milliseconds, but within the range of day
  18886. var advanceTime = function advanceTime(date, amount) {
  18887. return new Date(Math.min(date.getTime() + amount, time_rangevue_type_script_lang_js_maxTimeOfDay(date).getTime()));
  18888. };
  18889. /* harmony default export */ var time_rangevue_type_script_lang_js_ = ({
  18890. mixins: [locale_default.a],
  18891. components: { TimeSpinner: time_spinner },
  18892. computed: {
  18893. showSeconds: function showSeconds() {
  18894. return (this.format || '').indexOf('ss') !== -1;
  18895. },
  18896. offset: function offset() {
  18897. return this.showSeconds ? 11 : 8;
  18898. },
  18899. spinner: function spinner() {
  18900. return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner;
  18901. },
  18902. btnDisabled: function btnDisabled() {
  18903. return this.minDate.getTime() > this.maxDate.getTime();
  18904. },
  18905. amPmMode: function amPmMode() {
  18906. if ((this.format || '').indexOf('A') !== -1) return 'A';
  18907. if ((this.format || '').indexOf('a') !== -1) return 'a';
  18908. return '';
  18909. }
  18910. },
  18911. data: function data() {
  18912. return {
  18913. popperClass: '',
  18914. minDate: new Date(),
  18915. maxDate: new Date(),
  18916. value: [],
  18917. oldValue: [new Date(), new Date()],
  18918. defaultValue: null,
  18919. format: 'HH:mm:ss',
  18920. visible: false,
  18921. selectionRange: [0, 2],
  18922. arrowControl: false
  18923. };
  18924. },
  18925. watch: {
  18926. value: function value(_value) {
  18927. if (Array.isArray(_value)) {
  18928. this.minDate = new Date(_value[0]);
  18929. this.maxDate = new Date(_value[1]);
  18930. } else {
  18931. if (Array.isArray(this.defaultValue)) {
  18932. this.minDate = new Date(this.defaultValue[0]);
  18933. this.maxDate = new Date(this.defaultValue[1]);
  18934. } else if (this.defaultValue) {
  18935. this.minDate = new Date(this.defaultValue);
  18936. this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000);
  18937. } else {
  18938. this.minDate = new Date();
  18939. this.maxDate = advanceTime(new Date(), 60 * 60 * 1000);
  18940. }
  18941. }
  18942. },
  18943. visible: function visible(val) {
  18944. var _this = this;
  18945. if (val) {
  18946. this.oldValue = this.value;
  18947. this.$nextTick(function () {
  18948. return _this.$refs.minSpinner.emitSelectRange('hours');
  18949. });
  18950. }
  18951. }
  18952. },
  18953. methods: {
  18954. handleClear: function handleClear() {
  18955. this.$emit('pick', null);
  18956. },
  18957. handleCancel: function handleCancel() {
  18958. this.$emit('pick', this.oldValue);
  18959. },
  18960. handleMinChange: function handleMinChange(date) {
  18961. this.minDate = Object(date_util_["clearMilliseconds"])(date);
  18962. this.handleChange();
  18963. },
  18964. handleMaxChange: function handleMaxChange(date) {
  18965. this.maxDate = Object(date_util_["clearMilliseconds"])(date);
  18966. this.handleChange();
  18967. },
  18968. handleChange: function handleChange() {
  18969. if (this.isValidValue([this.minDate, this.maxDate])) {
  18970. this.$refs.minSpinner.selectableRange = [[time_rangevue_type_script_lang_js_minTimeOfDay(this.minDate), this.maxDate]];
  18971. this.$refs.maxSpinner.selectableRange = [[this.minDate, time_rangevue_type_script_lang_js_maxTimeOfDay(this.maxDate)]];
  18972. this.$emit('pick', [this.minDate, this.maxDate], true);
  18973. }
  18974. },
  18975. setMinSelectionRange: function setMinSelectionRange(start, end) {
  18976. this.$emit('select-range', start, end, 'min');
  18977. this.selectionRange = [start, end];
  18978. },
  18979. setMaxSelectionRange: function setMaxSelectionRange(start, end) {
  18980. this.$emit('select-range', start, end, 'max');
  18981. this.selectionRange = [start + this.offset, end + this.offset];
  18982. },
  18983. handleConfirm: function handleConfirm() {
  18984. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18985. var minSelectableRange = this.$refs.minSpinner.selectableRange;
  18986. var maxSelectableRange = this.$refs.maxSpinner.selectableRange;
  18987. this.minDate = Object(date_util_["limitTimeRange"])(this.minDate, minSelectableRange, this.format);
  18988. this.maxDate = Object(date_util_["limitTimeRange"])(this.maxDate, maxSelectableRange, this.format);
  18989. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18990. },
  18991. adjustSpinners: function adjustSpinners() {
  18992. this.$refs.minSpinner.adjustSpinners();
  18993. this.$refs.maxSpinner.adjustSpinners();
  18994. },
  18995. changeSelectionRange: function changeSelectionRange(step) {
  18996. var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
  18997. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  18998. var index = list.indexOf(this.selectionRange[0]);
  18999. var next = (index + step + list.length) % list.length;
  19000. var half = list.length / 2;
  19001. if (next < half) {
  19002. this.$refs.minSpinner.emitSelectRange(mapping[next]);
  19003. } else {
  19004. this.$refs.maxSpinner.emitSelectRange(mapping[next - half]);
  19005. }
  19006. },
  19007. isValidValue: function isValidValue(date) {
  19008. return Array.isArray(date) && Object(date_util_["timeWithinRange"])(this.minDate, this.$refs.minSpinner.selectableRange) && Object(date_util_["timeWithinRange"])(this.maxDate, this.$refs.maxSpinner.selectableRange);
  19009. },
  19010. handleKeydown: function handleKeydown(event) {
  19011. var keyCode = event.keyCode;
  19012. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  19013. // Left or Right
  19014. if (keyCode === 37 || keyCode === 39) {
  19015. var step = mapping[keyCode];
  19016. this.changeSelectionRange(step);
  19017. event.preventDefault();
  19018. return;
  19019. }
  19020. // Up or Down
  19021. if (keyCode === 38 || keyCode === 40) {
  19022. var _step = mapping[keyCode];
  19023. this.spinner.scrollDown(_step);
  19024. event.preventDefault();
  19025. return;
  19026. }
  19027. }
  19028. }
  19029. });
  19030. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
  19031. /* harmony default export */ var panel_time_rangevue_type_script_lang_js_ = (time_rangevue_type_script_lang_js_);
  19032. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue
  19033. /* normalize component */
  19034. var time_range_component = normalizeComponent(
  19035. panel_time_rangevue_type_script_lang_js_,
  19036. time_rangevue_type_template_id_fb28660e_render,
  19037. time_rangevue_type_template_id_fb28660e_staticRenderFns,
  19038. false,
  19039. null,
  19040. null,
  19041. null
  19042. )
  19043. /* hot reload */
  19044. if (false) { var time_range_api; }
  19045. time_range_component.options.__file = "packages/date-picker/src/panel/time-range.vue"
  19046. /* harmony default export */ var time_range = (time_range_component.exports);
  19047. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-picker.js
  19048. /* harmony default export */ var time_picker = ({
  19049. mixins: [picker],
  19050. name: 'ElTimePicker',
  19051. props: {
  19052. isRange: Boolean,
  19053. arrowControl: Boolean
  19054. },
  19055. data: function data() {
  19056. return {
  19057. type: ''
  19058. };
  19059. },
  19060. watch: {
  19061. isRange: function isRange(_isRange) {
  19062. if (this.picker) {
  19063. this.unmountPicker();
  19064. this.type = _isRange ? 'timerange' : 'time';
  19065. this.panel = _isRange ? time_range : panel_time;
  19066. this.mountPicker();
  19067. } else {
  19068. this.type = _isRange ? 'timerange' : 'time';
  19069. this.panel = _isRange ? time_range : panel_time;
  19070. }
  19071. }
  19072. },
  19073. created: function created() {
  19074. this.type = this.isRange ? 'timerange' : 'time';
  19075. this.panel = this.isRange ? time_range : panel_time;
  19076. }
  19077. });
  19078. // CONCATENATED MODULE: ./packages/time-picker/index.js
  19079. /* istanbul ignore next */
  19080. time_picker.install = function (Vue) {
  19081. Vue.component(time_picker.name, time_picker);
  19082. };
  19083. /* harmony default export */ var packages_time_picker = (time_picker);
  19084. // 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&
  19085. var mainvue_type_template_id_52060272_render = function() {
  19086. var _vm = this
  19087. var _h = _vm.$createElement
  19088. var _c = _vm._self._c || _h
  19089. return _c(
  19090. "span",
  19091. [
  19092. _c(
  19093. "transition",
  19094. {
  19095. attrs: { name: _vm.transition },
  19096. on: {
  19097. "after-enter": _vm.handleAfterEnter,
  19098. "after-leave": _vm.handleAfterLeave
  19099. }
  19100. },
  19101. [
  19102. _c(
  19103. "div",
  19104. {
  19105. directives: [
  19106. {
  19107. name: "show",
  19108. rawName: "v-show",
  19109. value: !_vm.disabled && _vm.showPopper,
  19110. expression: "!disabled && showPopper"
  19111. }
  19112. ],
  19113. ref: "popper",
  19114. staticClass: "el-popover el-popper",
  19115. class: [_vm.popperClass, _vm.content && "el-popover--plain"],
  19116. style: { width: _vm.width + "px" },
  19117. attrs: {
  19118. role: "tooltip",
  19119. id: _vm.tooltipId,
  19120. "aria-hidden":
  19121. _vm.disabled || !_vm.showPopper ? "true" : "false"
  19122. }
  19123. },
  19124. [
  19125. _vm.title
  19126. ? _c("div", {
  19127. staticClass: "el-popover__title",
  19128. domProps: { textContent: _vm._s(_vm.title) }
  19129. })
  19130. : _vm._e(),
  19131. _vm._t("default", [_vm._v(_vm._s(_vm.content))])
  19132. ],
  19133. 2
  19134. )
  19135. ]
  19136. ),
  19137. _c(
  19138. "span",
  19139. { ref: "wrapper", staticClass: "el-popover__reference-wrapper" },
  19140. [_vm._t("reference")],
  19141. 2
  19142. )
  19143. ],
  19144. 1
  19145. )
  19146. }
  19147. var mainvue_type_template_id_52060272_staticRenderFns = []
  19148. mainvue_type_template_id_52060272_render._withStripped = true
  19149. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=template&id=52060272&
  19150. // 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&
  19151. //
  19152. //
  19153. //
  19154. //
  19155. //
  19156. //
  19157. //
  19158. //
  19159. //
  19160. //
  19161. //
  19162. //
  19163. //
  19164. //
  19165. //
  19166. //
  19167. //
  19168. //
  19169. //
  19170. //
  19171. //
  19172. //
  19173. //
  19174. //
  19175. //
  19176. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  19177. name: 'ElPopover',
  19178. mixins: [vue_popper_default.a],
  19179. props: {
  19180. trigger: {
  19181. type: String,
  19182. default: 'click',
  19183. validator: function validator(value) {
  19184. return ['click', 'focus', 'hover', 'manual'].indexOf(value) > -1;
  19185. }
  19186. },
  19187. openDelay: {
  19188. type: Number,
  19189. default: 0
  19190. },
  19191. closeDelay: {
  19192. type: Number,
  19193. default: 200
  19194. },
  19195. title: String,
  19196. disabled: Boolean,
  19197. content: String,
  19198. reference: {},
  19199. popperClass: String,
  19200. width: {},
  19201. visibleArrow: {
  19202. default: true
  19203. },
  19204. arrowOffset: {
  19205. type: Number,
  19206. default: 0
  19207. },
  19208. transition: {
  19209. type: String,
  19210. default: 'fade-in-linear'
  19211. },
  19212. tabindex: {
  19213. type: Number,
  19214. default: 0
  19215. }
  19216. },
  19217. computed: {
  19218. tooltipId: function tooltipId() {
  19219. return 'el-popover-' + Object(util_["generateId"])();
  19220. }
  19221. },
  19222. watch: {
  19223. showPopper: function showPopper(val) {
  19224. if (this.disabled) {
  19225. return;
  19226. }
  19227. val ? this.$emit('show') : this.$emit('hide');
  19228. }
  19229. },
  19230. mounted: function mounted() {
  19231. var _this = this;
  19232. var reference = this.referenceElm = this.reference || this.$refs.reference;
  19233. var popper = this.popper || this.$refs.popper;
  19234. if (!reference && this.$refs.wrapper.children) {
  19235. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19236. }
  19237. // 可访问性
  19238. if (reference) {
  19239. Object(dom_["addClass"])(reference, 'el-popover__reference');
  19240. reference.setAttribute('aria-describedby', this.tooltipId);
  19241. reference.setAttribute('tabindex', this.tabindex); // tab序列
  19242. popper.setAttribute('tabindex', 0);
  19243. if (this.trigger !== 'click') {
  19244. Object(dom_["on"])(reference, 'focusin', function () {
  19245. _this.handleFocus();
  19246. var instance = reference.__vue__;
  19247. if (instance && typeof instance.focus === 'function') {
  19248. instance.focus();
  19249. }
  19250. });
  19251. Object(dom_["on"])(popper, 'focusin', this.handleFocus);
  19252. Object(dom_["on"])(reference, 'focusout', this.handleBlur);
  19253. Object(dom_["on"])(popper, 'focusout', this.handleBlur);
  19254. }
  19255. Object(dom_["on"])(reference, 'keydown', this.handleKeydown);
  19256. Object(dom_["on"])(reference, 'click', this.handleClick);
  19257. }
  19258. if (this.trigger === 'click') {
  19259. Object(dom_["on"])(reference, 'click', this.doToggle);
  19260. Object(dom_["on"])(document, 'click', this.handleDocumentClick);
  19261. } else if (this.trigger === 'hover') {
  19262. Object(dom_["on"])(reference, 'mouseenter', this.handleMouseEnter);
  19263. Object(dom_["on"])(popper, 'mouseenter', this.handleMouseEnter);
  19264. Object(dom_["on"])(reference, 'mouseleave', this.handleMouseLeave);
  19265. Object(dom_["on"])(popper, 'mouseleave', this.handleMouseLeave);
  19266. } else if (this.trigger === 'focus') {
  19267. if (this.tabindex < 0) {
  19268. console.warn('[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key');
  19269. }
  19270. if (reference.querySelector('input, textarea')) {
  19271. Object(dom_["on"])(reference, 'focusin', this.doShow);
  19272. Object(dom_["on"])(reference, 'focusout', this.doClose);
  19273. } else {
  19274. Object(dom_["on"])(reference, 'mousedown', this.doShow);
  19275. Object(dom_["on"])(reference, 'mouseup', this.doClose);
  19276. }
  19277. }
  19278. },
  19279. beforeDestroy: function beforeDestroy() {
  19280. this.cleanup();
  19281. },
  19282. deactivated: function deactivated() {
  19283. this.cleanup();
  19284. },
  19285. methods: {
  19286. doToggle: function doToggle() {
  19287. this.showPopper = !this.showPopper;
  19288. },
  19289. doShow: function doShow() {
  19290. this.showPopper = true;
  19291. },
  19292. doClose: function doClose() {
  19293. this.showPopper = false;
  19294. },
  19295. handleFocus: function handleFocus() {
  19296. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19297. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = true;
  19298. },
  19299. handleClick: function handleClick() {
  19300. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19301. },
  19302. handleBlur: function handleBlur() {
  19303. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19304. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = false;
  19305. },
  19306. handleMouseEnter: function handleMouseEnter() {
  19307. var _this2 = this;
  19308. clearTimeout(this._timer);
  19309. if (this.openDelay) {
  19310. this._timer = setTimeout(function () {
  19311. _this2.showPopper = true;
  19312. }, this.openDelay);
  19313. } else {
  19314. this.showPopper = true;
  19315. }
  19316. },
  19317. handleKeydown: function handleKeydown(ev) {
  19318. if (ev.keyCode === 27 && this.trigger !== 'manual') {
  19319. // esc
  19320. this.doClose();
  19321. }
  19322. },
  19323. handleMouseLeave: function handleMouseLeave() {
  19324. var _this3 = this;
  19325. clearTimeout(this._timer);
  19326. if (this.closeDelay) {
  19327. this._timer = setTimeout(function () {
  19328. _this3.showPopper = false;
  19329. }, this.closeDelay);
  19330. } else {
  19331. this.showPopper = false;
  19332. }
  19333. },
  19334. handleDocumentClick: function handleDocumentClick(e) {
  19335. var reference = this.reference || this.$refs.reference;
  19336. var popper = this.popper || this.$refs.popper;
  19337. if (!reference && this.$refs.wrapper.children) {
  19338. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19339. }
  19340. if (!this.$el || !reference || this.$el.contains(e.target) || reference.contains(e.target) || !popper || popper.contains(e.target)) return;
  19341. this.showPopper = false;
  19342. },
  19343. handleAfterEnter: function handleAfterEnter() {
  19344. this.$emit('after-enter');
  19345. },
  19346. handleAfterLeave: function handleAfterLeave() {
  19347. this.$emit('after-leave');
  19348. this.doDestroy();
  19349. },
  19350. cleanup: function cleanup() {
  19351. if (this.openDelay || this.closeDelay) {
  19352. clearTimeout(this._timer);
  19353. }
  19354. }
  19355. },
  19356. destroyed: function destroyed() {
  19357. var reference = this.reference;
  19358. Object(dom_["off"])(reference, 'click', this.doToggle);
  19359. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19360. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19361. Object(dom_["off"])(reference, 'focusin', this.doShow);
  19362. Object(dom_["off"])(reference, 'focusout', this.doClose);
  19363. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19364. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19365. Object(dom_["off"])(reference, 'mouseleave', this.handleMouseLeave);
  19366. Object(dom_["off"])(reference, 'mouseenter', this.handleMouseEnter);
  19367. Object(dom_["off"])(document, 'click', this.handleDocumentClick);
  19368. }
  19369. });
  19370. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=script&lang=js&
  19371. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  19372. // CONCATENATED MODULE: ./packages/popover/src/main.vue
  19373. /* normalize component */
  19374. var main_component = normalizeComponent(
  19375. src_mainvue_type_script_lang_js_,
  19376. mainvue_type_template_id_52060272_render,
  19377. mainvue_type_template_id_52060272_staticRenderFns,
  19378. false,
  19379. null,
  19380. null,
  19381. null
  19382. )
  19383. /* hot reload */
  19384. if (false) { var main_api; }
  19385. main_component.options.__file = "packages/popover/src/main.vue"
  19386. /* harmony default export */ var main = (main_component.exports);
  19387. // CONCATENATED MODULE: ./packages/popover/src/directive.js
  19388. var getReference = function getReference(el, binding, vnode) {
  19389. var _ref = binding.expression ? binding.value : binding.arg;
  19390. var popper = vnode.context.$refs[_ref];
  19391. if (popper) {
  19392. if (Array.isArray(popper)) {
  19393. popper[0].$refs.reference = el;
  19394. } else {
  19395. popper.$refs.reference = el;
  19396. }
  19397. }
  19398. };
  19399. /* harmony default export */ var directive = ({
  19400. bind: function bind(el, binding, vnode) {
  19401. getReference(el, binding, vnode);
  19402. },
  19403. inserted: function inserted(el, binding, vnode) {
  19404. getReference(el, binding, vnode);
  19405. }
  19406. });
  19407. // CONCATENATED MODULE: ./packages/popover/index.js
  19408. external_vue_default.a.directive('popover', directive);
  19409. /* istanbul ignore next */
  19410. main.install = function (Vue) {
  19411. Vue.directive('popover', directive);
  19412. Vue.component(main.name, main);
  19413. };
  19414. main.directive = directive;
  19415. /* harmony default export */ var popover = (main);
  19416. // CONCATENATED MODULE: ./packages/tooltip/src/main.js
  19417. /* harmony default export */ var src_main = ({
  19418. name: 'ElTooltip',
  19419. mixins: [vue_popper_default.a],
  19420. props: {
  19421. openDelay: {
  19422. type: Number,
  19423. default: 0
  19424. },
  19425. disabled: Boolean,
  19426. manual: Boolean,
  19427. effect: {
  19428. type: String,
  19429. default: 'dark'
  19430. },
  19431. arrowOffset: {
  19432. type: Number,
  19433. default: 0
  19434. },
  19435. popperClass: String,
  19436. content: String,
  19437. visibleArrow: {
  19438. default: true
  19439. },
  19440. transition: {
  19441. type: String,
  19442. default: 'el-fade-in-linear'
  19443. },
  19444. popperOptions: {
  19445. default: function _default() {
  19446. return {
  19447. boundariesPadding: 10,
  19448. gpuAcceleration: false
  19449. };
  19450. }
  19451. },
  19452. enterable: {
  19453. type: Boolean,
  19454. default: true
  19455. },
  19456. hideAfter: {
  19457. type: Number,
  19458. default: 0
  19459. },
  19460. tabindex: {
  19461. type: Number,
  19462. default: 0
  19463. }
  19464. },
  19465. data: function data() {
  19466. return {
  19467. tooltipId: 'el-tooltip-' + Object(util_["generateId"])(),
  19468. timeoutPending: null,
  19469. focusing: false
  19470. };
  19471. },
  19472. beforeCreate: function beforeCreate() {
  19473. var _this = this;
  19474. if (this.$isServer) return;
  19475. this.popperVM = new external_vue_default.a({
  19476. data: { node: '' },
  19477. render: function render(h) {
  19478. return this.node;
  19479. }
  19480. }).$mount();
  19481. this.debounceClose = debounce_default()(200, function () {
  19482. return _this.handleClosePopper();
  19483. });
  19484. },
  19485. render: function render(h) {
  19486. var _this2 = this;
  19487. if (this.popperVM) {
  19488. this.popperVM.node = h(
  19489. 'transition',
  19490. {
  19491. attrs: {
  19492. name: this.transition
  19493. },
  19494. on: {
  19495. 'afterLeave': this.doDestroy
  19496. }
  19497. },
  19498. [h(
  19499. 'div',
  19500. {
  19501. on: {
  19502. 'mouseleave': function mouseleave() {
  19503. _this2.setExpectedState(false);_this2.debounceClose();
  19504. },
  19505. 'mouseenter': function mouseenter() {
  19506. _this2.setExpectedState(true);
  19507. }
  19508. },
  19509. ref: 'popper',
  19510. attrs: { role: 'tooltip',
  19511. id: this.tooltipId,
  19512. 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
  19513. },
  19514. directives: [{
  19515. name: 'show',
  19516. value: !this.disabled && this.showPopper
  19517. }],
  19518. 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
  19519. [this.$slots.content || this.content]
  19520. )]
  19521. );
  19522. }
  19523. var firstElement = this.getFirstElement();
  19524. if (!firstElement) return null;
  19525. var data = firstElement.data = firstElement.data || {};
  19526. data.staticClass = this.addTooltipClass(data.staticClass);
  19527. return firstElement;
  19528. },
  19529. mounted: function mounted() {
  19530. var _this3 = this;
  19531. this.referenceElm = this.$el;
  19532. if (this.$el.nodeType === 1) {
  19533. this.$el.setAttribute('aria-describedby', this.tooltipId);
  19534. this.$el.setAttribute('tabindex', this.tabindex);
  19535. Object(dom_["on"])(this.referenceElm, 'mouseenter', this.show);
  19536. Object(dom_["on"])(this.referenceElm, 'mouseleave', this.hide);
  19537. Object(dom_["on"])(this.referenceElm, 'focus', function () {
  19538. if (!_this3.$slots.default || !_this3.$slots.default.length) {
  19539. _this3.handleFocus();
  19540. return;
  19541. }
  19542. var instance = _this3.$slots.default[0].componentInstance;
  19543. if (instance && instance.focus) {
  19544. instance.focus();
  19545. } else {
  19546. _this3.handleFocus();
  19547. }
  19548. });
  19549. Object(dom_["on"])(this.referenceElm, 'blur', this.handleBlur);
  19550. Object(dom_["on"])(this.referenceElm, 'click', this.removeFocusing);
  19551. }
  19552. // fix issue https://github.com/ElemeFE/element/issues/14424
  19553. if (this.value && this.popperVM) {
  19554. this.popperVM.$nextTick(function () {
  19555. if (_this3.value) {
  19556. _this3.updatePopper();
  19557. }
  19558. });
  19559. }
  19560. },
  19561. watch: {
  19562. focusing: function focusing(val) {
  19563. if (val) {
  19564. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19565. } else {
  19566. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19567. }
  19568. }
  19569. },
  19570. methods: {
  19571. show: function show() {
  19572. this.setExpectedState(true);
  19573. this.handleShowPopper();
  19574. },
  19575. hide: function hide() {
  19576. this.setExpectedState(false);
  19577. this.debounceClose();
  19578. },
  19579. handleFocus: function handleFocus() {
  19580. this.focusing = true;
  19581. this.show();
  19582. },
  19583. handleBlur: function handleBlur() {
  19584. this.focusing = false;
  19585. this.hide();
  19586. },
  19587. removeFocusing: function removeFocusing() {
  19588. this.focusing = false;
  19589. },
  19590. addTooltipClass: function addTooltipClass(prev) {
  19591. if (!prev) {
  19592. return 'el-tooltip';
  19593. } else {
  19594. return 'el-tooltip ' + prev.replace('el-tooltip', '');
  19595. }
  19596. },
  19597. handleShowPopper: function handleShowPopper() {
  19598. var _this4 = this;
  19599. if (!this.expectedState || this.manual) return;
  19600. clearTimeout(this.timeout);
  19601. this.timeout = setTimeout(function () {
  19602. _this4.showPopper = true;
  19603. }, this.openDelay);
  19604. if (this.hideAfter > 0) {
  19605. this.timeoutPending = setTimeout(function () {
  19606. _this4.showPopper = false;
  19607. }, this.hideAfter);
  19608. }
  19609. },
  19610. handleClosePopper: function handleClosePopper() {
  19611. if (this.enterable && this.expectedState || this.manual) return;
  19612. clearTimeout(this.timeout);
  19613. if (this.timeoutPending) {
  19614. clearTimeout(this.timeoutPending);
  19615. }
  19616. this.showPopper = false;
  19617. if (this.disabled) {
  19618. this.doDestroy();
  19619. }
  19620. },
  19621. setExpectedState: function setExpectedState(expectedState) {
  19622. if (expectedState === false) {
  19623. clearTimeout(this.timeoutPending);
  19624. }
  19625. this.expectedState = expectedState;
  19626. },
  19627. getFirstElement: function getFirstElement() {
  19628. var slots = this.$slots.default;
  19629. if (!Array.isArray(slots)) return null;
  19630. var element = null;
  19631. for (var index = 0; index < slots.length; index++) {
  19632. if (slots[index] && slots[index].tag) {
  19633. element = slots[index];
  19634. };
  19635. }
  19636. return element;
  19637. }
  19638. },
  19639. beforeDestroy: function beforeDestroy() {
  19640. this.popperVM && this.popperVM.$destroy();
  19641. },
  19642. destroyed: function destroyed() {
  19643. var reference = this.referenceElm;
  19644. if (reference.nodeType === 1) {
  19645. Object(dom_["off"])(reference, 'mouseenter', this.show);
  19646. Object(dom_["off"])(reference, 'mouseleave', this.hide);
  19647. Object(dom_["off"])(reference, 'focus', this.handleFocus);
  19648. Object(dom_["off"])(reference, 'blur', this.handleBlur);
  19649. Object(dom_["off"])(reference, 'click', this.removeFocusing);
  19650. }
  19651. }
  19652. });
  19653. // CONCATENATED MODULE: ./packages/tooltip/index.js
  19654. /* istanbul ignore next */
  19655. src_main.install = function (Vue) {
  19656. Vue.component(src_main.name, src_main);
  19657. };
  19658. /* harmony default export */ var packages_tooltip = (src_main);
  19659. // 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&
  19660. var mainvue_type_template_id_6b29b012_render = function() {
  19661. var _vm = this
  19662. var _h = _vm.$createElement
  19663. var _c = _vm._self._c || _h
  19664. return _c("transition", { attrs: { name: "msgbox-fade" } }, [
  19665. _c(
  19666. "div",
  19667. {
  19668. directives: [
  19669. {
  19670. name: "show",
  19671. rawName: "v-show",
  19672. value: _vm.visible,
  19673. expression: "visible"
  19674. }
  19675. ],
  19676. staticClass: "el-message-box__wrapper",
  19677. attrs: {
  19678. tabindex: "-1",
  19679. role: "dialog",
  19680. "aria-modal": "true",
  19681. "aria-label": _vm.title || "dialog"
  19682. },
  19683. on: {
  19684. click: function($event) {
  19685. if ($event.target !== $event.currentTarget) {
  19686. return null
  19687. }
  19688. return _vm.handleWrapperClick($event)
  19689. }
  19690. }
  19691. },
  19692. [
  19693. _c(
  19694. "div",
  19695. {
  19696. staticClass: "el-message-box",
  19697. class: [_vm.customClass, _vm.center && "el-message-box--center"]
  19698. },
  19699. [
  19700. _vm.title !== null
  19701. ? _c("div", { staticClass: "el-message-box__header" }, [
  19702. _c("div", { staticClass: "el-message-box__title" }, [
  19703. _vm.icon && _vm.center
  19704. ? _c("div", {
  19705. class: ["el-message-box__status", _vm.icon]
  19706. })
  19707. : _vm._e(),
  19708. _c("span", [_vm._v(_vm._s(_vm.title))])
  19709. ]),
  19710. _vm.showClose
  19711. ? _c(
  19712. "button",
  19713. {
  19714. staticClass: "el-message-box__headerbtn",
  19715. attrs: { type: "button", "aria-label": "Close" },
  19716. on: {
  19717. click: function($event) {
  19718. _vm.handleAction(
  19719. _vm.distinguishCancelAndClose
  19720. ? "close"
  19721. : "cancel"
  19722. )
  19723. },
  19724. keydown: function($event) {
  19725. if (
  19726. !("button" in $event) &&
  19727. _vm._k(
  19728. $event.keyCode,
  19729. "enter",
  19730. 13,
  19731. $event.key,
  19732. "Enter"
  19733. )
  19734. ) {
  19735. return null
  19736. }
  19737. _vm.handleAction(
  19738. _vm.distinguishCancelAndClose
  19739. ? "close"
  19740. : "cancel"
  19741. )
  19742. }
  19743. }
  19744. },
  19745. [
  19746. _c("i", {
  19747. staticClass: "el-message-box__close el-icon-close"
  19748. })
  19749. ]
  19750. )
  19751. : _vm._e()
  19752. ])
  19753. : _vm._e(),
  19754. _c("div", { staticClass: "el-message-box__content" }, [
  19755. _c("div", { staticClass: "el-message-box__container" }, [
  19756. _vm.icon && !_vm.center && _vm.message !== ""
  19757. ? _c("div", { class: ["el-message-box__status", _vm.icon] })
  19758. : _vm._e(),
  19759. _vm.message !== ""
  19760. ? _c(
  19761. "div",
  19762. { staticClass: "el-message-box__message" },
  19763. [
  19764. _vm._t("default", [
  19765. !_vm.dangerouslyUseHTMLString
  19766. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  19767. : _c("p", {
  19768. domProps: { innerHTML: _vm._s(_vm.message) }
  19769. })
  19770. ])
  19771. ],
  19772. 2
  19773. )
  19774. : _vm._e()
  19775. ]),
  19776. _c(
  19777. "div",
  19778. {
  19779. directives: [
  19780. {
  19781. name: "show",
  19782. rawName: "v-show",
  19783. value: _vm.showInput,
  19784. expression: "showInput"
  19785. }
  19786. ],
  19787. staticClass: "el-message-box__input"
  19788. },
  19789. [
  19790. _c("el-input", {
  19791. ref: "input",
  19792. attrs: {
  19793. type: _vm.inputType,
  19794. placeholder: _vm.inputPlaceholder
  19795. },
  19796. nativeOn: {
  19797. keydown: function($event) {
  19798. if (
  19799. !("button" in $event) &&
  19800. _vm._k(
  19801. $event.keyCode,
  19802. "enter",
  19803. 13,
  19804. $event.key,
  19805. "Enter"
  19806. )
  19807. ) {
  19808. return null
  19809. }
  19810. return _vm.handleInputEnter($event)
  19811. }
  19812. },
  19813. model: {
  19814. value: _vm.inputValue,
  19815. callback: function($$v) {
  19816. _vm.inputValue = $$v
  19817. },
  19818. expression: "inputValue"
  19819. }
  19820. }),
  19821. _c(
  19822. "div",
  19823. {
  19824. staticClass: "el-message-box__errormsg",
  19825. style: {
  19826. visibility: !!_vm.editorErrorMessage
  19827. ? "visible"
  19828. : "hidden"
  19829. }
  19830. },
  19831. [_vm._v(_vm._s(_vm.editorErrorMessage))]
  19832. )
  19833. ],
  19834. 1
  19835. )
  19836. ]),
  19837. _c(
  19838. "div",
  19839. { staticClass: "el-message-box__btns" },
  19840. [
  19841. _vm.showCancelButton
  19842. ? _c(
  19843. "el-button",
  19844. {
  19845. class: [_vm.cancelButtonClasses],
  19846. attrs: {
  19847. loading: _vm.cancelButtonLoading,
  19848. round: _vm.roundButton,
  19849. size: "small"
  19850. },
  19851. on: {
  19852. keydown: function($event) {
  19853. if (
  19854. !("button" in $event) &&
  19855. _vm._k(
  19856. $event.keyCode,
  19857. "enter",
  19858. 13,
  19859. $event.key,
  19860. "Enter"
  19861. )
  19862. ) {
  19863. return null
  19864. }
  19865. _vm.handleAction("cancel")
  19866. }
  19867. },
  19868. nativeOn: {
  19869. click: function($event) {
  19870. _vm.handleAction("cancel")
  19871. }
  19872. }
  19873. },
  19874. [
  19875. _vm._v(
  19876. "\n " +
  19877. _vm._s(
  19878. _vm.cancelButtonText ||
  19879. _vm.t("el.messagebox.cancel")
  19880. ) +
  19881. "\n "
  19882. )
  19883. ]
  19884. )
  19885. : _vm._e(),
  19886. _c(
  19887. "el-button",
  19888. {
  19889. directives: [
  19890. {
  19891. name: "show",
  19892. rawName: "v-show",
  19893. value: _vm.showConfirmButton,
  19894. expression: "showConfirmButton"
  19895. }
  19896. ],
  19897. ref: "confirm",
  19898. class: [_vm.confirmButtonClasses],
  19899. attrs: {
  19900. loading: _vm.confirmButtonLoading,
  19901. round: _vm.roundButton,
  19902. size: "small"
  19903. },
  19904. on: {
  19905. keydown: function($event) {
  19906. if (
  19907. !("button" in $event) &&
  19908. _vm._k(
  19909. $event.keyCode,
  19910. "enter",
  19911. 13,
  19912. $event.key,
  19913. "Enter"
  19914. )
  19915. ) {
  19916. return null
  19917. }
  19918. _vm.handleAction("confirm")
  19919. }
  19920. },
  19921. nativeOn: {
  19922. click: function($event) {
  19923. _vm.handleAction("confirm")
  19924. }
  19925. }
  19926. },
  19927. [
  19928. _vm._v(
  19929. "\n " +
  19930. _vm._s(
  19931. _vm.confirmButtonText ||
  19932. _vm.t("el.messagebox.confirm")
  19933. ) +
  19934. "\n "
  19935. )
  19936. ]
  19937. )
  19938. ],
  19939. 1
  19940. )
  19941. ]
  19942. )
  19943. ]
  19944. )
  19945. ])
  19946. }
  19947. var mainvue_type_template_id_6b29b012_staticRenderFns = []
  19948. mainvue_type_template_id_6b29b012_render._withStripped = true
  19949. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  19950. // EXTERNAL MODULE: external "element-ui/lib/locale"
  19951. var lib_locale_ = __webpack_require__(12);
  19952. var lib_locale_default = /*#__PURE__*/__webpack_require__.n(lib_locale_);
  19953. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-dialog"
  19954. var aria_dialog_ = __webpack_require__(39);
  19955. var aria_dialog_default = /*#__PURE__*/__webpack_require__.n(aria_dialog_);
  19956. // 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&
  19957. //
  19958. //
  19959. //
  19960. //
  19961. //
  19962. //
  19963. //
  19964. //
  19965. //
  19966. //
  19967. //
  19968. //
  19969. //
  19970. //
  19971. //
  19972. //
  19973. //
  19974. //
  19975. //
  19976. //
  19977. //
  19978. //
  19979. //
  19980. //
  19981. //
  19982. //
  19983. //
  19984. //
  19985. //
  19986. //
  19987. //
  19988. //
  19989. //
  19990. //
  19991. //
  19992. //
  19993. //
  19994. //
  19995. //
  19996. //
  19997. //
  19998. //
  19999. //
  20000. //
  20001. //
  20002. //
  20003. //
  20004. //
  20005. //
  20006. //
  20007. //
  20008. //
  20009. //
  20010. //
  20011. //
  20012. //
  20013. //
  20014. //
  20015. //
  20016. //
  20017. //
  20018. //
  20019. //
  20020. //
  20021. //
  20022. //
  20023. //
  20024. //
  20025. //
  20026. //
  20027. //
  20028. //
  20029. //
  20030. //
  20031. //
  20032. //
  20033. //
  20034. //
  20035. //
  20036. //
  20037. var messageBox = void 0;
  20038. var typeMap = {
  20039. success: 'success',
  20040. info: 'info',
  20041. warning: 'warning',
  20042. error: 'error'
  20043. };
  20044. /* harmony default export */ var message_box_src_mainvue_type_script_lang_js_ = ({
  20045. mixins: [popup_default.a, locale_default.a],
  20046. props: {
  20047. modal: {
  20048. default: true
  20049. },
  20050. lockScroll: {
  20051. default: true
  20052. },
  20053. showClose: {
  20054. type: Boolean,
  20055. default: true
  20056. },
  20057. closeOnClickModal: {
  20058. default: true
  20059. },
  20060. closeOnPressEscape: {
  20061. default: true
  20062. },
  20063. closeOnHashChange: {
  20064. default: true
  20065. },
  20066. center: {
  20067. default: false,
  20068. type: Boolean
  20069. },
  20070. roundButton: {
  20071. default: false,
  20072. type: Boolean
  20073. }
  20074. },
  20075. components: {
  20076. ElInput: input_default.a,
  20077. ElButton: button_default.a
  20078. },
  20079. computed: {
  20080. icon: function icon() {
  20081. var type = this.type,
  20082. iconClass = this.iconClass;
  20083. return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
  20084. },
  20085. confirmButtonClasses: function confirmButtonClasses() {
  20086. return 'el-button--primary ' + this.confirmButtonClass;
  20087. },
  20088. cancelButtonClasses: function cancelButtonClasses() {
  20089. return '' + this.cancelButtonClass;
  20090. }
  20091. },
  20092. methods: {
  20093. getSafeClose: function getSafeClose() {
  20094. var _this = this;
  20095. var currentId = this.uid;
  20096. return function () {
  20097. _this.$nextTick(function () {
  20098. if (currentId === _this.uid) _this.doClose();
  20099. });
  20100. };
  20101. },
  20102. doClose: function doClose() {
  20103. var _this2 = this;
  20104. if (!this.visible) return;
  20105. this.visible = false;
  20106. this._closing = true;
  20107. this.onClose && this.onClose();
  20108. messageBox.closeDialog(); // 解绑
  20109. if (this.lockScroll) {
  20110. setTimeout(this.restoreBodyStyle, 200);
  20111. }
  20112. this.opened = false;
  20113. this.doAfterClose();
  20114. setTimeout(function () {
  20115. if (_this2.action) _this2.callback(_this2.action, _this2);
  20116. });
  20117. },
  20118. handleWrapperClick: function handleWrapperClick() {
  20119. if (this.closeOnClickModal) {
  20120. this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
  20121. }
  20122. },
  20123. handleInputEnter: function handleInputEnter() {
  20124. if (this.inputType !== 'textarea') {
  20125. return this.handleAction('confirm');
  20126. }
  20127. },
  20128. handleAction: function handleAction(action) {
  20129. if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
  20130. return;
  20131. }
  20132. this.action = action;
  20133. if (typeof this.beforeClose === 'function') {
  20134. this.close = this.getSafeClose();
  20135. this.beforeClose(action, this, this.close);
  20136. } else {
  20137. this.doClose();
  20138. }
  20139. },
  20140. validate: function validate() {
  20141. if (this.$type === 'prompt') {
  20142. var inputPattern = this.inputPattern;
  20143. if (inputPattern && !inputPattern.test(this.inputValue || '')) {
  20144. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20145. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20146. return false;
  20147. }
  20148. var inputValidator = this.inputValidator;
  20149. if (typeof inputValidator === 'function') {
  20150. var validateResult = inputValidator(this.inputValue);
  20151. if (validateResult === false) {
  20152. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20153. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20154. return false;
  20155. }
  20156. if (typeof validateResult === 'string') {
  20157. this.editorErrorMessage = validateResult;
  20158. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20159. return false;
  20160. }
  20161. }
  20162. }
  20163. this.editorErrorMessage = '';
  20164. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20165. return true;
  20166. },
  20167. getFirstFocus: function getFirstFocus() {
  20168. var btn = this.$el.querySelector('.el-message-box__btns .el-button');
  20169. var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
  20170. return btn || title;
  20171. },
  20172. getInputElement: function getInputElement() {
  20173. var inputRefs = this.$refs.input.$refs;
  20174. return inputRefs.input || inputRefs.textarea;
  20175. },
  20176. handleClose: function handleClose() {
  20177. this.handleAction('close');
  20178. }
  20179. },
  20180. watch: {
  20181. inputValue: {
  20182. immediate: true,
  20183. handler: function handler(val) {
  20184. var _this3 = this;
  20185. this.$nextTick(function (_) {
  20186. if (_this3.$type === 'prompt' && val !== null) {
  20187. _this3.validate();
  20188. }
  20189. });
  20190. }
  20191. },
  20192. visible: function visible(val) {
  20193. var _this4 = this;
  20194. if (val) {
  20195. this.uid++;
  20196. if (this.$type === 'alert' || this.$type === 'confirm') {
  20197. this.$nextTick(function () {
  20198. _this4.$refs.confirm.$el.focus();
  20199. });
  20200. }
  20201. this.focusAfterClosed = document.activeElement;
  20202. messageBox = new aria_dialog_default.a(this.$el, this.focusAfterClosed, this.getFirstFocus());
  20203. }
  20204. // prompt
  20205. if (this.$type !== 'prompt') return;
  20206. if (val) {
  20207. setTimeout(function () {
  20208. if (_this4.$refs.input && _this4.$refs.input.$el) {
  20209. _this4.getInputElement().focus();
  20210. }
  20211. }, 500);
  20212. } else {
  20213. this.editorErrorMessage = '';
  20214. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20215. }
  20216. }
  20217. },
  20218. mounted: function mounted() {
  20219. var _this5 = this;
  20220. this.$nextTick(function () {
  20221. if (_this5.closeOnHashChange) {
  20222. window.addEventListener('hashchange', _this5.close);
  20223. }
  20224. });
  20225. },
  20226. beforeDestroy: function beforeDestroy() {
  20227. if (this.closeOnHashChange) {
  20228. window.removeEventListener('hashchange', this.close);
  20229. }
  20230. setTimeout(function () {
  20231. messageBox.closeDialog();
  20232. });
  20233. },
  20234. data: function data() {
  20235. return {
  20236. uid: 1,
  20237. title: undefined,
  20238. message: '',
  20239. type: '',
  20240. iconClass: '',
  20241. customClass: '',
  20242. showInput: false,
  20243. inputValue: null,
  20244. inputPlaceholder: '',
  20245. inputType: 'text',
  20246. inputPattern: null,
  20247. inputValidator: null,
  20248. inputErrorMessage: '',
  20249. showConfirmButton: true,
  20250. showCancelButton: false,
  20251. action: '',
  20252. confirmButtonText: '',
  20253. cancelButtonText: '',
  20254. confirmButtonLoading: false,
  20255. cancelButtonLoading: false,
  20256. confirmButtonClass: '',
  20257. confirmButtonDisabled: false,
  20258. cancelButtonClass: '',
  20259. editorErrorMessage: null,
  20260. callback: null,
  20261. dangerouslyUseHTMLString: false,
  20262. focusAfterClosed: null,
  20263. isOnComposition: false,
  20264. distinguishCancelAndClose: false
  20265. };
  20266. }
  20267. });
  20268. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=script&lang=js&
  20269. /* harmony default export */ var packages_message_box_src_mainvue_type_script_lang_js_ = (message_box_src_mainvue_type_script_lang_js_);
  20270. // CONCATENATED MODULE: ./packages/message-box/src/main.vue
  20271. /* normalize component */
  20272. var src_main_component = normalizeComponent(
  20273. packages_message_box_src_mainvue_type_script_lang_js_,
  20274. mainvue_type_template_id_6b29b012_render,
  20275. mainvue_type_template_id_6b29b012_staticRenderFns,
  20276. false,
  20277. null,
  20278. null,
  20279. null
  20280. )
  20281. /* hot reload */
  20282. if (false) { var src_main_api; }
  20283. src_main_component.options.__file = "packages/message-box/src/main.vue"
  20284. /* harmony default export */ var message_box_src_main = (src_main_component.exports);
  20285. // EXTERNAL MODULE: external "element-ui/lib/utils/vdom"
  20286. var vdom_ = __webpack_require__(22);
  20287. // CONCATENATED MODULE: ./packages/message-box/src/main.js
  20288. 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; };
  20289. var main_defaults = {
  20290. title: null,
  20291. message: '',
  20292. type: '',
  20293. iconClass: '',
  20294. showInput: false,
  20295. showClose: true,
  20296. modalFade: true,
  20297. lockScroll: true,
  20298. closeOnClickModal: true,
  20299. closeOnPressEscape: true,
  20300. closeOnHashChange: true,
  20301. inputValue: null,
  20302. inputPlaceholder: '',
  20303. inputType: 'text',
  20304. inputPattern: null,
  20305. inputValidator: null,
  20306. inputErrorMessage: '',
  20307. showConfirmButton: true,
  20308. showCancelButton: false,
  20309. confirmButtonPosition: 'right',
  20310. confirmButtonHighlight: false,
  20311. cancelButtonHighlight: false,
  20312. confirmButtonText: '',
  20313. cancelButtonText: '',
  20314. confirmButtonClass: '',
  20315. cancelButtonClass: '',
  20316. customClass: '',
  20317. beforeClose: null,
  20318. dangerouslyUseHTMLString: false,
  20319. center: false,
  20320. roundButton: false,
  20321. distinguishCancelAndClose: false
  20322. };
  20323. var MessageBoxConstructor = external_vue_default.a.extend(message_box_src_main);
  20324. var currentMsg = void 0,
  20325. main_instance = void 0;
  20326. var msgQueue = [];
  20327. var defaultCallback = function defaultCallback(action) {
  20328. if (currentMsg) {
  20329. var callback = currentMsg.callback;
  20330. if (typeof callback === 'function') {
  20331. if (main_instance.showInput) {
  20332. callback(main_instance.inputValue, action);
  20333. } else {
  20334. callback(action);
  20335. }
  20336. }
  20337. if (currentMsg.resolve) {
  20338. if (action === 'confirm') {
  20339. if (main_instance.showInput) {
  20340. currentMsg.resolve({ value: main_instance.inputValue, action: action });
  20341. } else {
  20342. currentMsg.resolve(action);
  20343. }
  20344. } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
  20345. currentMsg.reject(action);
  20346. }
  20347. }
  20348. }
  20349. };
  20350. var initInstance = function initInstance() {
  20351. main_instance = new MessageBoxConstructor({
  20352. el: document.createElement('div')
  20353. });
  20354. main_instance.callback = defaultCallback;
  20355. };
  20356. var main_showNextMsg = function showNextMsg() {
  20357. if (!main_instance) {
  20358. initInstance();
  20359. }
  20360. main_instance.action = '';
  20361. if (!main_instance.visible || main_instance.closeTimer) {
  20362. if (msgQueue.length > 0) {
  20363. currentMsg = msgQueue.shift();
  20364. var options = currentMsg.options;
  20365. for (var prop in options) {
  20366. if (options.hasOwnProperty(prop)) {
  20367. main_instance[prop] = options[prop];
  20368. }
  20369. }
  20370. if (options.callback === undefined) {
  20371. main_instance.callback = defaultCallback;
  20372. }
  20373. var oldCb = main_instance.callback;
  20374. main_instance.callback = function (action, instance) {
  20375. oldCb(action, instance);
  20376. showNextMsg();
  20377. };
  20378. if (Object(vdom_["isVNode"])(main_instance.message)) {
  20379. main_instance.$slots.default = [main_instance.message];
  20380. main_instance.message = null;
  20381. } else {
  20382. delete main_instance.$slots.default;
  20383. }
  20384. ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
  20385. if (main_instance[prop] === undefined) {
  20386. main_instance[prop] = true;
  20387. }
  20388. });
  20389. document.body.appendChild(main_instance.$el);
  20390. external_vue_default.a.nextTick(function () {
  20391. main_instance.visible = true;
  20392. });
  20393. }
  20394. }
  20395. };
  20396. var main_MessageBox = function MessageBox(options, callback) {
  20397. if (external_vue_default.a.prototype.$isServer) return;
  20398. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  20399. options = {
  20400. message: options
  20401. };
  20402. if (typeof arguments[1] === 'string') {
  20403. options.title = arguments[1];
  20404. }
  20405. } else if (options.callback && !callback) {
  20406. callback = options.callback;
  20407. }
  20408. if (typeof Promise !== 'undefined') {
  20409. return new Promise(function (resolve, reject) {
  20410. // eslint-disable-line
  20411. msgQueue.push({
  20412. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20413. callback: callback,
  20414. resolve: resolve,
  20415. reject: reject
  20416. });
  20417. main_showNextMsg();
  20418. });
  20419. } else {
  20420. msgQueue.push({
  20421. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20422. callback: callback
  20423. });
  20424. main_showNextMsg();
  20425. }
  20426. };
  20427. main_MessageBox.setDefaults = function (defaults) {
  20428. main_MessageBox.defaults = defaults;
  20429. };
  20430. main_MessageBox.alert = function (message, title, options) {
  20431. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20432. options = title;
  20433. title = '';
  20434. } else if (title === undefined) {
  20435. title = '';
  20436. }
  20437. return main_MessageBox(merge_default()({
  20438. title: title,
  20439. message: message,
  20440. $type: 'alert',
  20441. closeOnPressEscape: false,
  20442. closeOnClickModal: false
  20443. }, options));
  20444. };
  20445. main_MessageBox.confirm = function (message, title, options) {
  20446. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20447. options = title;
  20448. title = '';
  20449. } else if (title === undefined) {
  20450. title = '';
  20451. }
  20452. return main_MessageBox(merge_default()({
  20453. title: title,
  20454. message: message,
  20455. $type: 'confirm',
  20456. showCancelButton: true
  20457. }, options));
  20458. };
  20459. main_MessageBox.prompt = function (message, title, options) {
  20460. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20461. options = title;
  20462. title = '';
  20463. } else if (title === undefined) {
  20464. title = '';
  20465. }
  20466. return main_MessageBox(merge_default()({
  20467. title: title,
  20468. message: message,
  20469. showCancelButton: true,
  20470. showInput: true,
  20471. $type: 'prompt'
  20472. }, options));
  20473. };
  20474. main_MessageBox.close = function () {
  20475. main_instance.doClose();
  20476. main_instance.visible = false;
  20477. msgQueue = [];
  20478. currentMsg = null;
  20479. };
  20480. /* harmony default export */ var packages_message_box_src_main = (main_MessageBox);
  20481. // CONCATENATED MODULE: ./packages/message-box/index.js
  20482. /* harmony default export */ var message_box = (packages_message_box_src_main);
  20483. // 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&
  20484. var breadcrumbvue_type_template_id_4b464c06_render = function() {
  20485. var _vm = this
  20486. var _h = _vm.$createElement
  20487. var _c = _vm._self._c || _h
  20488. return _c(
  20489. "div",
  20490. {
  20491. staticClass: "el-breadcrumb",
  20492. attrs: { "aria-label": "Breadcrumb", role: "navigation" }
  20493. },
  20494. [_vm._t("default")],
  20495. 2
  20496. )
  20497. }
  20498. var breadcrumbvue_type_template_id_4b464c06_staticRenderFns = []
  20499. breadcrumbvue_type_template_id_4b464c06_render._withStripped = true
  20500. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=template&id=4b464c06&
  20501. // 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&
  20502. //
  20503. //
  20504. //
  20505. //
  20506. //
  20507. /* harmony default export */ var breadcrumbvue_type_script_lang_js_ = ({
  20508. name: 'ElBreadcrumb',
  20509. props: {
  20510. separator: {
  20511. type: String,
  20512. default: '/'
  20513. },
  20514. separatorClass: {
  20515. type: String,
  20516. default: ''
  20517. }
  20518. },
  20519. provide: function provide() {
  20520. return {
  20521. elBreadcrumb: this
  20522. };
  20523. },
  20524. mounted: function mounted() {
  20525. var items = this.$el.querySelectorAll('.el-breadcrumb__item');
  20526. if (items.length) {
  20527. items[items.length - 1].setAttribute('aria-current', 'page');
  20528. }
  20529. }
  20530. });
  20531. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=script&lang=js&
  20532. /* harmony default export */ var src_breadcrumbvue_type_script_lang_js_ = (breadcrumbvue_type_script_lang_js_);
  20533. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue
  20534. /* normalize component */
  20535. var breadcrumb_component = normalizeComponent(
  20536. src_breadcrumbvue_type_script_lang_js_,
  20537. breadcrumbvue_type_template_id_4b464c06_render,
  20538. breadcrumbvue_type_template_id_4b464c06_staticRenderFns,
  20539. false,
  20540. null,
  20541. null,
  20542. null
  20543. )
  20544. /* hot reload */
  20545. if (false) { var breadcrumb_api; }
  20546. breadcrumb_component.options.__file = "packages/breadcrumb/src/breadcrumb.vue"
  20547. /* harmony default export */ var breadcrumb = (breadcrumb_component.exports);
  20548. // CONCATENATED MODULE: ./packages/breadcrumb/index.js
  20549. /* istanbul ignore next */
  20550. breadcrumb.install = function (Vue) {
  20551. Vue.component(breadcrumb.name, breadcrumb);
  20552. };
  20553. /* harmony default export */ var packages_breadcrumb = (breadcrumb);
  20554. // 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&
  20555. var breadcrumb_itemvue_type_template_id_fcf9eaac_render = function() {
  20556. var _vm = this
  20557. var _h = _vm.$createElement
  20558. var _c = _vm._self._c || _h
  20559. return _c("span", { staticClass: "el-breadcrumb__item" }, [
  20560. _c(
  20561. "span",
  20562. {
  20563. ref: "link",
  20564. class: ["el-breadcrumb__inner", _vm.to ? "is-link" : ""],
  20565. attrs: { role: "link" }
  20566. },
  20567. [_vm._t("default")],
  20568. 2
  20569. ),
  20570. _vm.separatorClass
  20571. ? _c("i", {
  20572. staticClass: "el-breadcrumb__separator",
  20573. class: _vm.separatorClass
  20574. })
  20575. : _c(
  20576. "span",
  20577. {
  20578. staticClass: "el-breadcrumb__separator",
  20579. attrs: { role: "presentation" }
  20580. },
  20581. [_vm._v(_vm._s(_vm.separator))]
  20582. )
  20583. ])
  20584. }
  20585. var breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns = []
  20586. breadcrumb_itemvue_type_template_id_fcf9eaac_render._withStripped = true
  20587. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=template&id=fcf9eaac&
  20588. // 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&
  20589. //
  20590. //
  20591. //
  20592. //
  20593. //
  20594. //
  20595. //
  20596. //
  20597. //
  20598. //
  20599. //
  20600. //
  20601. /* harmony default export */ var breadcrumb_itemvue_type_script_lang_js_ = ({
  20602. name: 'ElBreadcrumbItem',
  20603. props: {
  20604. to: {},
  20605. replace: Boolean
  20606. },
  20607. data: function data() {
  20608. return {
  20609. separator: '',
  20610. separatorClass: ''
  20611. };
  20612. },
  20613. inject: ['elBreadcrumb'],
  20614. mounted: function mounted() {
  20615. var _this = this;
  20616. this.separator = this.elBreadcrumb.separator;
  20617. this.separatorClass = this.elBreadcrumb.separatorClass;
  20618. var link = this.$refs.link;
  20619. link.setAttribute('role', 'link');
  20620. link.addEventListener('click', function (_) {
  20621. var to = _this.to,
  20622. $router = _this.$router;
  20623. if (!to || !$router) return;
  20624. _this.replace ? $router.replace(to) : $router.push(to);
  20625. });
  20626. }
  20627. });
  20628. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=script&lang=js&
  20629. /* harmony default export */ var src_breadcrumb_itemvue_type_script_lang_js_ = (breadcrumb_itemvue_type_script_lang_js_);
  20630. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue
  20631. /* normalize component */
  20632. var breadcrumb_item_component = normalizeComponent(
  20633. src_breadcrumb_itemvue_type_script_lang_js_,
  20634. breadcrumb_itemvue_type_template_id_fcf9eaac_render,
  20635. breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns,
  20636. false,
  20637. null,
  20638. null,
  20639. null
  20640. )
  20641. /* hot reload */
  20642. if (false) { var breadcrumb_item_api; }
  20643. breadcrumb_item_component.options.__file = "packages/breadcrumb/src/breadcrumb-item.vue"
  20644. /* harmony default export */ var breadcrumb_item = (breadcrumb_item_component.exports);
  20645. // CONCATENATED MODULE: ./packages/breadcrumb-item/index.js
  20646. /* istanbul ignore next */
  20647. breadcrumb_item.install = function (Vue) {
  20648. Vue.component(breadcrumb_item.name, breadcrumb_item);
  20649. };
  20650. /* harmony default export */ var packages_breadcrumb_item = (breadcrumb_item);
  20651. // 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&
  20652. var formvue_type_template_id_a1b5ff34_render = function() {
  20653. var _vm = this
  20654. var _h = _vm.$createElement
  20655. var _c = _vm._self._c || _h
  20656. return _c(
  20657. "form",
  20658. {
  20659. staticClass: "el-form",
  20660. class: [
  20661. _vm.labelPosition ? "el-form--label-" + _vm.labelPosition : "",
  20662. { "el-form--inline": _vm.inline }
  20663. ]
  20664. },
  20665. [_vm._t("default")],
  20666. 2
  20667. )
  20668. }
  20669. var formvue_type_template_id_a1b5ff34_staticRenderFns = []
  20670. formvue_type_template_id_a1b5ff34_render._withStripped = true
  20671. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=template&id=a1b5ff34&
  20672. // 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&
  20673. //
  20674. //
  20675. //
  20676. //
  20677. //
  20678. //
  20679. //
  20680. //
  20681. /* harmony default export */ var formvue_type_script_lang_js_ = ({
  20682. name: 'ElForm',
  20683. componentName: 'ElForm',
  20684. provide: function provide() {
  20685. return {
  20686. elForm: this
  20687. };
  20688. },
  20689. props: {
  20690. model: Object,
  20691. rules: Object,
  20692. labelPosition: String,
  20693. labelWidth: String,
  20694. labelSuffix: {
  20695. type: String,
  20696. default: ''
  20697. },
  20698. inline: Boolean,
  20699. inlineMessage: Boolean,
  20700. statusIcon: Boolean,
  20701. showMessage: {
  20702. type: Boolean,
  20703. default: true
  20704. },
  20705. size: String,
  20706. disabled: Boolean,
  20707. validateOnRuleChange: {
  20708. type: Boolean,
  20709. default: true
  20710. },
  20711. hideRequiredAsterisk: {
  20712. type: Boolean,
  20713. default: false
  20714. }
  20715. },
  20716. watch: {
  20717. rules: function rules() {
  20718. // remove then add event listeners on form-item after form rules change
  20719. this.fields.forEach(function (field) {
  20720. field.removeValidateEvents();
  20721. field.addValidateEvents();
  20722. });
  20723. if (this.validateOnRuleChange) {
  20724. this.validate(function () {});
  20725. }
  20726. }
  20727. },
  20728. computed: {
  20729. autoLabelWidth: function autoLabelWidth() {
  20730. if (!this.potentialLabelWidthArr.length) return 0;
  20731. var max = Math.max.apply(Math, this.potentialLabelWidthArr);
  20732. return max ? max + 'px' : '';
  20733. }
  20734. },
  20735. data: function data() {
  20736. return {
  20737. fields: [],
  20738. potentialLabelWidthArr: [] // use this array to calculate auto width
  20739. };
  20740. },
  20741. created: function created() {
  20742. var _this = this;
  20743. this.$on('el.form.addField', function (field) {
  20744. if (field) {
  20745. _this.fields.push(field);
  20746. }
  20747. });
  20748. /* istanbul ignore next */
  20749. this.$on('el.form.removeField', function (field) {
  20750. if (field.prop) {
  20751. _this.fields.splice(_this.fields.indexOf(field), 1);
  20752. }
  20753. });
  20754. },
  20755. methods: {
  20756. resetFields: function resetFields() {
  20757. if (!this.model) {
  20758. console.warn('[Element Warn][Form]model is required for resetFields to work.');
  20759. return;
  20760. }
  20761. this.fields.forEach(function (field) {
  20762. field.resetField();
  20763. });
  20764. },
  20765. clearValidate: function clearValidate() {
  20766. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  20767. var fields = props.length ? typeof props === 'string' ? this.fields.filter(function (field) {
  20768. return props === field.prop;
  20769. }) : this.fields.filter(function (field) {
  20770. return props.indexOf(field.prop) > -1;
  20771. }) : this.fields;
  20772. fields.forEach(function (field) {
  20773. field.clearValidate();
  20774. });
  20775. },
  20776. validate: function validate(callback) {
  20777. var _this2 = this;
  20778. if (!this.model) {
  20779. console.warn('[Element Warn][Form]model is required for validate to work!');
  20780. return;
  20781. }
  20782. var promise = void 0;
  20783. // if no callback, return promise
  20784. if (typeof callback !== 'function' && window.Promise) {
  20785. promise = new window.Promise(function (resolve, reject) {
  20786. callback = function callback(valid, invalidFields) {
  20787. valid ? resolve(valid) : reject(invalidFields);
  20788. };
  20789. });
  20790. }
  20791. var valid = true;
  20792. var count = 0;
  20793. // 如果需要验证的fields为空,调用验证时立刻返回callback
  20794. if (this.fields.length === 0 && callback) {
  20795. callback(true);
  20796. }
  20797. var invalidFields = {};
  20798. this.fields.forEach(function (field) {
  20799. field.validate('', function (message, field) {
  20800. if (message) {
  20801. valid = false;
  20802. }
  20803. invalidFields = merge_default()({}, invalidFields, field);
  20804. if (typeof callback === 'function' && ++count === _this2.fields.length) {
  20805. callback(valid, invalidFields);
  20806. }
  20807. });
  20808. });
  20809. if (promise) {
  20810. return promise;
  20811. }
  20812. },
  20813. validateField: function validateField(props, cb) {
  20814. props = [].concat(props);
  20815. var fields = this.fields.filter(function (field) {
  20816. return props.indexOf(field.prop) !== -1;
  20817. });
  20818. if (!fields.length) {
  20819. console.warn('[Element Warn]please pass correct props!');
  20820. return;
  20821. }
  20822. fields.forEach(function (field) {
  20823. field.validate('', cb);
  20824. });
  20825. },
  20826. getLabelWidthIndex: function getLabelWidthIndex(width) {
  20827. var index = this.potentialLabelWidthArr.indexOf(width);
  20828. // it's impossible
  20829. if (index === -1) {
  20830. throw new Error('[ElementForm]unpected width ', width);
  20831. }
  20832. return index;
  20833. },
  20834. registerLabelWidth: function registerLabelWidth(val, oldVal) {
  20835. if (val && oldVal) {
  20836. var index = this.getLabelWidthIndex(oldVal);
  20837. this.potentialLabelWidthArr.splice(index, 1, val);
  20838. } else if (val) {
  20839. this.potentialLabelWidthArr.push(val);
  20840. }
  20841. },
  20842. deregisterLabelWidth: function deregisterLabelWidth(val) {
  20843. var index = this.getLabelWidthIndex(val);
  20844. this.potentialLabelWidthArr.splice(index, 1);
  20845. }
  20846. }
  20847. });
  20848. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=script&lang=js&
  20849. /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
  20850. // CONCATENATED MODULE: ./packages/form/src/form.vue
  20851. /* normalize component */
  20852. var form_component = normalizeComponent(
  20853. src_formvue_type_script_lang_js_,
  20854. formvue_type_template_id_a1b5ff34_render,
  20855. formvue_type_template_id_a1b5ff34_staticRenderFns,
  20856. false,
  20857. null,
  20858. null,
  20859. null
  20860. )
  20861. /* hot reload */
  20862. if (false) { var form_api; }
  20863. form_component.options.__file = "packages/form/src/form.vue"
  20864. /* harmony default export */ var src_form = (form_component.exports);
  20865. // CONCATENATED MODULE: ./packages/form/index.js
  20866. /* istanbul ignore next */
  20867. src_form.install = function (Vue) {
  20868. Vue.component(src_form.name, src_form);
  20869. };
  20870. /* harmony default export */ var packages_form = (src_form);
  20871. // 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&
  20872. var form_itemvue_type_template_id_b6f3db6c_render = function() {
  20873. var _vm = this
  20874. var _h = _vm.$createElement
  20875. var _c = _vm._self._c || _h
  20876. return _c(
  20877. "div",
  20878. {
  20879. staticClass: "el-form-item",
  20880. class: [
  20881. {
  20882. "el-form-item--feedback": _vm.elForm && _vm.elForm.statusIcon,
  20883. "is-error": _vm.validateState === "error",
  20884. "is-validating": _vm.validateState === "validating",
  20885. "is-success": _vm.validateState === "success",
  20886. "is-required": _vm.isRequired || _vm.required,
  20887. "is-no-asterisk": _vm.elForm && _vm.elForm.hideRequiredAsterisk
  20888. },
  20889. _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""
  20890. ]
  20891. },
  20892. [
  20893. _c(
  20894. "label-wrap",
  20895. {
  20896. attrs: {
  20897. "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
  20898. "update-all": _vm.form.labelWidth === "auto"
  20899. }
  20900. },
  20901. [
  20902. _vm.label || _vm.$slots.label
  20903. ? _c(
  20904. "label",
  20905. {
  20906. staticClass: "el-form-item__label",
  20907. style: _vm.labelStyle,
  20908. attrs: { for: _vm.labelFor }
  20909. },
  20910. [
  20911. _vm._t("label", [
  20912. _vm._v(_vm._s(_vm.label + _vm.form.labelSuffix))
  20913. ])
  20914. ],
  20915. 2
  20916. )
  20917. : _vm._e()
  20918. ]
  20919. ),
  20920. _c(
  20921. "div",
  20922. { staticClass: "el-form-item__content", style: _vm.contentStyle },
  20923. [
  20924. _vm._t("default"),
  20925. _c(
  20926. "transition",
  20927. { attrs: { name: "el-zoom-in-top" } },
  20928. [
  20929. _vm.validateState === "error" &&
  20930. _vm.showMessage &&
  20931. _vm.form.showMessage
  20932. ? _vm._t(
  20933. "error",
  20934. [
  20935. _c(
  20936. "div",
  20937. {
  20938. staticClass: "el-form-item__error",
  20939. class: {
  20940. "el-form-item__error--inline":
  20941. typeof _vm.inlineMessage === "boolean"
  20942. ? _vm.inlineMessage
  20943. : (_vm.elForm && _vm.elForm.inlineMessage) ||
  20944. false
  20945. }
  20946. },
  20947. [
  20948. _vm._v(
  20949. "\n " +
  20950. _vm._s(_vm.validateMessage) +
  20951. "\n "
  20952. )
  20953. ]
  20954. )
  20955. ],
  20956. { error: _vm.validateMessage }
  20957. )
  20958. : _vm._e()
  20959. ],
  20960. 2
  20961. )
  20962. ],
  20963. 2
  20964. )
  20965. ],
  20966. 1
  20967. )
  20968. }
  20969. var form_itemvue_type_template_id_b6f3db6c_staticRenderFns = []
  20970. form_itemvue_type_template_id_b6f3db6c_render._withStripped = true
  20971. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=template&id=b6f3db6c&
  20972. // EXTERNAL MODULE: external "async-validator"
  20973. var external_async_validator_ = __webpack_require__(40);
  20974. var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
  20975. // 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&
  20976. /* harmony default export */ var label_wrapvue_type_script_lang_js_ = ({
  20977. props: {
  20978. isAutoWidth: Boolean,
  20979. updateAll: Boolean
  20980. },
  20981. inject: ['elForm', 'elFormItem'],
  20982. render: function render() {
  20983. var h = arguments[0];
  20984. var slots = this.$slots.default;
  20985. if (!slots) return null;
  20986. if (this.isAutoWidth) {
  20987. var autoLabelWidth = this.elForm.autoLabelWidth;
  20988. var style = {};
  20989. if (autoLabelWidth && autoLabelWidth !== 'auto') {
  20990. var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
  20991. if (marginLeft) {
  20992. style.marginLeft = marginLeft + 'px';
  20993. }
  20994. }
  20995. return h(
  20996. 'div',
  20997. { 'class': 'el-form-item__label-wrap', style: style },
  20998. [slots]
  20999. );
  21000. } else {
  21001. return slots[0];
  21002. }
  21003. },
  21004. methods: {
  21005. getLabelWidth: function getLabelWidth() {
  21006. if (this.$el && this.$el.firstElementChild) {
  21007. var computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
  21008. return Math.ceil(parseFloat(computedWidth));
  21009. } else {
  21010. return 0;
  21011. }
  21012. },
  21013. updateLabelWidth: function updateLabelWidth() {
  21014. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'update';
  21015. if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
  21016. if (action === 'update') {
  21017. this.computedWidth = this.getLabelWidth();
  21018. } else if (action === 'remove') {
  21019. this.elForm.deregisterLabelWidth(this.computedWidth);
  21020. }
  21021. }
  21022. }
  21023. },
  21024. watch: {
  21025. computedWidth: function computedWidth(val, oldVal) {
  21026. if (this.updateAll) {
  21027. this.elForm.registerLabelWidth(val, oldVal);
  21028. this.elFormItem.updateComputedLabelWidth(val);
  21029. }
  21030. }
  21031. },
  21032. data: function data() {
  21033. return {
  21034. computedWidth: 0
  21035. };
  21036. },
  21037. mounted: function mounted() {
  21038. this.updateLabelWidth('update');
  21039. },
  21040. updated: function updated() {
  21041. this.updateLabelWidth('update');
  21042. },
  21043. beforeDestroy: function beforeDestroy() {
  21044. this.updateLabelWidth('remove');
  21045. }
  21046. });
  21047. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue?vue&type=script&lang=js&
  21048. /* harmony default export */ var src_label_wrapvue_type_script_lang_js_ = (label_wrapvue_type_script_lang_js_);
  21049. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue
  21050. var label_wrap_render, label_wrap_staticRenderFns
  21051. /* normalize component */
  21052. var label_wrap_component = normalizeComponent(
  21053. src_label_wrapvue_type_script_lang_js_,
  21054. label_wrap_render,
  21055. label_wrap_staticRenderFns,
  21056. false,
  21057. null,
  21058. null,
  21059. null
  21060. )
  21061. /* hot reload */
  21062. if (false) { var label_wrap_api; }
  21063. label_wrap_component.options.__file = "packages/form/src/label-wrap.vue"
  21064. /* harmony default export */ var label_wrap = (label_wrap_component.exports);
  21065. // 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&
  21066. //
  21067. //
  21068. //
  21069. //
  21070. //
  21071. //
  21072. //
  21073. //
  21074. //
  21075. //
  21076. //
  21077. //
  21078. //
  21079. //
  21080. //
  21081. //
  21082. //
  21083. //
  21084. //
  21085. //
  21086. //
  21087. //
  21088. //
  21089. //
  21090. //
  21091. //
  21092. //
  21093. //
  21094. //
  21095. //
  21096. //
  21097. //
  21098. //
  21099. //
  21100. //
  21101. //
  21102. //
  21103. //
  21104. //
  21105. //
  21106. /* harmony default export */ var form_itemvue_type_script_lang_js_ = ({
  21107. name: 'ElFormItem',
  21108. componentName: 'ElFormItem',
  21109. mixins: [emitter_default.a],
  21110. provide: function provide() {
  21111. return {
  21112. elFormItem: this
  21113. };
  21114. },
  21115. inject: ['elForm'],
  21116. props: {
  21117. label: String,
  21118. labelWidth: String,
  21119. prop: String,
  21120. required: {
  21121. type: Boolean,
  21122. default: undefined
  21123. },
  21124. rules: [Object, Array],
  21125. error: String,
  21126. validateStatus: String,
  21127. for: String,
  21128. inlineMessage: {
  21129. type: [String, Boolean],
  21130. default: ''
  21131. },
  21132. showMessage: {
  21133. type: Boolean,
  21134. default: true
  21135. },
  21136. size: String
  21137. },
  21138. components: {
  21139. // use this component to calculate auto width
  21140. LabelWrap: label_wrap
  21141. },
  21142. watch: {
  21143. error: {
  21144. immediate: true,
  21145. handler: function handler(value) {
  21146. this.validateMessage = value;
  21147. this.validateState = value ? 'error' : '';
  21148. }
  21149. },
  21150. validateStatus: function validateStatus(value) {
  21151. this.validateState = value;
  21152. }
  21153. },
  21154. computed: {
  21155. labelFor: function labelFor() {
  21156. return this.for || this.prop;
  21157. },
  21158. labelStyle: function labelStyle() {
  21159. var ret = {};
  21160. if (this.form.labelPosition === 'top') return ret;
  21161. var labelWidth = this.labelWidth || this.form.labelWidth;
  21162. if (labelWidth) {
  21163. ret.width = labelWidth;
  21164. }
  21165. return ret;
  21166. },
  21167. contentStyle: function contentStyle() {
  21168. var ret = {};
  21169. var label = this.label;
  21170. if (this.form.labelPosition === 'top' || this.form.inline) return ret;
  21171. if (!label && !this.labelWidth && this.isNested) return ret;
  21172. var labelWidth = this.labelWidth || this.form.labelWidth;
  21173. if (labelWidth === 'auto') {
  21174. if (this.labelWidth === 'auto') {
  21175. ret.marginLeft = this.computedLabelWidth;
  21176. } else if (this.form.labelWidth === 'auto') {
  21177. ret.marginLeft = this.elForm.autoLabelWidth;
  21178. }
  21179. } else {
  21180. ret.marginLeft = labelWidth;
  21181. }
  21182. return ret;
  21183. },
  21184. form: function form() {
  21185. var parent = this.$parent;
  21186. var parentName = parent.$options.componentName;
  21187. while (parentName !== 'ElForm') {
  21188. if (parentName === 'ElFormItem') {
  21189. this.isNested = true;
  21190. }
  21191. parent = parent.$parent;
  21192. parentName = parent.$options.componentName;
  21193. }
  21194. return parent;
  21195. },
  21196. fieldValue: function fieldValue() {
  21197. var model = this.form.model;
  21198. if (!model || !this.prop) {
  21199. return;
  21200. }
  21201. var path = this.prop;
  21202. if (path.indexOf(':') !== -1) {
  21203. path = path.replace(/:/, '.');
  21204. }
  21205. return Object(util_["getPropByPath"])(model, path, true).v;
  21206. },
  21207. isRequired: function isRequired() {
  21208. var rules = this.getRules();
  21209. var isRequired = false;
  21210. if (rules && rules.length) {
  21211. rules.every(function (rule) {
  21212. if (rule.required) {
  21213. isRequired = true;
  21214. return false;
  21215. }
  21216. return true;
  21217. });
  21218. }
  21219. return isRequired;
  21220. },
  21221. _formSize: function _formSize() {
  21222. return this.elForm.size;
  21223. },
  21224. elFormItemSize: function elFormItemSize() {
  21225. return this.size || this._formSize;
  21226. },
  21227. sizeClass: function sizeClass() {
  21228. return this.elFormItemSize || (this.$ELEMENT || {}).size;
  21229. }
  21230. },
  21231. data: function data() {
  21232. return {
  21233. validateState: '',
  21234. validateMessage: '',
  21235. validateDisabled: false,
  21236. validator: {},
  21237. isNested: false,
  21238. computedLabelWidth: ''
  21239. };
  21240. },
  21241. methods: {
  21242. validate: function validate(trigger) {
  21243. var _this = this;
  21244. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : util_["noop"];
  21245. this.validateDisabled = false;
  21246. var rules = this.getFilteredRule(trigger);
  21247. if ((!rules || rules.length === 0) && this.required === undefined) {
  21248. callback();
  21249. return true;
  21250. }
  21251. this.validateState = 'validating';
  21252. var descriptor = {};
  21253. if (rules && rules.length > 0) {
  21254. rules.forEach(function (rule) {
  21255. delete rule.trigger;
  21256. });
  21257. }
  21258. descriptor[this.prop] = rules;
  21259. var validator = new external_async_validator_default.a(descriptor);
  21260. var model = {};
  21261. model[this.prop] = this.fieldValue;
  21262. validator.validate(model, { firstFields: true }, function (errors, invalidFields) {
  21263. _this.validateState = !errors ? 'success' : 'error';
  21264. _this.validateMessage = errors ? errors[0].message : '';
  21265. callback(_this.validateMessage, invalidFields);
  21266. _this.elForm && _this.elForm.$emit('validate', _this.prop, !errors, _this.validateMessage || null);
  21267. });
  21268. },
  21269. clearValidate: function clearValidate() {
  21270. this.validateState = '';
  21271. this.validateMessage = '';
  21272. this.validateDisabled = false;
  21273. },
  21274. resetField: function resetField() {
  21275. var _this2 = this;
  21276. this.validateState = '';
  21277. this.validateMessage = '';
  21278. var model = this.form.model;
  21279. var value = this.fieldValue;
  21280. var path = this.prop;
  21281. if (path.indexOf(':') !== -1) {
  21282. path = path.replace(/:/, '.');
  21283. }
  21284. var prop = Object(util_["getPropByPath"])(model, path, true);
  21285. this.validateDisabled = true;
  21286. if (Array.isArray(value)) {
  21287. prop.o[prop.k] = [].concat(this.initialValue);
  21288. } else {
  21289. prop.o[prop.k] = this.initialValue;
  21290. }
  21291. // reset validateDisabled after onFieldChange triggered
  21292. this.$nextTick(function () {
  21293. _this2.validateDisabled = false;
  21294. });
  21295. this.broadcast('ElTimeSelect', 'fieldReset', this.initialValue);
  21296. },
  21297. getRules: function getRules() {
  21298. var formRules = this.form.rules;
  21299. var selfRules = this.rules;
  21300. var requiredRule = this.required !== undefined ? { required: !!this.required } : [];
  21301. var prop = Object(util_["getPropByPath"])(formRules, this.prop || '');
  21302. formRules = formRules ? prop.o[this.prop || ''] || prop.v : [];
  21303. return [].concat(selfRules || formRules || []).concat(requiredRule);
  21304. },
  21305. getFilteredRule: function getFilteredRule(trigger) {
  21306. var rules = this.getRules();
  21307. return rules.filter(function (rule) {
  21308. if (!rule.trigger || trigger === '') return true;
  21309. if (Array.isArray(rule.trigger)) {
  21310. return rule.trigger.indexOf(trigger) > -1;
  21311. } else {
  21312. return rule.trigger === trigger;
  21313. }
  21314. }).map(function (rule) {
  21315. return merge_default()({}, rule);
  21316. });
  21317. },
  21318. onFieldBlur: function onFieldBlur() {
  21319. this.validate('blur');
  21320. },
  21321. onFieldChange: function onFieldChange() {
  21322. if (this.validateDisabled) {
  21323. this.validateDisabled = false;
  21324. return;
  21325. }
  21326. this.validate('change');
  21327. },
  21328. updateComputedLabelWidth: function updateComputedLabelWidth(width) {
  21329. this.computedLabelWidth = width ? width + 'px' : '';
  21330. },
  21331. addValidateEvents: function addValidateEvents() {
  21332. var rules = this.getRules();
  21333. if (rules.length || this.required !== undefined) {
  21334. this.$on('el.form.blur', this.onFieldBlur);
  21335. this.$on('el.form.change', this.onFieldChange);
  21336. }
  21337. },
  21338. removeValidateEvents: function removeValidateEvents() {
  21339. this.$off();
  21340. }
  21341. },
  21342. mounted: function mounted() {
  21343. if (this.prop) {
  21344. this.dispatch('ElForm', 'el.form.addField', [this]);
  21345. var initialValue = this.fieldValue;
  21346. if (Array.isArray(initialValue)) {
  21347. initialValue = [].concat(initialValue);
  21348. }
  21349. Object.defineProperty(this, 'initialValue', {
  21350. value: initialValue
  21351. });
  21352. this.addValidateEvents();
  21353. }
  21354. },
  21355. beforeDestroy: function beforeDestroy() {
  21356. this.dispatch('ElForm', 'el.form.removeField', [this]);
  21357. }
  21358. });
  21359. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=script&lang=js&
  21360. /* harmony default export */ var src_form_itemvue_type_script_lang_js_ = (form_itemvue_type_script_lang_js_);
  21361. // CONCATENATED MODULE: ./packages/form/src/form-item.vue
  21362. /* normalize component */
  21363. var form_item_component = normalizeComponent(
  21364. src_form_itemvue_type_script_lang_js_,
  21365. form_itemvue_type_template_id_b6f3db6c_render,
  21366. form_itemvue_type_template_id_b6f3db6c_staticRenderFns,
  21367. false,
  21368. null,
  21369. null,
  21370. null
  21371. )
  21372. /* hot reload */
  21373. if (false) { var form_item_api; }
  21374. form_item_component.options.__file = "packages/form/src/form-item.vue"
  21375. /* harmony default export */ var form_item = (form_item_component.exports);
  21376. // CONCATENATED MODULE: ./packages/form-item/index.js
  21377. /* istanbul ignore next */
  21378. form_item.install = function (Vue) {
  21379. Vue.component(form_item.name, form_item);
  21380. };
  21381. /* harmony default export */ var packages_form_item = (form_item);
  21382. // 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&
  21383. var tab_barvue_type_template_id_2031f33a_render = function() {
  21384. var _vm = this
  21385. var _h = _vm.$createElement
  21386. var _c = _vm._self._c || _h
  21387. return _c("div", {
  21388. staticClass: "el-tabs__active-bar",
  21389. class: "is-" + _vm.rootTabs.tabPosition,
  21390. style: _vm.barStyle
  21391. })
  21392. }
  21393. var tab_barvue_type_template_id_2031f33a_staticRenderFns = []
  21394. tab_barvue_type_template_id_2031f33a_render._withStripped = true
  21395. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=template&id=2031f33a&
  21396. // 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&
  21397. //
  21398. //
  21399. //
  21400. /* harmony default export */ var tab_barvue_type_script_lang_js_ = ({
  21401. name: 'TabBar',
  21402. props: {
  21403. tabs: Array
  21404. },
  21405. inject: ['rootTabs'],
  21406. computed: {
  21407. barStyle: {
  21408. get: function get() {
  21409. var _this = this;
  21410. var style = {};
  21411. var offset = 0;
  21412. var tabSize = 0;
  21413. var sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21414. var sizeDir = sizeName === 'width' ? 'x' : 'y';
  21415. var firstUpperCase = function firstUpperCase(str) {
  21416. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21417. return L.toUpperCase();
  21418. });
  21419. };
  21420. this.tabs.every(function (tab, index) {
  21421. var $el = Object(util_["arrayFind"])(_this.$parent.$refs.tabs || [], function (t) {
  21422. return t.id.replace('tab-', '') === tab.paneName;
  21423. });
  21424. if (!$el) {
  21425. return false;
  21426. }
  21427. if (!tab.active) {
  21428. offset += $el['client' + firstUpperCase(sizeName)];
  21429. return true;
  21430. } else {
  21431. tabSize = $el['client' + firstUpperCase(sizeName)];
  21432. var tabStyles = window.getComputedStyle($el);
  21433. if (sizeName === 'width' && _this.tabs.length > 1) {
  21434. tabSize -= parseFloat(tabStyles.paddingLeft) + parseFloat(tabStyles.paddingRight);
  21435. }
  21436. if (sizeName === 'width') {
  21437. offset += parseFloat(tabStyles.paddingLeft);
  21438. }
  21439. return false;
  21440. }
  21441. });
  21442. var transform = 'translate' + firstUpperCase(sizeDir) + '(' + offset + 'px)';
  21443. style[sizeName] = tabSize + 'px';
  21444. style.transform = transform;
  21445. style.msTransform = transform;
  21446. style.webkitTransform = transform;
  21447. return style;
  21448. }
  21449. }
  21450. }
  21451. });
  21452. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js&
  21453. /* harmony default export */ var src_tab_barvue_type_script_lang_js_ = (tab_barvue_type_script_lang_js_);
  21454. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue
  21455. /* normalize component */
  21456. var tab_bar_component = normalizeComponent(
  21457. src_tab_barvue_type_script_lang_js_,
  21458. tab_barvue_type_template_id_2031f33a_render,
  21459. tab_barvue_type_template_id_2031f33a_staticRenderFns,
  21460. false,
  21461. null,
  21462. null,
  21463. null
  21464. )
  21465. /* hot reload */
  21466. if (false) { var tab_bar_api; }
  21467. tab_bar_component.options.__file = "packages/tabs/src/tab-bar.vue"
  21468. /* harmony default export */ var tab_bar = (tab_bar_component.exports);
  21469. // 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&
  21470. function noop() {}
  21471. var tab_navvue_type_script_lang_js_firstUpperCase = function firstUpperCase(str) {
  21472. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21473. return L.toUpperCase();
  21474. });
  21475. };
  21476. /* harmony default export */ var tab_navvue_type_script_lang_js_ = ({
  21477. name: 'TabNav',
  21478. components: {
  21479. TabBar: tab_bar
  21480. },
  21481. inject: ['rootTabs'],
  21482. props: {
  21483. panes: Array,
  21484. currentName: String,
  21485. editable: Boolean,
  21486. onTabClick: {
  21487. type: Function,
  21488. default: noop
  21489. },
  21490. onTabRemove: {
  21491. type: Function,
  21492. default: noop
  21493. },
  21494. type: String,
  21495. stretch: Boolean
  21496. },
  21497. data: function data() {
  21498. return {
  21499. scrollable: false,
  21500. navOffset: 0,
  21501. isFocus: false,
  21502. focusable: true
  21503. };
  21504. },
  21505. computed: {
  21506. navStyle: function navStyle() {
  21507. var dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
  21508. return {
  21509. transform: 'translate' + dir + '(-' + this.navOffset + 'px)'
  21510. };
  21511. },
  21512. sizeName: function sizeName() {
  21513. return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21514. }
  21515. },
  21516. methods: {
  21517. scrollPrev: function scrollPrev() {
  21518. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21519. var currentOffset = this.navOffset;
  21520. if (!currentOffset) return;
  21521. var newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
  21522. this.navOffset = newOffset;
  21523. },
  21524. scrollNext: function scrollNext() {
  21525. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21526. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21527. var currentOffset = this.navOffset;
  21528. if (navSize - currentOffset <= containerSize) return;
  21529. var newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  21530. this.navOffset = newOffset;
  21531. },
  21532. scrollToActiveTab: function scrollToActiveTab() {
  21533. if (!this.scrollable) return;
  21534. var nav = this.$refs.nav;
  21535. var activeTab = this.$el.querySelector('.is-active');
  21536. if (!activeTab) return;
  21537. var navScroll = this.$refs.navScroll;
  21538. var isHorizontal = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1;
  21539. var activeTabBounding = activeTab.getBoundingClientRect();
  21540. var navScrollBounding = navScroll.getBoundingClientRect();
  21541. var maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  21542. var currentOffset = this.navOffset;
  21543. var newOffset = currentOffset;
  21544. if (isHorizontal) {
  21545. if (activeTabBounding.left < navScrollBounding.left) {
  21546. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  21547. }
  21548. if (activeTabBounding.right > navScrollBounding.right) {
  21549. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  21550. }
  21551. } else {
  21552. if (activeTabBounding.top < navScrollBounding.top) {
  21553. newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  21554. }
  21555. if (activeTabBounding.bottom > navScrollBounding.bottom) {
  21556. newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  21557. }
  21558. }
  21559. newOffset = Math.max(newOffset, 0);
  21560. this.navOffset = Math.min(newOffset, maxOffset);
  21561. },
  21562. update: function update() {
  21563. if (!this.$refs.nav) return;
  21564. var sizeName = this.sizeName;
  21565. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21566. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21567. var currentOffset = this.navOffset;
  21568. if (containerSize < navSize) {
  21569. var _currentOffset = this.navOffset;
  21570. this.scrollable = this.scrollable || {};
  21571. this.scrollable.prev = _currentOffset;
  21572. this.scrollable.next = _currentOffset + containerSize < navSize;
  21573. if (navSize - _currentOffset < containerSize) {
  21574. this.navOffset = navSize - containerSize;
  21575. }
  21576. } else {
  21577. this.scrollable = false;
  21578. if (currentOffset > 0) {
  21579. this.navOffset = 0;
  21580. }
  21581. }
  21582. },
  21583. changeTab: function changeTab(e) {
  21584. var keyCode = e.keyCode;
  21585. var nextIndex = void 0;
  21586. var currentIndex = void 0,
  21587. tabList = void 0;
  21588. if ([37, 38, 39, 40].indexOf(keyCode) !== -1) {
  21589. // 左右上下键更换tab
  21590. tabList = e.currentTarget.querySelectorAll('[role=tab]');
  21591. currentIndex = Array.prototype.indexOf.call(tabList, e.target);
  21592. } else {
  21593. return;
  21594. }
  21595. if (keyCode === 37 || keyCode === 38) {
  21596. // left
  21597. if (currentIndex === 0) {
  21598. // first
  21599. nextIndex = tabList.length - 1;
  21600. } else {
  21601. nextIndex = currentIndex - 1;
  21602. }
  21603. } else {
  21604. // right
  21605. if (currentIndex < tabList.length - 1) {
  21606. // not last
  21607. nextIndex = currentIndex + 1;
  21608. } else {
  21609. nextIndex = 0;
  21610. }
  21611. }
  21612. tabList[nextIndex].focus(); // 改变焦点元素
  21613. tabList[nextIndex].click(); // 选中下一个tab
  21614. this.setFocus();
  21615. },
  21616. setFocus: function setFocus() {
  21617. if (this.focusable) {
  21618. this.isFocus = true;
  21619. }
  21620. },
  21621. removeFocus: function removeFocus() {
  21622. this.isFocus = false;
  21623. },
  21624. visibilityChangeHandler: function visibilityChangeHandler() {
  21625. var _this = this;
  21626. var visibility = document.visibilityState;
  21627. if (visibility === 'hidden') {
  21628. this.focusable = false;
  21629. } else if (visibility === 'visible') {
  21630. setTimeout(function () {
  21631. _this.focusable = true;
  21632. }, 50);
  21633. }
  21634. },
  21635. windowBlurHandler: function windowBlurHandler() {
  21636. this.focusable = false;
  21637. },
  21638. windowFocusHandler: function windowFocusHandler() {
  21639. var _this2 = this;
  21640. setTimeout(function () {
  21641. _this2.focusable = true;
  21642. }, 50);
  21643. }
  21644. },
  21645. updated: function updated() {
  21646. this.update();
  21647. },
  21648. render: function render(h) {
  21649. var _this3 = this;
  21650. var type = this.type,
  21651. panes = this.panes,
  21652. editable = this.editable,
  21653. stretch = this.stretch,
  21654. onTabClick = this.onTabClick,
  21655. onTabRemove = this.onTabRemove,
  21656. navStyle = this.navStyle,
  21657. scrollable = this.scrollable,
  21658. scrollNext = this.scrollNext,
  21659. scrollPrev = this.scrollPrev,
  21660. changeTab = this.changeTab,
  21661. setFocus = this.setFocus,
  21662. removeFocus = this.removeFocus;
  21663. var scrollBtn = scrollable ? [h(
  21664. 'span',
  21665. { 'class': ['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled'], on: {
  21666. 'click': scrollPrev
  21667. }
  21668. },
  21669. [h('i', { 'class': 'el-icon-arrow-left' })]
  21670. ), h(
  21671. 'span',
  21672. { 'class': ['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled'], on: {
  21673. 'click': scrollNext
  21674. }
  21675. },
  21676. [h('i', { 'class': 'el-icon-arrow-right' })]
  21677. )] : null;
  21678. var tabs = this._l(panes, function (pane, index) {
  21679. var _ref;
  21680. var tabName = pane.name || pane.index || index;
  21681. var closable = pane.isClosable || editable;
  21682. pane.index = '' + index;
  21683. var btnClose = closable ? h('span', { 'class': 'el-icon-close', on: {
  21684. 'click': function click(ev) {
  21685. onTabRemove(pane, ev);
  21686. }
  21687. }
  21688. }) : null;
  21689. var tabLabelContent = pane.$slots.label || pane.label;
  21690. var tabindex = pane.active ? 0 : -1;
  21691. return h(
  21692. 'div',
  21693. {
  21694. 'class': (_ref = {
  21695. 'el-tabs__item': true
  21696. }, _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),
  21697. attrs: { id: 'tab-' + tabName,
  21698. 'aria-controls': 'pane-' + tabName,
  21699. role: 'tab',
  21700. 'aria-selected': pane.active,
  21701. tabindex: tabindex
  21702. },
  21703. key: 'tab-' + tabName, ref: 'tabs', refInFor: true,
  21704. on: {
  21705. 'focus': function focus() {
  21706. setFocus();
  21707. },
  21708. 'blur': function blur() {
  21709. removeFocus();
  21710. },
  21711. 'click': function click(ev) {
  21712. removeFocus();onTabClick(pane, tabName, ev);
  21713. },
  21714. 'keydown': function keydown(ev) {
  21715. if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) {
  21716. onTabRemove(pane, ev);
  21717. }
  21718. }
  21719. }
  21720. },
  21721. [tabLabelContent, btnClose]
  21722. );
  21723. });
  21724. return h(
  21725. 'div',
  21726. { 'class': ['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', 'is-' + this.rootTabs.tabPosition] },
  21727. [scrollBtn, h(
  21728. 'div',
  21729. { 'class': ['el-tabs__nav-scroll'], ref: 'navScroll' },
  21730. [h(
  21731. 'div',
  21732. {
  21733. 'class': ['el-tabs__nav', 'is-' + this.rootTabs.tabPosition, stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : ''],
  21734. ref: 'nav',
  21735. style: navStyle,
  21736. attrs: { role: 'tablist'
  21737. },
  21738. on: {
  21739. 'keydown': changeTab
  21740. }
  21741. },
  21742. [!type ? h('tab-bar', {
  21743. attrs: { tabs: panes }
  21744. }) : null, tabs]
  21745. )]
  21746. )]
  21747. );
  21748. },
  21749. mounted: function mounted() {
  21750. var _this4 = this;
  21751. Object(resize_event_["addResizeListener"])(this.$el, this.update);
  21752. document.addEventListener('visibilitychange', this.visibilityChangeHandler);
  21753. window.addEventListener('blur', this.windowBlurHandler);
  21754. window.addEventListener('focus', this.windowFocusHandler);
  21755. setTimeout(function () {
  21756. _this4.scrollToActiveTab();
  21757. }, 0);
  21758. },
  21759. beforeDestroy: function beforeDestroy() {
  21760. if (this.$el && this.update) Object(resize_event_["removeResizeListener"])(this.$el, this.update);
  21761. document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
  21762. window.removeEventListener('blur', this.windowBlurHandler);
  21763. window.removeEventListener('focus', this.windowFocusHandler);
  21764. }
  21765. });
  21766. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js&
  21767. /* harmony default export */ var src_tab_navvue_type_script_lang_js_ = (tab_navvue_type_script_lang_js_);
  21768. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue
  21769. var tab_nav_render, tab_nav_staticRenderFns
  21770. /* normalize component */
  21771. var tab_nav_component = normalizeComponent(
  21772. src_tab_navvue_type_script_lang_js_,
  21773. tab_nav_render,
  21774. tab_nav_staticRenderFns,
  21775. false,
  21776. null,
  21777. null,
  21778. null
  21779. )
  21780. /* hot reload */
  21781. if (false) { var tab_nav_api; }
  21782. tab_nav_component.options.__file = "packages/tabs/src/tab-nav.vue"
  21783. /* harmony default export */ var tab_nav = (tab_nav_component.exports);
  21784. // 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&
  21785. /* harmony default export */ var tabsvue_type_script_lang_js_ = ({
  21786. name: 'ElTabs',
  21787. components: {
  21788. TabNav: tab_nav
  21789. },
  21790. props: {
  21791. type: String,
  21792. activeName: String,
  21793. closable: Boolean,
  21794. addable: Boolean,
  21795. value: {},
  21796. editable: Boolean,
  21797. tabPosition: {
  21798. type: String,
  21799. default: 'top'
  21800. },
  21801. beforeLeave: Function,
  21802. stretch: Boolean
  21803. },
  21804. provide: function provide() {
  21805. return {
  21806. rootTabs: this
  21807. };
  21808. },
  21809. data: function data() {
  21810. return {
  21811. currentName: this.value || this.activeName,
  21812. panes: []
  21813. };
  21814. },
  21815. watch: {
  21816. activeName: function activeName(value) {
  21817. this.setCurrentName(value);
  21818. },
  21819. value: function value(_value) {
  21820. this.setCurrentName(_value);
  21821. },
  21822. currentName: function currentName(value) {
  21823. var _this = this;
  21824. if (this.$refs.nav) {
  21825. this.$nextTick(function () {
  21826. _this.$refs.nav.$nextTick(function (_) {
  21827. _this.$refs.nav.scrollToActiveTab();
  21828. });
  21829. });
  21830. }
  21831. }
  21832. },
  21833. methods: {
  21834. calcPaneInstances: function calcPaneInstances() {
  21835. var _this2 = this;
  21836. var isForceUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  21837. if (this.$slots.default) {
  21838. var paneSlots = this.$slots.default.filter(function (vnode) {
  21839. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane';
  21840. });
  21841. // update indeed
  21842. var panes = paneSlots.map(function (_ref) {
  21843. var componentInstance = _ref.componentInstance;
  21844. return componentInstance;
  21845. });
  21846. var panesChanged = !(panes.length === this.panes.length && panes.every(function (pane, index) {
  21847. return pane === _this2.panes[index];
  21848. }));
  21849. if (isForceUpdate || panesChanged) {
  21850. this.panes = panes;
  21851. }
  21852. } else if (this.panes.length !== 0) {
  21853. this.panes = [];
  21854. }
  21855. },
  21856. handleTabClick: function handleTabClick(tab, tabName, event) {
  21857. if (tab.disabled) return;
  21858. this.setCurrentName(tabName);
  21859. this.$emit('tab-click', tab, event);
  21860. },
  21861. handleTabRemove: function handleTabRemove(pane, ev) {
  21862. if (pane.disabled) return;
  21863. ev.stopPropagation();
  21864. this.$emit('edit', pane.name, 'remove');
  21865. this.$emit('tab-remove', pane.name);
  21866. },
  21867. handleTabAdd: function handleTabAdd() {
  21868. this.$emit('edit', null, 'add');
  21869. this.$emit('tab-add');
  21870. },
  21871. setCurrentName: function setCurrentName(value) {
  21872. var _this3 = this;
  21873. var changeCurrentName = function changeCurrentName() {
  21874. _this3.currentName = value;
  21875. _this3.$emit('input', value);
  21876. };
  21877. if (this.currentName !== value && this.beforeLeave) {
  21878. var before = this.beforeLeave(value, this.currentName);
  21879. if (before && before.then) {
  21880. before.then(function () {
  21881. changeCurrentName();
  21882. _this3.$refs.nav && _this3.$refs.nav.removeFocus();
  21883. }, function () {
  21884. // https://github.com/ElemeFE/element/pull/14816
  21885. // ignore promise rejection in `before-leave` hook
  21886. });
  21887. } else if (before !== false) {
  21888. changeCurrentName();
  21889. }
  21890. } else {
  21891. changeCurrentName();
  21892. }
  21893. }
  21894. },
  21895. render: function render(h) {
  21896. var _ref2;
  21897. var type = this.type,
  21898. handleTabClick = this.handleTabClick,
  21899. handleTabRemove = this.handleTabRemove,
  21900. handleTabAdd = this.handleTabAdd,
  21901. currentName = this.currentName,
  21902. panes = this.panes,
  21903. editable = this.editable,
  21904. addable = this.addable,
  21905. tabPosition = this.tabPosition,
  21906. stretch = this.stretch;
  21907. var newButton = editable || addable ? h(
  21908. 'span',
  21909. {
  21910. 'class': 'el-tabs__new-tab',
  21911. on: {
  21912. 'click': handleTabAdd,
  21913. 'keydown': function keydown(ev) {
  21914. if (ev.keyCode === 13) {
  21915. handleTabAdd();
  21916. }
  21917. }
  21918. },
  21919. attrs: {
  21920. tabindex: '0'
  21921. }
  21922. },
  21923. [h('i', { 'class': 'el-icon-plus' })]
  21924. ) : null;
  21925. var navData = {
  21926. props: {
  21927. currentName: currentName,
  21928. onTabClick: handleTabClick,
  21929. onTabRemove: handleTabRemove,
  21930. editable: editable,
  21931. type: type,
  21932. panes: panes,
  21933. stretch: stretch
  21934. },
  21935. ref: 'nav'
  21936. };
  21937. var header = h(
  21938. 'div',
  21939. { 'class': ['el-tabs__header', 'is-' + tabPosition] },
  21940. [newButton, h('tab-nav', navData)]
  21941. );
  21942. var panels = h(
  21943. 'div',
  21944. { 'class': 'el-tabs__content' },
  21945. [this.$slots.default]
  21946. );
  21947. return h(
  21948. 'div',
  21949. { 'class': (_ref2 = {
  21950. 'el-tabs': true,
  21951. 'el-tabs--card': type === 'card'
  21952. }, _ref2['el-tabs--' + tabPosition] = true, _ref2['el-tabs--border-card'] = type === 'border-card', _ref2) },
  21953. [tabPosition !== 'bottom' ? [header, panels] : [panels, header]]
  21954. );
  21955. },
  21956. created: function created() {
  21957. if (!this.currentName) {
  21958. this.setCurrentName('0');
  21959. }
  21960. this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
  21961. },
  21962. mounted: function mounted() {
  21963. this.calcPaneInstances();
  21964. },
  21965. updated: function updated() {
  21966. this.calcPaneInstances();
  21967. }
  21968. });
  21969. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue?vue&type=script&lang=js&
  21970. /* harmony default export */ var src_tabsvue_type_script_lang_js_ = (tabsvue_type_script_lang_js_);
  21971. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue
  21972. var tabs_render, tabs_staticRenderFns
  21973. /* normalize component */
  21974. var tabs_component = normalizeComponent(
  21975. src_tabsvue_type_script_lang_js_,
  21976. tabs_render,
  21977. tabs_staticRenderFns,
  21978. false,
  21979. null,
  21980. null,
  21981. null
  21982. )
  21983. /* hot reload */
  21984. if (false) { var tabs_api; }
  21985. tabs_component.options.__file = "packages/tabs/src/tabs.vue"
  21986. /* harmony default export */ var tabs = (tabs_component.exports);
  21987. // CONCATENATED MODULE: ./packages/tabs/index.js
  21988. /* istanbul ignore next */
  21989. tabs.install = function (Vue) {
  21990. Vue.component(tabs.name, tabs);
  21991. };
  21992. /* harmony default export */ var packages_tabs = (tabs);
  21993. // 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&
  21994. var tab_panevue_type_template_id_9145a070_render = function() {
  21995. var _vm = this
  21996. var _h = _vm.$createElement
  21997. var _c = _vm._self._c || _h
  21998. return !_vm.lazy || _vm.loaded || _vm.active
  21999. ? _c(
  22000. "div",
  22001. {
  22002. directives: [
  22003. {
  22004. name: "show",
  22005. rawName: "v-show",
  22006. value: _vm.active,
  22007. expression: "active"
  22008. }
  22009. ],
  22010. staticClass: "el-tab-pane",
  22011. attrs: {
  22012. role: "tabpanel",
  22013. "aria-hidden": !_vm.active,
  22014. id: "pane-" + _vm.paneName,
  22015. "aria-labelledby": "tab-" + _vm.paneName
  22016. }
  22017. },
  22018. [_vm._t("default")],
  22019. 2
  22020. )
  22021. : _vm._e()
  22022. }
  22023. var tab_panevue_type_template_id_9145a070_staticRenderFns = []
  22024. tab_panevue_type_template_id_9145a070_render._withStripped = true
  22025. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
  22026. // 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&
  22027. //
  22028. //
  22029. //
  22030. //
  22031. //
  22032. //
  22033. //
  22034. //
  22035. //
  22036. //
  22037. //
  22038. //
  22039. //
  22040. /* harmony default export */ var tab_panevue_type_script_lang_js_ = ({
  22041. name: 'ElTabPane',
  22042. componentName: 'ElTabPane',
  22043. props: {
  22044. label: String,
  22045. labelContent: Function,
  22046. name: String,
  22047. closable: Boolean,
  22048. disabled: Boolean,
  22049. lazy: Boolean
  22050. },
  22051. data: function data() {
  22052. return {
  22053. index: null,
  22054. loaded: false
  22055. };
  22056. },
  22057. computed: {
  22058. isClosable: function isClosable() {
  22059. return this.closable || this.$parent.closable;
  22060. },
  22061. active: function active() {
  22062. var active = this.$parent.currentName === (this.name || this.index);
  22063. if (active) {
  22064. this.loaded = true;
  22065. }
  22066. return active;
  22067. },
  22068. paneName: function paneName() {
  22069. return this.name || this.index;
  22070. }
  22071. },
  22072. updated: function updated() {
  22073. this.$parent.$emit('tab-nav-update');
  22074. }
  22075. });
  22076. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
  22077. /* harmony default export */ var src_tab_panevue_type_script_lang_js_ = (tab_panevue_type_script_lang_js_);
  22078. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue
  22079. /* normalize component */
  22080. var tab_pane_component = normalizeComponent(
  22081. src_tab_panevue_type_script_lang_js_,
  22082. tab_panevue_type_template_id_9145a070_render,
  22083. tab_panevue_type_template_id_9145a070_staticRenderFns,
  22084. false,
  22085. null,
  22086. null,
  22087. null
  22088. )
  22089. /* hot reload */
  22090. if (false) { var tab_pane_api; }
  22091. tab_pane_component.options.__file = "packages/tabs/src/tab-pane.vue"
  22092. /* harmony default export */ var tab_pane = (tab_pane_component.exports);
  22093. // CONCATENATED MODULE: ./packages/tab-pane/index.js
  22094. /* istanbul ignore next */
  22095. tab_pane.install = function (Vue) {
  22096. Vue.component(tab_pane.name, tab_pane);
  22097. };
  22098. /* harmony default export */ var packages_tab_pane = (tab_pane);
  22099. // 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&
  22100. /* harmony default export */ var tagvue_type_script_lang_js_ = ({
  22101. name: 'ElTag',
  22102. props: {
  22103. text: String,
  22104. closable: Boolean,
  22105. type: String,
  22106. hit: Boolean,
  22107. disableTransitions: Boolean,
  22108. color: String,
  22109. size: String,
  22110. effect: {
  22111. type: String,
  22112. default: 'light',
  22113. validator: function validator(val) {
  22114. return ['dark', 'light', 'plain'].indexOf(val) !== -1;
  22115. }
  22116. }
  22117. },
  22118. methods: {
  22119. handleClose: function handleClose(event) {
  22120. event.stopPropagation();
  22121. this.$emit('close', event);
  22122. },
  22123. handleClick: function handleClick(event) {
  22124. this.$emit('click', event);
  22125. }
  22126. },
  22127. computed: {
  22128. tagSize: function tagSize() {
  22129. return this.size || (this.$ELEMENT || {}).size;
  22130. }
  22131. },
  22132. render: function render(h) {
  22133. var type = this.type,
  22134. tagSize = this.tagSize,
  22135. hit = this.hit,
  22136. effect = this.effect;
  22137. var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
  22138. var tagEl = h(
  22139. 'span',
  22140. {
  22141. 'class': classes,
  22142. style: { backgroundColor: this.color },
  22143. on: {
  22144. 'click': this.handleClick
  22145. }
  22146. },
  22147. [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
  22148. 'click': this.handleClose
  22149. }
  22150. })]
  22151. );
  22152. return this.disableTransitions ? tagEl : h(
  22153. 'transition',
  22154. {
  22155. attrs: { name: 'el-zoom-in-center' }
  22156. },
  22157. [tagEl]
  22158. );
  22159. }
  22160. });
  22161. // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js&
  22162. /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_);
  22163. // CONCATENATED MODULE: ./packages/tag/src/tag.vue
  22164. var tag_render, tag_staticRenderFns
  22165. /* normalize component */
  22166. var tag_component = normalizeComponent(
  22167. src_tagvue_type_script_lang_js_,
  22168. tag_render,
  22169. tag_staticRenderFns,
  22170. false,
  22171. null,
  22172. null,
  22173. null
  22174. )
  22175. /* hot reload */
  22176. if (false) { var tag_api; }
  22177. tag_component.options.__file = "packages/tag/src/tag.vue"
  22178. /* harmony default export */ var src_tag = (tag_component.exports);
  22179. // CONCATENATED MODULE: ./packages/tag/index.js
  22180. /* istanbul ignore next */
  22181. src_tag.install = function (Vue) {
  22182. Vue.component(src_tag.name, src_tag);
  22183. };
  22184. /* harmony default export */ var packages_tag = (src_tag);
  22185. // 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&
  22186. var treevue_type_template_id_547575a6_render = function() {
  22187. var _vm = this
  22188. var _h = _vm.$createElement
  22189. var _c = _vm._self._c || _h
  22190. return _c(
  22191. "div",
  22192. {
  22193. staticClass: "el-tree",
  22194. class: {
  22195. "el-tree--highlight-current": _vm.highlightCurrent,
  22196. "is-dragging": !!_vm.dragState.draggingNode,
  22197. "is-drop-not-allow": !_vm.dragState.allowDrop,
  22198. "is-drop-inner": _vm.dragState.dropType === "inner"
  22199. },
  22200. attrs: { role: "tree" }
  22201. },
  22202. [
  22203. _vm._l(_vm.root.childNodes, function(child) {
  22204. return _c("el-tree-node", {
  22205. key: _vm.getNodeKey(child),
  22206. attrs: {
  22207. node: child,
  22208. props: _vm.props,
  22209. "render-after-expand": _vm.renderAfterExpand,
  22210. "show-checkbox": _vm.showCheckbox,
  22211. "render-content": _vm.renderContent
  22212. },
  22213. on: { "node-expand": _vm.handleNodeExpand }
  22214. })
  22215. }),
  22216. _vm.isEmpty
  22217. ? _c("div", { staticClass: "el-tree__empty-block" }, [
  22218. _c("span", { staticClass: "el-tree__empty-text" }, [
  22219. _vm._v(_vm._s(_vm.emptyText))
  22220. ])
  22221. ])
  22222. : _vm._e(),
  22223. _c("div", {
  22224. directives: [
  22225. {
  22226. name: "show",
  22227. rawName: "v-show",
  22228. value: _vm.dragState.showDropIndicator,
  22229. expression: "dragState.showDropIndicator"
  22230. }
  22231. ],
  22232. ref: "dropIndicator",
  22233. staticClass: "el-tree__drop-indicator"
  22234. })
  22235. ],
  22236. 2
  22237. )
  22238. }
  22239. var treevue_type_template_id_547575a6_staticRenderFns = []
  22240. treevue_type_template_id_547575a6_render._withStripped = true
  22241. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=547575a6&
  22242. // CONCATENATED MODULE: ./packages/tree/src/model/util.js
  22243. var NODE_KEY = '$treeNodeId';
  22244. var markNodeData = function markNodeData(node, data) {
  22245. if (!data || data[NODE_KEY]) return;
  22246. Object.defineProperty(data, NODE_KEY, {
  22247. value: node.id,
  22248. enumerable: false,
  22249. configurable: false,
  22250. writable: false
  22251. });
  22252. };
  22253. var util_getNodeKey = function getNodeKey(key, data) {
  22254. if (!key) return data[NODE_KEY];
  22255. return data[key];
  22256. };
  22257. var findNearestComponent = function findNearestComponent(element, componentName) {
  22258. var target = element;
  22259. while (target && target.tagName !== 'BODY') {
  22260. if (target.__vue__ && target.__vue__.$options.name === componentName) {
  22261. return target.__vue__;
  22262. }
  22263. target = target.parentNode;
  22264. }
  22265. return null;
  22266. };
  22267. // CONCATENATED MODULE: ./packages/tree/src/model/node.js
  22268. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22269. function node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22270. var getChildState = function getChildState(node) {
  22271. var all = true;
  22272. var none = true;
  22273. var allWithoutDisable = true;
  22274. for (var i = 0, j = node.length; i < j; i++) {
  22275. var n = node[i];
  22276. if (n.checked !== true || n.indeterminate) {
  22277. all = false;
  22278. if (!n.disabled) {
  22279. allWithoutDisable = false;
  22280. }
  22281. }
  22282. if (n.checked !== false || n.indeterminate) {
  22283. none = false;
  22284. }
  22285. }
  22286. return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
  22287. };
  22288. var reInitChecked = function reInitChecked(node) {
  22289. if (node.childNodes.length === 0) return;
  22290. var _getChildState = getChildState(node.childNodes),
  22291. all = _getChildState.all,
  22292. none = _getChildState.none,
  22293. half = _getChildState.half;
  22294. if (all) {
  22295. node.checked = true;
  22296. node.indeterminate = false;
  22297. } else if (half) {
  22298. node.checked = false;
  22299. node.indeterminate = true;
  22300. } else if (none) {
  22301. node.checked = false;
  22302. node.indeterminate = false;
  22303. }
  22304. var parent = node.parent;
  22305. if (!parent || parent.level === 0) return;
  22306. if (!node.store.checkStrictly) {
  22307. reInitChecked(parent);
  22308. }
  22309. };
  22310. var getPropertyFromData = function getPropertyFromData(node, prop) {
  22311. var props = node.store.props;
  22312. var data = node.data || {};
  22313. var config = props[prop];
  22314. if (typeof config === 'function') {
  22315. return config(data, node);
  22316. } else if (typeof config === 'string') {
  22317. return data[config];
  22318. } else if (typeof config === 'undefined') {
  22319. var dataProp = data[prop];
  22320. return dataProp === undefined ? '' : dataProp;
  22321. }
  22322. };
  22323. var nodeIdSeed = 0;
  22324. var node_Node = function () {
  22325. function Node(options) {
  22326. node_classCallCheck(this, Node);
  22327. this.id = nodeIdSeed++;
  22328. this.text = null;
  22329. this.checked = false;
  22330. this.indeterminate = false;
  22331. this.data = null;
  22332. this.expanded = false;
  22333. this.parent = null;
  22334. this.visible = true;
  22335. this.isCurrent = false;
  22336. for (var name in options) {
  22337. if (options.hasOwnProperty(name)) {
  22338. this[name] = options[name];
  22339. }
  22340. }
  22341. // internal
  22342. this.level = 0;
  22343. this.loaded = false;
  22344. this.childNodes = [];
  22345. this.loading = false;
  22346. if (this.parent) {
  22347. this.level = this.parent.level + 1;
  22348. }
  22349. var store = this.store;
  22350. if (!store) {
  22351. throw new Error('[Node]store is required!');
  22352. }
  22353. store.registerNode(this);
  22354. var props = store.props;
  22355. if (props && typeof props.isLeaf !== 'undefined') {
  22356. var isLeaf = getPropertyFromData(this, 'isLeaf');
  22357. if (typeof isLeaf === 'boolean') {
  22358. this.isLeafByUser = isLeaf;
  22359. }
  22360. }
  22361. if (store.lazy !== true && this.data) {
  22362. this.setData(this.data);
  22363. if (store.defaultExpandAll) {
  22364. this.expanded = true;
  22365. }
  22366. } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
  22367. this.expand();
  22368. }
  22369. if (!Array.isArray(this.data)) {
  22370. markNodeData(this, this.data);
  22371. }
  22372. if (!this.data) return;
  22373. var defaultExpandedKeys = store.defaultExpandedKeys;
  22374. var key = store.key;
  22375. if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
  22376. this.expand(null, store.autoExpandParent);
  22377. }
  22378. if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
  22379. store.currentNode = this;
  22380. store.currentNode.isCurrent = true;
  22381. }
  22382. if (store.lazy) {
  22383. store._initDefaultCheckedNode(this);
  22384. }
  22385. this.updateLeafState();
  22386. }
  22387. Node.prototype.setData = function setData(data) {
  22388. if (!Array.isArray(data)) {
  22389. markNodeData(this, data);
  22390. }
  22391. this.data = data;
  22392. this.childNodes = [];
  22393. var children = void 0;
  22394. if (this.level === 0 && this.data instanceof Array) {
  22395. children = this.data;
  22396. } else {
  22397. children = getPropertyFromData(this, 'children') || [];
  22398. }
  22399. for (var i = 0, j = children.length; i < j; i++) {
  22400. this.insertChild({ data: children[i] });
  22401. }
  22402. };
  22403. Node.prototype.contains = function contains(target) {
  22404. var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22405. var walk = function walk(parent) {
  22406. var children = parent.childNodes || [];
  22407. var result = false;
  22408. for (var i = 0, j = children.length; i < j; i++) {
  22409. var child = children[i];
  22410. if (child === target || deep && walk(child)) {
  22411. result = true;
  22412. break;
  22413. }
  22414. }
  22415. return result;
  22416. };
  22417. return walk(this);
  22418. };
  22419. Node.prototype.remove = function remove() {
  22420. var parent = this.parent;
  22421. if (parent) {
  22422. parent.removeChild(this);
  22423. }
  22424. };
  22425. Node.prototype.insertChild = function insertChild(child, index, batch) {
  22426. if (!child) throw new Error('insertChild error: child is required.');
  22427. if (!(child instanceof Node)) {
  22428. if (!batch) {
  22429. var children = this.getChildren(true) || [];
  22430. if (children.indexOf(child.data) === -1) {
  22431. if (typeof index === 'undefined' || index < 0) {
  22432. children.push(child.data);
  22433. } else {
  22434. children.splice(index, 0, child.data);
  22435. }
  22436. }
  22437. }
  22438. merge_default()(child, {
  22439. parent: this,
  22440. store: this.store
  22441. });
  22442. child = new Node(child);
  22443. }
  22444. child.level = this.level + 1;
  22445. if (typeof index === 'undefined' || index < 0) {
  22446. this.childNodes.push(child);
  22447. } else {
  22448. this.childNodes.splice(index, 0, child);
  22449. }
  22450. this.updateLeafState();
  22451. };
  22452. Node.prototype.insertBefore = function insertBefore(child, ref) {
  22453. var index = void 0;
  22454. if (ref) {
  22455. index = this.childNodes.indexOf(ref);
  22456. }
  22457. this.insertChild(child, index);
  22458. };
  22459. Node.prototype.insertAfter = function insertAfter(child, ref) {
  22460. var index = void 0;
  22461. if (ref) {
  22462. index = this.childNodes.indexOf(ref);
  22463. if (index !== -1) index += 1;
  22464. }
  22465. this.insertChild(child, index);
  22466. };
  22467. Node.prototype.removeChild = function removeChild(child) {
  22468. var children = this.getChildren() || [];
  22469. var dataIndex = children.indexOf(child.data);
  22470. if (dataIndex > -1) {
  22471. children.splice(dataIndex, 1);
  22472. }
  22473. var index = this.childNodes.indexOf(child);
  22474. if (index > -1) {
  22475. this.store && this.store.deregisterNode(child);
  22476. child.parent = null;
  22477. this.childNodes.splice(index, 1);
  22478. }
  22479. this.updateLeafState();
  22480. };
  22481. Node.prototype.removeChildByData = function removeChildByData(data) {
  22482. var targetNode = null;
  22483. for (var i = 0; i < this.childNodes.length; i++) {
  22484. if (this.childNodes[i].data === data) {
  22485. targetNode = this.childNodes[i];
  22486. break;
  22487. }
  22488. }
  22489. if (targetNode) {
  22490. this.removeChild(targetNode);
  22491. }
  22492. };
  22493. Node.prototype.expand = function expand(callback, expandParent) {
  22494. var _this = this;
  22495. var done = function done() {
  22496. if (expandParent) {
  22497. var parent = _this.parent;
  22498. while (parent.level > 0) {
  22499. parent.expanded = true;
  22500. parent = parent.parent;
  22501. }
  22502. }
  22503. _this.expanded = true;
  22504. if (callback) callback();
  22505. };
  22506. if (this.shouldLoadData()) {
  22507. this.loadData(function (data) {
  22508. if (data instanceof Array) {
  22509. if (_this.checked) {
  22510. _this.setChecked(true, true);
  22511. } else if (!_this.store.checkStrictly) {
  22512. reInitChecked(_this);
  22513. }
  22514. done();
  22515. }
  22516. });
  22517. } else {
  22518. done();
  22519. }
  22520. };
  22521. Node.prototype.doCreateChildren = function doCreateChildren(array) {
  22522. var _this2 = this;
  22523. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22524. array.forEach(function (item) {
  22525. _this2.insertChild(merge_default()({ data: item }, defaultProps), undefined, true);
  22526. });
  22527. };
  22528. Node.prototype.collapse = function collapse() {
  22529. this.expanded = false;
  22530. };
  22531. Node.prototype.shouldLoadData = function shouldLoadData() {
  22532. return this.store.lazy === true && this.store.load && !this.loaded;
  22533. };
  22534. Node.prototype.updateLeafState = function updateLeafState() {
  22535. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
  22536. this.isLeaf = this.isLeafByUser;
  22537. return;
  22538. }
  22539. var childNodes = this.childNodes;
  22540. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  22541. this.isLeaf = !childNodes || childNodes.length === 0;
  22542. return;
  22543. }
  22544. this.isLeaf = false;
  22545. };
  22546. Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
  22547. var _this3 = this;
  22548. this.indeterminate = value === 'half';
  22549. this.checked = value === true;
  22550. if (this.store.checkStrictly) return;
  22551. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  22552. var _getChildState2 = getChildState(this.childNodes),
  22553. all = _getChildState2.all,
  22554. allWithoutDisable = _getChildState2.allWithoutDisable;
  22555. if (!this.isLeaf && !all && allWithoutDisable) {
  22556. this.checked = false;
  22557. value = false;
  22558. }
  22559. var handleDescendants = function handleDescendants() {
  22560. if (deep) {
  22561. var childNodes = _this3.childNodes;
  22562. for (var i = 0, j = childNodes.length; i < j; i++) {
  22563. var child = childNodes[i];
  22564. passValue = passValue || value !== false;
  22565. var isCheck = child.disabled ? child.checked : passValue;
  22566. child.setChecked(isCheck, deep, true, passValue);
  22567. }
  22568. var _getChildState3 = getChildState(childNodes),
  22569. half = _getChildState3.half,
  22570. _all = _getChildState3.all;
  22571. if (!_all) {
  22572. _this3.checked = _all;
  22573. _this3.indeterminate = half;
  22574. }
  22575. }
  22576. };
  22577. if (this.shouldLoadData()) {
  22578. // Only work on lazy load data.
  22579. this.loadData(function () {
  22580. handleDescendants();
  22581. reInitChecked(_this3);
  22582. }, {
  22583. checked: value !== false
  22584. });
  22585. return;
  22586. } else {
  22587. handleDescendants();
  22588. }
  22589. }
  22590. var parent = this.parent;
  22591. if (!parent || parent.level === 0) return;
  22592. if (!recursion) {
  22593. reInitChecked(parent);
  22594. }
  22595. };
  22596. Node.prototype.getChildren = function getChildren() {
  22597. var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22598. // this is data
  22599. if (this.level === 0) return this.data;
  22600. var data = this.data;
  22601. if (!data) return null;
  22602. var props = this.store.props;
  22603. var children = 'children';
  22604. if (props) {
  22605. children = props.children || 'children';
  22606. }
  22607. if (data[children] === undefined) {
  22608. data[children] = null;
  22609. }
  22610. if (forceInit && !data[children]) {
  22611. data[children] = [];
  22612. }
  22613. return data[children];
  22614. };
  22615. Node.prototype.updateChildren = function updateChildren() {
  22616. var _this4 = this;
  22617. var newData = this.getChildren() || [];
  22618. var oldData = this.childNodes.map(function (node) {
  22619. return node.data;
  22620. });
  22621. var newDataMap = {};
  22622. var newNodes = [];
  22623. newData.forEach(function (item, index) {
  22624. var key = item[NODE_KEY];
  22625. var isNodeExists = !!key && Object(util_["arrayFindIndex"])(oldData, function (data) {
  22626. return data[NODE_KEY] === key;
  22627. }) >= 0;
  22628. if (isNodeExists) {
  22629. newDataMap[key] = { index: index, data: item };
  22630. } else {
  22631. newNodes.push({ index: index, data: item });
  22632. }
  22633. });
  22634. if (!this.store.lazy) {
  22635. oldData.forEach(function (item) {
  22636. if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
  22637. });
  22638. }
  22639. newNodes.forEach(function (_ref) {
  22640. var index = _ref.index,
  22641. data = _ref.data;
  22642. _this4.insertChild({ data: data }, index);
  22643. });
  22644. this.updateLeafState();
  22645. };
  22646. Node.prototype.loadData = function loadData(callback) {
  22647. var _this5 = this;
  22648. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22649. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  22650. this.loading = true;
  22651. var resolve = function resolve(children) {
  22652. _this5.loaded = true;
  22653. _this5.loading = false;
  22654. _this5.childNodes = [];
  22655. _this5.doCreateChildren(children, defaultProps);
  22656. _this5.updateLeafState();
  22657. if (callback) {
  22658. callback.call(_this5, children);
  22659. }
  22660. };
  22661. this.store.load(this, resolve);
  22662. } else {
  22663. if (callback) {
  22664. callback.call(this);
  22665. }
  22666. }
  22667. };
  22668. _createClass(Node, [{
  22669. key: 'label',
  22670. get: function get() {
  22671. return getPropertyFromData(this, 'label');
  22672. }
  22673. }, {
  22674. key: 'key',
  22675. get: function get() {
  22676. var nodeKey = this.store.key;
  22677. if (this.data) return this.data[nodeKey];
  22678. return null;
  22679. }
  22680. }, {
  22681. key: 'disabled',
  22682. get: function get() {
  22683. return getPropertyFromData(this, 'disabled');
  22684. }
  22685. }, {
  22686. key: 'nextSibling',
  22687. get: function get() {
  22688. var parent = this.parent;
  22689. if (parent) {
  22690. var index = parent.childNodes.indexOf(this);
  22691. if (index > -1) {
  22692. return parent.childNodes[index + 1];
  22693. }
  22694. }
  22695. return null;
  22696. }
  22697. }, {
  22698. key: 'previousSibling',
  22699. get: function get() {
  22700. var parent = this.parent;
  22701. if (parent) {
  22702. var index = parent.childNodes.indexOf(this);
  22703. if (index > -1) {
  22704. return index > 0 ? parent.childNodes[index - 1] : null;
  22705. }
  22706. }
  22707. return null;
  22708. }
  22709. }]);
  22710. return Node;
  22711. }();
  22712. /* harmony default export */ var model_node = (node_Node);
  22713. // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
  22714. 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; };
  22715. function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22716. var tree_store_TreeStore = function () {
  22717. function TreeStore(options) {
  22718. var _this = this;
  22719. tree_store_classCallCheck(this, TreeStore);
  22720. this.currentNode = null;
  22721. this.currentNodeKey = null;
  22722. for (var option in options) {
  22723. if (options.hasOwnProperty(option)) {
  22724. this[option] = options[option];
  22725. }
  22726. }
  22727. this.nodesMap = {};
  22728. this.root = new model_node({
  22729. data: this.data,
  22730. store: this
  22731. });
  22732. if (this.lazy && this.load) {
  22733. var loadFn = this.load;
  22734. loadFn(this.root, function (data) {
  22735. _this.root.doCreateChildren(data);
  22736. _this._initDefaultCheckedNodes();
  22737. });
  22738. } else {
  22739. this._initDefaultCheckedNodes();
  22740. }
  22741. }
  22742. TreeStore.prototype.filter = function filter(value) {
  22743. var filterNodeMethod = this.filterNodeMethod;
  22744. var lazy = this.lazy;
  22745. var traverse = function traverse(node) {
  22746. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22747. childNodes.forEach(function (child) {
  22748. child.visible = filterNodeMethod.call(child, value, child.data, child);
  22749. traverse(child);
  22750. });
  22751. if (!node.visible && childNodes.length) {
  22752. var allHidden = true;
  22753. allHidden = !childNodes.some(function (child) {
  22754. return child.visible;
  22755. });
  22756. if (node.root) {
  22757. node.root.visible = allHidden === false;
  22758. } else {
  22759. node.visible = allHidden === false;
  22760. }
  22761. }
  22762. if (!value) return;
  22763. if (node.visible && !node.isLeaf && !lazy) node.expand();
  22764. };
  22765. traverse(this);
  22766. };
  22767. TreeStore.prototype.setData = function setData(newVal) {
  22768. var instanceChanged = newVal !== this.root.data;
  22769. if (instanceChanged) {
  22770. this.root.setData(newVal);
  22771. this._initDefaultCheckedNodes();
  22772. } else {
  22773. this.root.updateChildren();
  22774. }
  22775. };
  22776. TreeStore.prototype.getNode = function getNode(data) {
  22777. if (data instanceof model_node) return data;
  22778. var key = (typeof data === 'undefined' ? 'undefined' : tree_store_typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
  22779. return this.nodesMap[key] || null;
  22780. };
  22781. TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
  22782. var refNode = this.getNode(refData);
  22783. refNode.parent.insertBefore({ data: data }, refNode);
  22784. };
  22785. TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
  22786. var refNode = this.getNode(refData);
  22787. refNode.parent.insertAfter({ data: data }, refNode);
  22788. };
  22789. TreeStore.prototype.remove = function remove(data) {
  22790. var node = this.getNode(data);
  22791. if (node && node.parent) {
  22792. if (node === this.currentNode) {
  22793. this.currentNode = null;
  22794. }
  22795. node.parent.removeChild(node);
  22796. }
  22797. };
  22798. TreeStore.prototype.append = function append(data, parentData) {
  22799. var parentNode = parentData ? this.getNode(parentData) : this.root;
  22800. if (parentNode) {
  22801. parentNode.insertChild({ data: data });
  22802. }
  22803. };
  22804. TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
  22805. var _this2 = this;
  22806. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22807. var nodesMap = this.nodesMap;
  22808. defaultCheckedKeys.forEach(function (checkedKey) {
  22809. var node = nodesMap[checkedKey];
  22810. if (node) {
  22811. node.setChecked(true, !_this2.checkStrictly);
  22812. }
  22813. });
  22814. };
  22815. TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
  22816. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22817. if (defaultCheckedKeys.indexOf(node.key) !== -1) {
  22818. node.setChecked(true, !this.checkStrictly);
  22819. }
  22820. };
  22821. TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
  22822. if (newVal !== this.defaultCheckedKeys) {
  22823. this.defaultCheckedKeys = newVal;
  22824. this._initDefaultCheckedNodes();
  22825. }
  22826. };
  22827. TreeStore.prototype.registerNode = function registerNode(node) {
  22828. var key = this.key;
  22829. if (!key || !node || !node.data) return;
  22830. var nodeKey = node.key;
  22831. if (nodeKey !== undefined) this.nodesMap[node.key] = node;
  22832. };
  22833. TreeStore.prototype.deregisterNode = function deregisterNode(node) {
  22834. var _this3 = this;
  22835. var key = this.key;
  22836. if (!key || !node || !node.data) return;
  22837. node.childNodes.forEach(function (child) {
  22838. _this3.deregisterNode(child);
  22839. });
  22840. delete this.nodesMap[node.key];
  22841. };
  22842. TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
  22843. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22844. var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22845. var checkedNodes = [];
  22846. var traverse = function traverse(node) {
  22847. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22848. childNodes.forEach(function (child) {
  22849. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
  22850. checkedNodes.push(child.data);
  22851. }
  22852. traverse(child);
  22853. });
  22854. };
  22855. traverse(this);
  22856. return checkedNodes;
  22857. };
  22858. TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
  22859. var _this4 = this;
  22860. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22861. return this.getCheckedNodes(leafOnly).map(function (data) {
  22862. return (data || {})[_this4.key];
  22863. });
  22864. };
  22865. TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
  22866. var nodes = [];
  22867. var traverse = function traverse(node) {
  22868. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22869. childNodes.forEach(function (child) {
  22870. if (child.indeterminate) {
  22871. nodes.push(child.data);
  22872. }
  22873. traverse(child);
  22874. });
  22875. };
  22876. traverse(this);
  22877. return nodes;
  22878. };
  22879. TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
  22880. var _this5 = this;
  22881. return this.getHalfCheckedNodes().map(function (data) {
  22882. return (data || {})[_this5.key];
  22883. });
  22884. };
  22885. TreeStore.prototype._getAllNodes = function _getAllNodes() {
  22886. var allNodes = [];
  22887. var nodesMap = this.nodesMap;
  22888. for (var nodeKey in nodesMap) {
  22889. if (nodesMap.hasOwnProperty(nodeKey)) {
  22890. allNodes.push(nodesMap[nodeKey]);
  22891. }
  22892. }
  22893. return allNodes;
  22894. };
  22895. TreeStore.prototype.updateChildren = function updateChildren(key, data) {
  22896. var node = this.nodesMap[key];
  22897. if (!node) return;
  22898. var childNodes = node.childNodes;
  22899. for (var i = childNodes.length - 1; i >= 0; i--) {
  22900. var child = childNodes[i];
  22901. this.remove(child.data);
  22902. }
  22903. for (var _i = 0, j = data.length; _i < j; _i++) {
  22904. var _child = data[_i];
  22905. this.append(_child, node.data);
  22906. }
  22907. };
  22908. TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
  22909. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22910. var checkedKeys = arguments[2];
  22911. var allNodes = this._getAllNodes().sort(function (a, b) {
  22912. return b.level - a.level;
  22913. });
  22914. var cache = Object.create(null);
  22915. var keys = Object.keys(checkedKeys);
  22916. allNodes.forEach(function (node) {
  22917. return node.setChecked(false, false);
  22918. });
  22919. for (var i = 0, j = allNodes.length; i < j; i++) {
  22920. var node = allNodes[i];
  22921. var nodeKey = node.data[key].toString();
  22922. var checked = keys.indexOf(nodeKey) > -1;
  22923. if (!checked) {
  22924. if (node.checked && !cache[nodeKey]) {
  22925. node.setChecked(false, false);
  22926. }
  22927. continue;
  22928. }
  22929. var parent = node.parent;
  22930. while (parent && parent.level > 0) {
  22931. cache[parent.data[key]] = true;
  22932. parent = parent.parent;
  22933. }
  22934. if (node.isLeaf || this.checkStrictly) {
  22935. node.setChecked(true, false);
  22936. continue;
  22937. }
  22938. node.setChecked(true, true);
  22939. if (leafOnly) {
  22940. (function () {
  22941. node.setChecked(false, false);
  22942. var traverse = function traverse(node) {
  22943. var childNodes = node.childNodes;
  22944. childNodes.forEach(function (child) {
  22945. if (!child.isLeaf) {
  22946. child.setChecked(false, false);
  22947. }
  22948. traverse(child);
  22949. });
  22950. };
  22951. traverse(node);
  22952. })();
  22953. }
  22954. }
  22955. };
  22956. TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
  22957. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22958. var key = this.key;
  22959. var checkedKeys = {};
  22960. array.forEach(function (item) {
  22961. checkedKeys[(item || {})[key]] = true;
  22962. });
  22963. this._setCheckedKeys(key, leafOnly, checkedKeys);
  22964. };
  22965. TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
  22966. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22967. this.defaultCheckedKeys = keys;
  22968. var key = this.key;
  22969. var checkedKeys = {};
  22970. keys.forEach(function (key) {
  22971. checkedKeys[key] = true;
  22972. });
  22973. this._setCheckedKeys(key, leafOnly, checkedKeys);
  22974. };
  22975. TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
  22976. var _this6 = this;
  22977. keys = keys || [];
  22978. this.defaultExpandedKeys = keys;
  22979. keys.forEach(function (key) {
  22980. var node = _this6.getNode(key);
  22981. if (node) node.expand(null, _this6.autoExpandParent);
  22982. });
  22983. };
  22984. TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
  22985. var node = this.getNode(data);
  22986. if (node) {
  22987. node.setChecked(!!checked, deep);
  22988. }
  22989. };
  22990. TreeStore.prototype.getCurrentNode = function getCurrentNode() {
  22991. return this.currentNode;
  22992. };
  22993. TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
  22994. var prevCurrentNode = this.currentNode;
  22995. if (prevCurrentNode) {
  22996. prevCurrentNode.isCurrent = false;
  22997. }
  22998. this.currentNode = currentNode;
  22999. this.currentNode.isCurrent = true;
  23000. };
  23001. TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
  23002. var key = node[this.key];
  23003. var currNode = this.nodesMap[key];
  23004. this.setCurrentNode(currNode);
  23005. };
  23006. TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
  23007. if (key === null || key === undefined) {
  23008. this.currentNode && (this.currentNode.isCurrent = false);
  23009. this.currentNode = null;
  23010. return;
  23011. }
  23012. var node = this.getNode(key);
  23013. if (node) {
  23014. this.setCurrentNode(node);
  23015. }
  23016. };
  23017. return TreeStore;
  23018. }();
  23019. /* harmony default export */ var tree_store = (tree_store_TreeStore);
  23020. ;
  23021. // 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&
  23022. var tree_nodevue_type_template_id_3ba3ef0e_render = function() {
  23023. var this$1 = this
  23024. var _vm = this
  23025. var _h = _vm.$createElement
  23026. var _c = _vm._self._c || _h
  23027. return _c(
  23028. "div",
  23029. {
  23030. directives: [
  23031. {
  23032. name: "show",
  23033. rawName: "v-show",
  23034. value: _vm.node.visible,
  23035. expression: "node.visible"
  23036. }
  23037. ],
  23038. ref: "node",
  23039. staticClass: "el-tree-node",
  23040. class: {
  23041. "is-expanded": _vm.expanded,
  23042. "is-current": _vm.node.isCurrent,
  23043. "is-hidden": !_vm.node.visible,
  23044. "is-focusable": !_vm.node.disabled,
  23045. "is-checked": !_vm.node.disabled && _vm.node.checked
  23046. },
  23047. attrs: {
  23048. role: "treeitem",
  23049. tabindex: "-1",
  23050. "aria-expanded": _vm.expanded,
  23051. "aria-disabled": _vm.node.disabled,
  23052. "aria-checked": _vm.node.checked,
  23053. draggable: _vm.tree.draggable
  23054. },
  23055. on: {
  23056. click: function($event) {
  23057. $event.stopPropagation()
  23058. return _vm.handleClick($event)
  23059. },
  23060. contextmenu: function($event) {
  23061. return this$1.handleContextMenu($event)
  23062. },
  23063. dragstart: function($event) {
  23064. $event.stopPropagation()
  23065. return _vm.handleDragStart($event)
  23066. },
  23067. dragover: function($event) {
  23068. $event.stopPropagation()
  23069. return _vm.handleDragOver($event)
  23070. },
  23071. dragend: function($event) {
  23072. $event.stopPropagation()
  23073. return _vm.handleDragEnd($event)
  23074. },
  23075. drop: function($event) {
  23076. $event.stopPropagation()
  23077. return _vm.handleDrop($event)
  23078. }
  23079. }
  23080. },
  23081. [
  23082. _c(
  23083. "div",
  23084. {
  23085. staticClass: "el-tree-node__content",
  23086. style: {
  23087. "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px"
  23088. }
  23089. },
  23090. [
  23091. _c("span", {
  23092. class: [
  23093. {
  23094. "is-leaf": _vm.node.isLeaf,
  23095. expanded: !_vm.node.isLeaf && _vm.expanded
  23096. },
  23097. "el-tree-node__expand-icon",
  23098. _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right"
  23099. ],
  23100. on: {
  23101. click: function($event) {
  23102. $event.stopPropagation()
  23103. return _vm.handleExpandIconClick($event)
  23104. }
  23105. }
  23106. }),
  23107. _vm.showCheckbox
  23108. ? _c("el-checkbox", {
  23109. attrs: {
  23110. indeterminate: _vm.node.indeterminate,
  23111. disabled: !!_vm.node.disabled
  23112. },
  23113. on: { change: _vm.handleCheckChange },
  23114. nativeOn: {
  23115. click: function($event) {
  23116. $event.stopPropagation()
  23117. }
  23118. },
  23119. model: {
  23120. value: _vm.node.checked,
  23121. callback: function($$v) {
  23122. _vm.$set(_vm.node, "checked", $$v)
  23123. },
  23124. expression: "node.checked"
  23125. }
  23126. })
  23127. : _vm._e(),
  23128. _vm.node.loading
  23129. ? _c("span", {
  23130. staticClass: "el-tree-node__loading-icon el-icon-loading"
  23131. })
  23132. : _vm._e(),
  23133. _c("node-content", { attrs: { node: _vm.node } })
  23134. ],
  23135. 1
  23136. ),
  23137. _c("el-collapse-transition", [
  23138. !_vm.renderAfterExpand || _vm.childNodeRendered
  23139. ? _c(
  23140. "div",
  23141. {
  23142. directives: [
  23143. {
  23144. name: "show",
  23145. rawName: "v-show",
  23146. value: _vm.expanded,
  23147. expression: "expanded"
  23148. }
  23149. ],
  23150. staticClass: "el-tree-node__children",
  23151. attrs: { role: "group", "aria-expanded": _vm.expanded }
  23152. },
  23153. _vm._l(_vm.node.childNodes, function(child) {
  23154. return _c("el-tree-node", {
  23155. key: _vm.getNodeKey(child),
  23156. attrs: {
  23157. "render-content": _vm.renderContent,
  23158. "render-after-expand": _vm.renderAfterExpand,
  23159. "show-checkbox": _vm.showCheckbox,
  23160. node: child
  23161. },
  23162. on: { "node-expand": _vm.handleChildNodeExpand }
  23163. })
  23164. }),
  23165. 1
  23166. )
  23167. : _vm._e()
  23168. ])
  23169. ],
  23170. 1
  23171. )
  23172. }
  23173. var tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns = []
  23174. tree_nodevue_type_template_id_3ba3ef0e_render._withStripped = true
  23175. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=3ba3ef0e&
  23176. // 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&
  23177. //
  23178. //
  23179. //
  23180. //
  23181. //
  23182. //
  23183. //
  23184. //
  23185. //
  23186. //
  23187. //
  23188. //
  23189. //
  23190. //
  23191. //
  23192. //
  23193. //
  23194. //
  23195. //
  23196. //
  23197. //
  23198. //
  23199. //
  23200. //
  23201. //
  23202. //
  23203. //
  23204. //
  23205. //
  23206. //
  23207. //
  23208. //
  23209. //
  23210. //
  23211. //
  23212. //
  23213. //
  23214. //
  23215. //
  23216. //
  23217. //
  23218. //
  23219. //
  23220. //
  23221. //
  23222. //
  23223. //
  23224. //
  23225. //
  23226. //
  23227. //
  23228. //
  23229. //
  23230. //
  23231. //
  23232. //
  23233. //
  23234. //
  23235. //
  23236. //
  23237. //
  23238. //
  23239. //
  23240. //
  23241. //
  23242. //
  23243. //
  23244. //
  23245. //
  23246. //
  23247. //
  23248. //
  23249. //
  23250. /* harmony default export */ var tree_nodevue_type_script_lang_js_ = ({
  23251. name: 'ElTreeNode',
  23252. componentName: 'ElTreeNode',
  23253. mixins: [emitter_default.a],
  23254. props: {
  23255. node: {
  23256. default: function _default() {
  23257. return {};
  23258. }
  23259. },
  23260. props: {},
  23261. renderContent: Function,
  23262. renderAfterExpand: {
  23263. type: Boolean,
  23264. default: true
  23265. },
  23266. showCheckbox: {
  23267. type: Boolean,
  23268. default: false
  23269. }
  23270. },
  23271. components: {
  23272. ElCollapseTransition: collapse_transition_default.a,
  23273. ElCheckbox: checkbox_default.a,
  23274. NodeContent: {
  23275. props: {
  23276. node: {
  23277. required: true
  23278. }
  23279. },
  23280. render: function render(h) {
  23281. var parent = this.$parent;
  23282. var tree = parent.tree;
  23283. var node = this.node;
  23284. var data = node.data,
  23285. store = node.store;
  23286. 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(
  23287. 'span',
  23288. { 'class': 'el-tree-node__label' },
  23289. [node.label]
  23290. );
  23291. }
  23292. }
  23293. },
  23294. data: function data() {
  23295. return {
  23296. tree: null,
  23297. expanded: false,
  23298. childNodeRendered: false,
  23299. oldChecked: null,
  23300. oldIndeterminate: null
  23301. };
  23302. },
  23303. watch: {
  23304. 'node.indeterminate': function nodeIndeterminate(val) {
  23305. this.handleSelectChange(this.node.checked, val);
  23306. },
  23307. 'node.checked': function nodeChecked(val) {
  23308. this.handleSelectChange(val, this.node.indeterminate);
  23309. },
  23310. 'node.expanded': function nodeExpanded(val) {
  23311. var _this = this;
  23312. this.$nextTick(function () {
  23313. return _this.expanded = val;
  23314. });
  23315. if (val) {
  23316. this.childNodeRendered = true;
  23317. }
  23318. }
  23319. },
  23320. methods: {
  23321. getNodeKey: function getNodeKey(node) {
  23322. return util_getNodeKey(this.tree.nodeKey, node.data);
  23323. },
  23324. handleSelectChange: function handleSelectChange(checked, indeterminate) {
  23325. if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
  23326. this.tree.$emit('check-change', this.node.data, checked, indeterminate);
  23327. }
  23328. this.oldChecked = checked;
  23329. this.indeterminate = indeterminate;
  23330. },
  23331. handleClick: function handleClick() {
  23332. var store = this.tree.store;
  23333. store.setCurrentNode(this.node);
  23334. this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
  23335. this.tree.currentNode = this;
  23336. if (this.tree.expandOnClickNode) {
  23337. this.handleExpandIconClick();
  23338. }
  23339. if (this.tree.checkOnClickNode && !this.node.disabled) {
  23340. this.handleCheckChange(null, {
  23341. target: { checked: !this.node.checked }
  23342. });
  23343. }
  23344. this.tree.$emit('node-click', this.node.data, this.node, this);
  23345. },
  23346. handleContextMenu: function handleContextMenu(event) {
  23347. if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
  23348. event.stopPropagation();
  23349. event.preventDefault();
  23350. }
  23351. this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
  23352. },
  23353. handleExpandIconClick: function handleExpandIconClick() {
  23354. if (this.node.isLeaf) return;
  23355. if (this.expanded) {
  23356. this.tree.$emit('node-collapse', this.node.data, this.node, this);
  23357. this.node.collapse();
  23358. } else {
  23359. this.node.expand();
  23360. this.$emit('node-expand', this.node.data, this.node, this);
  23361. }
  23362. },
  23363. handleCheckChange: function handleCheckChange(value, ev) {
  23364. var _this2 = this;
  23365. this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
  23366. this.$nextTick(function () {
  23367. var store = _this2.tree.store;
  23368. _this2.tree.$emit('check', _this2.node.data, {
  23369. checkedNodes: store.getCheckedNodes(),
  23370. checkedKeys: store.getCheckedKeys(),
  23371. halfCheckedNodes: store.getHalfCheckedNodes(),
  23372. halfCheckedKeys: store.getHalfCheckedKeys()
  23373. });
  23374. });
  23375. },
  23376. handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
  23377. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23378. this.tree.$emit('node-expand', nodeData, node, instance);
  23379. },
  23380. handleDragStart: function handleDragStart(event) {
  23381. if (!this.tree.draggable) return;
  23382. this.tree.$emit('tree-node-drag-start', event, this);
  23383. },
  23384. handleDragOver: function handleDragOver(event) {
  23385. if (!this.tree.draggable) return;
  23386. this.tree.$emit('tree-node-drag-over', event, this);
  23387. event.preventDefault();
  23388. },
  23389. handleDrop: function handleDrop(event) {
  23390. event.preventDefault();
  23391. },
  23392. handleDragEnd: function handleDragEnd(event) {
  23393. if (!this.tree.draggable) return;
  23394. this.tree.$emit('tree-node-drag-end', event, this);
  23395. }
  23396. },
  23397. created: function created() {
  23398. var _this3 = this;
  23399. var parent = this.$parent;
  23400. if (parent.isTree) {
  23401. this.tree = parent;
  23402. } else {
  23403. this.tree = parent.tree;
  23404. }
  23405. var tree = this.tree;
  23406. if (!tree) {
  23407. console.warn('Can not find node\'s tree.');
  23408. }
  23409. var props = tree.props || {};
  23410. var childrenKey = props['children'] || 'children';
  23411. this.$watch('node.data.' + childrenKey, function () {
  23412. _this3.node.updateChildren();
  23413. });
  23414. if (this.node.expanded) {
  23415. this.expanded = true;
  23416. this.childNodeRendered = true;
  23417. }
  23418. if (this.tree.accordion) {
  23419. this.$on('tree-node-expand', function (node) {
  23420. if (_this3.node !== node) {
  23421. _this3.node.collapse();
  23422. }
  23423. });
  23424. }
  23425. }
  23426. });
  23427. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js&
  23428. /* harmony default export */ var src_tree_nodevue_type_script_lang_js_ = (tree_nodevue_type_script_lang_js_);
  23429. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
  23430. /* normalize component */
  23431. var tree_node_component = normalizeComponent(
  23432. src_tree_nodevue_type_script_lang_js_,
  23433. tree_nodevue_type_template_id_3ba3ef0e_render,
  23434. tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns,
  23435. false,
  23436. null,
  23437. null,
  23438. null
  23439. )
  23440. /* hot reload */
  23441. if (false) { var tree_node_api; }
  23442. tree_node_component.options.__file = "packages/tree/src/tree-node.vue"
  23443. /* harmony default export */ var tree_node = (tree_node_component.exports);
  23444. // 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&
  23445. //
  23446. //
  23447. //
  23448. //
  23449. //
  23450. //
  23451. //
  23452. //
  23453. //
  23454. //
  23455. //
  23456. //
  23457. //
  23458. //
  23459. //
  23460. //
  23461. //
  23462. //
  23463. //
  23464. //
  23465. //
  23466. //
  23467. //
  23468. //
  23469. //
  23470. //
  23471. //
  23472. //
  23473. //
  23474. //
  23475. //
  23476. //
  23477. /* harmony default export */ var treevue_type_script_lang_js_ = ({
  23478. name: 'ElTree',
  23479. mixins: [emitter_default.a],
  23480. components: {
  23481. ElTreeNode: tree_node
  23482. },
  23483. data: function data() {
  23484. return {
  23485. store: null,
  23486. root: null,
  23487. currentNode: null,
  23488. treeItems: null,
  23489. checkboxItems: [],
  23490. dragState: {
  23491. showDropIndicator: false,
  23492. draggingNode: null,
  23493. dropNode: null,
  23494. allowDrop: true
  23495. }
  23496. };
  23497. },
  23498. props: {
  23499. data: {
  23500. type: Array
  23501. },
  23502. emptyText: {
  23503. type: String,
  23504. default: function _default() {
  23505. return Object(lib_locale_["t"])('el.tree.emptyText');
  23506. }
  23507. },
  23508. renderAfterExpand: {
  23509. type: Boolean,
  23510. default: true
  23511. },
  23512. nodeKey: String,
  23513. checkStrictly: Boolean,
  23514. defaultExpandAll: Boolean,
  23515. expandOnClickNode: {
  23516. type: Boolean,
  23517. default: true
  23518. },
  23519. checkOnClickNode: Boolean,
  23520. checkDescendants: {
  23521. type: Boolean,
  23522. default: false
  23523. },
  23524. autoExpandParent: {
  23525. type: Boolean,
  23526. default: true
  23527. },
  23528. defaultCheckedKeys: Array,
  23529. defaultExpandedKeys: Array,
  23530. currentNodeKey: [String, Number],
  23531. renderContent: Function,
  23532. showCheckbox: {
  23533. type: Boolean,
  23534. default: false
  23535. },
  23536. draggable: {
  23537. type: Boolean,
  23538. default: false
  23539. },
  23540. allowDrag: Function,
  23541. allowDrop: Function,
  23542. props: {
  23543. default: function _default() {
  23544. return {
  23545. children: 'children',
  23546. label: 'label',
  23547. disabled: 'disabled'
  23548. };
  23549. }
  23550. },
  23551. lazy: {
  23552. type: Boolean,
  23553. default: false
  23554. },
  23555. highlightCurrent: Boolean,
  23556. load: Function,
  23557. filterNodeMethod: Function,
  23558. accordion: Boolean,
  23559. indent: {
  23560. type: Number,
  23561. default: 18
  23562. },
  23563. iconClass: String
  23564. },
  23565. computed: {
  23566. children: {
  23567. set: function set(value) {
  23568. this.data = value;
  23569. },
  23570. get: function get() {
  23571. return this.data;
  23572. }
  23573. },
  23574. treeItemArray: function treeItemArray() {
  23575. return Array.prototype.slice.call(this.treeItems);
  23576. },
  23577. isEmpty: function isEmpty() {
  23578. var childNodes = this.root.childNodes;
  23579. return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
  23580. var visible = _ref.visible;
  23581. return !visible;
  23582. });
  23583. }
  23584. },
  23585. watch: {
  23586. defaultCheckedKeys: function defaultCheckedKeys(newVal) {
  23587. this.store.setDefaultCheckedKey(newVal);
  23588. },
  23589. defaultExpandedKeys: function defaultExpandedKeys(newVal) {
  23590. this.store.defaultExpandedKeys = newVal;
  23591. this.store.setDefaultExpandedKeys(newVal);
  23592. },
  23593. data: function data(newVal) {
  23594. this.store.setData(newVal);
  23595. },
  23596. checkboxItems: function checkboxItems(val) {
  23597. Array.prototype.forEach.call(val, function (checkbox) {
  23598. checkbox.setAttribute('tabindex', -1);
  23599. });
  23600. },
  23601. checkStrictly: function checkStrictly(newVal) {
  23602. this.store.checkStrictly = newVal;
  23603. }
  23604. },
  23605. methods: {
  23606. filter: function filter(value) {
  23607. if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
  23608. this.store.filter(value);
  23609. },
  23610. getNodeKey: function getNodeKey(node) {
  23611. return util_getNodeKey(this.nodeKey, node.data);
  23612. },
  23613. getNodePath: function getNodePath(data) {
  23614. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
  23615. var node = this.store.getNode(data);
  23616. if (!node) return [];
  23617. var path = [node.data];
  23618. var parent = node.parent;
  23619. while (parent && parent !== this.root) {
  23620. path.push(parent.data);
  23621. parent = parent.parent;
  23622. }
  23623. return path.reverse();
  23624. },
  23625. getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
  23626. return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
  23627. },
  23628. getCheckedKeys: function getCheckedKeys(leafOnly) {
  23629. return this.store.getCheckedKeys(leafOnly);
  23630. },
  23631. getCurrentNode: function getCurrentNode() {
  23632. var currentNode = this.store.getCurrentNode();
  23633. return currentNode ? currentNode.data : null;
  23634. },
  23635. getCurrentKey: function getCurrentKey() {
  23636. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
  23637. var currentNode = this.getCurrentNode();
  23638. return currentNode ? currentNode[this.nodeKey] : null;
  23639. },
  23640. setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
  23641. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
  23642. this.store.setCheckedNodes(nodes, leafOnly);
  23643. },
  23644. setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
  23645. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
  23646. this.store.setCheckedKeys(keys, leafOnly);
  23647. },
  23648. setChecked: function setChecked(data, checked, deep) {
  23649. this.store.setChecked(data, checked, deep);
  23650. },
  23651. getHalfCheckedNodes: function getHalfCheckedNodes() {
  23652. return this.store.getHalfCheckedNodes();
  23653. },
  23654. getHalfCheckedKeys: function getHalfCheckedKeys() {
  23655. return this.store.getHalfCheckedKeys();
  23656. },
  23657. setCurrentNode: function setCurrentNode(node) {
  23658. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
  23659. this.store.setUserCurrentNode(node);
  23660. },
  23661. setCurrentKey: function setCurrentKey(key) {
  23662. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
  23663. this.store.setCurrentNodeKey(key);
  23664. },
  23665. getNode: function getNode(data) {
  23666. return this.store.getNode(data);
  23667. },
  23668. remove: function remove(data) {
  23669. this.store.remove(data);
  23670. },
  23671. append: function append(data, parentNode) {
  23672. this.store.append(data, parentNode);
  23673. },
  23674. insertBefore: function insertBefore(data, refNode) {
  23675. this.store.insertBefore(data, refNode);
  23676. },
  23677. insertAfter: function insertAfter(data, refNode) {
  23678. this.store.insertAfter(data, refNode);
  23679. },
  23680. handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
  23681. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23682. this.$emit('node-expand', nodeData, node, instance);
  23683. },
  23684. updateKeyChildren: function updateKeyChildren(key, data) {
  23685. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
  23686. this.store.updateChildren(key, data);
  23687. },
  23688. initTabIndex: function initTabIndex() {
  23689. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23690. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23691. var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
  23692. if (checkedItem.length) {
  23693. checkedItem[0].setAttribute('tabindex', 0);
  23694. return;
  23695. }
  23696. this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
  23697. },
  23698. handleKeydown: function handleKeydown(ev) {
  23699. var currentItem = ev.target;
  23700. if (currentItem.className.indexOf('el-tree-node') === -1) return;
  23701. var keyCode = ev.keyCode;
  23702. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23703. var currentIndex = this.treeItemArray.indexOf(currentItem);
  23704. var nextIndex = void 0;
  23705. if ([38, 40].indexOf(keyCode) > -1) {
  23706. // up、down
  23707. ev.preventDefault();
  23708. if (keyCode === 38) {
  23709. // up
  23710. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  23711. } else {
  23712. nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
  23713. }
  23714. this.treeItemArray[nextIndex].focus(); // 选中
  23715. }
  23716. if ([37, 39].indexOf(keyCode) > -1) {
  23717. // left、right 展开
  23718. ev.preventDefault();
  23719. currentItem.click(); // 选中
  23720. }
  23721. var hasInput = currentItem.querySelector('[type="checkbox"]');
  23722. if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
  23723. // space enter选中checkbox
  23724. ev.preventDefault();
  23725. hasInput.click();
  23726. }
  23727. }
  23728. },
  23729. created: function created() {
  23730. var _this = this;
  23731. this.isTree = true;
  23732. this.store = new tree_store({
  23733. key: this.nodeKey,
  23734. data: this.data,
  23735. lazy: this.lazy,
  23736. props: this.props,
  23737. load: this.load,
  23738. currentNodeKey: this.currentNodeKey,
  23739. checkStrictly: this.checkStrictly,
  23740. checkDescendants: this.checkDescendants,
  23741. defaultCheckedKeys: this.defaultCheckedKeys,
  23742. defaultExpandedKeys: this.defaultExpandedKeys,
  23743. autoExpandParent: this.autoExpandParent,
  23744. defaultExpandAll: this.defaultExpandAll,
  23745. filterNodeMethod: this.filterNodeMethod
  23746. });
  23747. this.root = this.store.root;
  23748. var dragState = this.dragState;
  23749. this.$on('tree-node-drag-start', function (event, treeNode) {
  23750. if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
  23751. event.preventDefault();
  23752. return false;
  23753. }
  23754. event.dataTransfer.effectAllowed = 'move';
  23755. // wrap in try catch to address IE's error when first param is 'text/plain'
  23756. try {
  23757. // setData is required for draggable to work in FireFox
  23758. // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
  23759. event.dataTransfer.setData('text/plain', '');
  23760. } catch (e) {}
  23761. dragState.draggingNode = treeNode;
  23762. _this.$emit('node-drag-start', treeNode.node, event);
  23763. });
  23764. this.$on('tree-node-drag-over', function (event, treeNode) {
  23765. var dropNode = findNearestComponent(event.target, 'ElTreeNode');
  23766. var oldDropNode = dragState.dropNode;
  23767. if (oldDropNode && oldDropNode !== dropNode) {
  23768. Object(dom_["removeClass"])(oldDropNode.$el, 'is-drop-inner');
  23769. }
  23770. var draggingNode = dragState.draggingNode;
  23771. if (!draggingNode || !dropNode) return;
  23772. var dropPrev = true;
  23773. var dropInner = true;
  23774. var dropNext = true;
  23775. var userAllowDropInner = true;
  23776. if (typeof _this.allowDrop === 'function') {
  23777. dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
  23778. userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
  23779. dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
  23780. }
  23781. event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
  23782. if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
  23783. if (oldDropNode) {
  23784. _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
  23785. }
  23786. _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
  23787. }
  23788. if (dropPrev || dropInner || dropNext) {
  23789. dragState.dropNode = dropNode;
  23790. }
  23791. if (dropNode.node.nextSibling === draggingNode.node) {
  23792. dropNext = false;
  23793. }
  23794. if (dropNode.node.previousSibling === draggingNode.node) {
  23795. dropPrev = false;
  23796. }
  23797. if (dropNode.node.contains(draggingNode.node, false)) {
  23798. dropInner = false;
  23799. }
  23800. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  23801. dropPrev = false;
  23802. dropInner = false;
  23803. dropNext = false;
  23804. }
  23805. var targetPosition = dropNode.$el.getBoundingClientRect();
  23806. var treePosition = _this.$el.getBoundingClientRect();
  23807. var dropType = void 0;
  23808. var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
  23809. var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
  23810. var indicatorTop = -9999;
  23811. var distance = event.clientY - targetPosition.top;
  23812. if (distance < targetPosition.height * prevPercent) {
  23813. dropType = 'before';
  23814. } else if (distance > targetPosition.height * nextPercent) {
  23815. dropType = 'after';
  23816. } else if (dropInner) {
  23817. dropType = 'inner';
  23818. } else {
  23819. dropType = 'none';
  23820. }
  23821. var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
  23822. var dropIndicator = _this.$refs.dropIndicator;
  23823. if (dropType === 'before') {
  23824. indicatorTop = iconPosition.top - treePosition.top;
  23825. } else if (dropType === 'after') {
  23826. indicatorTop = iconPosition.bottom - treePosition.top;
  23827. }
  23828. dropIndicator.style.top = indicatorTop + 'px';
  23829. dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
  23830. if (dropType === 'inner') {
  23831. Object(dom_["addClass"])(dropNode.$el, 'is-drop-inner');
  23832. } else {
  23833. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23834. }
  23835. dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
  23836. dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
  23837. dragState.dropType = dropType;
  23838. _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
  23839. });
  23840. this.$on('tree-node-drag-end', function (event) {
  23841. var draggingNode = dragState.draggingNode,
  23842. dropType = dragState.dropType,
  23843. dropNode = dragState.dropNode;
  23844. event.preventDefault();
  23845. event.dataTransfer.dropEffect = 'move';
  23846. if (draggingNode && dropNode) {
  23847. var draggingNodeCopy = { data: draggingNode.node.data };
  23848. if (dropType !== 'none') {
  23849. draggingNode.node.remove();
  23850. }
  23851. if (dropType === 'before') {
  23852. dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
  23853. } else if (dropType === 'after') {
  23854. dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
  23855. } else if (dropType === 'inner') {
  23856. dropNode.node.insertChild(draggingNodeCopy);
  23857. }
  23858. if (dropType !== 'none') {
  23859. _this.store.registerNode(draggingNodeCopy);
  23860. }
  23861. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23862. _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
  23863. if (dropType !== 'none') {
  23864. _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
  23865. }
  23866. }
  23867. if (draggingNode && !dropNode) {
  23868. _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
  23869. }
  23870. dragState.showDropIndicator = false;
  23871. dragState.draggingNode = null;
  23872. dragState.dropNode = null;
  23873. dragState.allowDrop = true;
  23874. });
  23875. },
  23876. mounted: function mounted() {
  23877. this.initTabIndex();
  23878. this.$el.addEventListener('keydown', this.handleKeydown);
  23879. },
  23880. updated: function updated() {
  23881. this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
  23882. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23883. }
  23884. });
  23885. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js&
  23886. /* harmony default export */ var src_treevue_type_script_lang_js_ = (treevue_type_script_lang_js_);
  23887. // CONCATENATED MODULE: ./packages/tree/src/tree.vue
  23888. /* normalize component */
  23889. var tree_component = normalizeComponent(
  23890. src_treevue_type_script_lang_js_,
  23891. treevue_type_template_id_547575a6_render,
  23892. treevue_type_template_id_547575a6_staticRenderFns,
  23893. false,
  23894. null,
  23895. null,
  23896. null
  23897. )
  23898. /* hot reload */
  23899. if (false) { var tree_api; }
  23900. tree_component.options.__file = "packages/tree/src/tree.vue"
  23901. /* harmony default export */ var src_tree = (tree_component.exports);
  23902. // CONCATENATED MODULE: ./packages/tree/index.js
  23903. /* istanbul ignore next */
  23904. src_tree.install = function (Vue) {
  23905. Vue.component(src_tree.name, src_tree);
  23906. };
  23907. /* harmony default export */ var packages_tree = (src_tree);
  23908. // 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&
  23909. var mainvue_type_template_id_6e53341b_render = function() {
  23910. var _vm = this
  23911. var _h = _vm.$createElement
  23912. var _c = _vm._self._c || _h
  23913. return _c("transition", { attrs: { name: "el-alert-fade" } }, [
  23914. _c(
  23915. "div",
  23916. {
  23917. directives: [
  23918. {
  23919. name: "show",
  23920. rawName: "v-show",
  23921. value: _vm.visible,
  23922. expression: "visible"
  23923. }
  23924. ],
  23925. staticClass: "el-alert",
  23926. class: [
  23927. _vm.typeClass,
  23928. _vm.center ? "is-center" : "",
  23929. "is-" + _vm.effect
  23930. ],
  23931. attrs: { role: "alert" }
  23932. },
  23933. [
  23934. _vm.showIcon
  23935. ? _c("i", {
  23936. staticClass: "el-alert__icon",
  23937. class: [_vm.iconClass, _vm.isBigIcon]
  23938. })
  23939. : _vm._e(),
  23940. _c("div", { staticClass: "el-alert__content" }, [
  23941. _vm.title || _vm.$slots.title
  23942. ? _c(
  23943. "span",
  23944. { staticClass: "el-alert__title", class: [_vm.isBoldTitle] },
  23945. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  23946. 2
  23947. )
  23948. : _vm._e(),
  23949. _vm.$slots.default && !_vm.description
  23950. ? _c(
  23951. "p",
  23952. { staticClass: "el-alert__description" },
  23953. [_vm._t("default")],
  23954. 2
  23955. )
  23956. : _vm._e(),
  23957. _vm.description && !_vm.$slots.default
  23958. ? _c("p", { staticClass: "el-alert__description" }, [
  23959. _vm._v(_vm._s(_vm.description))
  23960. ])
  23961. : _vm._e(),
  23962. _c(
  23963. "i",
  23964. {
  23965. directives: [
  23966. {
  23967. name: "show",
  23968. rawName: "v-show",
  23969. value: _vm.closable,
  23970. expression: "closable"
  23971. }
  23972. ],
  23973. staticClass: "el-alert__closebtn",
  23974. class: {
  23975. "is-customed": _vm.closeText !== "",
  23976. "el-icon-close": _vm.closeText === ""
  23977. },
  23978. on: {
  23979. click: function($event) {
  23980. _vm.close()
  23981. }
  23982. }
  23983. },
  23984. [_vm._v(_vm._s(_vm.closeText))]
  23985. )
  23986. ])
  23987. ]
  23988. )
  23989. ])
  23990. }
  23991. var mainvue_type_template_id_6e53341b_staticRenderFns = []
  23992. mainvue_type_template_id_6e53341b_render._withStripped = true
  23993. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=template&id=6e53341b&
  23994. // 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&
  23995. //
  23996. //
  23997. //
  23998. //
  23999. //
  24000. //
  24001. //
  24002. //
  24003. //
  24004. //
  24005. //
  24006. //
  24007. //
  24008. //
  24009. //
  24010. //
  24011. //
  24012. //
  24013. //
  24014. //
  24015. //
  24016. var TYPE_CLASSES_MAP = {
  24017. 'success': 'el-icon-success',
  24018. 'warning': 'el-icon-warning',
  24019. 'error': 'el-icon-error'
  24020. };
  24021. /* harmony default export */ var alert_src_mainvue_type_script_lang_js_ = ({
  24022. name: 'ElAlert',
  24023. props: {
  24024. title: {
  24025. type: String,
  24026. default: ''
  24027. },
  24028. description: {
  24029. type: String,
  24030. default: ''
  24031. },
  24032. type: {
  24033. type: String,
  24034. default: 'info'
  24035. },
  24036. closable: {
  24037. type: Boolean,
  24038. default: true
  24039. },
  24040. closeText: {
  24041. type: String,
  24042. default: ''
  24043. },
  24044. showIcon: Boolean,
  24045. center: Boolean,
  24046. effect: {
  24047. type: String,
  24048. default: 'light',
  24049. validator: function validator(value) {
  24050. return ['light', 'dark'].indexOf(value) !== -1;
  24051. }
  24052. }
  24053. },
  24054. data: function data() {
  24055. return {
  24056. visible: true
  24057. };
  24058. },
  24059. methods: {
  24060. close: function close() {
  24061. this.visible = false;
  24062. this.$emit('close');
  24063. }
  24064. },
  24065. computed: {
  24066. typeClass: function typeClass() {
  24067. return 'el-alert--' + this.type;
  24068. },
  24069. iconClass: function iconClass() {
  24070. return TYPE_CLASSES_MAP[this.type] || 'el-icon-info';
  24071. },
  24072. isBigIcon: function isBigIcon() {
  24073. return this.description || this.$slots.default ? 'is-big' : '';
  24074. },
  24075. isBoldTitle: function isBoldTitle() {
  24076. return this.description || this.$slots.default ? 'is-bold' : '';
  24077. }
  24078. }
  24079. });
  24080. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=script&lang=js&
  24081. /* harmony default export */ var packages_alert_src_mainvue_type_script_lang_js_ = (alert_src_mainvue_type_script_lang_js_);
  24082. // CONCATENATED MODULE: ./packages/alert/src/main.vue
  24083. /* normalize component */
  24084. var alert_src_main_component = normalizeComponent(
  24085. packages_alert_src_mainvue_type_script_lang_js_,
  24086. mainvue_type_template_id_6e53341b_render,
  24087. mainvue_type_template_id_6e53341b_staticRenderFns,
  24088. false,
  24089. null,
  24090. null,
  24091. null
  24092. )
  24093. /* hot reload */
  24094. if (false) { var alert_src_main_api; }
  24095. alert_src_main_component.options.__file = "packages/alert/src/main.vue"
  24096. /* harmony default export */ var alert_src_main = (alert_src_main_component.exports);
  24097. // CONCATENATED MODULE: ./packages/alert/index.js
  24098. /* istanbul ignore next */
  24099. alert_src_main.install = function (Vue) {
  24100. Vue.component(alert_src_main.name, alert_src_main);
  24101. };
  24102. /* harmony default export */ var packages_alert = (alert_src_main);
  24103. // 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&
  24104. var mainvue_type_template_id_43dbc3d8_render = function() {
  24105. var _vm = this
  24106. var _h = _vm.$createElement
  24107. var _c = _vm._self._c || _h
  24108. return _c("transition", { attrs: { name: "el-notification-fade" } }, [
  24109. _c(
  24110. "div",
  24111. {
  24112. directives: [
  24113. {
  24114. name: "show",
  24115. rawName: "v-show",
  24116. value: _vm.visible,
  24117. expression: "visible"
  24118. }
  24119. ],
  24120. class: ["el-notification", _vm.customClass, _vm.horizontalClass],
  24121. style: _vm.positionStyle,
  24122. attrs: { role: "alert" },
  24123. on: {
  24124. mouseenter: function($event) {
  24125. _vm.clearTimer()
  24126. },
  24127. mouseleave: function($event) {
  24128. _vm.startTimer()
  24129. },
  24130. click: _vm.click
  24131. }
  24132. },
  24133. [
  24134. _vm.type || _vm.iconClass
  24135. ? _c("i", {
  24136. staticClass: "el-notification__icon",
  24137. class: [_vm.typeClass, _vm.iconClass]
  24138. })
  24139. : _vm._e(),
  24140. _c(
  24141. "div",
  24142. {
  24143. staticClass: "el-notification__group",
  24144. class: { "is-with-icon": _vm.typeClass || _vm.iconClass }
  24145. },
  24146. [
  24147. _c("h2", {
  24148. staticClass: "el-notification__title",
  24149. domProps: { textContent: _vm._s(_vm.title) }
  24150. }),
  24151. _c(
  24152. "div",
  24153. {
  24154. directives: [
  24155. {
  24156. name: "show",
  24157. rawName: "v-show",
  24158. value: _vm.message,
  24159. expression: "message"
  24160. }
  24161. ],
  24162. staticClass: "el-notification__content"
  24163. },
  24164. [
  24165. _vm._t("default", [
  24166. !_vm.dangerouslyUseHTMLString
  24167. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  24168. : _c("p", { domProps: { innerHTML: _vm._s(_vm.message) } })
  24169. ])
  24170. ],
  24171. 2
  24172. ),
  24173. _vm.showClose
  24174. ? _c("div", {
  24175. staticClass: "el-notification__closeBtn el-icon-close",
  24176. on: {
  24177. click: function($event) {
  24178. $event.stopPropagation()
  24179. return _vm.close($event)
  24180. }
  24181. }
  24182. })
  24183. : _vm._e()
  24184. ]
  24185. )
  24186. ]
  24187. )
  24188. ])
  24189. }
  24190. var mainvue_type_template_id_43dbc3d8_staticRenderFns = []
  24191. mainvue_type_template_id_43dbc3d8_render._withStripped = true
  24192. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=43dbc3d8&
  24193. // 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&
  24194. //
  24195. //
  24196. //
  24197. //
  24198. //
  24199. //
  24200. //
  24201. //
  24202. //
  24203. //
  24204. //
  24205. //
  24206. //
  24207. //
  24208. //
  24209. //
  24210. //
  24211. //
  24212. //
  24213. //
  24214. //
  24215. //
  24216. //
  24217. //
  24218. //
  24219. //
  24220. //
  24221. //
  24222. //
  24223. //
  24224. //
  24225. //
  24226. //
  24227. var mainvue_type_script_lang_js_typeMap = {
  24228. success: 'success',
  24229. info: 'info',
  24230. warning: 'warning',
  24231. error: 'error'
  24232. };
  24233. /* harmony default export */ var notification_src_mainvue_type_script_lang_js_ = ({
  24234. data: function data() {
  24235. return {
  24236. visible: false,
  24237. title: '',
  24238. message: '',
  24239. duration: 4500,
  24240. type: '',
  24241. showClose: true,
  24242. customClass: '',
  24243. iconClass: '',
  24244. onClose: null,
  24245. onClick: null,
  24246. closed: false,
  24247. verticalOffset: 0,
  24248. timer: null,
  24249. dangerouslyUseHTMLString: false,
  24250. position: 'top-right'
  24251. };
  24252. },
  24253. computed: {
  24254. typeClass: function typeClass() {
  24255. return this.type && mainvue_type_script_lang_js_typeMap[this.type] ? 'el-icon-' + mainvue_type_script_lang_js_typeMap[this.type] : '';
  24256. },
  24257. horizontalClass: function horizontalClass() {
  24258. return this.position.indexOf('right') > -1 ? 'right' : 'left';
  24259. },
  24260. verticalProperty: function verticalProperty() {
  24261. return (/^top-/.test(this.position) ? 'top' : 'bottom'
  24262. );
  24263. },
  24264. positionStyle: function positionStyle() {
  24265. var _ref;
  24266. return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
  24267. }
  24268. },
  24269. watch: {
  24270. closed: function closed(newVal) {
  24271. if (newVal) {
  24272. this.visible = false;
  24273. this.$el.addEventListener('transitionend', this.destroyElement);
  24274. }
  24275. }
  24276. },
  24277. methods: {
  24278. destroyElement: function destroyElement() {
  24279. this.$el.removeEventListener('transitionend', this.destroyElement);
  24280. this.$destroy(true);
  24281. this.$el.parentNode.removeChild(this.$el);
  24282. },
  24283. click: function click() {
  24284. if (typeof this.onClick === 'function') {
  24285. this.onClick();
  24286. }
  24287. },
  24288. close: function close() {
  24289. this.closed = true;
  24290. if (typeof this.onClose === 'function') {
  24291. this.onClose();
  24292. }
  24293. },
  24294. clearTimer: function clearTimer() {
  24295. clearTimeout(this.timer);
  24296. },
  24297. startTimer: function startTimer() {
  24298. var _this = this;
  24299. if (this.duration > 0) {
  24300. this.timer = setTimeout(function () {
  24301. if (!_this.closed) {
  24302. _this.close();
  24303. }
  24304. }, this.duration);
  24305. }
  24306. },
  24307. keydown: function keydown(e) {
  24308. if (e.keyCode === 46 || e.keyCode === 8) {
  24309. this.clearTimer(); // detele 取消倒计时
  24310. } else if (e.keyCode === 27) {
  24311. // esc关闭消息
  24312. if (!this.closed) {
  24313. this.close();
  24314. }
  24315. } else {
  24316. this.startTimer(); // 恢复倒计时
  24317. }
  24318. }
  24319. },
  24320. mounted: function mounted() {
  24321. var _this2 = this;
  24322. if (this.duration > 0) {
  24323. this.timer = setTimeout(function () {
  24324. if (!_this2.closed) {
  24325. _this2.close();
  24326. }
  24327. }, this.duration);
  24328. }
  24329. document.addEventListener('keydown', this.keydown);
  24330. },
  24331. beforeDestroy: function beforeDestroy() {
  24332. document.removeEventListener('keydown', this.keydown);
  24333. }
  24334. });
  24335. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
  24336. /* harmony default export */ var packages_notification_src_mainvue_type_script_lang_js_ = (notification_src_mainvue_type_script_lang_js_);
  24337. // CONCATENATED MODULE: ./packages/notification/src/main.vue
  24338. /* normalize component */
  24339. var notification_src_main_component = normalizeComponent(
  24340. packages_notification_src_mainvue_type_script_lang_js_,
  24341. mainvue_type_template_id_43dbc3d8_render,
  24342. mainvue_type_template_id_43dbc3d8_staticRenderFns,
  24343. false,
  24344. null,
  24345. null,
  24346. null
  24347. )
  24348. /* hot reload */
  24349. if (false) { var notification_src_main_api; }
  24350. notification_src_main_component.options.__file = "packages/notification/src/main.vue"
  24351. /* harmony default export */ var notification_src_main = (notification_src_main_component.exports);
  24352. // CONCATENATED MODULE: ./packages/notification/src/main.js
  24353. var NotificationConstructor = external_vue_default.a.extend(notification_src_main);
  24354. var src_main_instance = void 0;
  24355. var instances = [];
  24356. var seed = 1;
  24357. var main_Notification = function Notification(options) {
  24358. if (external_vue_default.a.prototype.$isServer) return;
  24359. options = merge_default()({}, options);
  24360. var userOnClose = options.onClose;
  24361. var id = 'notification_' + seed++;
  24362. var position = options.position || 'top-right';
  24363. options.onClose = function () {
  24364. Notification.close(id, userOnClose);
  24365. };
  24366. src_main_instance = new NotificationConstructor({
  24367. data: options
  24368. });
  24369. if (Object(vdom_["isVNode"])(options.message)) {
  24370. src_main_instance.$slots.default = [options.message];
  24371. options.message = 'REPLACED_BY_VNODE';
  24372. }
  24373. src_main_instance.id = id;
  24374. src_main_instance.$mount();
  24375. document.body.appendChild(src_main_instance.$el);
  24376. src_main_instance.visible = true;
  24377. src_main_instance.dom = src_main_instance.$el;
  24378. src_main_instance.dom.style.zIndex = popup_["PopupManager"].nextZIndex();
  24379. var verticalOffset = options.offset || 0;
  24380. instances.filter(function (item) {
  24381. return item.position === position;
  24382. }).forEach(function (item) {
  24383. verticalOffset += item.$el.offsetHeight + 16;
  24384. });
  24385. verticalOffset += 16;
  24386. src_main_instance.verticalOffset = verticalOffset;
  24387. instances.push(src_main_instance);
  24388. return src_main_instance;
  24389. };
  24390. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  24391. main_Notification[type] = function (options) {
  24392. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  24393. options = {
  24394. message: options
  24395. };
  24396. }
  24397. options.type = type;
  24398. return main_Notification(options);
  24399. };
  24400. });
  24401. main_Notification.close = function (id, userOnClose) {
  24402. var index = -1;
  24403. var len = instances.length;
  24404. var instance = instances.filter(function (instance, i) {
  24405. if (instance.id === id) {
  24406. index = i;
  24407. return true;
  24408. }
  24409. return false;
  24410. })[0];
  24411. if (!instance) return;
  24412. if (typeof userOnClose === 'function') {
  24413. userOnClose(instance);
  24414. }
  24415. instances.splice(index, 1);
  24416. if (len <= 1) return;
  24417. var position = instance.position;
  24418. var removedHeight = instance.dom.offsetHeight;
  24419. for (var i = index; i < len - 1; i++) {
  24420. if (instances[i].position === position) {
  24421. instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
  24422. }
  24423. }
  24424. };
  24425. main_Notification.closeAll = function () {
  24426. for (var i = instances.length - 1; i >= 0; i--) {
  24427. instances[i].close();
  24428. }
  24429. };
  24430. /* harmony default export */ var packages_notification_src_main = (main_Notification);
  24431. // CONCATENATED MODULE: ./packages/notification/index.js
  24432. /* harmony default export */ var notification = (packages_notification_src_main);
  24433. // 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&
  24434. var mainvue_type_template_id_32708644_render = function() {
  24435. var _vm = this
  24436. var _h = _vm.$createElement
  24437. var _c = _vm._self._c || _h
  24438. return _c(
  24439. "div",
  24440. {
  24441. staticClass: "el-slider",
  24442. class: {
  24443. "is-vertical": _vm.vertical,
  24444. "el-slider--with-input": _vm.showInput
  24445. },
  24446. attrs: {
  24447. role: "slider",
  24448. "aria-valuemin": _vm.min,
  24449. "aria-valuemax": _vm.max,
  24450. "aria-orientation": _vm.vertical ? "vertical" : "horizontal",
  24451. "aria-disabled": _vm.sliderDisabled
  24452. }
  24453. },
  24454. [
  24455. _vm.showInput && !_vm.range
  24456. ? _c("el-input-number", {
  24457. ref: "input",
  24458. staticClass: "el-slider__input",
  24459. attrs: {
  24460. step: _vm.step,
  24461. disabled: _vm.sliderDisabled,
  24462. controls: _vm.showInputControls,
  24463. min: _vm.min,
  24464. max: _vm.max,
  24465. debounce: _vm.debounce,
  24466. size: _vm.inputSize
  24467. },
  24468. on: { change: _vm.emitChange },
  24469. model: {
  24470. value: _vm.firstValue,
  24471. callback: function($$v) {
  24472. _vm.firstValue = $$v
  24473. },
  24474. expression: "firstValue"
  24475. }
  24476. })
  24477. : _vm._e(),
  24478. _c(
  24479. "div",
  24480. {
  24481. ref: "slider",
  24482. staticClass: "el-slider__runway",
  24483. class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
  24484. style: _vm.runwayStyle,
  24485. on: { click: _vm.onSliderClick }
  24486. },
  24487. [
  24488. _c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
  24489. _c("slider-button", {
  24490. ref: "button1",
  24491. attrs: {
  24492. vertical: _vm.vertical,
  24493. "tooltip-class": _vm.tooltipClass
  24494. },
  24495. model: {
  24496. value: _vm.firstValue,
  24497. callback: function($$v) {
  24498. _vm.firstValue = $$v
  24499. },
  24500. expression: "firstValue"
  24501. }
  24502. }),
  24503. _vm.range
  24504. ? _c("slider-button", {
  24505. ref: "button2",
  24506. attrs: {
  24507. vertical: _vm.vertical,
  24508. "tooltip-class": _vm.tooltipClass
  24509. },
  24510. model: {
  24511. value: _vm.secondValue,
  24512. callback: function($$v) {
  24513. _vm.secondValue = $$v
  24514. },
  24515. expression: "secondValue"
  24516. }
  24517. })
  24518. : _vm._e(),
  24519. _vm._l(_vm.stops, function(item, key) {
  24520. return _vm.showStops
  24521. ? _c("div", {
  24522. key: key,
  24523. staticClass: "el-slider__stop",
  24524. style: _vm.getStopStyle(item)
  24525. })
  24526. : _vm._e()
  24527. }),
  24528. _vm.markList.length > 0
  24529. ? [
  24530. _c(
  24531. "div",
  24532. _vm._l(_vm.markList, function(item, key) {
  24533. return _c("div", {
  24534. key: key,
  24535. staticClass: "el-slider__stop el-slider__marks-stop",
  24536. style: _vm.getStopStyle(item.position)
  24537. })
  24538. }),
  24539. 0
  24540. ),
  24541. _c(
  24542. "div",
  24543. { staticClass: "el-slider__marks" },
  24544. _vm._l(_vm.markList, function(item, key) {
  24545. return _c("slider-marker", {
  24546. key: key,
  24547. style: _vm.getStopStyle(item.position),
  24548. attrs: { mark: item.mark }
  24549. })
  24550. }),
  24551. 1
  24552. )
  24553. ]
  24554. : _vm._e()
  24555. ],
  24556. 2
  24557. )
  24558. ],
  24559. 1
  24560. )
  24561. }
  24562. var mainvue_type_template_id_32708644_staticRenderFns = []
  24563. mainvue_type_template_id_32708644_render._withStripped = true
  24564. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=32708644&
  24565. // EXTERNAL MODULE: external "element-ui/lib/input-number"
  24566. var input_number_ = __webpack_require__(41);
  24567. var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
  24568. // 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&
  24569. var buttonvue_type_template_id_e72d2ad2_render = function() {
  24570. var _vm = this
  24571. var _h = _vm.$createElement
  24572. var _c = _vm._self._c || _h
  24573. return _c(
  24574. "div",
  24575. {
  24576. ref: "button",
  24577. staticClass: "el-slider__button-wrapper",
  24578. class: { hover: _vm.hovering, dragging: _vm.dragging },
  24579. style: _vm.wrapperStyle,
  24580. attrs: { tabindex: "0" },
  24581. on: {
  24582. mouseenter: _vm.handleMouseEnter,
  24583. mouseleave: _vm.handleMouseLeave,
  24584. mousedown: _vm.onButtonDown,
  24585. touchstart: _vm.onButtonDown,
  24586. focus: _vm.handleMouseEnter,
  24587. blur: _vm.handleMouseLeave,
  24588. keydown: [
  24589. function($event) {
  24590. if (
  24591. !("button" in $event) &&
  24592. _vm._k($event.keyCode, "left", 37, $event.key, [
  24593. "Left",
  24594. "ArrowLeft"
  24595. ])
  24596. ) {
  24597. return null
  24598. }
  24599. if ("button" in $event && $event.button !== 0) {
  24600. return null
  24601. }
  24602. return _vm.onLeftKeyDown($event)
  24603. },
  24604. function($event) {
  24605. if (
  24606. !("button" in $event) &&
  24607. _vm._k($event.keyCode, "right", 39, $event.key, [
  24608. "Right",
  24609. "ArrowRight"
  24610. ])
  24611. ) {
  24612. return null
  24613. }
  24614. if ("button" in $event && $event.button !== 2) {
  24615. return null
  24616. }
  24617. return _vm.onRightKeyDown($event)
  24618. },
  24619. function($event) {
  24620. if (
  24621. !("button" in $event) &&
  24622. _vm._k($event.keyCode, "down", 40, $event.key, [
  24623. "Down",
  24624. "ArrowDown"
  24625. ])
  24626. ) {
  24627. return null
  24628. }
  24629. $event.preventDefault()
  24630. return _vm.onLeftKeyDown($event)
  24631. },
  24632. function($event) {
  24633. if (
  24634. !("button" in $event) &&
  24635. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  24636. ) {
  24637. return null
  24638. }
  24639. $event.preventDefault()
  24640. return _vm.onRightKeyDown($event)
  24641. }
  24642. ]
  24643. }
  24644. },
  24645. [
  24646. _c(
  24647. "el-tooltip",
  24648. {
  24649. ref: "tooltip",
  24650. attrs: {
  24651. placement: "top",
  24652. "popper-class": _vm.tooltipClass,
  24653. disabled: !_vm.showTooltip
  24654. }
  24655. },
  24656. [
  24657. _c("span", { attrs: { slot: "content" }, slot: "content" }, [
  24658. _vm._v(_vm._s(_vm.formatValue))
  24659. ]),
  24660. _c("div", {
  24661. staticClass: "el-slider__button",
  24662. class: { hover: _vm.hovering, dragging: _vm.dragging }
  24663. })
  24664. ]
  24665. )
  24666. ],
  24667. 1
  24668. )
  24669. }
  24670. var buttonvue_type_template_id_e72d2ad2_staticRenderFns = []
  24671. buttonvue_type_template_id_e72d2ad2_render._withStripped = true
  24672. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=e72d2ad2&
  24673. // 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&
  24674. //
  24675. //
  24676. //
  24677. //
  24678. //
  24679. //
  24680. //
  24681. //
  24682. //
  24683. //
  24684. //
  24685. //
  24686. //
  24687. //
  24688. //
  24689. //
  24690. //
  24691. //
  24692. //
  24693. //
  24694. //
  24695. //
  24696. //
  24697. //
  24698. //
  24699. //
  24700. //
  24701. //
  24702. //
  24703. /* harmony default export */ var slider_src_buttonvue_type_script_lang_js_ = ({
  24704. name: 'ElSliderButton',
  24705. components: {
  24706. ElTooltip: tooltip_default.a
  24707. },
  24708. props: {
  24709. value: {
  24710. type: Number,
  24711. default: 0
  24712. },
  24713. vertical: {
  24714. type: Boolean,
  24715. default: false
  24716. },
  24717. tooltipClass: String
  24718. },
  24719. data: function data() {
  24720. return {
  24721. hovering: false,
  24722. dragging: false,
  24723. isClick: false,
  24724. startX: 0,
  24725. currentX: 0,
  24726. startY: 0,
  24727. currentY: 0,
  24728. startPosition: 0,
  24729. newPosition: null,
  24730. oldValue: this.value
  24731. };
  24732. },
  24733. computed: {
  24734. disabled: function disabled() {
  24735. return this.$parent.sliderDisabled;
  24736. },
  24737. max: function max() {
  24738. return this.$parent.max;
  24739. },
  24740. min: function min() {
  24741. return this.$parent.min;
  24742. },
  24743. step: function step() {
  24744. return this.$parent.step;
  24745. },
  24746. showTooltip: function showTooltip() {
  24747. return this.$parent.showTooltip;
  24748. },
  24749. precision: function precision() {
  24750. return this.$parent.precision;
  24751. },
  24752. currentPosition: function currentPosition() {
  24753. return (this.value - this.min) / (this.max - this.min) * 100 + '%';
  24754. },
  24755. enableFormat: function enableFormat() {
  24756. return this.$parent.formatTooltip instanceof Function;
  24757. },
  24758. formatValue: function formatValue() {
  24759. return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
  24760. },
  24761. wrapperStyle: function wrapperStyle() {
  24762. return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
  24763. }
  24764. },
  24765. watch: {
  24766. dragging: function dragging(val) {
  24767. this.$parent.dragging = val;
  24768. }
  24769. },
  24770. methods: {
  24771. displayTooltip: function displayTooltip() {
  24772. this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
  24773. },
  24774. hideTooltip: function hideTooltip() {
  24775. this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
  24776. },
  24777. handleMouseEnter: function handleMouseEnter() {
  24778. this.hovering = true;
  24779. this.displayTooltip();
  24780. },
  24781. handleMouseLeave: function handleMouseLeave() {
  24782. this.hovering = false;
  24783. this.hideTooltip();
  24784. },
  24785. onButtonDown: function onButtonDown(event) {
  24786. if (this.disabled) return;
  24787. event.preventDefault();
  24788. this.onDragStart(event);
  24789. window.addEventListener('mousemove', this.onDragging);
  24790. window.addEventListener('touchmove', this.onDragging);
  24791. window.addEventListener('mouseup', this.onDragEnd);
  24792. window.addEventListener('touchend', this.onDragEnd);
  24793. window.addEventListener('contextmenu', this.onDragEnd);
  24794. },
  24795. onLeftKeyDown: function onLeftKeyDown() {
  24796. if (this.disabled) return;
  24797. this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
  24798. this.setPosition(this.newPosition);
  24799. this.$parent.emitChange();
  24800. },
  24801. onRightKeyDown: function onRightKeyDown() {
  24802. if (this.disabled) return;
  24803. this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
  24804. this.setPosition(this.newPosition);
  24805. this.$parent.emitChange();
  24806. },
  24807. onDragStart: function onDragStart(event) {
  24808. this.dragging = true;
  24809. this.isClick = true;
  24810. if (event.type === 'touchstart') {
  24811. event.clientY = event.touches[0].clientY;
  24812. event.clientX = event.touches[0].clientX;
  24813. }
  24814. if (this.vertical) {
  24815. this.startY = event.clientY;
  24816. } else {
  24817. this.startX = event.clientX;
  24818. }
  24819. this.startPosition = parseFloat(this.currentPosition);
  24820. this.newPosition = this.startPosition;
  24821. },
  24822. onDragging: function onDragging(event) {
  24823. if (this.dragging) {
  24824. this.isClick = false;
  24825. this.displayTooltip();
  24826. this.$parent.resetSize();
  24827. var diff = 0;
  24828. if (event.type === 'touchmove') {
  24829. event.clientY = event.touches[0].clientY;
  24830. event.clientX = event.touches[0].clientX;
  24831. }
  24832. if (this.vertical) {
  24833. this.currentY = event.clientY;
  24834. diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
  24835. } else {
  24836. this.currentX = event.clientX;
  24837. diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
  24838. }
  24839. this.newPosition = this.startPosition + diff;
  24840. this.setPosition(this.newPosition);
  24841. }
  24842. },
  24843. onDragEnd: function onDragEnd() {
  24844. var _this = this;
  24845. if (this.dragging) {
  24846. /*
  24847. * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
  24848. * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
  24849. */
  24850. setTimeout(function () {
  24851. _this.dragging = false;
  24852. _this.hideTooltip();
  24853. if (!_this.isClick) {
  24854. _this.setPosition(_this.newPosition);
  24855. _this.$parent.emitChange();
  24856. }
  24857. }, 0);
  24858. window.removeEventListener('mousemove', this.onDragging);
  24859. window.removeEventListener('touchmove', this.onDragging);
  24860. window.removeEventListener('mouseup', this.onDragEnd);
  24861. window.removeEventListener('touchend', this.onDragEnd);
  24862. window.removeEventListener('contextmenu', this.onDragEnd);
  24863. }
  24864. },
  24865. setPosition: function setPosition(newPosition) {
  24866. var _this2 = this;
  24867. if (newPosition === null || isNaN(newPosition)) return;
  24868. if (newPosition < 0) {
  24869. newPosition = 0;
  24870. } else if (newPosition > 100) {
  24871. newPosition = 100;
  24872. }
  24873. var lengthPerStep = 100 / ((this.max - this.min) / this.step);
  24874. var steps = Math.round(newPosition / lengthPerStep);
  24875. var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
  24876. value = parseFloat(value.toFixed(this.precision));
  24877. this.$emit('input', value);
  24878. this.$nextTick(function () {
  24879. _this2.displayTooltip();
  24880. _this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
  24881. });
  24882. if (!this.dragging && this.value !== this.oldValue) {
  24883. this.oldValue = this.value;
  24884. }
  24885. }
  24886. }
  24887. });
  24888. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js&
  24889. /* harmony default export */ var packages_slider_src_buttonvue_type_script_lang_js_ = (slider_src_buttonvue_type_script_lang_js_);
  24890. // CONCATENATED MODULE: ./packages/slider/src/button.vue
  24891. /* normalize component */
  24892. var src_button_component = normalizeComponent(
  24893. packages_slider_src_buttonvue_type_script_lang_js_,
  24894. buttonvue_type_template_id_e72d2ad2_render,
  24895. buttonvue_type_template_id_e72d2ad2_staticRenderFns,
  24896. false,
  24897. null,
  24898. null,
  24899. null
  24900. )
  24901. /* hot reload */
  24902. if (false) { var src_button_api; }
  24903. src_button_component.options.__file = "packages/slider/src/button.vue"
  24904. /* harmony default export */ var slider_src_button = (src_button_component.exports);
  24905. // CONCATENATED MODULE: ./packages/slider/src/marker.js
  24906. /* harmony default export */ var marker = ({
  24907. name: 'ElMarker',
  24908. props: {
  24909. mark: {
  24910. type: [String, Object]
  24911. }
  24912. },
  24913. render: function render() {
  24914. var h = arguments[0];
  24915. var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
  24916. return h(
  24917. 'div',
  24918. { 'class': 'el-slider__marks-text', style: this.mark.style || {} },
  24919. [label]
  24920. );
  24921. }
  24922. });
  24923. // 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&
  24924. //
  24925. //
  24926. //
  24927. //
  24928. //
  24929. //
  24930. //
  24931. //
  24932. //
  24933. //
  24934. //
  24935. //
  24936. //
  24937. //
  24938. //
  24939. //
  24940. //
  24941. //
  24942. //
  24943. //
  24944. //
  24945. //
  24946. //
  24947. //
  24948. //
  24949. //
  24950. //
  24951. //
  24952. //
  24953. //
  24954. //
  24955. //
  24956. //
  24957. //
  24958. //
  24959. //
  24960. //
  24961. //
  24962. //
  24963. //
  24964. //
  24965. //
  24966. //
  24967. //
  24968. //
  24969. //
  24970. //
  24971. //
  24972. //
  24973. //
  24974. //
  24975. //
  24976. //
  24977. //
  24978. //
  24979. //
  24980. //
  24981. //
  24982. //
  24983. //
  24984. //
  24985. //
  24986. //
  24987. //
  24988. //
  24989. //
  24990. //
  24991. //
  24992. //
  24993. //
  24994. //
  24995. //
  24996. //
  24997. //
  24998. //
  24999. /* harmony default export */ var slider_src_mainvue_type_script_lang_js_ = ({
  25000. name: 'ElSlider',
  25001. mixins: [emitter_default.a],
  25002. inject: {
  25003. elForm: {
  25004. default: ''
  25005. }
  25006. },
  25007. props: {
  25008. min: {
  25009. type: Number,
  25010. default: 0
  25011. },
  25012. max: {
  25013. type: Number,
  25014. default: 100
  25015. },
  25016. step: {
  25017. type: Number,
  25018. default: 1
  25019. },
  25020. value: {
  25021. type: [Number, Array],
  25022. default: 0
  25023. },
  25024. showInput: {
  25025. type: Boolean,
  25026. default: false
  25027. },
  25028. showInputControls: {
  25029. type: Boolean,
  25030. default: true
  25031. },
  25032. inputSize: {
  25033. type: String,
  25034. default: 'small'
  25035. },
  25036. showStops: {
  25037. type: Boolean,
  25038. default: false
  25039. },
  25040. showTooltip: {
  25041. type: Boolean,
  25042. default: true
  25043. },
  25044. formatTooltip: Function,
  25045. disabled: {
  25046. type: Boolean,
  25047. default: false
  25048. },
  25049. range: {
  25050. type: Boolean,
  25051. default: false
  25052. },
  25053. vertical: {
  25054. type: Boolean,
  25055. default: false
  25056. },
  25057. height: {
  25058. type: String
  25059. },
  25060. debounce: {
  25061. type: Number,
  25062. default: 300
  25063. },
  25064. label: {
  25065. type: String
  25066. },
  25067. tooltipClass: String,
  25068. marks: Object
  25069. },
  25070. components: {
  25071. ElInputNumber: input_number_default.a,
  25072. SliderButton: slider_src_button,
  25073. SliderMarker: marker
  25074. },
  25075. data: function data() {
  25076. return {
  25077. firstValue: null,
  25078. secondValue: null,
  25079. oldValue: null,
  25080. dragging: false,
  25081. sliderSize: 1
  25082. };
  25083. },
  25084. watch: {
  25085. value: function value(val, oldVal) {
  25086. if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
  25087. return item === oldVal[index];
  25088. })) {
  25089. return;
  25090. }
  25091. this.setValues();
  25092. },
  25093. dragging: function dragging(val) {
  25094. if (!val) {
  25095. this.setValues();
  25096. }
  25097. },
  25098. firstValue: function firstValue(val) {
  25099. if (this.range) {
  25100. this.$emit('input', [this.minValue, this.maxValue]);
  25101. } else {
  25102. this.$emit('input', val);
  25103. }
  25104. },
  25105. secondValue: function secondValue() {
  25106. if (this.range) {
  25107. this.$emit('input', [this.minValue, this.maxValue]);
  25108. }
  25109. },
  25110. min: function min() {
  25111. this.setValues();
  25112. },
  25113. max: function max() {
  25114. this.setValues();
  25115. }
  25116. },
  25117. methods: {
  25118. valueChanged: function valueChanged() {
  25119. var _this = this;
  25120. if (this.range) {
  25121. return ![this.minValue, this.maxValue].every(function (item, index) {
  25122. return item === _this.oldValue[index];
  25123. });
  25124. } else {
  25125. return this.value !== this.oldValue;
  25126. }
  25127. },
  25128. setValues: function setValues() {
  25129. if (this.min > this.max) {
  25130. console.error('[Element Error][Slider]min should not be greater than max.');
  25131. return;
  25132. }
  25133. var val = this.value;
  25134. if (this.range && Array.isArray(val)) {
  25135. if (val[1] < this.min) {
  25136. this.$emit('input', [this.min, this.min]);
  25137. } else if (val[0] > this.max) {
  25138. this.$emit('input', [this.max, this.max]);
  25139. } else if (val[0] < this.min) {
  25140. this.$emit('input', [this.min, val[1]]);
  25141. } else if (val[1] > this.max) {
  25142. this.$emit('input', [val[0], this.max]);
  25143. } else {
  25144. this.firstValue = val[0];
  25145. this.secondValue = val[1];
  25146. if (this.valueChanged()) {
  25147. this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
  25148. this.oldValue = val.slice();
  25149. }
  25150. }
  25151. } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
  25152. if (val < this.min) {
  25153. this.$emit('input', this.min);
  25154. } else if (val > this.max) {
  25155. this.$emit('input', this.max);
  25156. } else {
  25157. this.firstValue = val;
  25158. if (this.valueChanged()) {
  25159. this.dispatch('ElFormItem', 'el.form.change', val);
  25160. this.oldValue = val;
  25161. }
  25162. }
  25163. }
  25164. },
  25165. setPosition: function setPosition(percent) {
  25166. var targetValue = this.min + percent * (this.max - this.min) / 100;
  25167. if (!this.range) {
  25168. this.$refs.button1.setPosition(percent);
  25169. return;
  25170. }
  25171. var button = void 0;
  25172. if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
  25173. button = this.firstValue < this.secondValue ? 'button1' : 'button2';
  25174. } else {
  25175. button = this.firstValue > this.secondValue ? 'button1' : 'button2';
  25176. }
  25177. this.$refs[button].setPosition(percent);
  25178. },
  25179. onSliderClick: function onSliderClick(event) {
  25180. if (this.sliderDisabled || this.dragging) return;
  25181. this.resetSize();
  25182. if (this.vertical) {
  25183. var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
  25184. this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
  25185. } else {
  25186. var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  25187. this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
  25188. }
  25189. this.emitChange();
  25190. },
  25191. resetSize: function resetSize() {
  25192. if (this.$refs.slider) {
  25193. this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
  25194. }
  25195. },
  25196. emitChange: function emitChange() {
  25197. var _this2 = this;
  25198. this.$nextTick(function () {
  25199. _this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
  25200. });
  25201. },
  25202. getStopStyle: function getStopStyle(position) {
  25203. return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
  25204. }
  25205. },
  25206. computed: {
  25207. stops: function stops() {
  25208. var _this3 = this;
  25209. if (!this.showStops || this.min > this.max) return [];
  25210. if (this.step === 0) {
  25211. false && false;
  25212. return [];
  25213. }
  25214. var stopCount = (this.max - this.min) / this.step;
  25215. var stepWidth = 100 * this.step / (this.max - this.min);
  25216. var result = [];
  25217. for (var i = 1; i < stopCount; i++) {
  25218. result.push(i * stepWidth);
  25219. }
  25220. if (this.range) {
  25221. return result.filter(function (step) {
  25222. return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
  25223. });
  25224. } else {
  25225. return result.filter(function (step) {
  25226. return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
  25227. });
  25228. }
  25229. },
  25230. markList: function markList() {
  25231. var _this4 = this;
  25232. if (!this.marks) {
  25233. return [];
  25234. }
  25235. var marksKeys = Object.keys(this.marks);
  25236. return marksKeys.map(parseFloat).sort(function (a, b) {
  25237. return a - b;
  25238. }).filter(function (point) {
  25239. return point <= _this4.max && point >= _this4.min;
  25240. }).map(function (point) {
  25241. return {
  25242. point: point,
  25243. position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
  25244. mark: _this4.marks[point]
  25245. };
  25246. });
  25247. },
  25248. minValue: function minValue() {
  25249. return Math.min(this.firstValue, this.secondValue);
  25250. },
  25251. maxValue: function maxValue() {
  25252. return Math.max(this.firstValue, this.secondValue);
  25253. },
  25254. barSize: function barSize() {
  25255. return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
  25256. },
  25257. barStart: function barStart() {
  25258. return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
  25259. },
  25260. precision: function precision() {
  25261. var precisions = [this.min, this.max, this.step].map(function (item) {
  25262. var decimal = ('' + item).split('.')[1];
  25263. return decimal ? decimal.length : 0;
  25264. });
  25265. return Math.max.apply(null, precisions);
  25266. },
  25267. runwayStyle: function runwayStyle() {
  25268. return this.vertical ? { height: this.height } : {};
  25269. },
  25270. barStyle: function barStyle() {
  25271. return this.vertical ? {
  25272. height: this.barSize,
  25273. bottom: this.barStart
  25274. } : {
  25275. width: this.barSize,
  25276. left: this.barStart
  25277. };
  25278. },
  25279. sliderDisabled: function sliderDisabled() {
  25280. return this.disabled || (this.elForm || {}).disabled;
  25281. }
  25282. },
  25283. mounted: function mounted() {
  25284. var valuetext = void 0;
  25285. if (this.range) {
  25286. if (Array.isArray(this.value)) {
  25287. this.firstValue = Math.max(this.min, this.value[0]);
  25288. this.secondValue = Math.min(this.max, this.value[1]);
  25289. } else {
  25290. this.firstValue = this.min;
  25291. this.secondValue = this.max;
  25292. }
  25293. this.oldValue = [this.firstValue, this.secondValue];
  25294. valuetext = this.firstValue + '-' + this.secondValue;
  25295. } else {
  25296. if (typeof this.value !== 'number' || isNaN(this.value)) {
  25297. this.firstValue = this.min;
  25298. } else {
  25299. this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
  25300. }
  25301. this.oldValue = this.firstValue;
  25302. valuetext = this.firstValue;
  25303. }
  25304. this.$el.setAttribute('aria-valuetext', valuetext);
  25305. // label screen reader
  25306. this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
  25307. this.resetSize();
  25308. window.addEventListener('resize', this.resetSize);
  25309. },
  25310. beforeDestroy: function beforeDestroy() {
  25311. window.removeEventListener('resize', this.resetSize);
  25312. }
  25313. });
  25314. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js&
  25315. /* harmony default export */ var packages_slider_src_mainvue_type_script_lang_js_ = (slider_src_mainvue_type_script_lang_js_);
  25316. // CONCATENATED MODULE: ./packages/slider/src/main.vue
  25317. /* normalize component */
  25318. var slider_src_main_component = normalizeComponent(
  25319. packages_slider_src_mainvue_type_script_lang_js_,
  25320. mainvue_type_template_id_32708644_render,
  25321. mainvue_type_template_id_32708644_staticRenderFns,
  25322. false,
  25323. null,
  25324. null,
  25325. null
  25326. )
  25327. /* hot reload */
  25328. if (false) { var slider_src_main_api; }
  25329. slider_src_main_component.options.__file = "packages/slider/src/main.vue"
  25330. /* harmony default export */ var slider_src_main = (slider_src_main_component.exports);
  25331. // CONCATENATED MODULE: ./packages/slider/index.js
  25332. /* istanbul ignore next */
  25333. slider_src_main.install = function (Vue) {
  25334. Vue.component(slider_src_main.name, slider_src_main);
  25335. };
  25336. /* harmony default export */ var slider = (slider_src_main);
  25337. // 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&
  25338. var loadingvue_type_template_id_eee0a7ac_render = function() {
  25339. var _vm = this
  25340. var _h = _vm.$createElement
  25341. var _c = _vm._self._c || _h
  25342. return _c(
  25343. "transition",
  25344. {
  25345. attrs: { name: "el-loading-fade" },
  25346. on: { "after-leave": _vm.handleAfterLeave }
  25347. },
  25348. [
  25349. _c(
  25350. "div",
  25351. {
  25352. directives: [
  25353. {
  25354. name: "show",
  25355. rawName: "v-show",
  25356. value: _vm.visible,
  25357. expression: "visible"
  25358. }
  25359. ],
  25360. staticClass: "el-loading-mask",
  25361. class: [_vm.customClass, { "is-fullscreen": _vm.fullscreen }],
  25362. style: { backgroundColor: _vm.background || "" }
  25363. },
  25364. [
  25365. _c("div", { staticClass: "el-loading-spinner" }, [
  25366. !_vm.spinner
  25367. ? _c(
  25368. "svg",
  25369. {
  25370. staticClass: "circular",
  25371. attrs: { viewBox: "25 25 50 50" }
  25372. },
  25373. [
  25374. _c("circle", {
  25375. staticClass: "path",
  25376. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  25377. })
  25378. ]
  25379. )
  25380. : _c("i", { class: _vm.spinner }),
  25381. _vm.text
  25382. ? _c("p", { staticClass: "el-loading-text" }, [
  25383. _vm._v(_vm._s(_vm.text))
  25384. ])
  25385. : _vm._e()
  25386. ])
  25387. ]
  25388. )
  25389. ]
  25390. )
  25391. }
  25392. var loadingvue_type_template_id_eee0a7ac_staticRenderFns = []
  25393. loadingvue_type_template_id_eee0a7ac_render._withStripped = true
  25394. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  25395. // 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&
  25396. //
  25397. //
  25398. //
  25399. //
  25400. //
  25401. //
  25402. //
  25403. //
  25404. //
  25405. //
  25406. //
  25407. //
  25408. //
  25409. //
  25410. //
  25411. //
  25412. //
  25413. //
  25414. /* harmony default export */ var loadingvue_type_script_lang_js_ = ({
  25415. data: function data() {
  25416. return {
  25417. text: null,
  25418. spinner: null,
  25419. background: null,
  25420. fullscreen: true,
  25421. visible: false,
  25422. customClass: ''
  25423. };
  25424. },
  25425. methods: {
  25426. handleAfterLeave: function handleAfterLeave() {
  25427. this.$emit('after-leave');
  25428. },
  25429. setText: function setText(text) {
  25430. this.text = text;
  25431. }
  25432. }
  25433. });
  25434. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=script&lang=js&
  25435. /* harmony default export */ var src_loadingvue_type_script_lang_js_ = (loadingvue_type_script_lang_js_);
  25436. // CONCATENATED MODULE: ./packages/loading/src/loading.vue
  25437. /* normalize component */
  25438. var loading_component = normalizeComponent(
  25439. src_loadingvue_type_script_lang_js_,
  25440. loadingvue_type_template_id_eee0a7ac_render,
  25441. loadingvue_type_template_id_eee0a7ac_staticRenderFns,
  25442. false,
  25443. null,
  25444. null,
  25445. null
  25446. )
  25447. /* hot reload */
  25448. if (false) { var loading_api; }
  25449. loading_component.options.__file = "packages/loading/src/loading.vue"
  25450. /* harmony default export */ var loading = (loading_component.exports);
  25451. // EXTERNAL MODULE: external "element-ui/lib/utils/after-leave"
  25452. var after_leave_ = __webpack_require__(32);
  25453. var after_leave_default = /*#__PURE__*/__webpack_require__.n(after_leave_);
  25454. // CONCATENATED MODULE: ./packages/loading/src/directive.js
  25455. var Mask = external_vue_default.a.extend(loading);
  25456. var loadingDirective = {};
  25457. loadingDirective.install = function (Vue) {
  25458. if (Vue.prototype.$isServer) return;
  25459. var toggleLoading = function toggleLoading(el, binding) {
  25460. if (binding.value) {
  25461. Vue.nextTick(function () {
  25462. if (binding.modifiers.fullscreen) {
  25463. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25464. el.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25465. el.maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25466. Object(dom_["addClass"])(el.mask, 'is-fullscreen');
  25467. insertDom(document.body, el, binding);
  25468. } else {
  25469. Object(dom_["removeClass"])(el.mask, 'is-fullscreen');
  25470. if (binding.modifiers.body) {
  25471. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25472. ['top', 'left'].forEach(function (property) {
  25473. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25474. el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - parseInt(Object(dom_["getStyle"])(document.body, 'margin-' + property), 10) + 'px';
  25475. });
  25476. ['height', 'width'].forEach(function (property) {
  25477. el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
  25478. });
  25479. insertDom(document.body, el, binding);
  25480. } else {
  25481. el.originalPosition = Object(dom_["getStyle"])(el, 'position');
  25482. insertDom(el, el, binding);
  25483. }
  25484. }
  25485. });
  25486. } else {
  25487. after_leave_default()(el.instance, function (_) {
  25488. if (!el.instance.hiding) return;
  25489. el.domVisible = false;
  25490. var target = binding.modifiers.fullscreen || binding.modifiers.body ? document.body : el;
  25491. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25492. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25493. el.instance.hiding = false;
  25494. }, 300, true);
  25495. el.instance.visible = false;
  25496. el.instance.hiding = true;
  25497. }
  25498. };
  25499. var insertDom = function insertDom(parent, el, binding) {
  25500. if (!el.domVisible && Object(dom_["getStyle"])(el, 'display') !== 'none' && Object(dom_["getStyle"])(el, 'visibility') !== 'hidden') {
  25501. Object.keys(el.maskStyle).forEach(function (property) {
  25502. el.mask.style[property] = el.maskStyle[property];
  25503. });
  25504. if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed') {
  25505. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25506. }
  25507. if (binding.modifiers.fullscreen && binding.modifiers.lock) {
  25508. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25509. }
  25510. el.domVisible = true;
  25511. parent.appendChild(el.mask);
  25512. Vue.nextTick(function () {
  25513. if (el.instance.hiding) {
  25514. el.instance.$emit('after-leave');
  25515. } else {
  25516. el.instance.visible = true;
  25517. }
  25518. });
  25519. el.domInserted = true;
  25520. } else if (el.domVisible && el.instance.hiding === true) {
  25521. el.instance.visible = true;
  25522. el.instance.hiding = false;
  25523. }
  25524. };
  25525. Vue.directive('loading', {
  25526. bind: function bind(el, binding, vnode) {
  25527. var textExr = el.getAttribute('element-loading-text');
  25528. var spinnerExr = el.getAttribute('element-loading-spinner');
  25529. var backgroundExr = el.getAttribute('element-loading-background');
  25530. var customClassExr = el.getAttribute('element-loading-custom-class');
  25531. var vm = vnode.context;
  25532. var mask = new Mask({
  25533. el: document.createElement('div'),
  25534. data: {
  25535. text: vm && vm[textExr] || textExr,
  25536. spinner: vm && vm[spinnerExr] || spinnerExr,
  25537. background: vm && vm[backgroundExr] || backgroundExr,
  25538. customClass: vm && vm[customClassExr] || customClassExr,
  25539. fullscreen: !!binding.modifiers.fullscreen
  25540. }
  25541. });
  25542. el.instance = mask;
  25543. el.mask = mask.$el;
  25544. el.maskStyle = {};
  25545. binding.value && toggleLoading(el, binding);
  25546. },
  25547. update: function update(el, binding) {
  25548. el.instance.setText(el.getAttribute('element-loading-text'));
  25549. if (binding.oldValue !== binding.value) {
  25550. toggleLoading(el, binding);
  25551. }
  25552. },
  25553. unbind: function unbind(el, binding) {
  25554. if (el.domInserted) {
  25555. el.mask && el.mask.parentNode && el.mask.parentNode.removeChild(el.mask);
  25556. toggleLoading(el, { value: false, modifiers: binding.modifiers });
  25557. }
  25558. el.instance && el.instance.$destroy();
  25559. }
  25560. });
  25561. };
  25562. /* harmony default export */ var src_directive = (loadingDirective);
  25563. // CONCATENATED MODULE: ./packages/loading/src/index.js
  25564. var LoadingConstructor = external_vue_default.a.extend(loading);
  25565. var src_defaults = {
  25566. text: null,
  25567. fullscreen: true,
  25568. body: false,
  25569. lock: false,
  25570. customClass: ''
  25571. };
  25572. var fullscreenLoading = void 0;
  25573. LoadingConstructor.prototype.originalPosition = '';
  25574. LoadingConstructor.prototype.originalOverflow = '';
  25575. LoadingConstructor.prototype.close = function () {
  25576. var _this = this;
  25577. if (this.fullscreen) {
  25578. fullscreenLoading = undefined;
  25579. }
  25580. after_leave_default()(this, function (_) {
  25581. var target = _this.fullscreen || _this.body ? document.body : _this.target;
  25582. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25583. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25584. if (_this.$el && _this.$el.parentNode) {
  25585. _this.$el.parentNode.removeChild(_this.$el);
  25586. }
  25587. _this.$destroy();
  25588. }, 300);
  25589. this.visible = false;
  25590. };
  25591. var src_addStyle = function addStyle(options, parent, instance) {
  25592. var maskStyle = {};
  25593. if (options.fullscreen) {
  25594. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25595. instance.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25596. maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25597. } else if (options.body) {
  25598. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25599. ['top', 'left'].forEach(function (property) {
  25600. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25601. maskStyle[property] = options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
  25602. });
  25603. ['height', 'width'].forEach(function (property) {
  25604. maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
  25605. });
  25606. } else {
  25607. instance.originalPosition = Object(dom_["getStyle"])(parent, 'position');
  25608. }
  25609. Object.keys(maskStyle).forEach(function (property) {
  25610. instance.$el.style[property] = maskStyle[property];
  25611. });
  25612. };
  25613. var src_Loading = function Loading() {
  25614. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25615. if (external_vue_default.a.prototype.$isServer) return;
  25616. options = merge_default()({}, src_defaults, options);
  25617. if (typeof options.target === 'string') {
  25618. options.target = document.querySelector(options.target);
  25619. }
  25620. options.target = options.target || document.body;
  25621. if (options.target !== document.body) {
  25622. options.fullscreen = false;
  25623. } else {
  25624. options.body = true;
  25625. }
  25626. if (options.fullscreen && fullscreenLoading) {
  25627. return fullscreenLoading;
  25628. }
  25629. var parent = options.body ? document.body : options.target;
  25630. var instance = new LoadingConstructor({
  25631. el: document.createElement('div'),
  25632. data: options
  25633. });
  25634. src_addStyle(options, parent, instance);
  25635. if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed') {
  25636. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25637. }
  25638. if (options.fullscreen && options.lock) {
  25639. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25640. }
  25641. parent.appendChild(instance.$el);
  25642. external_vue_default.a.nextTick(function () {
  25643. instance.visible = true;
  25644. });
  25645. if (options.fullscreen) {
  25646. fullscreenLoading = instance;
  25647. }
  25648. return instance;
  25649. };
  25650. /* harmony default export */ var src = (src_Loading);
  25651. // CONCATENATED MODULE: ./packages/loading/index.js
  25652. /* harmony default export */ var packages_loading = ({
  25653. install: function install(Vue) {
  25654. Vue.use(src_directive);
  25655. Vue.prototype.$loading = src;
  25656. },
  25657. directive: src_directive,
  25658. service: src
  25659. });
  25660. // 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&
  25661. var iconvue_type_template_id_cb3fe7f4_render = function() {
  25662. var _vm = this
  25663. var _h = _vm.$createElement
  25664. var _c = _vm._self._c || _h
  25665. return _c("i", { class: "el-icon-" + _vm.name })
  25666. }
  25667. var iconvue_type_template_id_cb3fe7f4_staticRenderFns = []
  25668. iconvue_type_template_id_cb3fe7f4_render._withStripped = true
  25669. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=template&id=cb3fe7f4&
  25670. // 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&
  25671. //
  25672. //
  25673. //
  25674. //
  25675. /* harmony default export */ var iconvue_type_script_lang_js_ = ({
  25676. name: 'ElIcon',
  25677. props: {
  25678. name: String
  25679. }
  25680. });
  25681. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=script&lang=js&
  25682. /* harmony default export */ var src_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
  25683. // CONCATENATED MODULE: ./packages/icon/src/icon.vue
  25684. /* normalize component */
  25685. var icon_component = normalizeComponent(
  25686. src_iconvue_type_script_lang_js_,
  25687. iconvue_type_template_id_cb3fe7f4_render,
  25688. iconvue_type_template_id_cb3fe7f4_staticRenderFns,
  25689. false,
  25690. null,
  25691. null,
  25692. null
  25693. )
  25694. /* hot reload */
  25695. if (false) { var icon_api; }
  25696. icon_component.options.__file = "packages/icon/src/icon.vue"
  25697. /* harmony default export */ var icon = (icon_component.exports);
  25698. // CONCATENATED MODULE: ./packages/icon/index.js
  25699. /* istanbul ignore next */
  25700. icon.install = function (Vue) {
  25701. Vue.component(icon.name, icon);
  25702. };
  25703. /* harmony default export */ var packages_icon = (icon);
  25704. // CONCATENATED MODULE: ./packages/row/src/row.js
  25705. /* harmony default export */ var src_row = ({
  25706. name: 'ElRow',
  25707. componentName: 'ElRow',
  25708. props: {
  25709. tag: {
  25710. type: String,
  25711. default: 'div'
  25712. },
  25713. gutter: Number,
  25714. type: String,
  25715. justify: {
  25716. type: String,
  25717. default: 'start'
  25718. },
  25719. align: String
  25720. },
  25721. computed: {
  25722. style: function style() {
  25723. var ret = {};
  25724. if (this.gutter) {
  25725. ret.marginLeft = '-' + this.gutter / 2 + 'px';
  25726. ret.marginRight = ret.marginLeft;
  25727. }
  25728. return ret;
  25729. }
  25730. },
  25731. render: function render(h) {
  25732. return h(this.tag, {
  25733. class: ['el-row', this.justify !== 'start' ? 'is-justify-' + this.justify : '', this.align ? 'is-align-' + this.align : '', { 'el-row--flex': this.type === 'flex' }],
  25734. style: this.style
  25735. }, this.$slots.default);
  25736. }
  25737. });
  25738. // CONCATENATED MODULE: ./packages/row/index.js
  25739. /* istanbul ignore next */
  25740. src_row.install = function (Vue) {
  25741. Vue.component(src_row.name, src_row);
  25742. };
  25743. /* harmony default export */ var packages_row = (src_row);
  25744. // CONCATENATED MODULE: ./packages/col/src/col.js
  25745. 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; };
  25746. /* harmony default export */ var col = ({
  25747. name: 'ElCol',
  25748. props: {
  25749. span: {
  25750. type: Number,
  25751. default: 24
  25752. },
  25753. tag: {
  25754. type: String,
  25755. default: 'div'
  25756. },
  25757. offset: Number,
  25758. pull: Number,
  25759. push: Number,
  25760. xs: [Number, Object],
  25761. sm: [Number, Object],
  25762. md: [Number, Object],
  25763. lg: [Number, Object],
  25764. xl: [Number, Object]
  25765. },
  25766. computed: {
  25767. gutter: function gutter() {
  25768. var parent = this.$parent;
  25769. while (parent && parent.$options.componentName !== 'ElRow') {
  25770. parent = parent.$parent;
  25771. }
  25772. return parent ? parent.gutter : 0;
  25773. }
  25774. },
  25775. render: function render(h) {
  25776. var _this = this;
  25777. var classList = [];
  25778. var style = {};
  25779. if (this.gutter) {
  25780. style.paddingLeft = this.gutter / 2 + 'px';
  25781. style.paddingRight = style.paddingLeft;
  25782. }
  25783. ['span', 'offset', 'pull', 'push'].forEach(function (prop) {
  25784. if (_this[prop] || _this[prop] === 0) {
  25785. classList.push(prop !== 'span' ? 'el-col-' + prop + '-' + _this[prop] : 'el-col-' + _this[prop]);
  25786. }
  25787. });
  25788. ['xs', 'sm', 'md', 'lg', 'xl'].forEach(function (size) {
  25789. if (typeof _this[size] === 'number') {
  25790. classList.push('el-col-' + size + '-' + _this[size]);
  25791. } else if (col_typeof(_this[size]) === 'object') {
  25792. var props = _this[size];
  25793. Object.keys(props).forEach(function (prop) {
  25794. classList.push(prop !== 'span' ? 'el-col-' + size + '-' + prop + '-' + props[prop] : 'el-col-' + size + '-' + props[prop]);
  25795. });
  25796. }
  25797. });
  25798. return h(this.tag, {
  25799. class: ['el-col', classList],
  25800. style: style
  25801. }, this.$slots.default);
  25802. }
  25803. });
  25804. // CONCATENATED MODULE: ./packages/col/index.js
  25805. /* istanbul ignore next */
  25806. col.install = function (Vue) {
  25807. Vue.component(col.name, col);
  25808. };
  25809. /* harmony default export */ var packages_col = (col);
  25810. // 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&
  25811. var upload_listvue_type_template_id_173fedf5_render = function() {
  25812. var _vm = this
  25813. var _h = _vm.$createElement
  25814. var _c = _vm._self._c || _h
  25815. return _c(
  25816. "transition-group",
  25817. {
  25818. class: [
  25819. "el-upload-list",
  25820. "el-upload-list--" + _vm.listType,
  25821. { "is-disabled": _vm.disabled }
  25822. ],
  25823. attrs: { tag: "ul", name: "el-list" }
  25824. },
  25825. _vm._l(_vm.files, function(file) {
  25826. return _c(
  25827. "li",
  25828. {
  25829. key: file.uid,
  25830. class: [
  25831. "el-upload-list__item",
  25832. "is-" + file.status,
  25833. _vm.focusing ? "focusing" : ""
  25834. ],
  25835. attrs: { tabindex: "0" },
  25836. on: {
  25837. keydown: function($event) {
  25838. if (
  25839. !("button" in $event) &&
  25840. _vm._k($event.keyCode, "delete", [8, 46], $event.key, [
  25841. "Backspace",
  25842. "Delete",
  25843. "Del"
  25844. ])
  25845. ) {
  25846. return null
  25847. }
  25848. !_vm.disabled && _vm.$emit("remove", file)
  25849. },
  25850. focus: function($event) {
  25851. _vm.focusing = true
  25852. },
  25853. blur: function($event) {
  25854. _vm.focusing = false
  25855. },
  25856. click: function($event) {
  25857. _vm.focusing = false
  25858. }
  25859. }
  25860. },
  25861. [
  25862. _vm._t(
  25863. "default",
  25864. [
  25865. file.status !== "uploading" &&
  25866. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  25867. ? _c("img", {
  25868. staticClass: "el-upload-list__item-thumbnail",
  25869. attrs: { src: file.url, alt: "" }
  25870. })
  25871. : _vm._e(),
  25872. _c(
  25873. "a",
  25874. {
  25875. staticClass: "el-upload-list__item-name",
  25876. on: {
  25877. click: function($event) {
  25878. _vm.handleClick(file)
  25879. }
  25880. }
  25881. },
  25882. [
  25883. _c("i", { staticClass: "el-icon-document" }),
  25884. _vm._v(_vm._s(file.name) + "\n ")
  25885. ]
  25886. ),
  25887. _c(
  25888. "label",
  25889. { staticClass: "el-upload-list__item-status-label" },
  25890. [
  25891. _c("i", {
  25892. class: {
  25893. "el-icon-upload-success": true,
  25894. "el-icon-circle-check": _vm.listType === "text",
  25895. "el-icon-check":
  25896. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  25897. }
  25898. })
  25899. ]
  25900. ),
  25901. !_vm.disabled
  25902. ? _c("i", {
  25903. staticClass: "el-icon-close",
  25904. on: {
  25905. click: function($event) {
  25906. _vm.$emit("remove", file)
  25907. }
  25908. }
  25909. })
  25910. : _vm._e(),
  25911. !_vm.disabled
  25912. ? _c("i", { staticClass: "el-icon-close-tip" }, [
  25913. _vm._v(_vm._s(_vm.t("el.upload.deleteTip")))
  25914. ])
  25915. : _vm._e(),
  25916. file.status === "uploading"
  25917. ? _c("el-progress", {
  25918. attrs: {
  25919. type: _vm.listType === "picture-card" ? "circle" : "line",
  25920. "stroke-width": _vm.listType === "picture-card" ? 6 : 2,
  25921. percentage: _vm.parsePercentage(file.percentage)
  25922. }
  25923. })
  25924. : _vm._e(),
  25925. _vm.listType === "picture-card"
  25926. ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
  25927. _vm.handlePreview && _vm.listType === "picture-card"
  25928. ? _c(
  25929. "span",
  25930. {
  25931. staticClass: "el-upload-list__item-preview",
  25932. on: {
  25933. click: function($event) {
  25934. _vm.handlePreview(file)
  25935. }
  25936. }
  25937. },
  25938. [_c("i", { staticClass: "el-icon-zoom-in" })]
  25939. )
  25940. : _vm._e(),
  25941. !_vm.disabled
  25942. ? _c(
  25943. "span",
  25944. {
  25945. staticClass: "el-upload-list__item-delete",
  25946. on: {
  25947. click: function($event) {
  25948. _vm.$emit("remove", file)
  25949. }
  25950. }
  25951. },
  25952. [_c("i", { staticClass: "el-icon-delete" })]
  25953. )
  25954. : _vm._e()
  25955. ])
  25956. : _vm._e()
  25957. ],
  25958. { file: file }
  25959. )
  25960. ],
  25961. 2
  25962. )
  25963. }),
  25964. 0
  25965. )
  25966. }
  25967. var upload_listvue_type_template_id_173fedf5_staticRenderFns = []
  25968. upload_listvue_type_template_id_173fedf5_render._withStripped = true
  25969. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
  25970. // EXTERNAL MODULE: external "element-ui/lib/progress"
  25971. var progress_ = __webpack_require__(33);
  25972. var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
  25973. // 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&
  25974. //
  25975. //
  25976. //
  25977. //
  25978. //
  25979. //
  25980. //
  25981. //
  25982. //
  25983. //
  25984. //
  25985. //
  25986. //
  25987. //
  25988. //
  25989. //
  25990. //
  25991. //
  25992. //
  25993. //
  25994. //
  25995. //
  25996. //
  25997. //
  25998. //
  25999. //
  26000. //
  26001. //
  26002. //
  26003. //
  26004. //
  26005. //
  26006. //
  26007. //
  26008. //
  26009. //
  26010. //
  26011. //
  26012. //
  26013. //
  26014. //
  26015. //
  26016. //
  26017. //
  26018. //
  26019. //
  26020. //
  26021. //
  26022. //
  26023. //
  26024. //
  26025. //
  26026. //
  26027. //
  26028. //
  26029. //
  26030. //
  26031. //
  26032. //
  26033. //
  26034. //
  26035. //
  26036. //
  26037. //
  26038. /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({
  26039. name: 'ElUploadList',
  26040. mixins: [locale_default.a],
  26041. data: function data() {
  26042. return {
  26043. focusing: false
  26044. };
  26045. },
  26046. components: { ElProgress: progress_default.a },
  26047. props: {
  26048. files: {
  26049. type: Array,
  26050. default: function _default() {
  26051. return [];
  26052. }
  26053. },
  26054. disabled: {
  26055. type: Boolean,
  26056. default: false
  26057. },
  26058. handlePreview: Function,
  26059. listType: String
  26060. },
  26061. methods: {
  26062. parsePercentage: function parsePercentage(val) {
  26063. return parseInt(val, 10);
  26064. },
  26065. handleClick: function handleClick(file) {
  26066. this.handlePreview && this.handlePreview(file);
  26067. }
  26068. }
  26069. });
  26070. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
  26071. /* harmony default export */ var src_upload_listvue_type_script_lang_js_ = (upload_listvue_type_script_lang_js_);
  26072. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
  26073. /* normalize component */
  26074. var upload_list_component = normalizeComponent(
  26075. src_upload_listvue_type_script_lang_js_,
  26076. upload_listvue_type_template_id_173fedf5_render,
  26077. upload_listvue_type_template_id_173fedf5_staticRenderFns,
  26078. false,
  26079. null,
  26080. null,
  26081. null
  26082. )
  26083. /* hot reload */
  26084. if (false) { var upload_list_api; }
  26085. upload_list_component.options.__file = "packages/upload/src/upload-list.vue"
  26086. /* harmony default export */ var upload_list = (upload_list_component.exports);
  26087. // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
  26088. var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(24);
  26089. var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
  26090. // CONCATENATED MODULE: ./packages/upload/src/ajax.js
  26091. function getError(action, option, xhr) {
  26092. var msg = void 0;
  26093. if (xhr.response) {
  26094. msg = '' + (xhr.response.error || xhr.response);
  26095. } else if (xhr.responseText) {
  26096. msg = '' + xhr.responseText;
  26097. } else {
  26098. msg = 'fail to post ' + action + ' ' + xhr.status;
  26099. }
  26100. var err = new Error(msg);
  26101. err.status = xhr.status;
  26102. err.method = 'post';
  26103. err.url = action;
  26104. return err;
  26105. }
  26106. function getBody(xhr) {
  26107. var text = xhr.responseText || xhr.response;
  26108. if (!text) {
  26109. return text;
  26110. }
  26111. try {
  26112. return JSON.parse(text);
  26113. } catch (e) {
  26114. return text;
  26115. }
  26116. }
  26117. function upload(option) {
  26118. if (typeof XMLHttpRequest === 'undefined') {
  26119. return;
  26120. }
  26121. var xhr = new XMLHttpRequest();
  26122. var action = option.action;
  26123. if (xhr.upload) {
  26124. xhr.upload.onprogress = function progress(e) {
  26125. if (e.total > 0) {
  26126. e.percent = e.loaded / e.total * 100;
  26127. }
  26128. option.onProgress(e);
  26129. };
  26130. }
  26131. var formData = new FormData();
  26132. if (option.data) {
  26133. Object.keys(option.data).forEach(function (key) {
  26134. formData.append(key, option.data[key]);
  26135. });
  26136. }
  26137. formData.append(option.filename, option.file, option.file.name);
  26138. xhr.onerror = function error(e) {
  26139. option.onError(e);
  26140. };
  26141. xhr.onload = function onload() {
  26142. if (xhr.status < 200 || xhr.status >= 300) {
  26143. return option.onError(getError(action, option, xhr));
  26144. }
  26145. option.onSuccess(getBody(xhr));
  26146. };
  26147. xhr.open('post', action, true);
  26148. if (option.withCredentials && 'withCredentials' in xhr) {
  26149. xhr.withCredentials = true;
  26150. }
  26151. var headers = option.headers || {};
  26152. for (var item in headers) {
  26153. if (headers.hasOwnProperty(item) && headers[item] !== null) {
  26154. xhr.setRequestHeader(item, headers[item]);
  26155. }
  26156. }
  26157. xhr.send(formData);
  26158. return xhr;
  26159. }
  26160. // 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&
  26161. var upload_draggervue_type_template_id_7ebbf219_render = function() {
  26162. var _vm = this
  26163. var _h = _vm.$createElement
  26164. var _c = _vm._self._c || _h
  26165. return _c(
  26166. "div",
  26167. {
  26168. staticClass: "el-upload-dragger",
  26169. class: {
  26170. "is-dragover": _vm.dragover
  26171. },
  26172. on: {
  26173. drop: function($event) {
  26174. $event.preventDefault()
  26175. return _vm.onDrop($event)
  26176. },
  26177. dragover: function($event) {
  26178. $event.preventDefault()
  26179. return _vm.onDragover($event)
  26180. },
  26181. dragleave: function($event) {
  26182. $event.preventDefault()
  26183. _vm.dragover = false
  26184. }
  26185. }
  26186. },
  26187. [_vm._t("default")],
  26188. 2
  26189. )
  26190. }
  26191. var upload_draggervue_type_template_id_7ebbf219_staticRenderFns = []
  26192. upload_draggervue_type_template_id_7ebbf219_render._withStripped = true
  26193. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219&
  26194. // 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&
  26195. //
  26196. //
  26197. //
  26198. //
  26199. //
  26200. //
  26201. //
  26202. //
  26203. //
  26204. //
  26205. //
  26206. //
  26207. //
  26208. /* harmony default export */ var upload_draggervue_type_script_lang_js_ = ({
  26209. name: 'ElUploadDrag',
  26210. props: {
  26211. disabled: Boolean
  26212. },
  26213. inject: {
  26214. uploader: {
  26215. default: ''
  26216. }
  26217. },
  26218. data: function data() {
  26219. return {
  26220. dragover: false
  26221. };
  26222. },
  26223. methods: {
  26224. onDragover: function onDragover() {
  26225. if (!this.disabled) {
  26226. this.dragover = true;
  26227. }
  26228. },
  26229. onDrop: function onDrop(e) {
  26230. if (this.disabled || !this.uploader) return;
  26231. var accept = this.uploader.accept;
  26232. this.dragover = false;
  26233. if (!accept) {
  26234. this.$emit('file', e.dataTransfer.files);
  26235. return;
  26236. }
  26237. this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
  26238. var type = file.type,
  26239. name = file.name;
  26240. var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
  26241. var baseType = type.replace(/\/.*$/, '');
  26242. return accept.split(',').map(function (type) {
  26243. return type.trim();
  26244. }).filter(function (type) {
  26245. return type;
  26246. }).some(function (acceptedType) {
  26247. if (/\..+$/.test(acceptedType)) {
  26248. return extension === acceptedType;
  26249. }
  26250. if (/\/\*$/.test(acceptedType)) {
  26251. return baseType === acceptedType.replace(/\/\*$/, '');
  26252. }
  26253. if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
  26254. return type === acceptedType;
  26255. }
  26256. return false;
  26257. });
  26258. }));
  26259. }
  26260. }
  26261. });
  26262. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js&
  26263. /* harmony default export */ var src_upload_draggervue_type_script_lang_js_ = (upload_draggervue_type_script_lang_js_);
  26264. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
  26265. /* normalize component */
  26266. var upload_dragger_component = normalizeComponent(
  26267. src_upload_draggervue_type_script_lang_js_,
  26268. upload_draggervue_type_template_id_7ebbf219_render,
  26269. upload_draggervue_type_template_id_7ebbf219_staticRenderFns,
  26270. false,
  26271. null,
  26272. null,
  26273. null
  26274. )
  26275. /* hot reload */
  26276. if (false) { var upload_dragger_api; }
  26277. upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vue"
  26278. /* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
  26279. // 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&
  26280. /* harmony default export */ var uploadvue_type_script_lang_js_ = ({
  26281. inject: ['uploader'],
  26282. components: {
  26283. UploadDragger: upload_dragger
  26284. },
  26285. props: {
  26286. type: String,
  26287. action: {
  26288. type: String,
  26289. required: true
  26290. },
  26291. name: {
  26292. type: String,
  26293. default: 'file'
  26294. },
  26295. data: Object,
  26296. headers: Object,
  26297. withCredentials: Boolean,
  26298. multiple: Boolean,
  26299. accept: String,
  26300. onStart: Function,
  26301. onProgress: Function,
  26302. onSuccess: Function,
  26303. onError: Function,
  26304. beforeUpload: Function,
  26305. drag: Boolean,
  26306. onPreview: {
  26307. type: Function,
  26308. default: function _default() {}
  26309. },
  26310. onRemove: {
  26311. type: Function,
  26312. default: function _default() {}
  26313. },
  26314. fileList: Array,
  26315. autoUpload: Boolean,
  26316. listType: String,
  26317. httpRequest: {
  26318. type: Function,
  26319. default: upload
  26320. },
  26321. disabled: Boolean,
  26322. limit: Number,
  26323. onExceed: Function
  26324. },
  26325. data: function data() {
  26326. return {
  26327. mouseover: false,
  26328. reqs: {}
  26329. };
  26330. },
  26331. methods: {
  26332. isImage: function isImage(str) {
  26333. return str.indexOf('image') !== -1;
  26334. },
  26335. handleChange: function handleChange(ev) {
  26336. var files = ev.target.files;
  26337. if (!files) return;
  26338. this.uploadFiles(files);
  26339. },
  26340. uploadFiles: function uploadFiles(files) {
  26341. var _this = this;
  26342. if (this.limit && this.fileList.length + files.length > this.limit) {
  26343. this.onExceed && this.onExceed(files, this.fileList);
  26344. return;
  26345. }
  26346. var postFiles = Array.prototype.slice.call(files);
  26347. if (!this.multiple) {
  26348. postFiles = postFiles.slice(0, 1);
  26349. }
  26350. if (postFiles.length === 0) {
  26351. return;
  26352. }
  26353. postFiles.forEach(function (rawFile) {
  26354. _this.onStart(rawFile);
  26355. if (_this.autoUpload) _this.upload(rawFile);
  26356. });
  26357. },
  26358. upload: function upload(rawFile) {
  26359. var _this2 = this;
  26360. this.$refs.input.value = null;
  26361. if (!this.beforeUpload) {
  26362. return this.post(rawFile);
  26363. }
  26364. var before = this.beforeUpload(rawFile);
  26365. if (before && before.then) {
  26366. before.then(function (processedFile) {
  26367. var fileType = Object.prototype.toString.call(processedFile);
  26368. if (fileType === '[object File]' || fileType === '[object Blob]') {
  26369. if (fileType === '[object Blob]') {
  26370. processedFile = new File([processedFile], rawFile.name, {
  26371. type: rawFile.type
  26372. });
  26373. }
  26374. for (var p in rawFile) {
  26375. if (rawFile.hasOwnProperty(p)) {
  26376. processedFile[p] = rawFile[p];
  26377. }
  26378. }
  26379. _this2.post(processedFile);
  26380. } else {
  26381. _this2.post(rawFile);
  26382. }
  26383. }, function () {
  26384. _this2.onRemove(null, rawFile);
  26385. });
  26386. } else if (before !== false) {
  26387. this.post(rawFile);
  26388. } else {
  26389. this.onRemove(null, rawFile);
  26390. }
  26391. },
  26392. abort: function abort(file) {
  26393. var reqs = this.reqs;
  26394. if (file) {
  26395. var uid = file;
  26396. if (file.uid) uid = file.uid;
  26397. if (reqs[uid]) {
  26398. reqs[uid].abort();
  26399. }
  26400. } else {
  26401. Object.keys(reqs).forEach(function (uid) {
  26402. if (reqs[uid]) reqs[uid].abort();
  26403. delete reqs[uid];
  26404. });
  26405. }
  26406. },
  26407. post: function post(rawFile) {
  26408. var _this3 = this;
  26409. var uid = rawFile.uid;
  26410. var options = {
  26411. headers: this.headers,
  26412. withCredentials: this.withCredentials,
  26413. file: rawFile,
  26414. data: this.data,
  26415. filename: this.name,
  26416. action: this.action,
  26417. onProgress: function onProgress(e) {
  26418. _this3.onProgress(e, rawFile);
  26419. },
  26420. onSuccess: function onSuccess(res) {
  26421. _this3.onSuccess(res, rawFile);
  26422. delete _this3.reqs[uid];
  26423. },
  26424. onError: function onError(err) {
  26425. _this3.onError(err, rawFile);
  26426. delete _this3.reqs[uid];
  26427. }
  26428. };
  26429. var req = this.httpRequest(options);
  26430. this.reqs[uid] = req;
  26431. if (req && req.then) {
  26432. req.then(options.onSuccess, options.onError);
  26433. }
  26434. },
  26435. handleClick: function handleClick() {
  26436. if (!this.disabled) {
  26437. this.$refs.input.value = null;
  26438. this.$refs.input.click();
  26439. }
  26440. },
  26441. handleKeydown: function handleKeydown(e) {
  26442. if (e.target !== e.currentTarget) return;
  26443. if (e.keyCode === 13 || e.keyCode === 32) {
  26444. this.handleClick();
  26445. }
  26446. }
  26447. },
  26448. render: function render(h) {
  26449. var handleClick = this.handleClick,
  26450. drag = this.drag,
  26451. name = this.name,
  26452. handleChange = this.handleChange,
  26453. multiple = this.multiple,
  26454. accept = this.accept,
  26455. listType = this.listType,
  26456. uploadFiles = this.uploadFiles,
  26457. disabled = this.disabled,
  26458. handleKeydown = this.handleKeydown;
  26459. var data = {
  26460. class: {
  26461. 'el-upload': true
  26462. },
  26463. on: {
  26464. click: handleClick,
  26465. keydown: handleKeydown
  26466. }
  26467. };
  26468. data.class['el-upload--' + listType] = true;
  26469. return h(
  26470. 'div',
  26471. external_babel_helper_vue_jsx_merge_props_default()([data, {
  26472. attrs: { tabindex: '0' }
  26473. }]),
  26474. [drag ? h(
  26475. 'upload-dragger',
  26476. {
  26477. attrs: { disabled: disabled },
  26478. on: {
  26479. 'file': uploadFiles
  26480. }
  26481. },
  26482. [this.$slots.default]
  26483. ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
  26484. ref: 'input', on: {
  26485. 'change': handleChange
  26486. }
  26487. })]
  26488. );
  26489. }
  26490. });
  26491. // CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js&
  26492. /* harmony default export */ var src_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_);
  26493. // CONCATENATED MODULE: ./packages/upload/src/upload.vue
  26494. var upload_render, upload_staticRenderFns
  26495. /* normalize component */
  26496. var upload_component = normalizeComponent(
  26497. src_uploadvue_type_script_lang_js_,
  26498. upload_render,
  26499. upload_staticRenderFns,
  26500. false,
  26501. null,
  26502. null,
  26503. null
  26504. )
  26505. /* hot reload */
  26506. if (false) { var upload_api; }
  26507. upload_component.options.__file = "packages/upload/src/upload.vue"
  26508. /* harmony default export */ var src_upload = (upload_component.exports);
  26509. // 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&
  26510. function srcvue_type_script_lang_js_noop() {}
  26511. /* harmony default export */ var srcvue_type_script_lang_js_ = ({
  26512. name: 'ElUpload',
  26513. mixins: [migrating_default.a],
  26514. components: {
  26515. ElProgress: progress_default.a,
  26516. UploadList: upload_list,
  26517. Upload: src_upload
  26518. },
  26519. provide: function provide() {
  26520. return {
  26521. uploader: this
  26522. };
  26523. },
  26524. inject: {
  26525. elForm: {
  26526. default: ''
  26527. }
  26528. },
  26529. props: {
  26530. action: {
  26531. type: String,
  26532. required: true
  26533. },
  26534. headers: {
  26535. type: Object,
  26536. default: function _default() {
  26537. return {};
  26538. }
  26539. },
  26540. data: Object,
  26541. multiple: Boolean,
  26542. name: {
  26543. type: String,
  26544. default: 'file'
  26545. },
  26546. drag: Boolean,
  26547. dragger: Boolean,
  26548. withCredentials: Boolean,
  26549. showFileList: {
  26550. type: Boolean,
  26551. default: true
  26552. },
  26553. accept: String,
  26554. type: {
  26555. type: String,
  26556. default: 'select'
  26557. },
  26558. beforeUpload: Function,
  26559. beforeRemove: Function,
  26560. onRemove: {
  26561. type: Function,
  26562. default: srcvue_type_script_lang_js_noop
  26563. },
  26564. onChange: {
  26565. type: Function,
  26566. default: srcvue_type_script_lang_js_noop
  26567. },
  26568. onPreview: {
  26569. type: Function
  26570. },
  26571. onSuccess: {
  26572. type: Function,
  26573. default: srcvue_type_script_lang_js_noop
  26574. },
  26575. onProgress: {
  26576. type: Function,
  26577. default: srcvue_type_script_lang_js_noop
  26578. },
  26579. onError: {
  26580. type: Function,
  26581. default: srcvue_type_script_lang_js_noop
  26582. },
  26583. fileList: {
  26584. type: Array,
  26585. default: function _default() {
  26586. return [];
  26587. }
  26588. },
  26589. autoUpload: {
  26590. type: Boolean,
  26591. default: true
  26592. },
  26593. listType: {
  26594. type: String,
  26595. default: 'text' // text,picture,picture-card
  26596. },
  26597. httpRequest: Function,
  26598. disabled: Boolean,
  26599. limit: Number,
  26600. onExceed: {
  26601. type: Function,
  26602. default: srcvue_type_script_lang_js_noop
  26603. }
  26604. },
  26605. data: function data() {
  26606. return {
  26607. uploadFiles: [],
  26608. dragOver: false,
  26609. draging: false,
  26610. tempIndex: 1
  26611. };
  26612. },
  26613. computed: {
  26614. uploadDisabled: function uploadDisabled() {
  26615. return this.disabled || (this.elForm || {}).disabled;
  26616. }
  26617. },
  26618. watch: {
  26619. listType: function listType(type) {
  26620. if (type === 'picture-card' || type === 'picture') {
  26621. this.uploadFiles = this.uploadFiles.map(function (file) {
  26622. if (!file.url && file.raw) {
  26623. try {
  26624. file.url = URL.createObjectURL(file.raw);
  26625. } catch (err) {
  26626. console.error('[Element Error][Upload]', err);
  26627. }
  26628. }
  26629. return file;
  26630. });
  26631. }
  26632. },
  26633. fileList: {
  26634. immediate: true,
  26635. handler: function handler(fileList) {
  26636. var _this = this;
  26637. this.uploadFiles = fileList.map(function (item) {
  26638. item.uid = item.uid || Date.now() + _this.tempIndex++;
  26639. item.status = item.status || 'success';
  26640. return item;
  26641. });
  26642. }
  26643. }
  26644. },
  26645. methods: {
  26646. handleStart: function handleStart(rawFile) {
  26647. rawFile.uid = Date.now() + this.tempIndex++;
  26648. var file = {
  26649. status: 'ready',
  26650. name: rawFile.name,
  26651. size: rawFile.size,
  26652. percentage: 0,
  26653. uid: rawFile.uid,
  26654. raw: rawFile
  26655. };
  26656. if (this.listType === 'picture-card' || this.listType === 'picture') {
  26657. try {
  26658. file.url = URL.createObjectURL(rawFile);
  26659. } catch (err) {
  26660. console.error('[Element Error][Upload]', err);
  26661. return;
  26662. }
  26663. }
  26664. this.uploadFiles.push(file);
  26665. this.onChange(file, this.uploadFiles);
  26666. },
  26667. handleProgress: function handleProgress(ev, rawFile) {
  26668. var file = this.getFile(rawFile);
  26669. this.onProgress(ev, file, this.uploadFiles);
  26670. file.status = 'uploading';
  26671. file.percentage = ev.percent || 0;
  26672. },
  26673. handleSuccess: function handleSuccess(res, rawFile) {
  26674. var file = this.getFile(rawFile);
  26675. if (file) {
  26676. file.status = 'success';
  26677. file.response = res;
  26678. this.onSuccess(res, file, this.uploadFiles);
  26679. this.onChange(file, this.uploadFiles);
  26680. }
  26681. },
  26682. handleError: function handleError(err, rawFile) {
  26683. var file = this.getFile(rawFile);
  26684. var fileList = this.uploadFiles;
  26685. file.status = 'fail';
  26686. fileList.splice(fileList.indexOf(file), 1);
  26687. this.onError(err, file, this.uploadFiles);
  26688. this.onChange(file, this.uploadFiles);
  26689. },
  26690. handleRemove: function handleRemove(file, raw) {
  26691. var _this2 = this;
  26692. if (raw) {
  26693. file = this.getFile(raw);
  26694. }
  26695. var doRemove = function doRemove() {
  26696. _this2.abort(file);
  26697. var fileList = _this2.uploadFiles;
  26698. fileList.splice(fileList.indexOf(file), 1);
  26699. _this2.onRemove(file, fileList);
  26700. };
  26701. if (!this.beforeRemove) {
  26702. doRemove();
  26703. } else if (typeof this.beforeRemove === 'function') {
  26704. var before = this.beforeRemove(file, this.uploadFiles);
  26705. if (before && before.then) {
  26706. before.then(function () {
  26707. doRemove();
  26708. }, srcvue_type_script_lang_js_noop);
  26709. } else if (before !== false) {
  26710. doRemove();
  26711. }
  26712. }
  26713. },
  26714. getFile: function getFile(rawFile) {
  26715. var fileList = this.uploadFiles;
  26716. var target = void 0;
  26717. fileList.every(function (item) {
  26718. target = rawFile.uid === item.uid ? item : null;
  26719. return !target;
  26720. });
  26721. return target;
  26722. },
  26723. abort: function abort(file) {
  26724. this.$refs['upload-inner'].abort(file);
  26725. },
  26726. clearFiles: function clearFiles() {
  26727. this.uploadFiles = [];
  26728. },
  26729. submit: function submit() {
  26730. var _this3 = this;
  26731. this.uploadFiles.filter(function (file) {
  26732. return file.status === 'ready';
  26733. }).forEach(function (file) {
  26734. _this3.$refs['upload-inner'].upload(file.raw);
  26735. });
  26736. },
  26737. getMigratingConfig: function getMigratingConfig() {
  26738. return {
  26739. props: {
  26740. 'default-file-list': 'default-file-list is renamed to file-list.',
  26741. 'show-upload-list': 'show-upload-list is renamed to show-file-list.',
  26742. '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'
  26743. }
  26744. };
  26745. }
  26746. },
  26747. beforeDestroy: function beforeDestroy() {
  26748. this.uploadFiles.forEach(function (file) {
  26749. if (file.url && file.url.indexOf('blob:') === 0) {
  26750. URL.revokeObjectURL(file.url);
  26751. }
  26752. });
  26753. },
  26754. render: function render(h) {
  26755. var _this4 = this;
  26756. var uploadList = void 0;
  26757. if (this.showFileList) {
  26758. uploadList = h(
  26759. upload_list,
  26760. {
  26761. attrs: {
  26762. disabled: this.uploadDisabled,
  26763. listType: this.listType,
  26764. files: this.uploadFiles,
  26765. handlePreview: this.onPreview },
  26766. on: {
  26767. 'remove': this.handleRemove
  26768. }
  26769. },
  26770. [function (props) {
  26771. if (_this4.$scopedSlots.file) {
  26772. return _this4.$scopedSlots.file({
  26773. file: props.file
  26774. });
  26775. }
  26776. }]
  26777. );
  26778. }
  26779. var uploadData = {
  26780. props: {
  26781. type: this.type,
  26782. drag: this.drag,
  26783. action: this.action,
  26784. multiple: this.multiple,
  26785. 'before-upload': this.beforeUpload,
  26786. 'with-credentials': this.withCredentials,
  26787. headers: this.headers,
  26788. name: this.name,
  26789. data: this.data,
  26790. accept: this.accept,
  26791. fileList: this.uploadFiles,
  26792. autoUpload: this.autoUpload,
  26793. listType: this.listType,
  26794. disabled: this.uploadDisabled,
  26795. limit: this.limit,
  26796. 'on-exceed': this.onExceed,
  26797. 'on-start': this.handleStart,
  26798. 'on-progress': this.handleProgress,
  26799. 'on-success': this.handleSuccess,
  26800. 'on-error': this.handleError,
  26801. 'on-preview': this.onPreview,
  26802. 'on-remove': this.handleRemove,
  26803. 'http-request': this.httpRequest
  26804. },
  26805. ref: 'upload-inner'
  26806. };
  26807. var trigger = this.$slots.trigger || this.$slots.default;
  26808. var uploadComponent = h(
  26809. 'upload',
  26810. uploadData,
  26811. [trigger]
  26812. );
  26813. return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
  26814. }
  26815. });
  26816. // CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js&
  26817. /* harmony default export */ var upload_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
  26818. // CONCATENATED MODULE: ./packages/upload/src/index.vue
  26819. var src_render, src_staticRenderFns
  26820. /* normalize component */
  26821. var upload_src_component = normalizeComponent(
  26822. upload_srcvue_type_script_lang_js_,
  26823. src_render,
  26824. src_staticRenderFns,
  26825. false,
  26826. null,
  26827. null,
  26828. null
  26829. )
  26830. /* hot reload */
  26831. if (false) { var src_api; }
  26832. upload_src_component.options.__file = "packages/upload/src/index.vue"
  26833. /* harmony default export */ var upload_src = (upload_src_component.exports);
  26834. // CONCATENATED MODULE: ./packages/upload/index.js
  26835. /* istanbul ignore next */
  26836. upload_src.install = function (Vue) {
  26837. Vue.component(upload_src.name, upload_src);
  26838. };
  26839. /* harmony default export */ var packages_upload = (upload_src);
  26840. // 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&
  26841. var progressvue_type_template_id_229ee406_render = function() {
  26842. var _vm = this
  26843. var _h = _vm.$createElement
  26844. var _c = _vm._self._c || _h
  26845. return _c(
  26846. "div",
  26847. {
  26848. staticClass: "el-progress",
  26849. class: [
  26850. "el-progress--" + _vm.type,
  26851. _vm.status ? "is-" + _vm.status : "",
  26852. {
  26853. "el-progress--without-text": !_vm.showText,
  26854. "el-progress--text-inside": _vm.textInside
  26855. }
  26856. ],
  26857. attrs: {
  26858. role: "progressbar",
  26859. "aria-valuenow": _vm.percentage,
  26860. "aria-valuemin": "0",
  26861. "aria-valuemax": "100"
  26862. }
  26863. },
  26864. [
  26865. _vm.type === "line"
  26866. ? _c("div", { staticClass: "el-progress-bar" }, [
  26867. _c(
  26868. "div",
  26869. {
  26870. staticClass: "el-progress-bar__outer",
  26871. style: { height: _vm.strokeWidth + "px" }
  26872. },
  26873. [
  26874. _c(
  26875. "div",
  26876. {
  26877. staticClass: "el-progress-bar__inner",
  26878. style: _vm.barStyle
  26879. },
  26880. [
  26881. _vm.showText && _vm.textInside
  26882. ? _c(
  26883. "div",
  26884. { staticClass: "el-progress-bar__innerText" },
  26885. [_vm._v(_vm._s(_vm.content))]
  26886. )
  26887. : _vm._e()
  26888. ]
  26889. )
  26890. ]
  26891. )
  26892. ])
  26893. : _c(
  26894. "div",
  26895. {
  26896. staticClass: "el-progress-circle",
  26897. style: { height: _vm.width + "px", width: _vm.width + "px" }
  26898. },
  26899. [
  26900. _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
  26901. _c("path", {
  26902. staticClass: "el-progress-circle__track",
  26903. style: _vm.trailPathStyle,
  26904. attrs: {
  26905. d: _vm.trackPath,
  26906. stroke: "#e5e9f2",
  26907. "stroke-width": _vm.relativeStrokeWidth,
  26908. fill: "none"
  26909. }
  26910. }),
  26911. _c("path", {
  26912. staticClass: "el-progress-circle__path",
  26913. style: _vm.circlePathStyle,
  26914. attrs: {
  26915. d: _vm.trackPath,
  26916. stroke: _vm.stroke,
  26917. fill: "none",
  26918. "stroke-linecap": _vm.strokeLinecap,
  26919. "stroke-width": _vm.percentage ? _vm.relativeStrokeWidth : 0
  26920. }
  26921. })
  26922. ])
  26923. ]
  26924. ),
  26925. _vm.showText && !_vm.textInside
  26926. ? _c(
  26927. "div",
  26928. {
  26929. staticClass: "el-progress__text",
  26930. style: { fontSize: _vm.progressTextSize + "px" }
  26931. },
  26932. [
  26933. !_vm.status
  26934. ? [_vm._v(_vm._s(_vm.content))]
  26935. : _c("i", { class: _vm.iconClass })
  26936. ],
  26937. 2
  26938. )
  26939. : _vm._e()
  26940. ]
  26941. )
  26942. }
  26943. var progressvue_type_template_id_229ee406_staticRenderFns = []
  26944. progressvue_type_template_id_229ee406_render._withStripped = true
  26945. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=229ee406&
  26946. // 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&
  26947. //
  26948. //
  26949. //
  26950. //
  26951. //
  26952. //
  26953. //
  26954. //
  26955. //
  26956. //
  26957. //
  26958. //
  26959. //
  26960. //
  26961. //
  26962. //
  26963. //
  26964. //
  26965. //
  26966. //
  26967. //
  26968. //
  26969. //
  26970. //
  26971. //
  26972. //
  26973. //
  26974. //
  26975. //
  26976. //
  26977. //
  26978. //
  26979. //
  26980. //
  26981. //
  26982. //
  26983. //
  26984. //
  26985. //
  26986. //
  26987. //
  26988. //
  26989. //
  26990. //
  26991. //
  26992. //
  26993. //
  26994. //
  26995. //
  26996. //
  26997. //
  26998. //
  26999. /* harmony default export */ var progressvue_type_script_lang_js_ = ({
  27000. name: 'ElProgress',
  27001. props: {
  27002. type: {
  27003. type: String,
  27004. default: 'line',
  27005. validator: function validator(val) {
  27006. return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
  27007. }
  27008. },
  27009. percentage: {
  27010. type: Number,
  27011. default: 0,
  27012. required: true,
  27013. validator: function validator(val) {
  27014. return val >= 0 && val <= 100;
  27015. }
  27016. },
  27017. status: {
  27018. type: String,
  27019. validator: function validator(val) {
  27020. return ['success', 'exception', 'warning'].indexOf(val) > -1;
  27021. }
  27022. },
  27023. strokeWidth: {
  27024. type: Number,
  27025. default: 6
  27026. },
  27027. strokeLinecap: {
  27028. type: String,
  27029. default: 'round'
  27030. },
  27031. textInside: {
  27032. type: Boolean,
  27033. default: false
  27034. },
  27035. width: {
  27036. type: Number,
  27037. default: 126
  27038. },
  27039. showText: {
  27040. type: Boolean,
  27041. default: true
  27042. },
  27043. color: {
  27044. type: [String, Array, Function],
  27045. default: ''
  27046. },
  27047. format: Function
  27048. },
  27049. computed: {
  27050. barStyle: function barStyle() {
  27051. var style = {};
  27052. style.width = this.percentage + '%';
  27053. style.backgroundColor = this.getCurrentColor(this.percentage);
  27054. return style;
  27055. },
  27056. relativeStrokeWidth: function relativeStrokeWidth() {
  27057. return (this.strokeWidth / this.width * 100).toFixed(1);
  27058. },
  27059. radius: function radius() {
  27060. if (this.type === 'circle' || this.type === 'dashboard') {
  27061. return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
  27062. } else {
  27063. return 0;
  27064. }
  27065. },
  27066. trackPath: function trackPath() {
  27067. var radius = this.radius;
  27068. var isDashboard = this.type === 'dashboard';
  27069. 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 ';
  27070. },
  27071. perimeter: function perimeter() {
  27072. return 2 * Math.PI * this.radius;
  27073. },
  27074. rate: function rate() {
  27075. return this.type === 'dashboard' ? 0.75 : 1;
  27076. },
  27077. strokeDashoffset: function strokeDashoffset() {
  27078. var offset = -1 * this.perimeter * (1 - this.rate) / 2;
  27079. return offset + 'px';
  27080. },
  27081. trailPathStyle: function trailPathStyle() {
  27082. return {
  27083. strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
  27084. strokeDashoffset: this.strokeDashoffset
  27085. };
  27086. },
  27087. circlePathStyle: function circlePathStyle() {
  27088. return {
  27089. strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
  27090. strokeDashoffset: this.strokeDashoffset,
  27091. transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
  27092. };
  27093. },
  27094. stroke: function stroke() {
  27095. var ret = void 0;
  27096. if (this.color) {
  27097. ret = this.getCurrentColor(this.percentage);
  27098. } else {
  27099. switch (this.status) {
  27100. case 'success':
  27101. ret = '#13ce66';
  27102. break;
  27103. case 'exception':
  27104. ret = '#ff4949';
  27105. break;
  27106. case 'warning':
  27107. ret = '#e6a23c';
  27108. break;
  27109. default:
  27110. ret = '#20a0ff';
  27111. }
  27112. }
  27113. return ret;
  27114. },
  27115. iconClass: function iconClass() {
  27116. if (this.status === 'warning') {
  27117. return 'el-icon-warning';
  27118. }
  27119. if (this.type === 'line') {
  27120. return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
  27121. } else {
  27122. return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
  27123. }
  27124. },
  27125. progressTextSize: function progressTextSize() {
  27126. return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
  27127. },
  27128. content: function content() {
  27129. if (typeof this.format === 'function') {
  27130. return this.format(this.percentage) || '';
  27131. } else {
  27132. return this.percentage + '%';
  27133. }
  27134. }
  27135. },
  27136. methods: {
  27137. getCurrentColor: function getCurrentColor(percentage) {
  27138. if (typeof this.color === 'function') {
  27139. return this.color(percentage);
  27140. } else if (typeof this.color === 'string') {
  27141. return this.color;
  27142. } else {
  27143. return this.getLevelColor(percentage);
  27144. }
  27145. },
  27146. getLevelColor: function getLevelColor(percentage) {
  27147. var colorArray = this.getColorArray().sort(function (a, b) {
  27148. return a.percentage - b.percentage;
  27149. });
  27150. for (var i = 0; i < colorArray.length; i++) {
  27151. if (colorArray[i].percentage > percentage) {
  27152. return colorArray[i].color;
  27153. }
  27154. }
  27155. return colorArray[colorArray.length - 1].color;
  27156. },
  27157. getColorArray: function getColorArray() {
  27158. var color = this.color;
  27159. var span = 100 / color.length;
  27160. return color.map(function (seriesColor, index) {
  27161. if (typeof seriesColor === 'string') {
  27162. return {
  27163. color: seriesColor,
  27164. percentage: (index + 1) * span
  27165. };
  27166. }
  27167. return seriesColor;
  27168. });
  27169. }
  27170. }
  27171. });
  27172. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js&
  27173. /* harmony default export */ var src_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_);
  27174. // CONCATENATED MODULE: ./packages/progress/src/progress.vue
  27175. /* normalize component */
  27176. var progress_component = normalizeComponent(
  27177. src_progressvue_type_script_lang_js_,
  27178. progressvue_type_template_id_229ee406_render,
  27179. progressvue_type_template_id_229ee406_staticRenderFns,
  27180. false,
  27181. null,
  27182. null,
  27183. null
  27184. )
  27185. /* hot reload */
  27186. if (false) { var progress_api; }
  27187. progress_component.options.__file = "packages/progress/src/progress.vue"
  27188. /* harmony default export */ var progress = (progress_component.exports);
  27189. // CONCATENATED MODULE: ./packages/progress/index.js
  27190. /* istanbul ignore next */
  27191. progress.install = function (Vue) {
  27192. Vue.component(progress.name, progress);
  27193. };
  27194. /* harmony default export */ var packages_progress = (progress);
  27195. // 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&
  27196. var spinnervue_type_template_id_697b8538_render = function() {
  27197. var _vm = this
  27198. var _h = _vm.$createElement
  27199. var _c = _vm._self._c || _h
  27200. return _c("span", { staticClass: "el-spinner" }, [
  27201. _c(
  27202. "svg",
  27203. {
  27204. staticClass: "el-spinner-inner",
  27205. style: { width: _vm.radius / 2 + "px", height: _vm.radius / 2 + "px" },
  27206. attrs: { viewBox: "0 0 50 50" }
  27207. },
  27208. [
  27209. _c("circle", {
  27210. staticClass: "path",
  27211. attrs: {
  27212. cx: "25",
  27213. cy: "25",
  27214. r: "20",
  27215. fill: "none",
  27216. stroke: _vm.strokeColor,
  27217. "stroke-width": _vm.strokeWidth
  27218. }
  27219. })
  27220. ]
  27221. )
  27222. ])
  27223. }
  27224. var spinnervue_type_template_id_697b8538_staticRenderFns = []
  27225. spinnervue_type_template_id_697b8538_render._withStripped = true
  27226. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=template&id=697b8538&
  27227. // 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&
  27228. //
  27229. //
  27230. //
  27231. //
  27232. //
  27233. //
  27234. //
  27235. /* harmony default export */ var spinnervue_type_script_lang_js_ = ({
  27236. name: 'ElSpinner',
  27237. props: {
  27238. type: String,
  27239. radius: {
  27240. type: Number,
  27241. default: 100
  27242. },
  27243. strokeWidth: {
  27244. type: Number,
  27245. default: 5
  27246. },
  27247. strokeColor: {
  27248. type: String,
  27249. default: '#efefef'
  27250. }
  27251. }
  27252. });
  27253. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=script&lang=js&
  27254. /* harmony default export */ var src_spinnervue_type_script_lang_js_ = (spinnervue_type_script_lang_js_);
  27255. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue
  27256. /* normalize component */
  27257. var spinner_component = normalizeComponent(
  27258. src_spinnervue_type_script_lang_js_,
  27259. spinnervue_type_template_id_697b8538_render,
  27260. spinnervue_type_template_id_697b8538_staticRenderFns,
  27261. false,
  27262. null,
  27263. null,
  27264. null
  27265. )
  27266. /* hot reload */
  27267. if (false) { var spinner_api; }
  27268. spinner_component.options.__file = "packages/spinner/src/spinner.vue"
  27269. /* harmony default export */ var spinner = (spinner_component.exports);
  27270. // CONCATENATED MODULE: ./packages/spinner/index.js
  27271. /* istanbul ignore next */
  27272. spinner.install = function (Vue) {
  27273. Vue.component(spinner.name, spinner);
  27274. };
  27275. /* harmony default export */ var packages_spinner = (spinner);
  27276. // 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&
  27277. var mainvue_type_template_id_455b9f60_render = function() {
  27278. var _vm = this
  27279. var _h = _vm.$createElement
  27280. var _c = _vm._self._c || _h
  27281. return _c(
  27282. "transition",
  27283. {
  27284. attrs: { name: "el-message-fade" },
  27285. on: { "after-leave": _vm.handleAfterLeave }
  27286. },
  27287. [
  27288. _c(
  27289. "div",
  27290. {
  27291. directives: [
  27292. {
  27293. name: "show",
  27294. rawName: "v-show",
  27295. value: _vm.visible,
  27296. expression: "visible"
  27297. }
  27298. ],
  27299. class: [
  27300. "el-message",
  27301. _vm.type && !_vm.iconClass ? "el-message--" + _vm.type : "",
  27302. _vm.center ? "is-center" : "",
  27303. _vm.showClose ? "is-closable" : "",
  27304. _vm.customClass
  27305. ],
  27306. style: _vm.positionStyle,
  27307. attrs: { role: "alert" },
  27308. on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer }
  27309. },
  27310. [
  27311. _vm.iconClass
  27312. ? _c("i", { class: _vm.iconClass })
  27313. : _c("i", { class: _vm.typeClass }),
  27314. _vm._t("default", [
  27315. !_vm.dangerouslyUseHTMLString
  27316. ? _c("p", { staticClass: "el-message__content" }, [
  27317. _vm._v(_vm._s(_vm.message))
  27318. ])
  27319. : _c("p", {
  27320. staticClass: "el-message__content",
  27321. domProps: { innerHTML: _vm._s(_vm.message) }
  27322. })
  27323. ]),
  27324. _vm.showClose
  27325. ? _c("i", {
  27326. staticClass: "el-message__closeBtn el-icon-close",
  27327. on: { click: _vm.close }
  27328. })
  27329. : _vm._e()
  27330. ],
  27331. 2
  27332. )
  27333. ]
  27334. )
  27335. }
  27336. var mainvue_type_template_id_455b9f60_staticRenderFns = []
  27337. mainvue_type_template_id_455b9f60_render._withStripped = true
  27338. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  27339. // 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&
  27340. //
  27341. //
  27342. //
  27343. //
  27344. //
  27345. //
  27346. //
  27347. //
  27348. //
  27349. //
  27350. //
  27351. //
  27352. //
  27353. //
  27354. //
  27355. //
  27356. //
  27357. //
  27358. //
  27359. //
  27360. //
  27361. //
  27362. //
  27363. //
  27364. //
  27365. //
  27366. var src_mainvue_type_script_lang_js_typeMap = {
  27367. success: 'success',
  27368. info: 'info',
  27369. warning: 'warning',
  27370. error: 'error'
  27371. };
  27372. /* harmony default export */ var message_src_mainvue_type_script_lang_js_ = ({
  27373. data: function data() {
  27374. return {
  27375. visible: false,
  27376. message: '',
  27377. duration: 3000,
  27378. type: 'info',
  27379. iconClass: '',
  27380. customClass: '',
  27381. onClose: null,
  27382. showClose: false,
  27383. closed: false,
  27384. verticalOffset: 20,
  27385. timer: null,
  27386. dangerouslyUseHTMLString: false,
  27387. center: false
  27388. };
  27389. },
  27390. computed: {
  27391. typeClass: function typeClass() {
  27392. return this.type && !this.iconClass ? 'el-message__icon el-icon-' + src_mainvue_type_script_lang_js_typeMap[this.type] : '';
  27393. },
  27394. positionStyle: function positionStyle() {
  27395. return {
  27396. 'top': this.verticalOffset + 'px'
  27397. };
  27398. }
  27399. },
  27400. watch: {
  27401. closed: function closed(newVal) {
  27402. if (newVal) {
  27403. this.visible = false;
  27404. }
  27405. }
  27406. },
  27407. methods: {
  27408. handleAfterLeave: function handleAfterLeave() {
  27409. this.$destroy(true);
  27410. this.$el.parentNode.removeChild(this.$el);
  27411. },
  27412. close: function close() {
  27413. this.closed = true;
  27414. if (typeof this.onClose === 'function') {
  27415. this.onClose(this);
  27416. }
  27417. },
  27418. clearTimer: function clearTimer() {
  27419. clearTimeout(this.timer);
  27420. },
  27421. startTimer: function startTimer() {
  27422. var _this = this;
  27423. if (this.duration > 0) {
  27424. this.timer = setTimeout(function () {
  27425. if (!_this.closed) {
  27426. _this.close();
  27427. }
  27428. }, this.duration);
  27429. }
  27430. },
  27431. keydown: function keydown(e) {
  27432. if (e.keyCode === 27) {
  27433. // esc关闭消息
  27434. if (!this.closed) {
  27435. this.close();
  27436. }
  27437. }
  27438. }
  27439. },
  27440. mounted: function mounted() {
  27441. this.startTimer();
  27442. document.addEventListener('keydown', this.keydown);
  27443. },
  27444. beforeDestroy: function beforeDestroy() {
  27445. document.removeEventListener('keydown', this.keydown);
  27446. }
  27447. });
  27448. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
  27449. /* harmony default export */ var packages_message_src_mainvue_type_script_lang_js_ = (message_src_mainvue_type_script_lang_js_);
  27450. // CONCATENATED MODULE: ./packages/message/src/main.vue
  27451. /* normalize component */
  27452. var message_src_main_component = normalizeComponent(
  27453. packages_message_src_mainvue_type_script_lang_js_,
  27454. mainvue_type_template_id_455b9f60_render,
  27455. mainvue_type_template_id_455b9f60_staticRenderFns,
  27456. false,
  27457. null,
  27458. null,
  27459. null
  27460. )
  27461. /* hot reload */
  27462. if (false) { var message_src_main_api; }
  27463. message_src_main_component.options.__file = "packages/message/src/main.vue"
  27464. /* harmony default export */ var message_src_main = (message_src_main_component.exports);
  27465. // EXTERNAL MODULE: external "element-ui/lib/utils/types"
  27466. var types_ = __webpack_require__(15);
  27467. // CONCATENATED MODULE: ./packages/message/src/main.js
  27468. 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; };
  27469. var MessageConstructor = external_vue_default.a.extend(message_src_main);
  27470. var message_src_main_instance = void 0;
  27471. var main_instances = [];
  27472. var main_seed = 1;
  27473. var main_Message = function Message(options) {
  27474. if (external_vue_default.a.prototype.$isServer) return;
  27475. options = options || {};
  27476. if (typeof options === 'string') {
  27477. options = {
  27478. message: options
  27479. };
  27480. }
  27481. var userOnClose = options.onClose;
  27482. var id = 'message_' + main_seed++;
  27483. options.onClose = function () {
  27484. Message.close(id, userOnClose);
  27485. };
  27486. message_src_main_instance = new MessageConstructor({
  27487. data: options
  27488. });
  27489. message_src_main_instance.id = id;
  27490. if (Object(vdom_["isVNode"])(message_src_main_instance.message)) {
  27491. message_src_main_instance.$slots.default = [message_src_main_instance.message];
  27492. message_src_main_instance.message = null;
  27493. }
  27494. message_src_main_instance.$mount();
  27495. document.body.appendChild(message_src_main_instance.$el);
  27496. var verticalOffset = options.offset || 20;
  27497. main_instances.forEach(function (item) {
  27498. verticalOffset += item.$el.offsetHeight + 16;
  27499. });
  27500. message_src_main_instance.verticalOffset = verticalOffset;
  27501. message_src_main_instance.visible = true;
  27502. message_src_main_instance.$el.style.zIndex = popup_["PopupManager"].nextZIndex();
  27503. main_instances.push(message_src_main_instance);
  27504. return message_src_main_instance;
  27505. };
  27506. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  27507. main_Message[type] = function (options) {
  27508. if (Object(types_["isObject"])(options) && !Object(vdom_["isVNode"])(options)) {
  27509. return main_Message(main_extends({}, options, {
  27510. type: type
  27511. }));
  27512. }
  27513. return main_Message({
  27514. type: type,
  27515. message: options
  27516. });
  27517. };
  27518. });
  27519. main_Message.close = function (id, userOnClose) {
  27520. var len = main_instances.length;
  27521. var index = -1;
  27522. var removedHeight = void 0;
  27523. for (var i = 0; i < len; i++) {
  27524. if (id === main_instances[i].id) {
  27525. removedHeight = main_instances[i].$el.offsetHeight;
  27526. index = i;
  27527. if (typeof userOnClose === 'function') {
  27528. userOnClose(main_instances[i]);
  27529. }
  27530. main_instances.splice(i, 1);
  27531. break;
  27532. }
  27533. }
  27534. if (len <= 1 || index === -1 || index > main_instances.length - 1) return;
  27535. for (var _i = index; _i < len - 1; _i++) {
  27536. var dom = main_instances[_i].$el;
  27537. dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
  27538. }
  27539. };
  27540. main_Message.closeAll = function () {
  27541. for (var i = main_instances.length - 1; i >= 0; i--) {
  27542. main_instances[i].close();
  27543. }
  27544. };
  27545. /* harmony default export */ var packages_message_src_main = (main_Message);
  27546. // CONCATENATED MODULE: ./packages/message/index.js
  27547. /* harmony default export */ var packages_message = (packages_message_src_main);
  27548. // 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&
  27549. var mainvue_type_template_id_7ccb6598_render = function() {
  27550. var _vm = this
  27551. var _h = _vm.$createElement
  27552. var _c = _vm._self._c || _h
  27553. return _c(
  27554. "div",
  27555. { staticClass: "el-badge" },
  27556. [
  27557. _vm._t("default"),
  27558. _c("transition", { attrs: { name: "el-zoom-in-center" } }, [
  27559. _c("sup", {
  27560. directives: [
  27561. {
  27562. name: "show",
  27563. rawName: "v-show",
  27564. value:
  27565. !_vm.hidden && (_vm.content || _vm.content === 0 || _vm.isDot),
  27566. expression: "!hidden && (content || content === 0 || isDot)"
  27567. }
  27568. ],
  27569. staticClass: "el-badge__content",
  27570. class: [
  27571. _vm.type ? "el-badge__content--" + _vm.type : null,
  27572. {
  27573. "is-fixed": _vm.$slots.default,
  27574. "is-dot": _vm.isDot
  27575. }
  27576. ],
  27577. domProps: { textContent: _vm._s(_vm.content) }
  27578. })
  27579. ])
  27580. ],
  27581. 2
  27582. )
  27583. }
  27584. var mainvue_type_template_id_7ccb6598_staticRenderFns = []
  27585. mainvue_type_template_id_7ccb6598_render._withStripped = true
  27586. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=template&id=7ccb6598&
  27587. // 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&
  27588. //
  27589. //
  27590. //
  27591. //
  27592. //
  27593. //
  27594. //
  27595. //
  27596. //
  27597. //
  27598. //
  27599. //
  27600. //
  27601. //
  27602. //
  27603. //
  27604. //
  27605. //
  27606. //
  27607. //
  27608. /* harmony default export */ var badge_src_mainvue_type_script_lang_js_ = ({
  27609. name: 'ElBadge',
  27610. props: {
  27611. value: [String, Number],
  27612. max: Number,
  27613. isDot: Boolean,
  27614. hidden: Boolean,
  27615. type: {
  27616. type: String,
  27617. validator: function validator(val) {
  27618. return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
  27619. }
  27620. }
  27621. },
  27622. computed: {
  27623. content: function content() {
  27624. if (this.isDot) return;
  27625. var value = this.value;
  27626. var max = this.max;
  27627. if (typeof value === 'number' && typeof max === 'number') {
  27628. return max < value ? max + '+' : value;
  27629. }
  27630. return value;
  27631. }
  27632. }
  27633. });
  27634. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=script&lang=js&
  27635. /* harmony default export */ var packages_badge_src_mainvue_type_script_lang_js_ = (badge_src_mainvue_type_script_lang_js_);
  27636. // CONCATENATED MODULE: ./packages/badge/src/main.vue
  27637. /* normalize component */
  27638. var badge_src_main_component = normalizeComponent(
  27639. packages_badge_src_mainvue_type_script_lang_js_,
  27640. mainvue_type_template_id_7ccb6598_render,
  27641. mainvue_type_template_id_7ccb6598_staticRenderFns,
  27642. false,
  27643. null,
  27644. null,
  27645. null
  27646. )
  27647. /* hot reload */
  27648. if (false) { var badge_src_main_api; }
  27649. badge_src_main_component.options.__file = "packages/badge/src/main.vue"
  27650. /* harmony default export */ var badge_src_main = (badge_src_main_component.exports);
  27651. // CONCATENATED MODULE: ./packages/badge/index.js
  27652. /* istanbul ignore next */
  27653. badge_src_main.install = function (Vue) {
  27654. Vue.component(badge_src_main.name, badge_src_main);
  27655. };
  27656. /* harmony default export */ var badge = (badge_src_main);
  27657. // 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&
  27658. var mainvue_type_template_id_59a4a40f_render = function() {
  27659. var _vm = this
  27660. var _h = _vm.$createElement
  27661. var _c = _vm._self._c || _h
  27662. return _c(
  27663. "div",
  27664. {
  27665. staticClass: "el-card",
  27666. class: _vm.shadow ? "is-" + _vm.shadow + "-shadow" : "is-always-shadow"
  27667. },
  27668. [
  27669. _vm.$slots.header || _vm.header
  27670. ? _c(
  27671. "div",
  27672. { staticClass: "el-card__header" },
  27673. [_vm._t("header", [_vm._v(_vm._s(_vm.header))])],
  27674. 2
  27675. )
  27676. : _vm._e(),
  27677. _c(
  27678. "div",
  27679. { staticClass: "el-card__body", style: _vm.bodyStyle },
  27680. [_vm._t("default")],
  27681. 2
  27682. )
  27683. ]
  27684. )
  27685. }
  27686. var mainvue_type_template_id_59a4a40f_staticRenderFns = []
  27687. mainvue_type_template_id_59a4a40f_render._withStripped = true
  27688. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=template&id=59a4a40f&
  27689. // 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&
  27690. //
  27691. //
  27692. //
  27693. //
  27694. //
  27695. //
  27696. //
  27697. //
  27698. //
  27699. //
  27700. //
  27701. /* harmony default export */ var card_src_mainvue_type_script_lang_js_ = ({
  27702. name: 'ElCard',
  27703. props: {
  27704. header: {},
  27705. bodyStyle: {},
  27706. shadow: {
  27707. type: String
  27708. }
  27709. }
  27710. });
  27711. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=script&lang=js&
  27712. /* harmony default export */ var packages_card_src_mainvue_type_script_lang_js_ = (card_src_mainvue_type_script_lang_js_);
  27713. // CONCATENATED MODULE: ./packages/card/src/main.vue
  27714. /* normalize component */
  27715. var card_src_main_component = normalizeComponent(
  27716. packages_card_src_mainvue_type_script_lang_js_,
  27717. mainvue_type_template_id_59a4a40f_render,
  27718. mainvue_type_template_id_59a4a40f_staticRenderFns,
  27719. false,
  27720. null,
  27721. null,
  27722. null
  27723. )
  27724. /* hot reload */
  27725. if (false) { var card_src_main_api; }
  27726. card_src_main_component.options.__file = "packages/card/src/main.vue"
  27727. /* harmony default export */ var card_src_main = (card_src_main_component.exports);
  27728. // CONCATENATED MODULE: ./packages/card/index.js
  27729. /* istanbul ignore next */
  27730. card_src_main.install = function (Vue) {
  27731. Vue.component(card_src_main.name, card_src_main);
  27732. };
  27733. /* harmony default export */ var card = (card_src_main);
  27734. // 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&
  27735. var mainvue_type_template_id_ada57782_render = function() {
  27736. var _vm = this
  27737. var _h = _vm.$createElement
  27738. var _c = _vm._self._c || _h
  27739. return _c(
  27740. "div",
  27741. {
  27742. staticClass: "el-rate",
  27743. attrs: {
  27744. role: "slider",
  27745. "aria-valuenow": _vm.currentValue,
  27746. "aria-valuetext": _vm.text,
  27747. "aria-valuemin": "0",
  27748. "aria-valuemax": _vm.max,
  27749. tabindex: "0"
  27750. },
  27751. on: { keydown: _vm.handleKey }
  27752. },
  27753. [
  27754. _vm._l(_vm.max, function(item, key) {
  27755. return _c(
  27756. "span",
  27757. {
  27758. key: key,
  27759. staticClass: "el-rate__item",
  27760. style: { cursor: _vm.rateDisabled ? "auto" : "pointer" },
  27761. on: {
  27762. mousemove: function($event) {
  27763. _vm.setCurrentValue(item, $event)
  27764. },
  27765. mouseleave: _vm.resetCurrentValue,
  27766. click: function($event) {
  27767. _vm.selectValue(item)
  27768. }
  27769. }
  27770. },
  27771. [
  27772. _c(
  27773. "i",
  27774. {
  27775. staticClass: "el-rate__icon",
  27776. class: [
  27777. _vm.classes[item - 1],
  27778. { hover: _vm.hoverIndex === item }
  27779. ],
  27780. style: _vm.getIconStyle(item)
  27781. },
  27782. [
  27783. _vm.showDecimalIcon(item)
  27784. ? _c("i", {
  27785. staticClass: "el-rate__decimal",
  27786. class: _vm.decimalIconClass,
  27787. style: _vm.decimalStyle
  27788. })
  27789. : _vm._e()
  27790. ]
  27791. )
  27792. ]
  27793. )
  27794. }),
  27795. _vm.showText || _vm.showScore
  27796. ? _c(
  27797. "span",
  27798. { staticClass: "el-rate__text", style: { color: _vm.textColor } },
  27799. [_vm._v(_vm._s(_vm.text))]
  27800. )
  27801. : _vm._e()
  27802. ],
  27803. 2
  27804. )
  27805. }
  27806. var mainvue_type_template_id_ada57782_staticRenderFns = []
  27807. mainvue_type_template_id_ada57782_render._withStripped = true
  27808. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=template&id=ada57782&
  27809. // 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&
  27810. //
  27811. //
  27812. //
  27813. //
  27814. //
  27815. //
  27816. //
  27817. //
  27818. //
  27819. //
  27820. //
  27821. //
  27822. //
  27823. //
  27824. //
  27825. //
  27826. //
  27827. //
  27828. //
  27829. //
  27830. //
  27831. //
  27832. //
  27833. //
  27834. //
  27835. //
  27836. //
  27837. //
  27838. //
  27839. //
  27840. //
  27841. //
  27842. //
  27843. //
  27844. /* harmony default export */ var rate_src_mainvue_type_script_lang_js_ = ({
  27845. name: 'ElRate',
  27846. mixins: [migrating_default.a],
  27847. inject: {
  27848. elForm: {
  27849. default: ''
  27850. }
  27851. },
  27852. data: function data() {
  27853. return {
  27854. pointerAtLeftHalf: true,
  27855. currentValue: this.value,
  27856. hoverIndex: -1
  27857. };
  27858. },
  27859. props: {
  27860. value: {
  27861. type: Number,
  27862. default: 0
  27863. },
  27864. lowThreshold: {
  27865. type: Number,
  27866. default: 2
  27867. },
  27868. highThreshold: {
  27869. type: Number,
  27870. default: 4
  27871. },
  27872. max: {
  27873. type: Number,
  27874. default: 5
  27875. },
  27876. colors: {
  27877. type: [Array, Object],
  27878. default: function _default() {
  27879. return ['#F7BA2A', '#F7BA2A', '#F7BA2A'];
  27880. }
  27881. },
  27882. voidColor: {
  27883. type: String,
  27884. default: '#C6D1DE'
  27885. },
  27886. disabledVoidColor: {
  27887. type: String,
  27888. default: '#EFF2F7'
  27889. },
  27890. iconClasses: {
  27891. type: [Array, Object],
  27892. default: function _default() {
  27893. return ['el-icon-star-on', 'el-icon-star-on', 'el-icon-star-on'];
  27894. }
  27895. },
  27896. voidIconClass: {
  27897. type: String,
  27898. default: 'el-icon-star-off'
  27899. },
  27900. disabledVoidIconClass: {
  27901. type: String,
  27902. default: 'el-icon-star-on'
  27903. },
  27904. disabled: {
  27905. type: Boolean,
  27906. default: false
  27907. },
  27908. allowHalf: {
  27909. type: Boolean,
  27910. default: false
  27911. },
  27912. showText: {
  27913. type: Boolean,
  27914. default: false
  27915. },
  27916. showScore: {
  27917. type: Boolean,
  27918. default: false
  27919. },
  27920. textColor: {
  27921. type: String,
  27922. default: '#1f2d3d'
  27923. },
  27924. texts: {
  27925. type: Array,
  27926. default: function _default() {
  27927. return ['极差', '失望', '一般', '满意', '惊喜'];
  27928. }
  27929. },
  27930. scoreTemplate: {
  27931. type: String,
  27932. default: '{value}'
  27933. }
  27934. },
  27935. computed: {
  27936. text: function text() {
  27937. var result = '';
  27938. if (this.showScore) {
  27939. result = this.scoreTemplate.replace(/\{\s*value\s*\}/, this.rateDisabled ? this.value : this.currentValue);
  27940. } else if (this.showText) {
  27941. result = this.texts[Math.ceil(this.currentValue) - 1];
  27942. }
  27943. return result;
  27944. },
  27945. decimalStyle: function decimalStyle() {
  27946. var width = '';
  27947. if (this.rateDisabled) {
  27948. width = this.valueDecimal + '%';
  27949. } else if (this.allowHalf) {
  27950. width = '50%';
  27951. }
  27952. return {
  27953. color: this.activeColor,
  27954. width: width
  27955. };
  27956. },
  27957. valueDecimal: function valueDecimal() {
  27958. return this.value * 100 - Math.floor(this.value) * 100;
  27959. },
  27960. classMap: function classMap() {
  27961. var _ref;
  27962. 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;
  27963. },
  27964. decimalIconClass: function decimalIconClass() {
  27965. return this.getValueFromMap(this.value, this.classMap);
  27966. },
  27967. voidClass: function voidClass() {
  27968. return this.rateDisabled ? this.disabledVoidIconClass : this.voidIconClass;
  27969. },
  27970. activeClass: function activeClass() {
  27971. return this.getValueFromMap(this.currentValue, this.classMap);
  27972. },
  27973. colorMap: function colorMap() {
  27974. var _ref2;
  27975. 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;
  27976. },
  27977. activeColor: function activeColor() {
  27978. return this.getValueFromMap(this.currentValue, this.colorMap);
  27979. },
  27980. classes: function classes() {
  27981. var result = [];
  27982. var i = 0;
  27983. var threshold = this.currentValue;
  27984. if (this.allowHalf && this.currentValue !== Math.floor(this.currentValue)) {
  27985. threshold--;
  27986. }
  27987. for (; i < threshold; i++) {
  27988. result.push(this.activeClass);
  27989. }
  27990. for (; i < this.max; i++) {
  27991. result.push(this.voidClass);
  27992. }
  27993. return result;
  27994. },
  27995. rateDisabled: function rateDisabled() {
  27996. return this.disabled || (this.elForm || {}).disabled;
  27997. }
  27998. },
  27999. watch: {
  28000. value: function value(val) {
  28001. this.currentValue = val;
  28002. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28003. }
  28004. },
  28005. methods: {
  28006. getMigratingConfig: function getMigratingConfig() {
  28007. return {
  28008. props: {
  28009. 'text-template': 'text-template is renamed to score-template.'
  28010. }
  28011. };
  28012. },
  28013. getValueFromMap: function getValueFromMap(value, map) {
  28014. var matchedKeys = Object.keys(map).filter(function (key) {
  28015. var val = map[key];
  28016. var excluded = Object(types_["isObject"])(val) ? val.excluded : false;
  28017. return excluded ? value < key : value <= key;
  28018. }).sort(function (a, b) {
  28019. return a - b;
  28020. });
  28021. var matchedValue = map[matchedKeys[0]];
  28022. return Object(types_["isObject"])(matchedValue) ? matchedValue.value : matchedValue || '';
  28023. },
  28024. showDecimalIcon: function showDecimalIcon(item) {
  28025. var showWhenDisabled = this.rateDisabled && this.valueDecimal > 0 && item - 1 < this.value && item > this.value;
  28026. /* istanbul ignore next */
  28027. var showWhenAllowHalf = this.allowHalf && this.pointerAtLeftHalf && item - 0.5 <= this.currentValue && item > this.currentValue;
  28028. return showWhenDisabled || showWhenAllowHalf;
  28029. },
  28030. getIconStyle: function getIconStyle(item) {
  28031. var voidColor = this.rateDisabled ? this.disabledVoidColor : this.voidColor;
  28032. return {
  28033. color: item <= this.currentValue ? this.activeColor : voidColor
  28034. };
  28035. },
  28036. selectValue: function selectValue(value) {
  28037. if (this.rateDisabled) {
  28038. return;
  28039. }
  28040. if (this.allowHalf && this.pointerAtLeftHalf) {
  28041. this.$emit('input', this.currentValue);
  28042. this.$emit('change', this.currentValue);
  28043. } else {
  28044. this.$emit('input', value);
  28045. this.$emit('change', value);
  28046. }
  28047. },
  28048. handleKey: function handleKey(e) {
  28049. if (this.rateDisabled) {
  28050. return;
  28051. }
  28052. var currentValue = this.currentValue;
  28053. var keyCode = e.keyCode;
  28054. if (keyCode === 38 || keyCode === 39) {
  28055. // left / down
  28056. if (this.allowHalf) {
  28057. currentValue += 0.5;
  28058. } else {
  28059. currentValue += 1;
  28060. }
  28061. e.stopPropagation();
  28062. e.preventDefault();
  28063. } else if (keyCode === 37 || keyCode === 40) {
  28064. if (this.allowHalf) {
  28065. currentValue -= 0.5;
  28066. } else {
  28067. currentValue -= 1;
  28068. }
  28069. e.stopPropagation();
  28070. e.preventDefault();
  28071. }
  28072. currentValue = currentValue < 0 ? 0 : currentValue;
  28073. currentValue = currentValue > this.max ? this.max : currentValue;
  28074. this.$emit('input', currentValue);
  28075. this.$emit('change', currentValue);
  28076. },
  28077. setCurrentValue: function setCurrentValue(value, event) {
  28078. if (this.rateDisabled) {
  28079. return;
  28080. }
  28081. /* istanbul ignore if */
  28082. if (this.allowHalf) {
  28083. var target = event.target;
  28084. if (Object(dom_["hasClass"])(target, 'el-rate__item')) {
  28085. target = target.querySelector('.el-rate__icon');
  28086. }
  28087. if (Object(dom_["hasClass"])(target, 'el-rate__decimal')) {
  28088. target = target.parentNode;
  28089. }
  28090. this.pointerAtLeftHalf = event.offsetX * 2 <= target.clientWidth;
  28091. this.currentValue = this.pointerAtLeftHalf ? value - 0.5 : value;
  28092. } else {
  28093. this.currentValue = value;
  28094. }
  28095. this.hoverIndex = value;
  28096. },
  28097. resetCurrentValue: function resetCurrentValue() {
  28098. if (this.rateDisabled) {
  28099. return;
  28100. }
  28101. if (this.allowHalf) {
  28102. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28103. }
  28104. this.currentValue = this.value;
  28105. this.hoverIndex = -1;
  28106. }
  28107. },
  28108. created: function created() {
  28109. if (!this.value) {
  28110. this.$emit('input', 0);
  28111. }
  28112. }
  28113. });
  28114. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=script&lang=js&
  28115. /* harmony default export */ var packages_rate_src_mainvue_type_script_lang_js_ = (rate_src_mainvue_type_script_lang_js_);
  28116. // CONCATENATED MODULE: ./packages/rate/src/main.vue
  28117. /* normalize component */
  28118. var rate_src_main_component = normalizeComponent(
  28119. packages_rate_src_mainvue_type_script_lang_js_,
  28120. mainvue_type_template_id_ada57782_render,
  28121. mainvue_type_template_id_ada57782_staticRenderFns,
  28122. false,
  28123. null,
  28124. null,
  28125. null
  28126. )
  28127. /* hot reload */
  28128. if (false) { var rate_src_main_api; }
  28129. rate_src_main_component.options.__file = "packages/rate/src/main.vue"
  28130. /* harmony default export */ var rate_src_main = (rate_src_main_component.exports);
  28131. // CONCATENATED MODULE: ./packages/rate/index.js
  28132. /* istanbul ignore next */
  28133. rate_src_main.install = function (Vue) {
  28134. Vue.component(rate_src_main.name, rate_src_main);
  28135. };
  28136. /* harmony default export */ var rate = (rate_src_main);
  28137. // 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&
  28138. var stepsvue_type_template_id_3c6b6dc0_render = function() {
  28139. var _vm = this
  28140. var _h = _vm.$createElement
  28141. var _c = _vm._self._c || _h
  28142. return _c(
  28143. "div",
  28144. {
  28145. staticClass: "el-steps",
  28146. class: [
  28147. !_vm.simple && "el-steps--" + _vm.direction,
  28148. _vm.simple && "el-steps--simple"
  28149. ]
  28150. },
  28151. [_vm._t("default")],
  28152. 2
  28153. )
  28154. }
  28155. var stepsvue_type_template_id_3c6b6dc0_staticRenderFns = []
  28156. stepsvue_type_template_id_3c6b6dc0_render._withStripped = true
  28157. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=template&id=3c6b6dc0&
  28158. // 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&
  28159. //
  28160. //
  28161. //
  28162. //
  28163. //
  28164. //
  28165. //
  28166. //
  28167. //
  28168. //
  28169. //
  28170. /* harmony default export */ var stepsvue_type_script_lang_js_ = ({
  28171. name: 'ElSteps',
  28172. mixins: [migrating_default.a],
  28173. props: {
  28174. space: [Number, String],
  28175. active: Number,
  28176. direction: {
  28177. type: String,
  28178. default: 'horizontal'
  28179. },
  28180. alignCenter: Boolean,
  28181. simple: Boolean,
  28182. finishStatus: {
  28183. type: String,
  28184. default: 'finish'
  28185. },
  28186. processStatus: {
  28187. type: String,
  28188. default: 'process'
  28189. }
  28190. },
  28191. data: function data() {
  28192. return {
  28193. steps: [],
  28194. stepOffset: 0
  28195. };
  28196. },
  28197. methods: {
  28198. getMigratingConfig: function getMigratingConfig() {
  28199. return {
  28200. props: {
  28201. 'center': 'center is removed.'
  28202. }
  28203. };
  28204. }
  28205. },
  28206. watch: {
  28207. active: function active(newVal, oldVal) {
  28208. this.$emit('change', newVal, oldVal);
  28209. },
  28210. steps: function steps(_steps) {
  28211. _steps.forEach(function (child, index) {
  28212. child.index = index;
  28213. });
  28214. }
  28215. }
  28216. });
  28217. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=script&lang=js&
  28218. /* harmony default export */ var src_stepsvue_type_script_lang_js_ = (stepsvue_type_script_lang_js_);
  28219. // CONCATENATED MODULE: ./packages/steps/src/steps.vue
  28220. /* normalize component */
  28221. var steps_component = normalizeComponent(
  28222. src_stepsvue_type_script_lang_js_,
  28223. stepsvue_type_template_id_3c6b6dc0_render,
  28224. stepsvue_type_template_id_3c6b6dc0_staticRenderFns,
  28225. false,
  28226. null,
  28227. null,
  28228. null
  28229. )
  28230. /* hot reload */
  28231. if (false) { var steps_api; }
  28232. steps_component.options.__file = "packages/steps/src/steps.vue"
  28233. /* harmony default export */ var steps = (steps_component.exports);
  28234. // CONCATENATED MODULE: ./packages/steps/index.js
  28235. /* istanbul ignore next */
  28236. steps.install = function (Vue) {
  28237. Vue.component(steps.name, steps);
  28238. };
  28239. /* harmony default export */ var packages_steps = (steps);
  28240. // 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&
  28241. var stepvue_type_template_id_f414a87a_render = function() {
  28242. var _vm = this
  28243. var _h = _vm.$createElement
  28244. var _c = _vm._self._c || _h
  28245. return _c(
  28246. "div",
  28247. {
  28248. staticClass: "el-step",
  28249. class: [
  28250. !_vm.isSimple && "is-" + _vm.$parent.direction,
  28251. _vm.isSimple && "is-simple",
  28252. _vm.isLast && !_vm.space && !_vm.isCenter && "is-flex",
  28253. _vm.isCenter && !_vm.isVertical && !_vm.isSimple && "is-center"
  28254. ],
  28255. style: _vm.style
  28256. },
  28257. [
  28258. _c(
  28259. "div",
  28260. { staticClass: "el-step__head", class: "is-" + _vm.currentStatus },
  28261. [
  28262. _c(
  28263. "div",
  28264. {
  28265. staticClass: "el-step__line",
  28266. style: _vm.isLast
  28267. ? ""
  28268. : { marginRight: _vm.$parent.stepOffset + "px" }
  28269. },
  28270. [
  28271. _c("i", {
  28272. staticClass: "el-step__line-inner",
  28273. style: _vm.lineStyle
  28274. })
  28275. ]
  28276. ),
  28277. _c(
  28278. "div",
  28279. {
  28280. staticClass: "el-step__icon",
  28281. class: "is-" + (_vm.icon ? "icon" : "text")
  28282. },
  28283. [
  28284. _vm.currentStatus !== "success" && _vm.currentStatus !== "error"
  28285. ? _vm._t("icon", [
  28286. _vm.icon
  28287. ? _c("i", {
  28288. staticClass: "el-step__icon-inner",
  28289. class: [_vm.icon]
  28290. })
  28291. : _vm._e(),
  28292. !_vm.icon && !_vm.isSimple
  28293. ? _c("div", { staticClass: "el-step__icon-inner" }, [
  28294. _vm._v(_vm._s(_vm.index + 1))
  28295. ])
  28296. : _vm._e()
  28297. ])
  28298. : _c("i", {
  28299. staticClass: "el-step__icon-inner is-status",
  28300. class: [
  28301. "el-icon-" +
  28302. (_vm.currentStatus === "success" ? "check" : "close")
  28303. ]
  28304. })
  28305. ],
  28306. 2
  28307. )
  28308. ]
  28309. ),
  28310. _c("div", { staticClass: "el-step__main" }, [
  28311. _c(
  28312. "div",
  28313. {
  28314. ref: "title",
  28315. staticClass: "el-step__title",
  28316. class: ["is-" + _vm.currentStatus]
  28317. },
  28318. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  28319. 2
  28320. ),
  28321. _vm.isSimple
  28322. ? _c("div", { staticClass: "el-step__arrow" })
  28323. : _c(
  28324. "div",
  28325. {
  28326. staticClass: "el-step__description",
  28327. class: ["is-" + _vm.currentStatus]
  28328. },
  28329. [_vm._t("description", [_vm._v(_vm._s(_vm.description))])],
  28330. 2
  28331. )
  28332. ])
  28333. ]
  28334. )
  28335. }
  28336. var stepvue_type_template_id_f414a87a_staticRenderFns = []
  28337. stepvue_type_template_id_f414a87a_render._withStripped = true
  28338. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=template&id=f414a87a&
  28339. // 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&
  28340. //
  28341. //
  28342. //
  28343. //
  28344. //
  28345. //
  28346. //
  28347. //
  28348. //
  28349. //
  28350. //
  28351. //
  28352. //
  28353. //
  28354. //
  28355. //
  28356. //
  28357. //
  28358. //
  28359. //
  28360. //
  28361. //
  28362. //
  28363. //
  28364. //
  28365. //
  28366. //
  28367. //
  28368. //
  28369. //
  28370. //
  28371. //
  28372. //
  28373. //
  28374. //
  28375. //
  28376. //
  28377. //
  28378. //
  28379. //
  28380. //
  28381. //
  28382. //
  28383. //
  28384. //
  28385. //
  28386. //
  28387. //
  28388. //
  28389. //
  28390. //
  28391. //
  28392. //
  28393. //
  28394. //
  28395. /* harmony default export */ var stepvue_type_script_lang_js_ = ({
  28396. name: 'ElStep',
  28397. props: {
  28398. title: String,
  28399. icon: String,
  28400. description: String,
  28401. status: String
  28402. },
  28403. data: function data() {
  28404. return {
  28405. index: -1,
  28406. lineStyle: {},
  28407. internalStatus: ''
  28408. };
  28409. },
  28410. beforeCreate: function beforeCreate() {
  28411. this.$parent.steps.push(this);
  28412. },
  28413. beforeDestroy: function beforeDestroy() {
  28414. var steps = this.$parent.steps;
  28415. var index = steps.indexOf(this);
  28416. if (index >= 0) {
  28417. steps.splice(index, 1);
  28418. }
  28419. },
  28420. computed: {
  28421. currentStatus: function currentStatus() {
  28422. return this.status || this.internalStatus;
  28423. },
  28424. prevStatus: function prevStatus() {
  28425. var prevStep = this.$parent.steps[this.index - 1];
  28426. return prevStep ? prevStep.currentStatus : 'wait';
  28427. },
  28428. isCenter: function isCenter() {
  28429. return this.$parent.alignCenter;
  28430. },
  28431. isVertical: function isVertical() {
  28432. return this.$parent.direction === 'vertical';
  28433. },
  28434. isSimple: function isSimple() {
  28435. return this.$parent.simple;
  28436. },
  28437. isLast: function isLast() {
  28438. var parent = this.$parent;
  28439. return parent.steps[parent.steps.length - 1] === this;
  28440. },
  28441. stepsCount: function stepsCount() {
  28442. return this.$parent.steps.length;
  28443. },
  28444. space: function space() {
  28445. var isSimple = this.isSimple,
  28446. space = this.$parent.space;
  28447. return isSimple ? '' : space;
  28448. },
  28449. style: function style() {
  28450. var style = {};
  28451. var parent = this.$parent;
  28452. var len = parent.steps.length;
  28453. var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
  28454. style.flexBasis = space;
  28455. if (this.isVertical) return style;
  28456. if (this.isLast) {
  28457. style.maxWidth = 100 / this.stepsCount + '%';
  28458. } else {
  28459. style.marginRight = -this.$parent.stepOffset + 'px';
  28460. }
  28461. return style;
  28462. }
  28463. },
  28464. methods: {
  28465. updateStatus: function updateStatus(val) {
  28466. var prevChild = this.$parent.$children[this.index - 1];
  28467. if (val > this.index) {
  28468. this.internalStatus = this.$parent.finishStatus;
  28469. } else if (val === this.index && this.prevStatus !== 'error') {
  28470. this.internalStatus = this.$parent.processStatus;
  28471. } else {
  28472. this.internalStatus = 'wait';
  28473. }
  28474. if (prevChild) prevChild.calcProgress(this.internalStatus);
  28475. },
  28476. calcProgress: function calcProgress(status) {
  28477. var step = 100;
  28478. var style = {};
  28479. style.transitionDelay = 150 * this.index + 'ms';
  28480. if (status === this.$parent.processStatus) {
  28481. step = this.currentStatus !== 'error' ? 0 : 0;
  28482. } else if (status === 'wait') {
  28483. step = 0;
  28484. style.transitionDelay = -150 * this.index + 'ms';
  28485. }
  28486. style.borderWidth = step && !this.isSimple ? '1px' : 0;
  28487. this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
  28488. this.lineStyle = style;
  28489. }
  28490. },
  28491. mounted: function mounted() {
  28492. var _this = this;
  28493. var unwatch = this.$watch('index', function (val) {
  28494. _this.$watch('$parent.active', _this.updateStatus, { immediate: true });
  28495. _this.$watch('$parent.processStatus', function () {
  28496. var activeIndex = _this.$parent.active;
  28497. _this.updateStatus(activeIndex);
  28498. }, { immediate: true });
  28499. unwatch();
  28500. });
  28501. }
  28502. });
  28503. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=script&lang=js&
  28504. /* harmony default export */ var src_stepvue_type_script_lang_js_ = (stepvue_type_script_lang_js_);
  28505. // CONCATENATED MODULE: ./packages/steps/src/step.vue
  28506. /* normalize component */
  28507. var step_component = normalizeComponent(
  28508. src_stepvue_type_script_lang_js_,
  28509. stepvue_type_template_id_f414a87a_render,
  28510. stepvue_type_template_id_f414a87a_staticRenderFns,
  28511. false,
  28512. null,
  28513. null,
  28514. null
  28515. )
  28516. /* hot reload */
  28517. if (false) { var step_api; }
  28518. step_component.options.__file = "packages/steps/src/step.vue"
  28519. /* harmony default export */ var step = (step_component.exports);
  28520. // CONCATENATED MODULE: ./packages/step/index.js
  28521. /* istanbul ignore next */
  28522. step.install = function (Vue) {
  28523. Vue.component(step.name, step);
  28524. };
  28525. /* harmony default export */ var packages_step = (step);
  28526. // 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&
  28527. var mainvue_type_template_id_5d5d1482_render = function() {
  28528. var _vm = this
  28529. var _h = _vm.$createElement
  28530. var _c = _vm._self._c || _h
  28531. return _c(
  28532. "div",
  28533. {
  28534. class: _vm.carouselClasses,
  28535. on: {
  28536. mouseenter: function($event) {
  28537. $event.stopPropagation()
  28538. return _vm.handleMouseEnter($event)
  28539. },
  28540. mouseleave: function($event) {
  28541. $event.stopPropagation()
  28542. return _vm.handleMouseLeave($event)
  28543. }
  28544. }
  28545. },
  28546. [
  28547. _c(
  28548. "div",
  28549. {
  28550. staticClass: "el-carousel__container",
  28551. style: { height: _vm.height }
  28552. },
  28553. [
  28554. _vm.arrowDisplay
  28555. ? _c("transition", { attrs: { name: "carousel-arrow-left" } }, [
  28556. _c(
  28557. "button",
  28558. {
  28559. directives: [
  28560. {
  28561. name: "show",
  28562. rawName: "v-show",
  28563. value:
  28564. (_vm.arrow === "always" || _vm.hover) &&
  28565. (_vm.loop || _vm.activeIndex > 0),
  28566. expression:
  28567. "(arrow === 'always' || hover) && (loop || activeIndex > 0)"
  28568. }
  28569. ],
  28570. staticClass: "el-carousel__arrow el-carousel__arrow--left",
  28571. attrs: { type: "button" },
  28572. on: {
  28573. mouseenter: function($event) {
  28574. _vm.handleButtonEnter("left")
  28575. },
  28576. mouseleave: _vm.handleButtonLeave,
  28577. click: function($event) {
  28578. $event.stopPropagation()
  28579. _vm.throttledArrowClick(_vm.activeIndex - 1)
  28580. }
  28581. }
  28582. },
  28583. [_c("i", { staticClass: "el-icon-arrow-left" })]
  28584. )
  28585. ])
  28586. : _vm._e(),
  28587. _vm.arrowDisplay
  28588. ? _c("transition", { attrs: { name: "carousel-arrow-right" } }, [
  28589. _c(
  28590. "button",
  28591. {
  28592. directives: [
  28593. {
  28594. name: "show",
  28595. rawName: "v-show",
  28596. value:
  28597. (_vm.arrow === "always" || _vm.hover) &&
  28598. (_vm.loop || _vm.activeIndex < _vm.items.length - 1),
  28599. expression:
  28600. "(arrow === 'always' || hover) && (loop || activeIndex < items.length - 1)"
  28601. }
  28602. ],
  28603. staticClass: "el-carousel__arrow el-carousel__arrow--right",
  28604. attrs: { type: "button" },
  28605. on: {
  28606. mouseenter: function($event) {
  28607. _vm.handleButtonEnter("right")
  28608. },
  28609. mouseleave: _vm.handleButtonLeave,
  28610. click: function($event) {
  28611. $event.stopPropagation()
  28612. _vm.throttledArrowClick(_vm.activeIndex + 1)
  28613. }
  28614. }
  28615. },
  28616. [_c("i", { staticClass: "el-icon-arrow-right" })]
  28617. )
  28618. ])
  28619. : _vm._e(),
  28620. _vm._t("default")
  28621. ],
  28622. 2
  28623. ),
  28624. _vm.indicatorPosition !== "none"
  28625. ? _c(
  28626. "ul",
  28627. { class: _vm.indicatorsClasses },
  28628. _vm._l(_vm.items, function(item, index) {
  28629. return _c(
  28630. "li",
  28631. {
  28632. key: index,
  28633. class: [
  28634. "el-carousel__indicator",
  28635. "el-carousel__indicator--" + _vm.direction,
  28636. { "is-active": index === _vm.activeIndex }
  28637. ],
  28638. on: {
  28639. mouseenter: function($event) {
  28640. _vm.throttledIndicatorHover(index)
  28641. },
  28642. click: function($event) {
  28643. $event.stopPropagation()
  28644. _vm.handleIndicatorClick(index)
  28645. }
  28646. }
  28647. },
  28648. [
  28649. _c("button", { staticClass: "el-carousel__button" }, [
  28650. _vm.hasLabel
  28651. ? _c("span", [_vm._v(_vm._s(item.label))])
  28652. : _vm._e()
  28653. ])
  28654. ]
  28655. )
  28656. }),
  28657. 0
  28658. )
  28659. : _vm._e()
  28660. ]
  28661. )
  28662. }
  28663. var mainvue_type_template_id_5d5d1482_staticRenderFns = []
  28664. mainvue_type_template_id_5d5d1482_render._withStripped = true
  28665. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=template&id=5d5d1482&
  28666. // EXTERNAL MODULE: external "throttle-debounce/throttle"
  28667. var throttle_ = __webpack_require__(25);
  28668. var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
  28669. // 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&
  28670. //
  28671. //
  28672. //
  28673. //
  28674. //
  28675. //
  28676. //
  28677. //
  28678. //
  28679. //
  28680. //
  28681. //
  28682. //
  28683. //
  28684. //
  28685. //
  28686. //
  28687. //
  28688. //
  28689. //
  28690. //
  28691. //
  28692. //
  28693. //
  28694. //
  28695. //
  28696. //
  28697. //
  28698. //
  28699. //
  28700. //
  28701. //
  28702. //
  28703. //
  28704. //
  28705. //
  28706. //
  28707. //
  28708. //
  28709. //
  28710. //
  28711. //
  28712. //
  28713. //
  28714. //
  28715. //
  28716. //
  28717. //
  28718. //
  28719. //
  28720. //
  28721. //
  28722. //
  28723. //
  28724. //
  28725. //
  28726. /* harmony default export */ var carousel_src_mainvue_type_script_lang_js_ = ({
  28727. name: 'ElCarousel',
  28728. props: {
  28729. initialIndex: {
  28730. type: Number,
  28731. default: 0
  28732. },
  28733. height: String,
  28734. trigger: {
  28735. type: String,
  28736. default: 'hover'
  28737. },
  28738. autoplay: {
  28739. type: Boolean,
  28740. default: true
  28741. },
  28742. interval: {
  28743. type: Number,
  28744. default: 3000
  28745. },
  28746. indicatorPosition: String,
  28747. indicator: {
  28748. type: Boolean,
  28749. default: true
  28750. },
  28751. arrow: {
  28752. type: String,
  28753. default: 'hover'
  28754. },
  28755. type: String,
  28756. loop: {
  28757. type: Boolean,
  28758. default: true
  28759. },
  28760. direction: {
  28761. type: String,
  28762. default: 'horizontal',
  28763. validator: function validator(val) {
  28764. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  28765. }
  28766. }
  28767. },
  28768. data: function data() {
  28769. return {
  28770. items: [],
  28771. activeIndex: -1,
  28772. containerWidth: 0,
  28773. timer: null,
  28774. hover: false
  28775. };
  28776. },
  28777. computed: {
  28778. arrowDisplay: function arrowDisplay() {
  28779. return this.arrow !== 'never' && this.direction !== 'vertical';
  28780. },
  28781. hasLabel: function hasLabel() {
  28782. return this.items.some(function (item) {
  28783. return item.label.toString().length > 0;
  28784. });
  28785. },
  28786. carouselClasses: function carouselClasses() {
  28787. var classes = ['el-carousel', 'el-carousel--' + this.direction];
  28788. if (this.type === 'card') {
  28789. classes.push('el-carousel--card');
  28790. }
  28791. return classes;
  28792. },
  28793. indicatorsClasses: function indicatorsClasses() {
  28794. var classes = ['el-carousel__indicators', 'el-carousel__indicators--' + this.direction];
  28795. if (this.hasLabel) {
  28796. classes.push('el-carousel__indicators--labels');
  28797. }
  28798. if (this.indicatorPosition === 'outside' || this.type === 'card') {
  28799. classes.push('el-carousel__indicators--outside');
  28800. }
  28801. return classes;
  28802. }
  28803. },
  28804. watch: {
  28805. items: function items(val) {
  28806. if (val.length > 0) this.setActiveItem(this.initialIndex);
  28807. },
  28808. activeIndex: function activeIndex(val, oldVal) {
  28809. this.resetItemPosition(oldVal);
  28810. if (oldVal > -1) {
  28811. this.$emit('change', val, oldVal);
  28812. }
  28813. },
  28814. autoplay: function autoplay(val) {
  28815. val ? this.startTimer() : this.pauseTimer();
  28816. },
  28817. loop: function loop() {
  28818. this.setActiveItem(this.activeIndex);
  28819. },
  28820. interval: function interval() {
  28821. this.pauseTimer();
  28822. this.startTimer();
  28823. }
  28824. },
  28825. methods: {
  28826. handleMouseEnter: function handleMouseEnter() {
  28827. this.hover = true;
  28828. this.pauseTimer();
  28829. },
  28830. handleMouseLeave: function handleMouseLeave() {
  28831. this.hover = false;
  28832. this.startTimer();
  28833. },
  28834. itemInStage: function itemInStage(item, index) {
  28835. var length = this.items.length;
  28836. if (index === length - 1 && item.inStage && this.items[0].active || item.inStage && this.items[index + 1] && this.items[index + 1].active) {
  28837. return 'left';
  28838. } else if (index === 0 && item.inStage && this.items[length - 1].active || item.inStage && this.items[index - 1] && this.items[index - 1].active) {
  28839. return 'right';
  28840. }
  28841. return false;
  28842. },
  28843. handleButtonEnter: function handleButtonEnter(arrow) {
  28844. var _this = this;
  28845. if (this.direction === 'vertical') return;
  28846. this.items.forEach(function (item, index) {
  28847. if (arrow === _this.itemInStage(item, index)) {
  28848. item.hover = true;
  28849. }
  28850. });
  28851. },
  28852. handleButtonLeave: function handleButtonLeave() {
  28853. if (this.direction === 'vertical') return;
  28854. this.items.forEach(function (item) {
  28855. item.hover = false;
  28856. });
  28857. },
  28858. updateItems: function updateItems() {
  28859. this.items = this.$children.filter(function (child) {
  28860. return child.$options.name === 'ElCarouselItem';
  28861. });
  28862. },
  28863. resetItemPosition: function resetItemPosition(oldIndex) {
  28864. var _this2 = this;
  28865. this.items.forEach(function (item, index) {
  28866. item.translateItem(index, _this2.activeIndex, oldIndex);
  28867. });
  28868. },
  28869. playSlides: function playSlides() {
  28870. if (this.activeIndex < this.items.length - 1) {
  28871. this.activeIndex++;
  28872. } else if (this.loop) {
  28873. this.activeIndex = 0;
  28874. }
  28875. },
  28876. pauseTimer: function pauseTimer() {
  28877. if (this.timer) {
  28878. clearInterval(this.timer);
  28879. this.timer = null;
  28880. }
  28881. },
  28882. startTimer: function startTimer() {
  28883. if (this.interval <= 0 || !this.autoplay || this.timer) return;
  28884. this.timer = setInterval(this.playSlides, this.interval);
  28885. },
  28886. resetTimer: function resetTimer() {
  28887. this.pauseTimer();
  28888. this.startTimer();
  28889. },
  28890. setActiveItem: function setActiveItem(index) {
  28891. if (typeof index === 'string') {
  28892. var filteredItems = this.items.filter(function (item) {
  28893. return item.name === index;
  28894. });
  28895. if (filteredItems.length > 0) {
  28896. index = this.items.indexOf(filteredItems[0]);
  28897. }
  28898. }
  28899. index = Number(index);
  28900. if (isNaN(index) || index !== Math.floor(index)) {
  28901. console.warn('[Element Warn][Carousel]index must be an integer.');
  28902. return;
  28903. }
  28904. var length = this.items.length;
  28905. var oldIndex = this.activeIndex;
  28906. if (index < 0) {
  28907. this.activeIndex = this.loop ? length - 1 : 0;
  28908. } else if (index >= length) {
  28909. this.activeIndex = this.loop ? 0 : length - 1;
  28910. } else {
  28911. this.activeIndex = index;
  28912. }
  28913. if (oldIndex === this.activeIndex) {
  28914. this.resetItemPosition(oldIndex);
  28915. }
  28916. this.resetTimer();
  28917. },
  28918. prev: function prev() {
  28919. this.setActiveItem(this.activeIndex - 1);
  28920. },
  28921. next: function next() {
  28922. this.setActiveItem(this.activeIndex + 1);
  28923. },
  28924. handleIndicatorClick: function handleIndicatorClick(index) {
  28925. this.activeIndex = index;
  28926. },
  28927. handleIndicatorHover: function handleIndicatorHover(index) {
  28928. if (this.trigger === 'hover' && index !== this.activeIndex) {
  28929. this.activeIndex = index;
  28930. }
  28931. }
  28932. },
  28933. created: function created() {
  28934. var _this3 = this;
  28935. this.throttledArrowClick = throttle_default()(300, true, function (index) {
  28936. _this3.setActiveItem(index);
  28937. });
  28938. this.throttledIndicatorHover = throttle_default()(300, function (index) {
  28939. _this3.handleIndicatorHover(index);
  28940. });
  28941. },
  28942. mounted: function mounted() {
  28943. var _this4 = this;
  28944. this.updateItems();
  28945. this.$nextTick(function () {
  28946. Object(resize_event_["addResizeListener"])(_this4.$el, _this4.resetItemPosition);
  28947. if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
  28948. _this4.activeIndex = _this4.initialIndex;
  28949. }
  28950. _this4.startTimer();
  28951. });
  28952. },
  28953. beforeDestroy: function beforeDestroy() {
  28954. if (this.$el) Object(resize_event_["removeResizeListener"])(this.$el, this.resetItemPosition);
  28955. this.pauseTimer();
  28956. }
  28957. });
  28958. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=script&lang=js&
  28959. /* harmony default export */ var packages_carousel_src_mainvue_type_script_lang_js_ = (carousel_src_mainvue_type_script_lang_js_);
  28960. // CONCATENATED MODULE: ./packages/carousel/src/main.vue
  28961. /* normalize component */
  28962. var carousel_src_main_component = normalizeComponent(
  28963. packages_carousel_src_mainvue_type_script_lang_js_,
  28964. mainvue_type_template_id_5d5d1482_render,
  28965. mainvue_type_template_id_5d5d1482_staticRenderFns,
  28966. false,
  28967. null,
  28968. null,
  28969. null
  28970. )
  28971. /* hot reload */
  28972. if (false) { var carousel_src_main_api; }
  28973. carousel_src_main_component.options.__file = "packages/carousel/src/main.vue"
  28974. /* harmony default export */ var carousel_src_main = (carousel_src_main_component.exports);
  28975. // CONCATENATED MODULE: ./packages/carousel/index.js
  28976. /* istanbul ignore next */
  28977. carousel_src_main.install = function (Vue) {
  28978. Vue.component(carousel_src_main.name, carousel_src_main);
  28979. };
  28980. /* harmony default export */ var carousel = (carousel_src_main);
  28981. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  28982. var BAR_MAP = {
  28983. vertical: {
  28984. offset: 'offsetHeight',
  28985. scroll: 'scrollTop',
  28986. scrollSize: 'scrollHeight',
  28987. size: 'height',
  28988. key: 'vertical',
  28989. axis: 'Y',
  28990. client: 'clientY',
  28991. direction: 'top'
  28992. },
  28993. horizontal: {
  28994. offset: 'offsetWidth',
  28995. scroll: 'scrollLeft',
  28996. scrollSize: 'scrollWidth',
  28997. size: 'width',
  28998. key: 'horizontal',
  28999. axis: 'X',
  29000. client: 'clientX',
  29001. direction: 'left'
  29002. }
  29003. };
  29004. function renderThumbStyle(_ref) {
  29005. var move = _ref.move,
  29006. size = _ref.size,
  29007. bar = _ref.bar;
  29008. var style = {};
  29009. var translate = 'translate' + bar.axis + '(' + move + '%)';
  29010. style[bar.size] = size;
  29011. style.transform = translate;
  29012. style.msTransform = translate;
  29013. style.webkitTransform = translate;
  29014. return style;
  29015. };
  29016. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  29017. /* istanbul ignore next */
  29018. /* harmony default export */ var src_bar = ({
  29019. name: 'Bar',
  29020. props: {
  29021. vertical: Boolean,
  29022. size: String,
  29023. move: Number
  29024. },
  29025. computed: {
  29026. bar: function bar() {
  29027. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  29028. },
  29029. wrap: function wrap() {
  29030. return this.$parent.wrap;
  29031. }
  29032. },
  29033. render: function render(h) {
  29034. var size = this.size,
  29035. move = this.move,
  29036. bar = this.bar;
  29037. return h(
  29038. 'div',
  29039. {
  29040. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  29041. on: {
  29042. 'mousedown': this.clickTrackHandler
  29043. }
  29044. },
  29045. [h('div', {
  29046. ref: 'thumb',
  29047. 'class': 'el-scrollbar__thumb',
  29048. on: {
  29049. 'mousedown': this.clickThumbHandler
  29050. },
  29051. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  29052. );
  29053. },
  29054. methods: {
  29055. clickThumbHandler: function clickThumbHandler(e) {
  29056. // prevent click event of right button
  29057. if (e.ctrlKey || e.button === 2) {
  29058. return;
  29059. }
  29060. this.startDrag(e);
  29061. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  29062. },
  29063. clickTrackHandler: function clickTrackHandler(e) {
  29064. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  29065. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  29066. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  29067. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29068. },
  29069. startDrag: function startDrag(e) {
  29070. e.stopImmediatePropagation();
  29071. this.cursorDown = true;
  29072. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29073. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29074. document.onselectstart = function () {
  29075. return false;
  29076. };
  29077. },
  29078. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  29079. if (this.cursorDown === false) return;
  29080. var prevPage = this[this.bar.axis];
  29081. if (!prevPage) return;
  29082. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  29083. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  29084. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  29085. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29086. },
  29087. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  29088. this.cursorDown = false;
  29089. this[this.bar.axis] = 0;
  29090. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29091. document.onselectstart = null;
  29092. }
  29093. },
  29094. destroyed: function destroyed() {
  29095. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29096. }
  29097. });
  29098. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  29099. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  29100. /* istanbul ignore next */
  29101. /* harmony default export */ var scrollbar_src_main = ({
  29102. name: 'ElScrollbar',
  29103. components: { Bar: src_bar },
  29104. props: {
  29105. native: Boolean,
  29106. wrapStyle: {},
  29107. wrapClass: {},
  29108. viewClass: {},
  29109. viewStyle: {},
  29110. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  29111. tag: {
  29112. type: String,
  29113. default: 'div'
  29114. }
  29115. },
  29116. data: function data() {
  29117. return {
  29118. sizeWidth: '0',
  29119. sizeHeight: '0',
  29120. moveX: 0,
  29121. moveY: 0
  29122. };
  29123. },
  29124. computed: {
  29125. wrap: function wrap() {
  29126. return this.$refs.wrap;
  29127. }
  29128. },
  29129. render: function render(h) {
  29130. var gutter = scrollbar_width_default()();
  29131. var style = this.wrapStyle;
  29132. if (gutter) {
  29133. var gutterWith = '-' + gutter + 'px';
  29134. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  29135. if (Array.isArray(this.wrapStyle)) {
  29136. style = Object(util_["toObject"])(this.wrapStyle);
  29137. style.marginRight = style.marginBottom = gutterWith;
  29138. } else if (typeof this.wrapStyle === 'string') {
  29139. style += gutterStyle;
  29140. } else {
  29141. style = gutterStyle;
  29142. }
  29143. }
  29144. var view = h(this.tag, {
  29145. class: ['el-scrollbar__view', this.viewClass],
  29146. style: this.viewStyle,
  29147. ref: 'resize'
  29148. }, this.$slots.default);
  29149. var wrap = h(
  29150. 'div',
  29151. {
  29152. ref: 'wrap',
  29153. style: style,
  29154. on: {
  29155. 'scroll': this.handleScroll
  29156. },
  29157. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  29158. [[view]]
  29159. );
  29160. var nodes = void 0;
  29161. if (!this.native) {
  29162. nodes = [wrap, h(src_bar, {
  29163. attrs: {
  29164. move: this.moveX,
  29165. size: this.sizeWidth }
  29166. }), h(src_bar, {
  29167. attrs: {
  29168. vertical: true,
  29169. move: this.moveY,
  29170. size: this.sizeHeight }
  29171. })];
  29172. } else {
  29173. nodes = [h(
  29174. 'div',
  29175. {
  29176. ref: 'wrap',
  29177. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  29178. style: style },
  29179. [[view]]
  29180. )];
  29181. }
  29182. return h('div', { class: 'el-scrollbar' }, nodes);
  29183. },
  29184. methods: {
  29185. handleScroll: function handleScroll() {
  29186. var wrap = this.wrap;
  29187. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  29188. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  29189. },
  29190. update: function update() {
  29191. var heightPercentage = void 0,
  29192. widthPercentage = void 0;
  29193. var wrap = this.wrap;
  29194. if (!wrap) return;
  29195. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  29196. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  29197. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  29198. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  29199. }
  29200. },
  29201. mounted: function mounted() {
  29202. if (this.native) return;
  29203. this.$nextTick(this.update);
  29204. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  29205. },
  29206. beforeDestroy: function beforeDestroy() {
  29207. if (this.native) return;
  29208. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  29209. }
  29210. });
  29211. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  29212. /* istanbul ignore next */
  29213. scrollbar_src_main.install = function (Vue) {
  29214. Vue.component(scrollbar_src_main.name, scrollbar_src_main);
  29215. };
  29216. /* harmony default export */ var scrollbar = (scrollbar_src_main);
  29217. // 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&
  29218. var itemvue_type_template_id_1801ae19_render = function() {
  29219. var _vm = this
  29220. var _h = _vm.$createElement
  29221. var _c = _vm._self._c || _h
  29222. return _c(
  29223. "div",
  29224. {
  29225. directives: [
  29226. {
  29227. name: "show",
  29228. rawName: "v-show",
  29229. value: _vm.ready,
  29230. expression: "ready"
  29231. }
  29232. ],
  29233. staticClass: "el-carousel__item",
  29234. class: {
  29235. "is-active": _vm.active,
  29236. "el-carousel__item--card": _vm.$parent.type === "card",
  29237. "is-in-stage": _vm.inStage,
  29238. "is-hover": _vm.hover,
  29239. "is-animating": _vm.animating
  29240. },
  29241. style: _vm.itemStyle,
  29242. on: { click: _vm.handleItemClick }
  29243. },
  29244. [
  29245. _vm.$parent.type === "card"
  29246. ? _c("div", {
  29247. directives: [
  29248. {
  29249. name: "show",
  29250. rawName: "v-show",
  29251. value: !_vm.active,
  29252. expression: "!active"
  29253. }
  29254. ],
  29255. staticClass: "el-carousel__mask"
  29256. })
  29257. : _vm._e(),
  29258. _vm._t("default")
  29259. ],
  29260. 2
  29261. )
  29262. }
  29263. var itemvue_type_template_id_1801ae19_staticRenderFns = []
  29264. itemvue_type_template_id_1801ae19_render._withStripped = true
  29265. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=template&id=1801ae19&
  29266. // 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&
  29267. //
  29268. //
  29269. //
  29270. //
  29271. //
  29272. //
  29273. //
  29274. //
  29275. //
  29276. //
  29277. //
  29278. //
  29279. //
  29280. //
  29281. //
  29282. //
  29283. //
  29284. //
  29285. //
  29286. //
  29287. //
  29288. //
  29289. var CARD_SCALE = 0.83;
  29290. /* harmony default export */ var itemvue_type_script_lang_js_ = ({
  29291. name: 'ElCarouselItem',
  29292. props: {
  29293. name: String,
  29294. label: {
  29295. type: [String, Number],
  29296. default: ''
  29297. }
  29298. },
  29299. data: function data() {
  29300. return {
  29301. hover: false,
  29302. translate: 0,
  29303. scale: 1,
  29304. active: false,
  29305. ready: false,
  29306. inStage: false,
  29307. animating: false
  29308. };
  29309. },
  29310. methods: {
  29311. processIndex: function processIndex(index, activeIndex, length) {
  29312. if (activeIndex === 0 && index === length - 1) {
  29313. return -1;
  29314. } else if (activeIndex === length - 1 && index === 0) {
  29315. return length;
  29316. } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
  29317. return length + 1;
  29318. } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
  29319. return -2;
  29320. }
  29321. return index;
  29322. },
  29323. calcCardTranslate: function calcCardTranslate(index, activeIndex) {
  29324. var parentWidth = this.$parent.$el.offsetWidth;
  29325. if (this.inStage) {
  29326. return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
  29327. } else if (index < activeIndex) {
  29328. return -(1 + CARD_SCALE) * parentWidth / 4;
  29329. } else {
  29330. return (3 + CARD_SCALE) * parentWidth / 4;
  29331. }
  29332. },
  29333. calcTranslate: function calcTranslate(index, activeIndex, isVertical) {
  29334. var distance = this.$parent.$el[isVertical ? 'offsetHeight' : 'offsetWidth'];
  29335. return distance * (index - activeIndex);
  29336. },
  29337. translateItem: function translateItem(index, activeIndex, oldIndex) {
  29338. var parentType = this.$parent.type;
  29339. var parentDirection = this.parentDirection;
  29340. var length = this.$parent.items.length;
  29341. if (parentType !== 'card' && oldIndex !== undefined) {
  29342. this.animating = index === activeIndex || index === oldIndex;
  29343. }
  29344. if (index !== activeIndex && length > 2 && this.$parent.loop) {
  29345. index = this.processIndex(index, activeIndex, length);
  29346. }
  29347. if (parentType === 'card') {
  29348. if (parentDirection === 'vertical') {
  29349. console.warn('[Element Warn][Carousel]vertical direction is not supported in card mode');
  29350. }
  29351. this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
  29352. this.active = index === activeIndex;
  29353. this.translate = this.calcCardTranslate(index, activeIndex);
  29354. this.scale = this.active ? 1 : CARD_SCALE;
  29355. } else {
  29356. this.active = index === activeIndex;
  29357. var isVertical = parentDirection === 'vertical';
  29358. this.translate = this.calcTranslate(index, activeIndex, isVertical);
  29359. this.scale = 1;
  29360. }
  29361. this.ready = true;
  29362. },
  29363. handleItemClick: function handleItemClick() {
  29364. var parent = this.$parent;
  29365. if (parent && parent.type === 'card') {
  29366. var index = parent.items.indexOf(this);
  29367. parent.setActiveItem(index);
  29368. }
  29369. }
  29370. },
  29371. computed: {
  29372. parentDirection: function parentDirection() {
  29373. return this.$parent.direction;
  29374. },
  29375. itemStyle: function itemStyle() {
  29376. var translateType = this.parentDirection === 'vertical' ? 'translateY' : 'translateX';
  29377. var value = translateType + '(' + this.translate + 'px) scale(' + this.scale + ')';
  29378. var style = {
  29379. transform: value
  29380. };
  29381. return Object(util_["autoprefixer"])(style);
  29382. }
  29383. },
  29384. created: function created() {
  29385. this.$parent && this.$parent.updateItems();
  29386. },
  29387. destroyed: function destroyed() {
  29388. this.$parent && this.$parent.updateItems();
  29389. }
  29390. });
  29391. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=script&lang=js&
  29392. /* harmony default export */ var src_itemvue_type_script_lang_js_ = (itemvue_type_script_lang_js_);
  29393. // CONCATENATED MODULE: ./packages/carousel/src/item.vue
  29394. /* normalize component */
  29395. var item_component = normalizeComponent(
  29396. src_itemvue_type_script_lang_js_,
  29397. itemvue_type_template_id_1801ae19_render,
  29398. itemvue_type_template_id_1801ae19_staticRenderFns,
  29399. false,
  29400. null,
  29401. null,
  29402. null
  29403. )
  29404. /* hot reload */
  29405. if (false) { var item_api; }
  29406. item_component.options.__file = "packages/carousel/src/item.vue"
  29407. /* harmony default export */ var src_item = (item_component.exports);
  29408. // CONCATENATED MODULE: ./packages/carousel-item/index.js
  29409. /* istanbul ignore next */
  29410. src_item.install = function (Vue) {
  29411. Vue.component(src_item.name, src_item);
  29412. };
  29413. /* harmony default export */ var carousel_item = (src_item);
  29414. // 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&
  29415. var collapsevue_type_template_id_461d57f4_render = function() {
  29416. var _vm = this
  29417. var _h = _vm.$createElement
  29418. var _c = _vm._self._c || _h
  29419. return _c(
  29420. "div",
  29421. {
  29422. staticClass: "el-collapse",
  29423. attrs: { role: "tablist", "aria-multiselectable": "true" }
  29424. },
  29425. [_vm._t("default")],
  29426. 2
  29427. )
  29428. }
  29429. var collapsevue_type_template_id_461d57f4_staticRenderFns = []
  29430. collapsevue_type_template_id_461d57f4_render._withStripped = true
  29431. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=461d57f4&
  29432. // 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&
  29433. //
  29434. //
  29435. //
  29436. //
  29437. //
  29438. /* harmony default export */ var collapsevue_type_script_lang_js_ = ({
  29439. name: 'ElCollapse',
  29440. componentName: 'ElCollapse',
  29441. props: {
  29442. accordion: Boolean,
  29443. value: {
  29444. type: [Array, String, Number],
  29445. default: function _default() {
  29446. return [];
  29447. }
  29448. }
  29449. },
  29450. data: function data() {
  29451. return {
  29452. activeNames: [].concat(this.value)
  29453. };
  29454. },
  29455. provide: function provide() {
  29456. return {
  29457. collapse: this
  29458. };
  29459. },
  29460. watch: {
  29461. value: function value(_value) {
  29462. this.activeNames = [].concat(_value);
  29463. }
  29464. },
  29465. methods: {
  29466. setActiveNames: function setActiveNames(activeNames) {
  29467. activeNames = [].concat(activeNames);
  29468. var value = this.accordion ? activeNames[0] : activeNames;
  29469. this.activeNames = activeNames;
  29470. this.$emit('input', value);
  29471. this.$emit('change', value);
  29472. },
  29473. handleItemClick: function handleItemClick(item) {
  29474. if (this.accordion) {
  29475. this.setActiveNames((this.activeNames[0] || this.activeNames[0] === 0) && this.activeNames[0] === item.name ? '' : item.name);
  29476. } else {
  29477. var activeNames = this.activeNames.slice(0);
  29478. var index = activeNames.indexOf(item.name);
  29479. if (index > -1) {
  29480. activeNames.splice(index, 1);
  29481. } else {
  29482. activeNames.push(item.name);
  29483. }
  29484. this.setActiveNames(activeNames);
  29485. }
  29486. }
  29487. },
  29488. created: function created() {
  29489. this.$on('item-click', this.handleItemClick);
  29490. }
  29491. });
  29492. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js&
  29493. /* harmony default export */ var src_collapsevue_type_script_lang_js_ = (collapsevue_type_script_lang_js_);
  29494. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
  29495. /* normalize component */
  29496. var collapse_component = normalizeComponent(
  29497. src_collapsevue_type_script_lang_js_,
  29498. collapsevue_type_template_id_461d57f4_render,
  29499. collapsevue_type_template_id_461d57f4_staticRenderFns,
  29500. false,
  29501. null,
  29502. null,
  29503. null
  29504. )
  29505. /* hot reload */
  29506. if (false) { var collapse_api; }
  29507. collapse_component.options.__file = "packages/collapse/src/collapse.vue"
  29508. /* harmony default export */ var collapse = (collapse_component.exports);
  29509. // CONCATENATED MODULE: ./packages/collapse/index.js
  29510. /* istanbul ignore next */
  29511. collapse.install = function (Vue) {
  29512. Vue.component(collapse.name, collapse);
  29513. };
  29514. /* harmony default export */ var packages_collapse = (collapse);
  29515. // 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&
  29516. var collapse_itemvue_type_template_id_2d05faac_render = function() {
  29517. var _vm = this
  29518. var _h = _vm.$createElement
  29519. var _c = _vm._self._c || _h
  29520. return _c(
  29521. "div",
  29522. {
  29523. staticClass: "el-collapse-item",
  29524. class: { "is-active": _vm.isActive, "is-disabled": _vm.disabled }
  29525. },
  29526. [
  29527. _c(
  29528. "div",
  29529. {
  29530. attrs: {
  29531. role: "tab",
  29532. "aria-expanded": _vm.isActive,
  29533. "aria-controls": "el-collapse-content-" + _vm.id,
  29534. "aria-describedby": "el-collapse-content-" + _vm.id
  29535. }
  29536. },
  29537. [
  29538. _c(
  29539. "div",
  29540. {
  29541. staticClass: "el-collapse-item__header",
  29542. class: {
  29543. focusing: _vm.focusing,
  29544. "is-active": _vm.isActive
  29545. },
  29546. attrs: {
  29547. role: "button",
  29548. id: "el-collapse-head-" + _vm.id,
  29549. tabindex: _vm.disabled ? undefined : 0
  29550. },
  29551. on: {
  29552. click: _vm.handleHeaderClick,
  29553. keyup: function($event) {
  29554. if (
  29555. !("button" in $event) &&
  29556. _vm._k($event.keyCode, "space", 32, $event.key, [
  29557. " ",
  29558. "Spacebar"
  29559. ]) &&
  29560. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  29561. ) {
  29562. return null
  29563. }
  29564. $event.stopPropagation()
  29565. return _vm.handleEnterClick($event)
  29566. },
  29567. focus: _vm.handleFocus,
  29568. blur: function($event) {
  29569. _vm.focusing = false
  29570. }
  29571. }
  29572. },
  29573. [
  29574. _vm._t("title", [_vm._v(_vm._s(_vm.title))]),
  29575. _c("i", {
  29576. staticClass: "el-collapse-item__arrow el-icon-arrow-right",
  29577. class: { "is-active": _vm.isActive }
  29578. })
  29579. ],
  29580. 2
  29581. )
  29582. ]
  29583. ),
  29584. _c("el-collapse-transition", [
  29585. _c(
  29586. "div",
  29587. {
  29588. directives: [
  29589. {
  29590. name: "show",
  29591. rawName: "v-show",
  29592. value: _vm.isActive,
  29593. expression: "isActive"
  29594. }
  29595. ],
  29596. staticClass: "el-collapse-item__wrap",
  29597. attrs: {
  29598. role: "tabpanel",
  29599. "aria-hidden": !_vm.isActive,
  29600. "aria-labelledby": "el-collapse-head-" + _vm.id,
  29601. id: "el-collapse-content-" + _vm.id
  29602. }
  29603. },
  29604. [
  29605. _c(
  29606. "div",
  29607. { staticClass: "el-collapse-item__content" },
  29608. [_vm._t("default")],
  29609. 2
  29610. )
  29611. ]
  29612. )
  29613. ])
  29614. ],
  29615. 1
  29616. )
  29617. }
  29618. var collapse_itemvue_type_template_id_2d05faac_staticRenderFns = []
  29619. collapse_itemvue_type_template_id_2d05faac_render._withStripped = true
  29620. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=2d05faac&
  29621. // 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&
  29622. //
  29623. //
  29624. //
  29625. //
  29626. //
  29627. //
  29628. //
  29629. //
  29630. //
  29631. //
  29632. //
  29633. //
  29634. //
  29635. //
  29636. //
  29637. //
  29638. //
  29639. //
  29640. //
  29641. //
  29642. //
  29643. //
  29644. //
  29645. //
  29646. //
  29647. //
  29648. //
  29649. //
  29650. //
  29651. //
  29652. //
  29653. //
  29654. //
  29655. //
  29656. //
  29657. //
  29658. //
  29659. //
  29660. //
  29661. //
  29662. //
  29663. //
  29664. //
  29665. //
  29666. //
  29667. //
  29668. /* harmony default export */ var collapse_itemvue_type_script_lang_js_ = ({
  29669. name: 'ElCollapseItem',
  29670. componentName: 'ElCollapseItem',
  29671. mixins: [emitter_default.a],
  29672. components: { ElCollapseTransition: collapse_transition_default.a },
  29673. data: function data() {
  29674. return {
  29675. contentWrapStyle: {
  29676. height: 'auto',
  29677. display: 'block'
  29678. },
  29679. contentHeight: 0,
  29680. focusing: false,
  29681. isClick: false,
  29682. id: Object(util_["generateId"])()
  29683. };
  29684. },
  29685. inject: ['collapse'],
  29686. props: {
  29687. title: String,
  29688. name: {
  29689. type: [String, Number],
  29690. default: function _default() {
  29691. return this._uid;
  29692. }
  29693. },
  29694. disabled: Boolean
  29695. },
  29696. computed: {
  29697. isActive: function isActive() {
  29698. return this.collapse.activeNames.indexOf(this.name) > -1;
  29699. }
  29700. },
  29701. methods: {
  29702. handleFocus: function handleFocus() {
  29703. var _this = this;
  29704. setTimeout(function () {
  29705. if (!_this.isClick) {
  29706. _this.focusing = true;
  29707. } else {
  29708. _this.isClick = false;
  29709. }
  29710. }, 50);
  29711. },
  29712. handleHeaderClick: function handleHeaderClick() {
  29713. if (this.disabled) return;
  29714. this.dispatch('ElCollapse', 'item-click', this);
  29715. this.focusing = false;
  29716. this.isClick = true;
  29717. },
  29718. handleEnterClick: function handleEnterClick() {
  29719. this.dispatch('ElCollapse', 'item-click', this);
  29720. }
  29721. }
  29722. });
  29723. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js&
  29724. /* harmony default export */ var src_collapse_itemvue_type_script_lang_js_ = (collapse_itemvue_type_script_lang_js_);
  29725. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
  29726. /* normalize component */
  29727. var collapse_item_component = normalizeComponent(
  29728. src_collapse_itemvue_type_script_lang_js_,
  29729. collapse_itemvue_type_template_id_2d05faac_render,
  29730. collapse_itemvue_type_template_id_2d05faac_staticRenderFns,
  29731. false,
  29732. null,
  29733. null,
  29734. null
  29735. )
  29736. /* hot reload */
  29737. if (false) { var collapse_item_api; }
  29738. collapse_item_component.options.__file = "packages/collapse/src/collapse-item.vue"
  29739. /* harmony default export */ var collapse_item = (collapse_item_component.exports);
  29740. // CONCATENATED MODULE: ./packages/collapse-item/index.js
  29741. /* istanbul ignore next */
  29742. collapse_item.install = function (Vue) {
  29743. Vue.component(collapse_item.name, collapse_item);
  29744. };
  29745. /* harmony default export */ var packages_collapse_item = (collapse_item);
  29746. // 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&
  29747. var cascadervue_type_template_id_032537a6_render = function() {
  29748. var _vm = this
  29749. var _h = _vm.$createElement
  29750. var _c = _vm._self._c || _h
  29751. return _c(
  29752. "div",
  29753. {
  29754. directives: [
  29755. {
  29756. name: "clickoutside",
  29757. rawName: "v-clickoutside",
  29758. value: function() {
  29759. return _vm.toggleDropDownVisible(false)
  29760. },
  29761. expression: "() => toggleDropDownVisible(false)"
  29762. }
  29763. ],
  29764. ref: "reference",
  29765. class: [
  29766. "el-cascader",
  29767. _vm.realSize && "el-cascader--" + _vm.realSize,
  29768. { "is-disabled": _vm.isDisabled }
  29769. ],
  29770. on: {
  29771. mouseenter: function($event) {
  29772. _vm.inputHover = true
  29773. },
  29774. mouseleave: function($event) {
  29775. _vm.inputHover = false
  29776. },
  29777. click: function() {
  29778. return _vm.toggleDropDownVisible(_vm.readonly ? undefined : true)
  29779. },
  29780. keydown: _vm.handleKeyDown
  29781. }
  29782. },
  29783. [
  29784. _c(
  29785. "el-input",
  29786. {
  29787. ref: "input",
  29788. class: { "is-focus": _vm.dropDownVisible },
  29789. attrs: {
  29790. size: _vm.realSize,
  29791. placeholder: _vm.placeholder,
  29792. readonly: _vm.readonly,
  29793. disabled: _vm.isDisabled,
  29794. "validate-event": false
  29795. },
  29796. on: {
  29797. focus: _vm.handleFocus,
  29798. blur: _vm.handleBlur,
  29799. input: _vm.handleInput
  29800. },
  29801. model: {
  29802. value: _vm.multiple ? _vm.presentText : _vm.inputValue,
  29803. callback: function($$v) {
  29804. _vm.multiple ? _vm.presentText : (_vm.inputValue = $$v)
  29805. },
  29806. expression: "multiple ? presentText : inputValue"
  29807. }
  29808. },
  29809. [
  29810. _c("template", { slot: "suffix" }, [
  29811. _vm.clearBtnVisible
  29812. ? _c("i", {
  29813. key: "clear",
  29814. staticClass: "el-input__icon el-icon-circle-close",
  29815. on: {
  29816. click: function($event) {
  29817. $event.stopPropagation()
  29818. return _vm.handleClear($event)
  29819. }
  29820. }
  29821. })
  29822. : _c("i", {
  29823. key: "arrow-down",
  29824. class: [
  29825. "el-input__icon",
  29826. "el-icon-arrow-down",
  29827. _vm.dropDownVisible && "is-reverse"
  29828. ],
  29829. on: {
  29830. click: function($event) {
  29831. $event.stopPropagation()
  29832. _vm.toggleDropDownVisible()
  29833. }
  29834. }
  29835. })
  29836. ])
  29837. ],
  29838. 2
  29839. ),
  29840. _vm.multiple
  29841. ? _c(
  29842. "div",
  29843. { staticClass: "el-cascader__tags" },
  29844. [
  29845. _vm._l(_vm.presentTags, function(tag) {
  29846. return _c(
  29847. "el-tag",
  29848. {
  29849. key: tag.key,
  29850. attrs: {
  29851. type: "info",
  29852. size: _vm.tagSize,
  29853. hit: tag.hitState,
  29854. closable: tag.closable,
  29855. "disable-transitions": ""
  29856. },
  29857. on: {
  29858. close: function($event) {
  29859. _vm.deleteTag(tag)
  29860. }
  29861. }
  29862. },
  29863. [_c("span", [_vm._v(_vm._s(tag.text))])]
  29864. )
  29865. }),
  29866. _vm.filterable && !_vm.isDisabled
  29867. ? _c("input", {
  29868. directives: [
  29869. {
  29870. name: "model",
  29871. rawName: "v-model.trim",
  29872. value: _vm.inputValue,
  29873. expression: "inputValue",
  29874. modifiers: { trim: true }
  29875. }
  29876. ],
  29877. staticClass: "el-cascader__search-input",
  29878. attrs: {
  29879. type: "text",
  29880. placeholder: _vm.presentTags.length ? "" : _vm.placeholder
  29881. },
  29882. domProps: { value: _vm.inputValue },
  29883. on: {
  29884. input: [
  29885. function($event) {
  29886. if ($event.target.composing) {
  29887. return
  29888. }
  29889. _vm.inputValue = $event.target.value.trim()
  29890. },
  29891. function(e) {
  29892. return _vm.handleInput(_vm.inputValue, e)
  29893. }
  29894. ],
  29895. click: function($event) {
  29896. $event.stopPropagation()
  29897. _vm.toggleDropDownVisible(true)
  29898. },
  29899. keydown: function($event) {
  29900. if (
  29901. !("button" in $event) &&
  29902. _vm._k(
  29903. $event.keyCode,
  29904. "delete",
  29905. [8, 46],
  29906. $event.key,
  29907. ["Backspace", "Delete", "Del"]
  29908. )
  29909. ) {
  29910. return null
  29911. }
  29912. return _vm.handleDelete($event)
  29913. },
  29914. blur: function($event) {
  29915. _vm.$forceUpdate()
  29916. }
  29917. }
  29918. })
  29919. : _vm._e()
  29920. ],
  29921. 2
  29922. )
  29923. : _vm._e(),
  29924. _c(
  29925. "transition",
  29926. {
  29927. attrs: { name: "el-zoom-in-top" },
  29928. on: { "after-leave": _vm.handleDropdownLeave }
  29929. },
  29930. [
  29931. _c(
  29932. "div",
  29933. {
  29934. directives: [
  29935. {
  29936. name: "show",
  29937. rawName: "v-show",
  29938. value: _vm.dropDownVisible,
  29939. expression: "dropDownVisible"
  29940. }
  29941. ],
  29942. ref: "popper",
  29943. class: ["el-popper", "el-cascader__dropdown", _vm.popperClass]
  29944. },
  29945. [
  29946. _c("el-cascader-panel", {
  29947. directives: [
  29948. {
  29949. name: "show",
  29950. rawName: "v-show",
  29951. value: !_vm.filtering,
  29952. expression: "!filtering"
  29953. }
  29954. ],
  29955. ref: "panel",
  29956. attrs: {
  29957. options: _vm.options,
  29958. props: _vm.config,
  29959. border: false,
  29960. "render-label": _vm.$scopedSlots.default
  29961. },
  29962. on: {
  29963. "expand-change": _vm.handleExpandChange,
  29964. close: function($event) {
  29965. _vm.toggleDropDownVisible(false)
  29966. }
  29967. },
  29968. model: {
  29969. value: _vm.checkedValue,
  29970. callback: function($$v) {
  29971. _vm.checkedValue = $$v
  29972. },
  29973. expression: "checkedValue"
  29974. }
  29975. }),
  29976. _vm.filterable
  29977. ? _c(
  29978. "el-scrollbar",
  29979. {
  29980. directives: [
  29981. {
  29982. name: "show",
  29983. rawName: "v-show",
  29984. value: _vm.filtering,
  29985. expression: "filtering"
  29986. }
  29987. ],
  29988. ref: "suggestionPanel",
  29989. staticClass: "el-cascader__suggestion-panel",
  29990. attrs: {
  29991. tag: "ul",
  29992. "view-class": "el-cascader__suggestion-list"
  29993. },
  29994. nativeOn: {
  29995. keydown: function($event) {
  29996. return _vm.handleSuggestionKeyDown($event)
  29997. }
  29998. }
  29999. },
  30000. [
  30001. _vm.suggestions.length
  30002. ? _vm._l(_vm.suggestions, function(item, index) {
  30003. return _c(
  30004. "li",
  30005. {
  30006. key: item.uid,
  30007. class: [
  30008. "el-cascader__suggestion-item",
  30009. item.checked && "is-checked"
  30010. ],
  30011. attrs: { tabindex: -1 },
  30012. on: {
  30013. click: function($event) {
  30014. _vm.handleSuggestionClick(index)
  30015. }
  30016. }
  30017. },
  30018. [
  30019. _c("span", [_vm._v(_vm._s(item.text))]),
  30020. item.checked
  30021. ? _c("i", { staticClass: "el-icon-check" })
  30022. : _vm._e()
  30023. ]
  30024. )
  30025. })
  30026. : _vm._t("empty", [
  30027. _c(
  30028. "li",
  30029. { staticClass: "el-cascader__empty-text" },
  30030. [_vm._v(_vm._s(_vm.t("el.cascader.noMatch")))]
  30031. )
  30032. ])
  30033. ],
  30034. 2
  30035. )
  30036. : _vm._e()
  30037. ],
  30038. 1
  30039. )
  30040. ]
  30041. )
  30042. ],
  30043. 1
  30044. )
  30045. }
  30046. var cascadervue_type_template_id_032537a6_staticRenderFns = []
  30047. cascadervue_type_template_id_032537a6_render._withStripped = true
  30048. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
  30049. // EXTERNAL MODULE: external "element-ui/lib/cascader-panel"
  30050. var cascader_panel_ = __webpack_require__(42);
  30051. var cascader_panel_default = /*#__PURE__*/__webpack_require__.n(cascader_panel_);
  30052. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
  30053. var aria_utils_ = __webpack_require__(34);
  30054. var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
  30055. // 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&
  30056. //
  30057. //
  30058. //
  30059. //
  30060. //
  30061. //
  30062. //
  30063. //
  30064. //
  30065. //
  30066. //
  30067. //
  30068. //
  30069. //
  30070. //
  30071. //
  30072. //
  30073. //
  30074. //
  30075. //
  30076. //
  30077. //
  30078. //
  30079. //
  30080. //
  30081. //
  30082. //
  30083. //
  30084. //
  30085. //
  30086. //
  30087. //
  30088. //
  30089. //
  30090. //
  30091. //
  30092. //
  30093. //
  30094. //
  30095. //
  30096. //
  30097. //
  30098. //
  30099. //
  30100. //
  30101. //
  30102. //
  30103. //
  30104. //
  30105. //
  30106. //
  30107. //
  30108. //
  30109. //
  30110. //
  30111. //
  30112. //
  30113. //
  30114. //
  30115. //
  30116. //
  30117. //
  30118. //
  30119. //
  30120. //
  30121. //
  30122. //
  30123. //
  30124. //
  30125. //
  30126. //
  30127. //
  30128. //
  30129. //
  30130. //
  30131. //
  30132. //
  30133. //
  30134. //
  30135. //
  30136. //
  30137. //
  30138. //
  30139. //
  30140. //
  30141. //
  30142. //
  30143. //
  30144. //
  30145. //
  30146. //
  30147. //
  30148. //
  30149. //
  30150. //
  30151. //
  30152. //
  30153. //
  30154. //
  30155. //
  30156. //
  30157. //
  30158. //
  30159. //
  30160. //
  30161. //
  30162. //
  30163. //
  30164. //
  30165. //
  30166. //
  30167. //
  30168. //
  30169. var KeyCode = aria_utils_default.a.keys;
  30170. var MigratingProps = {
  30171. expandTrigger: {
  30172. newProp: 'expandTrigger',
  30173. type: String
  30174. },
  30175. changeOnSelect: {
  30176. newProp: 'checkStrictly',
  30177. type: Boolean
  30178. },
  30179. hoverThreshold: {
  30180. newProp: 'hoverThreshold',
  30181. type: Number
  30182. }
  30183. };
  30184. var PopperMixin = {
  30185. props: {
  30186. placement: {
  30187. type: String,
  30188. default: 'bottom-start'
  30189. },
  30190. appendToBody: vue_popper_default.a.props.appendToBody,
  30191. visibleArrow: {
  30192. type: Boolean,
  30193. default: true
  30194. },
  30195. arrowOffset: vue_popper_default.a.props.arrowOffset,
  30196. offset: vue_popper_default.a.props.offset,
  30197. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  30198. popperOptions: vue_popper_default.a.props.popperOptions
  30199. },
  30200. methods: vue_popper_default.a.methods,
  30201. data: vue_popper_default.a.data,
  30202. beforeDestroy: vue_popper_default.a.beforeDestroy
  30203. };
  30204. var InputSizeMap = {
  30205. medium: 36,
  30206. small: 32,
  30207. mini: 28
  30208. };
  30209. /* harmony default export */ var cascadervue_type_script_lang_js_ = ({
  30210. name: 'ElCascader',
  30211. directives: { Clickoutside: clickoutside_default.a },
  30212. mixins: [PopperMixin, emitter_default.a, locale_default.a, migrating_default.a],
  30213. inject: {
  30214. elForm: {
  30215. default: ''
  30216. },
  30217. elFormItem: {
  30218. default: ''
  30219. }
  30220. },
  30221. components: {
  30222. ElInput: input_default.a,
  30223. ElTag: tag_default.a,
  30224. ElScrollbar: scrollbar_default.a,
  30225. ElCascaderPanel: cascader_panel_default.a
  30226. },
  30227. props: {
  30228. value: {},
  30229. options: Array,
  30230. props: Object,
  30231. size: String,
  30232. placeholder: {
  30233. type: String,
  30234. default: function _default() {
  30235. return Object(lib_locale_["t"])('el.cascader.placeholder');
  30236. }
  30237. },
  30238. disabled: Boolean,
  30239. clearable: Boolean,
  30240. filterable: Boolean,
  30241. filterMethod: Function,
  30242. separator: {
  30243. type: String,
  30244. default: ' / '
  30245. },
  30246. showAllLevels: {
  30247. type: Boolean,
  30248. default: true
  30249. },
  30250. collapseTags: Boolean,
  30251. debounce: {
  30252. type: Number,
  30253. default: 300
  30254. },
  30255. beforeFilter: {
  30256. type: Function,
  30257. default: function _default() {
  30258. return function () {};
  30259. }
  30260. },
  30261. popperClass: String
  30262. },
  30263. data: function data() {
  30264. return {
  30265. dropDownVisible: false,
  30266. checkedValue: this.value,
  30267. inputHover: false,
  30268. inputValue: null,
  30269. presentText: null,
  30270. presentTags: [],
  30271. checkedNodes: [],
  30272. filtering: false,
  30273. suggestions: [],
  30274. inputInitialHeight: 0,
  30275. pressDeleteCount: 0
  30276. };
  30277. },
  30278. computed: {
  30279. realSize: function realSize() {
  30280. var _elFormItemSize = (this.elFormItem || {}).elFormItemSize;
  30281. return this.size || _elFormItemSize || (this.$ELEMENT || {}).size;
  30282. },
  30283. tagSize: function tagSize() {
  30284. return ['small', 'mini'].indexOf(this.realSize) > -1 ? 'mini' : 'small';
  30285. },
  30286. isDisabled: function isDisabled() {
  30287. return this.disabled || (this.elForm || {}).disabled;
  30288. },
  30289. config: function config() {
  30290. var config = this.props || {};
  30291. var $attrs = this.$attrs;
  30292. Object.keys(MigratingProps).forEach(function (oldProp) {
  30293. var _MigratingProps$oldPr = MigratingProps[oldProp],
  30294. newProp = _MigratingProps$oldPr.newProp,
  30295. type = _MigratingProps$oldPr.type;
  30296. var oldValue = $attrs[oldProp] || $attrs[Object(util_["kebabCase"])(oldProp)];
  30297. if (Object(shared_["isDef"])(oldProp) && !Object(shared_["isDef"])(config[newProp])) {
  30298. if (type === Boolean && oldValue === '') {
  30299. oldValue = true;
  30300. }
  30301. config[newProp] = oldValue;
  30302. }
  30303. });
  30304. return config;
  30305. },
  30306. multiple: function multiple() {
  30307. return this.config.multiple;
  30308. },
  30309. leafOnly: function leafOnly() {
  30310. return !this.config.checkStrictly;
  30311. },
  30312. readonly: function readonly() {
  30313. return !this.filterable || this.multiple;
  30314. },
  30315. clearBtnVisible: function clearBtnVisible() {
  30316. if (!this.clearable || this.isDisabled || this.filtering || !this.inputHover) {
  30317. return false;
  30318. }
  30319. return this.multiple ? !!this.checkedNodes.filter(function (node) {
  30320. return !node.isDisabled;
  30321. }).length : !!this.presentText;
  30322. },
  30323. panel: function panel() {
  30324. return this.$refs.panel;
  30325. }
  30326. },
  30327. watch: {
  30328. disabled: function disabled() {
  30329. this.computePresentContent();
  30330. },
  30331. value: function value(val) {
  30332. if (!Object(util_["isEqual"])(val, this.checkedValue)) {
  30333. this.checkedValue = val;
  30334. this.computePresentContent();
  30335. }
  30336. },
  30337. checkedValue: function checkedValue(val) {
  30338. var value = this.value,
  30339. dropDownVisible = this.dropDownVisible;
  30340. var _config = this.config,
  30341. checkStrictly = _config.checkStrictly,
  30342. multiple = _config.multiple;
  30343. if (!Object(util_["isEqual"])(val, value) || Object(types_["isUndefined"])(value)) {
  30344. this.computePresentContent();
  30345. // hide dropdown when single mode
  30346. if (!multiple && !checkStrictly && dropDownVisible) {
  30347. this.toggleDropDownVisible(false);
  30348. }
  30349. this.$emit('input', val);
  30350. this.$emit('change', val);
  30351. this.dispatch('ElFormItem', 'el.form.change', [val]);
  30352. }
  30353. },
  30354. options: {
  30355. handler: function handler() {
  30356. this.$nextTick(this.computePresentContent);
  30357. },
  30358. deep: true
  30359. },
  30360. presentText: function presentText(val) {
  30361. this.inputValue = val;
  30362. },
  30363. presentTags: function presentTags(val, oldVal) {
  30364. if (this.multiple && (val.length || oldVal.length)) {
  30365. this.$nextTick(this.updateStyle);
  30366. }
  30367. },
  30368. filtering: function filtering(val) {
  30369. this.$nextTick(this.updatePopper);
  30370. }
  30371. },
  30372. mounted: function mounted() {
  30373. var _this = this;
  30374. var input = this.$refs.input;
  30375. if (input && input.$el) {
  30376. this.inputInitialHeight = input.$el.offsetHeight || InputSizeMap[this.realSize] || 40;
  30377. }
  30378. if (!this.isEmptyValue(this.value)) {
  30379. this.computePresentContent();
  30380. }
  30381. this.filterHandler = debounce_default()(this.debounce, function () {
  30382. var inputValue = _this.inputValue;
  30383. if (!inputValue) {
  30384. _this.filtering = false;
  30385. return;
  30386. }
  30387. var before = _this.beforeFilter(inputValue);
  30388. if (before && before.then) {
  30389. before.then(_this.getSuggestions);
  30390. } else if (before !== false) {
  30391. _this.getSuggestions();
  30392. } else {
  30393. _this.filtering = false;
  30394. }
  30395. });
  30396. Object(resize_event_["addResizeListener"])(this.$el, this.updateStyle);
  30397. },
  30398. beforeDestroy: function beforeDestroy() {
  30399. Object(resize_event_["removeResizeListener"])(this.$el, this.updateStyle);
  30400. },
  30401. methods: {
  30402. getMigratingConfig: function getMigratingConfig() {
  30403. return {
  30404. props: {
  30405. 'expand-trigger': 'expand-trigger is removed, use `props.expandTrigger` instead.',
  30406. 'change-on-select': 'change-on-select is removed, use `props.checkStrictly` instead.',
  30407. 'hover-threshold': 'hover-threshold is removed, use `props.hoverThreshold` instead'
  30408. },
  30409. events: {
  30410. 'active-item-change': 'active-item-change is renamed to expand-change'
  30411. }
  30412. };
  30413. },
  30414. toggleDropDownVisible: function toggleDropDownVisible(visible) {
  30415. var _this2 = this;
  30416. if (this.isDisabled) return;
  30417. var dropDownVisible = this.dropDownVisible;
  30418. var input = this.$refs.input;
  30419. visible = Object(shared_["isDef"])(visible) ? visible : !dropDownVisible;
  30420. if (visible !== dropDownVisible) {
  30421. this.dropDownVisible = visible;
  30422. if (visible) {
  30423. this.$nextTick(function () {
  30424. _this2.updatePopper();
  30425. _this2.panel.scrollIntoView();
  30426. });
  30427. }
  30428. input.$refs.input.setAttribute('aria-expanded', visible);
  30429. this.$emit('visible-change', visible);
  30430. }
  30431. },
  30432. handleDropdownLeave: function handleDropdownLeave() {
  30433. this.filtering = false;
  30434. this.inputValue = this.presentText;
  30435. this.doDestroy();
  30436. },
  30437. handleKeyDown: function handleKeyDown(event) {
  30438. switch (event.keyCode) {
  30439. case KeyCode.enter:
  30440. this.toggleDropDownVisible();
  30441. break;
  30442. case KeyCode.down:
  30443. this.toggleDropDownVisible(true);
  30444. this.focusFirstNode();
  30445. event.preventDefault();
  30446. break;
  30447. case KeyCode.esc:
  30448. case KeyCode.tab:
  30449. this.toggleDropDownVisible(false);
  30450. break;
  30451. }
  30452. },
  30453. handleFocus: function handleFocus(e) {
  30454. this.$emit('focus', e);
  30455. },
  30456. handleBlur: function handleBlur(e) {
  30457. this.$emit('blur', e);
  30458. },
  30459. handleInput: function handleInput(val, event) {
  30460. !this.dropDownVisible && this.toggleDropDownVisible(true);
  30461. if (event && event.isComposing) return;
  30462. if (val) {
  30463. this.filterHandler();
  30464. } else {
  30465. this.filtering = false;
  30466. }
  30467. },
  30468. handleClear: function handleClear() {
  30469. this.presentText = '';
  30470. this.panel.clearCheckedNodes();
  30471. },
  30472. handleExpandChange: function handleExpandChange(value) {
  30473. this.$nextTick(this.updatePopper.bind(this));
  30474. this.$emit('expand-change', value);
  30475. this.$emit('active-item-change', value); // Deprecated
  30476. },
  30477. focusFirstNode: function focusFirstNode() {
  30478. var _this3 = this;
  30479. this.$nextTick(function () {
  30480. var filtering = _this3.filtering;
  30481. var _$refs = _this3.$refs,
  30482. popper = _$refs.popper,
  30483. suggestionPanel = _$refs.suggestionPanel;
  30484. var firstNode = null;
  30485. if (filtering && suggestionPanel) {
  30486. firstNode = suggestionPanel.$el.querySelector('.el-cascader__suggestion-item');
  30487. } else {
  30488. var firstMenu = popper.querySelector('.el-cascader-menu');
  30489. firstNode = firstMenu.querySelector('.el-cascader-node[tabindex="-1"]');
  30490. }
  30491. if (firstNode) {
  30492. firstNode.focus();
  30493. !filtering && firstNode.click();
  30494. }
  30495. });
  30496. },
  30497. computePresentContent: function computePresentContent() {
  30498. var _this4 = this;
  30499. // nextTick is required, because checked nodes may not change right now
  30500. this.$nextTick(function () {
  30501. if (_this4.config.multiple) {
  30502. _this4.computePresentTags();
  30503. _this4.presentText = _this4.presentTags.length ? ' ' : null;
  30504. } else {
  30505. _this4.computePresentText();
  30506. }
  30507. });
  30508. },
  30509. isEmptyValue: function isEmptyValue(val) {
  30510. var multiple = this.multiple;
  30511. var emitPath = this.panel.config.emitPath;
  30512. if (multiple || emitPath) {
  30513. return Object(util_["isEmpty"])(val);
  30514. }
  30515. return false;
  30516. },
  30517. computePresentText: function computePresentText() {
  30518. var checkedValue = this.checkedValue,
  30519. config = this.config;
  30520. if (!this.isEmptyValue(checkedValue)) {
  30521. var node = this.panel.getNodeByValue(checkedValue);
  30522. if (node && (config.checkStrictly || node.isLeaf)) {
  30523. this.presentText = node.getText(this.showAllLevels, this.separator);
  30524. return;
  30525. }
  30526. }
  30527. this.presentText = null;
  30528. },
  30529. computePresentTags: function computePresentTags() {
  30530. var isDisabled = this.isDisabled,
  30531. leafOnly = this.leafOnly,
  30532. showAllLevels = this.showAllLevels,
  30533. separator = this.separator,
  30534. collapseTags = this.collapseTags;
  30535. var checkedNodes = this.getCheckedNodes(leafOnly);
  30536. var tags = [];
  30537. var genTag = function genTag(node) {
  30538. return {
  30539. node: node,
  30540. key: node.uid,
  30541. text: node.getText(showAllLevels, separator),
  30542. hitState: false,
  30543. closable: !isDisabled && !node.isDisabled
  30544. };
  30545. };
  30546. if (checkedNodes.length) {
  30547. var first = checkedNodes[0],
  30548. rest = checkedNodes.slice(1);
  30549. var restCount = rest.length;
  30550. tags.push(genTag(first));
  30551. if (restCount) {
  30552. if (collapseTags) {
  30553. tags.push({
  30554. key: -1,
  30555. text: '+ ' + restCount,
  30556. closable: false
  30557. });
  30558. } else {
  30559. rest.forEach(function (node) {
  30560. return tags.push(genTag(node));
  30561. });
  30562. }
  30563. }
  30564. }
  30565. this.checkedNodes = checkedNodes;
  30566. this.presentTags = tags;
  30567. },
  30568. getSuggestions: function getSuggestions() {
  30569. var _this5 = this;
  30570. var filterMethod = this.filterMethod;
  30571. if (!Object(types_["isFunction"])(filterMethod)) {
  30572. filterMethod = function filterMethod(node, keyword) {
  30573. return node.text.includes(keyword);
  30574. };
  30575. }
  30576. var suggestions = this.panel.getFlattedNodes(this.leafOnly).filter(function (node) {
  30577. if (node.isDisabled) return false;
  30578. node.text = node.getText(_this5.showAllLevels, _this5.separator) || '';
  30579. return filterMethod(node, _this5.inputValue);
  30580. });
  30581. if (this.multiple) {
  30582. this.presentTags.forEach(function (tag) {
  30583. tag.hitState = false;
  30584. });
  30585. } else {
  30586. suggestions.forEach(function (node) {
  30587. node.checked = Object(util_["isEqual"])(_this5.checkedValue, node.getValueByOption());
  30588. });
  30589. }
  30590. this.filtering = true;
  30591. this.suggestions = suggestions;
  30592. this.$nextTick(this.updatePopper);
  30593. },
  30594. handleSuggestionKeyDown: function handleSuggestionKeyDown(event) {
  30595. var keyCode = event.keyCode,
  30596. target = event.target;
  30597. switch (keyCode) {
  30598. case KeyCode.enter:
  30599. target.click();
  30600. break;
  30601. case KeyCode.up:
  30602. var prev = target.previousElementSibling;
  30603. prev && prev.focus();
  30604. break;
  30605. case KeyCode.down:
  30606. var next = target.nextElementSibling;
  30607. next && next.focus();
  30608. break;
  30609. case KeyCode.esc:
  30610. case KeyCode.tab:
  30611. this.toggleDropDownVisible(false);
  30612. break;
  30613. }
  30614. },
  30615. handleDelete: function handleDelete() {
  30616. var inputValue = this.inputValue,
  30617. pressDeleteCount = this.pressDeleteCount,
  30618. presentTags = this.presentTags;
  30619. var lastIndex = presentTags.length - 1;
  30620. var lastTag = presentTags[lastIndex];
  30621. this.pressDeleteCount = inputValue ? 0 : pressDeleteCount + 1;
  30622. if (!lastTag) return;
  30623. if (this.pressDeleteCount) {
  30624. if (lastTag.hitState) {
  30625. this.deleteTag(lastTag);
  30626. } else {
  30627. lastTag.hitState = true;
  30628. }
  30629. }
  30630. },
  30631. handleSuggestionClick: function handleSuggestionClick(index) {
  30632. var multiple = this.multiple;
  30633. var targetNode = this.suggestions[index];
  30634. if (multiple) {
  30635. var checked = targetNode.checked;
  30636. targetNode.doCheck(!checked);
  30637. this.panel.calculateMultiCheckedValue();
  30638. } else {
  30639. this.checkedValue = targetNode.getValueByOption();
  30640. this.toggleDropDownVisible(false);
  30641. }
  30642. },
  30643. deleteTag: function deleteTag(tag) {
  30644. var checkedValue = this.checkedValue;
  30645. var current = tag.node.getValueByOption();
  30646. var val = checkedValue.find(function (n) {
  30647. return Object(util_["isEqual"])(n, current);
  30648. });
  30649. this.checkedValue = checkedValue.filter(function (n) {
  30650. return !Object(util_["isEqual"])(n, current);
  30651. });
  30652. this.$emit('remove-tag', val);
  30653. },
  30654. updateStyle: function updateStyle() {
  30655. var $el = this.$el,
  30656. inputInitialHeight = this.inputInitialHeight;
  30657. if (this.$isServer || !$el) return;
  30658. var suggestionPanel = this.$refs.suggestionPanel;
  30659. var inputInner = $el.querySelector('.el-input__inner');
  30660. if (!inputInner) return;
  30661. var tags = $el.querySelector('.el-cascader__tags');
  30662. var suggestionPanelEl = null;
  30663. if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
  30664. var suggestionList = suggestionPanelEl.querySelector('.el-cascader__suggestion-list');
  30665. suggestionList.style.minWidth = inputInner.offsetWidth + 'px';
  30666. }
  30667. if (tags) {
  30668. var offsetHeight = Math.round(tags.getBoundingClientRect().height);
  30669. var height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
  30670. inputInner.style.height = height;
  30671. if (this.dropDownVisible) {
  30672. this.updatePopper();
  30673. }
  30674. }
  30675. },
  30676. /**
  30677. * public methods
  30678. */
  30679. getCheckedNodes: function getCheckedNodes(leafOnly) {
  30680. return this.panel.getCheckedNodes(leafOnly);
  30681. }
  30682. }
  30683. });
  30684. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=script&lang=js&
  30685. /* harmony default export */ var src_cascadervue_type_script_lang_js_ = (cascadervue_type_script_lang_js_);
  30686. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue
  30687. /* normalize component */
  30688. var cascader_component = normalizeComponent(
  30689. src_cascadervue_type_script_lang_js_,
  30690. cascadervue_type_template_id_032537a6_render,
  30691. cascadervue_type_template_id_032537a6_staticRenderFns,
  30692. false,
  30693. null,
  30694. null,
  30695. null
  30696. )
  30697. /* hot reload */
  30698. if (false) { var cascader_api; }
  30699. cascader_component.options.__file = "packages/cascader/src/cascader.vue"
  30700. /* harmony default export */ var cascader = (cascader_component.exports);
  30701. // CONCATENATED MODULE: ./packages/cascader/index.js
  30702. /* istanbul ignore next */
  30703. cascader.install = function (Vue) {
  30704. Vue.component(cascader.name, cascader);
  30705. };
  30706. /* harmony default export */ var packages_cascader = (cascader);
  30707. // 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&
  30708. var mainvue_type_template_id_55c8ade7_render = function() {
  30709. var _vm = this
  30710. var _h = _vm.$createElement
  30711. var _c = _vm._self._c || _h
  30712. return _c(
  30713. "div",
  30714. {
  30715. directives: [
  30716. {
  30717. name: "clickoutside",
  30718. rawName: "v-clickoutside",
  30719. value: _vm.hide,
  30720. expression: "hide"
  30721. }
  30722. ],
  30723. class: [
  30724. "el-color-picker",
  30725. _vm.colorDisabled ? "is-disabled" : "",
  30726. _vm.colorSize ? "el-color-picker--" + _vm.colorSize : ""
  30727. ]
  30728. },
  30729. [
  30730. _vm.colorDisabled
  30731. ? _c("div", { staticClass: "el-color-picker__mask" })
  30732. : _vm._e(),
  30733. _c(
  30734. "div",
  30735. {
  30736. staticClass: "el-color-picker__trigger",
  30737. on: { click: _vm.handleTrigger }
  30738. },
  30739. [
  30740. _c(
  30741. "span",
  30742. {
  30743. staticClass: "el-color-picker__color",
  30744. class: { "is-alpha": _vm.showAlpha }
  30745. },
  30746. [
  30747. _c("span", {
  30748. staticClass: "el-color-picker__color-inner",
  30749. style: {
  30750. backgroundColor: _vm.displayedColor
  30751. }
  30752. }),
  30753. !_vm.value && !_vm.showPanelColor
  30754. ? _c("span", {
  30755. staticClass: "el-color-picker__empty el-icon-close"
  30756. })
  30757. : _vm._e()
  30758. ]
  30759. ),
  30760. _c("span", {
  30761. directives: [
  30762. {
  30763. name: "show",
  30764. rawName: "v-show",
  30765. value: _vm.value || _vm.showPanelColor,
  30766. expression: "value || showPanelColor"
  30767. }
  30768. ],
  30769. staticClass: "el-color-picker__icon el-icon-arrow-down"
  30770. })
  30771. ]
  30772. ),
  30773. _c("picker-dropdown", {
  30774. ref: "dropdown",
  30775. class: ["el-color-picker__panel", _vm.popperClass || ""],
  30776. attrs: {
  30777. color: _vm.color,
  30778. "show-alpha": _vm.showAlpha,
  30779. predefine: _vm.predefine
  30780. },
  30781. on: { pick: _vm.confirmValue, clear: _vm.clearValue },
  30782. model: {
  30783. value: _vm.showPicker,
  30784. callback: function($$v) {
  30785. _vm.showPicker = $$v
  30786. },
  30787. expression: "showPicker"
  30788. }
  30789. })
  30790. ],
  30791. 1
  30792. )
  30793. }
  30794. var mainvue_type_template_id_55c8ade7_staticRenderFns = []
  30795. mainvue_type_template_id_55c8ade7_render._withStripped = true
  30796. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  30797. // CONCATENATED MODULE: ./packages/color-picker/src/color.js
  30798. 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; };
  30799. function color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30800. var hsv2hsl = function hsv2hsl(hue, sat, val) {
  30801. return [hue, sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0, hue / 2];
  30802. };
  30803. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  30804. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  30805. var isOnePointZero = function isOnePointZero(n) {
  30806. return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
  30807. };
  30808. var isPercentage = function isPercentage(n) {
  30809. return typeof n === 'string' && n.indexOf('%') !== -1;
  30810. };
  30811. // Take input from [0, n] and return it as [0, 1]
  30812. var bound01 = function bound01(value, max) {
  30813. if (isOnePointZero(value)) value = '100%';
  30814. var processPercent = isPercentage(value);
  30815. value = Math.min(max, Math.max(0, parseFloat(value)));
  30816. // Automatically convert percentage into number
  30817. if (processPercent) {
  30818. value = parseInt(value * max, 10) / 100;
  30819. }
  30820. // Handle floating point rounding errors
  30821. if (Math.abs(value - max) < 0.000001) {
  30822. return 1;
  30823. }
  30824. // Convert into [0, 1] range if it isn't already
  30825. return value % max / parseFloat(max);
  30826. };
  30827. var INT_HEX_MAP = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' };
  30828. var toHex = function toHex(_ref) {
  30829. var r = _ref.r,
  30830. g = _ref.g,
  30831. b = _ref.b;
  30832. var hexOne = function hexOne(value) {
  30833. value = Math.min(Math.round(value), 255);
  30834. var high = Math.floor(value / 16);
  30835. var low = value % 16;
  30836. return '' + (INT_HEX_MAP[high] || high) + (INT_HEX_MAP[low] || low);
  30837. };
  30838. if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
  30839. return '#' + hexOne(r) + hexOne(g) + hexOne(b);
  30840. };
  30841. var HEX_INT_MAP = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 };
  30842. var parseHexChannel = function parseHexChannel(hex) {
  30843. if (hex.length === 2) {
  30844. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  30845. }
  30846. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  30847. };
  30848. var hsl2hsv = function hsl2hsv(hue, sat, light) {
  30849. sat = sat / 100;
  30850. light = light / 100;
  30851. var smin = sat;
  30852. var lmin = Math.max(light, 0.01);
  30853. var sv = void 0;
  30854. var v = void 0;
  30855. light *= 2;
  30856. sat *= light <= 1 ? light : 2 - light;
  30857. smin *= lmin <= 1 ? lmin : 2 - lmin;
  30858. v = (light + sat) / 2;
  30859. sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  30860. return {
  30861. h: hue,
  30862. s: sv * 100,
  30863. v: v * 100
  30864. };
  30865. };
  30866. // `rgbToHsv`
  30867. // Converts an RGB color value to HSV
  30868. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  30869. // *Returns:* { h, s, v } in [0,1]
  30870. var rgb2hsv = function rgb2hsv(r, g, b) {
  30871. r = bound01(r, 255);
  30872. g = bound01(g, 255);
  30873. b = bound01(b, 255);
  30874. var max = Math.max(r, g, b);
  30875. var min = Math.min(r, g, b);
  30876. var h = void 0,
  30877. s = void 0;
  30878. var v = max;
  30879. var d = max - min;
  30880. s = max === 0 ? 0 : d / max;
  30881. if (max === min) {
  30882. h = 0; // achromatic
  30883. } else {
  30884. switch (max) {
  30885. case r:
  30886. h = (g - b) / d + (g < b ? 6 : 0);
  30887. break;
  30888. case g:
  30889. h = (b - r) / d + 2;
  30890. break;
  30891. case b:
  30892. h = (r - g) / d + 4;
  30893. break;
  30894. }
  30895. h /= 6;
  30896. }
  30897. return { h: h * 360, s: s * 100, v: v * 100 };
  30898. };
  30899. // `hsvToRgb`
  30900. // Converts an HSV color value to RGB.
  30901. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  30902. // *Returns:* { r, g, b } in the set [0, 255]
  30903. var hsv2rgb = function hsv2rgb(h, s, v) {
  30904. h = bound01(h, 360) * 6;
  30905. s = bound01(s, 100);
  30906. v = bound01(v, 100);
  30907. var i = Math.floor(h);
  30908. var f = h - i;
  30909. var p = v * (1 - s);
  30910. var q = v * (1 - f * s);
  30911. var t = v * (1 - (1 - f) * s);
  30912. var mod = i % 6;
  30913. var r = [v, q, p, p, t, v][mod];
  30914. var g = [t, v, v, q, p, p][mod];
  30915. var b = [p, p, t, v, v, q][mod];
  30916. return {
  30917. r: Math.round(r * 255),
  30918. g: Math.round(g * 255),
  30919. b: Math.round(b * 255)
  30920. };
  30921. };
  30922. var Color = function () {
  30923. function Color(options) {
  30924. color_classCallCheck(this, Color);
  30925. this._hue = 0;
  30926. this._saturation = 100;
  30927. this._value = 100;
  30928. this._alpha = 100;
  30929. this.enableAlpha = false;
  30930. this.format = 'hex';
  30931. this.value = '';
  30932. options = options || {};
  30933. for (var option in options) {
  30934. if (options.hasOwnProperty(option)) {
  30935. this[option] = options[option];
  30936. }
  30937. }
  30938. this.doOnChange();
  30939. }
  30940. Color.prototype.set = function set(prop, value) {
  30941. if (arguments.length === 1 && (typeof prop === 'undefined' ? 'undefined' : color_typeof(prop)) === 'object') {
  30942. for (var p in prop) {
  30943. if (prop.hasOwnProperty(p)) {
  30944. this.set(p, prop[p]);
  30945. }
  30946. }
  30947. return;
  30948. }
  30949. this['_' + prop] = value;
  30950. this.doOnChange();
  30951. };
  30952. Color.prototype.get = function get(prop) {
  30953. return this['_' + prop];
  30954. };
  30955. Color.prototype.toRgb = function toRgb() {
  30956. return hsv2rgb(this._hue, this._saturation, this._value);
  30957. };
  30958. Color.prototype.fromString = function fromString(value) {
  30959. var _this = this;
  30960. if (!value) {
  30961. this._hue = 0;
  30962. this._saturation = 100;
  30963. this._value = 100;
  30964. this.doOnChange();
  30965. return;
  30966. }
  30967. var fromHSV = function fromHSV(h, s, v) {
  30968. _this._hue = Math.max(0, Math.min(360, h));
  30969. _this._saturation = Math.max(0, Math.min(100, s));
  30970. _this._value = Math.max(0, Math.min(100, v));
  30971. _this.doOnChange();
  30972. };
  30973. if (value.indexOf('hsl') !== -1) {
  30974. var parts = value.replace(/hsla|hsl|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  30975. return val !== '';
  30976. }).map(function (val, index) {
  30977. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  30978. });
  30979. if (parts.length === 4) {
  30980. this._alpha = Math.floor(parseFloat(parts[3]) * 100);
  30981. } else if (parts.length === 3) {
  30982. this._alpha = 100;
  30983. }
  30984. if (parts.length >= 3) {
  30985. var _hsl2hsv = hsl2hsv(parts[0], parts[1], parts[2]),
  30986. h = _hsl2hsv.h,
  30987. s = _hsl2hsv.s,
  30988. v = _hsl2hsv.v;
  30989. fromHSV(h, s, v);
  30990. }
  30991. } else if (value.indexOf('hsv') !== -1) {
  30992. var _parts = value.replace(/hsva|hsv|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  30993. return val !== '';
  30994. }).map(function (val, index) {
  30995. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  30996. });
  30997. if (_parts.length === 4) {
  30998. this._alpha = Math.floor(parseFloat(_parts[3]) * 100);
  30999. } else if (_parts.length === 3) {
  31000. this._alpha = 100;
  31001. }
  31002. if (_parts.length >= 3) {
  31003. fromHSV(_parts[0], _parts[1], _parts[2]);
  31004. }
  31005. } else if (value.indexOf('rgb') !== -1) {
  31006. var _parts2 = value.replace(/rgba|rgb|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31007. return val !== '';
  31008. }).map(function (val, index) {
  31009. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31010. });
  31011. if (_parts2.length === 4) {
  31012. this._alpha = Math.floor(parseFloat(_parts2[3]) * 100);
  31013. } else if (_parts2.length === 3) {
  31014. this._alpha = 100;
  31015. }
  31016. if (_parts2.length >= 3) {
  31017. var _rgb2hsv = rgb2hsv(_parts2[0], _parts2[1], _parts2[2]),
  31018. _h = _rgb2hsv.h,
  31019. _s = _rgb2hsv.s,
  31020. _v = _rgb2hsv.v;
  31021. fromHSV(_h, _s, _v);
  31022. }
  31023. } else if (value.indexOf('#') !== -1) {
  31024. var hex = value.replace('#', '').trim();
  31025. if (!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(hex)) return;
  31026. var r = void 0,
  31027. g = void 0,
  31028. b = void 0;
  31029. if (hex.length === 3) {
  31030. r = parseHexChannel(hex[0] + hex[0]);
  31031. g = parseHexChannel(hex[1] + hex[1]);
  31032. b = parseHexChannel(hex[2] + hex[2]);
  31033. } else if (hex.length === 6 || hex.length === 8) {
  31034. r = parseHexChannel(hex.substring(0, 2));
  31035. g = parseHexChannel(hex.substring(2, 4));
  31036. b = parseHexChannel(hex.substring(4, 6));
  31037. }
  31038. if (hex.length === 8) {
  31039. this._alpha = Math.floor(parseHexChannel(hex.substring(6)) / 255 * 100);
  31040. } else if (hex.length === 3 || hex.length === 6) {
  31041. this._alpha = 100;
  31042. }
  31043. var _rgb2hsv2 = rgb2hsv(r, g, b),
  31044. _h2 = _rgb2hsv2.h,
  31045. _s2 = _rgb2hsv2.s,
  31046. _v2 = _rgb2hsv2.v;
  31047. fromHSV(_h2, _s2, _v2);
  31048. }
  31049. };
  31050. Color.prototype.compare = function compare(color) {
  31051. 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;
  31052. };
  31053. Color.prototype.doOnChange = function doOnChange() {
  31054. var _hue = this._hue,
  31055. _saturation = this._saturation,
  31056. _value = this._value,
  31057. _alpha = this._alpha,
  31058. format = this.format;
  31059. if (this.enableAlpha) {
  31060. switch (format) {
  31061. case 'hsl':
  31062. var hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31063. this.value = 'hsla(' + _hue + ', ' + Math.round(hsl[1] * 100) + '%, ' + Math.round(hsl[2] * 100) + '%, ' + _alpha / 100 + ')';
  31064. break;
  31065. case 'hsv':
  31066. this.value = 'hsva(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%, ' + _alpha / 100 + ')';
  31067. break;
  31068. default:
  31069. var _hsv2rgb = hsv2rgb(_hue, _saturation, _value),
  31070. r = _hsv2rgb.r,
  31071. g = _hsv2rgb.g,
  31072. b = _hsv2rgb.b;
  31073. this.value = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + _alpha / 100 + ')';
  31074. }
  31075. } else {
  31076. switch (format) {
  31077. case 'hsl':
  31078. var _hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31079. this.value = 'hsl(' + _hue + ', ' + Math.round(_hsl[1] * 100) + '%, ' + Math.round(_hsl[2] * 100) + '%)';
  31080. break;
  31081. case 'hsv':
  31082. this.value = 'hsv(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%)';
  31083. break;
  31084. case 'rgb':
  31085. var _hsv2rgb2 = hsv2rgb(_hue, _saturation, _value),
  31086. _r = _hsv2rgb2.r,
  31087. _g = _hsv2rgb2.g,
  31088. _b = _hsv2rgb2.b;
  31089. this.value = 'rgb(' + _r + ', ' + _g + ', ' + _b + ')';
  31090. break;
  31091. default:
  31092. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  31093. }
  31094. }
  31095. };
  31096. return Color;
  31097. }();
  31098. /* harmony default export */ var src_color = (Color);
  31099. ;
  31100. // 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&
  31101. var picker_dropdownvue_type_template_id_06601625_render = function() {
  31102. var _vm = this
  31103. var _h = _vm.$createElement
  31104. var _c = _vm._self._c || _h
  31105. return _c(
  31106. "transition",
  31107. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  31108. [
  31109. _c(
  31110. "div",
  31111. {
  31112. directives: [
  31113. {
  31114. name: "show",
  31115. rawName: "v-show",
  31116. value: _vm.showPopper,
  31117. expression: "showPopper"
  31118. }
  31119. ],
  31120. staticClass: "el-color-dropdown"
  31121. },
  31122. [
  31123. _c(
  31124. "div",
  31125. { staticClass: "el-color-dropdown__main-wrapper" },
  31126. [
  31127. _c("hue-slider", {
  31128. ref: "hue",
  31129. staticStyle: { float: "right" },
  31130. attrs: { color: _vm.color, vertical: "" }
  31131. }),
  31132. _c("sv-panel", { ref: "sl", attrs: { color: _vm.color } })
  31133. ],
  31134. 1
  31135. ),
  31136. _vm.showAlpha
  31137. ? _c("alpha-slider", { ref: "alpha", attrs: { color: _vm.color } })
  31138. : _vm._e(),
  31139. _vm.predefine
  31140. ? _c("predefine", {
  31141. attrs: { color: _vm.color, colors: _vm.predefine }
  31142. })
  31143. : _vm._e(),
  31144. _c(
  31145. "div",
  31146. { staticClass: "el-color-dropdown__btns" },
  31147. [
  31148. _c(
  31149. "span",
  31150. { staticClass: "el-color-dropdown__value" },
  31151. [
  31152. _c("el-input", {
  31153. attrs: { "validate-event": false, size: "mini" },
  31154. on: { blur: _vm.handleConfirm },
  31155. nativeOn: {
  31156. keyup: function($event) {
  31157. if (
  31158. !("button" in $event) &&
  31159. _vm._k(
  31160. $event.keyCode,
  31161. "enter",
  31162. 13,
  31163. $event.key,
  31164. "Enter"
  31165. )
  31166. ) {
  31167. return null
  31168. }
  31169. return _vm.handleConfirm($event)
  31170. }
  31171. },
  31172. model: {
  31173. value: _vm.customInput,
  31174. callback: function($$v) {
  31175. _vm.customInput = $$v
  31176. },
  31177. expression: "customInput"
  31178. }
  31179. })
  31180. ],
  31181. 1
  31182. ),
  31183. _c(
  31184. "el-button",
  31185. {
  31186. staticClass: "el-color-dropdown__link-btn",
  31187. attrs: { size: "mini", type: "text" },
  31188. on: {
  31189. click: function($event) {
  31190. _vm.$emit("clear")
  31191. }
  31192. }
  31193. },
  31194. [
  31195. _vm._v(
  31196. "\n " +
  31197. _vm._s(_vm.t("el.colorpicker.clear")) +
  31198. "\n "
  31199. )
  31200. ]
  31201. ),
  31202. _c(
  31203. "el-button",
  31204. {
  31205. staticClass: "el-color-dropdown__btn",
  31206. attrs: { plain: "", size: "mini" },
  31207. on: { click: _vm.confirmValue }
  31208. },
  31209. [
  31210. _vm._v(
  31211. "\n " +
  31212. _vm._s(_vm.t("el.colorpicker.confirm")) +
  31213. "\n "
  31214. )
  31215. ]
  31216. )
  31217. ],
  31218. 1
  31219. )
  31220. ],
  31221. 1
  31222. )
  31223. ]
  31224. )
  31225. }
  31226. var picker_dropdownvue_type_template_id_06601625_staticRenderFns = []
  31227. picker_dropdownvue_type_template_id_06601625_render._withStripped = true
  31228. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  31229. // 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&
  31230. var sv_panelvue_type_template_id_d8583596_render = function() {
  31231. var _vm = this
  31232. var _h = _vm.$createElement
  31233. var _c = _vm._self._c || _h
  31234. return _c(
  31235. "div",
  31236. {
  31237. staticClass: "el-color-svpanel",
  31238. style: {
  31239. backgroundColor: _vm.background
  31240. }
  31241. },
  31242. [
  31243. _c("div", { staticClass: "el-color-svpanel__white" }),
  31244. _c("div", { staticClass: "el-color-svpanel__black" }),
  31245. _c(
  31246. "div",
  31247. {
  31248. staticClass: "el-color-svpanel__cursor",
  31249. style: {
  31250. top: _vm.cursorTop + "px",
  31251. left: _vm.cursorLeft + "px"
  31252. }
  31253. },
  31254. [_c("div")]
  31255. )
  31256. ]
  31257. )
  31258. }
  31259. var sv_panelvue_type_template_id_d8583596_staticRenderFns = []
  31260. sv_panelvue_type_template_id_d8583596_render._withStripped = true
  31261. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  31262. // CONCATENATED MODULE: ./packages/color-picker/src/draggable.js
  31263. var isDragging = false;
  31264. /* harmony default export */ var draggable = (function (element, options) {
  31265. if (external_vue_default.a.prototype.$isServer) return;
  31266. var moveFn = function moveFn(event) {
  31267. if (options.drag) {
  31268. options.drag(event);
  31269. }
  31270. };
  31271. var upFn = function upFn(event) {
  31272. document.removeEventListener('mousemove', moveFn);
  31273. document.removeEventListener('mouseup', upFn);
  31274. document.onselectstart = null;
  31275. document.ondragstart = null;
  31276. isDragging = false;
  31277. if (options.end) {
  31278. options.end(event);
  31279. }
  31280. };
  31281. element.addEventListener('mousedown', function (event) {
  31282. if (isDragging) return;
  31283. document.onselectstart = function () {
  31284. return false;
  31285. };
  31286. document.ondragstart = function () {
  31287. return false;
  31288. };
  31289. document.addEventListener('mousemove', moveFn);
  31290. document.addEventListener('mouseup', upFn);
  31291. isDragging = true;
  31292. if (options.start) {
  31293. options.start(event);
  31294. }
  31295. });
  31296. });
  31297. // 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&
  31298. //
  31299. //
  31300. //
  31301. //
  31302. //
  31303. //
  31304. //
  31305. //
  31306. //
  31307. //
  31308. //
  31309. //
  31310. //
  31311. //
  31312. //
  31313. //
  31314. //
  31315. /* harmony default export */ var sv_panelvue_type_script_lang_js_ = ({
  31316. name: 'el-sl-panel',
  31317. props: {
  31318. color: {
  31319. required: true
  31320. }
  31321. },
  31322. computed: {
  31323. colorValue: function colorValue() {
  31324. var hue = this.color.get('hue');
  31325. var value = this.color.get('value');
  31326. return { hue: hue, value: value };
  31327. }
  31328. },
  31329. watch: {
  31330. colorValue: function colorValue() {
  31331. this.update();
  31332. }
  31333. },
  31334. methods: {
  31335. update: function update() {
  31336. var saturation = this.color.get('saturation');
  31337. var value = this.color.get('value');
  31338. var el = this.$el;
  31339. var width = el.clientWidth,
  31340. height = el.clientHeight;
  31341. this.cursorLeft = saturation * width / 100;
  31342. this.cursorTop = (100 - value) * height / 100;
  31343. this.background = 'hsl(' + this.color.get('hue') + ', 100%, 50%)';
  31344. },
  31345. handleDrag: function handleDrag(event) {
  31346. var el = this.$el;
  31347. var rect = el.getBoundingClientRect();
  31348. var left = event.clientX - rect.left;
  31349. var top = event.clientY - rect.top;
  31350. left = Math.max(0, left);
  31351. left = Math.min(left, rect.width);
  31352. top = Math.max(0, top);
  31353. top = Math.min(top, rect.height);
  31354. this.cursorLeft = left;
  31355. this.cursorTop = top;
  31356. this.color.set({
  31357. saturation: left / rect.width * 100,
  31358. value: 100 - top / rect.height * 100
  31359. });
  31360. }
  31361. },
  31362. mounted: function mounted() {
  31363. var _this = this;
  31364. draggable(this.$el, {
  31365. drag: function drag(event) {
  31366. _this.handleDrag(event);
  31367. },
  31368. end: function end(event) {
  31369. _this.handleDrag(event);
  31370. }
  31371. });
  31372. this.update();
  31373. },
  31374. data: function data() {
  31375. return {
  31376. cursorTop: 0,
  31377. cursorLeft: 0,
  31378. background: 'hsl(0, 100%, 50%)'
  31379. };
  31380. }
  31381. });
  31382. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  31383. /* harmony default export */ var components_sv_panelvue_type_script_lang_js_ = (sv_panelvue_type_script_lang_js_);
  31384. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue
  31385. /* normalize component */
  31386. var sv_panel_component = normalizeComponent(
  31387. components_sv_panelvue_type_script_lang_js_,
  31388. sv_panelvue_type_template_id_d8583596_render,
  31389. sv_panelvue_type_template_id_d8583596_staticRenderFns,
  31390. false,
  31391. null,
  31392. null,
  31393. null
  31394. )
  31395. /* hot reload */
  31396. if (false) { var sv_panel_api; }
  31397. sv_panel_component.options.__file = "packages/color-picker/src/components/sv-panel.vue"
  31398. /* harmony default export */ var sv_panel = (sv_panel_component.exports);
  31399. // 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&
  31400. var hue_slidervue_type_template_id_5cdc43b1_render = function() {
  31401. var _vm = this
  31402. var _h = _vm.$createElement
  31403. var _c = _vm._self._c || _h
  31404. return _c(
  31405. "div",
  31406. {
  31407. staticClass: "el-color-hue-slider",
  31408. class: { "is-vertical": _vm.vertical }
  31409. },
  31410. [
  31411. _c("div", {
  31412. ref: "bar",
  31413. staticClass: "el-color-hue-slider__bar",
  31414. on: { click: _vm.handleClick }
  31415. }),
  31416. _c("div", {
  31417. ref: "thumb",
  31418. staticClass: "el-color-hue-slider__thumb",
  31419. style: {
  31420. left: _vm.thumbLeft + "px",
  31421. top: _vm.thumbTop + "px"
  31422. }
  31423. })
  31424. ]
  31425. )
  31426. }
  31427. var hue_slidervue_type_template_id_5cdc43b1_staticRenderFns = []
  31428. hue_slidervue_type_template_id_5cdc43b1_render._withStripped = true
  31429. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  31430. // 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&
  31431. //
  31432. //
  31433. //
  31434. //
  31435. //
  31436. //
  31437. //
  31438. //
  31439. //
  31440. //
  31441. //
  31442. //
  31443. //
  31444. /* harmony default export */ var hue_slidervue_type_script_lang_js_ = ({
  31445. name: 'el-color-hue-slider',
  31446. props: {
  31447. color: {
  31448. required: true
  31449. },
  31450. vertical: Boolean
  31451. },
  31452. data: function data() {
  31453. return {
  31454. thumbLeft: 0,
  31455. thumbTop: 0
  31456. };
  31457. },
  31458. computed: {
  31459. hueValue: function hueValue() {
  31460. var hue = this.color.get('hue');
  31461. return hue;
  31462. }
  31463. },
  31464. watch: {
  31465. hueValue: function hueValue() {
  31466. this.update();
  31467. }
  31468. },
  31469. methods: {
  31470. handleClick: function handleClick(event) {
  31471. var thumb = this.$refs.thumb;
  31472. var target = event.target;
  31473. if (target !== thumb) {
  31474. this.handleDrag(event);
  31475. }
  31476. },
  31477. handleDrag: function handleDrag(event) {
  31478. var rect = this.$el.getBoundingClientRect();
  31479. var thumb = this.$refs.thumb;
  31480. var hue = void 0;
  31481. if (!this.vertical) {
  31482. var left = event.clientX - rect.left;
  31483. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31484. left = Math.max(thumb.offsetWidth / 2, left);
  31485. hue = Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 360);
  31486. } else {
  31487. var top = event.clientY - rect.top;
  31488. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31489. top = Math.max(thumb.offsetHeight / 2, top);
  31490. hue = Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 360);
  31491. }
  31492. this.color.set('hue', hue);
  31493. },
  31494. getThumbLeft: function getThumbLeft() {
  31495. if (this.vertical) return 0;
  31496. var el = this.$el;
  31497. var hue = this.color.get('hue');
  31498. if (!el) return 0;
  31499. var thumb = this.$refs.thumb;
  31500. return Math.round(hue * (el.offsetWidth - thumb.offsetWidth / 2) / 360);
  31501. },
  31502. getThumbTop: function getThumbTop() {
  31503. if (!this.vertical) return 0;
  31504. var el = this.$el;
  31505. var hue = this.color.get('hue');
  31506. if (!el) return 0;
  31507. var thumb = this.$refs.thumb;
  31508. return Math.round(hue * (el.offsetHeight - thumb.offsetHeight / 2) / 360);
  31509. },
  31510. update: function update() {
  31511. this.thumbLeft = this.getThumbLeft();
  31512. this.thumbTop = this.getThumbTop();
  31513. }
  31514. },
  31515. mounted: function mounted() {
  31516. var _this = this;
  31517. var _$refs = this.$refs,
  31518. bar = _$refs.bar,
  31519. thumb = _$refs.thumb;
  31520. var dragConfig = {
  31521. drag: function drag(event) {
  31522. _this.handleDrag(event);
  31523. },
  31524. end: function end(event) {
  31525. _this.handleDrag(event);
  31526. }
  31527. };
  31528. draggable(bar, dragConfig);
  31529. draggable(thumb, dragConfig);
  31530. this.update();
  31531. }
  31532. });
  31533. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  31534. /* harmony default export */ var components_hue_slidervue_type_script_lang_js_ = (hue_slidervue_type_script_lang_js_);
  31535. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue
  31536. /* normalize component */
  31537. var hue_slider_component = normalizeComponent(
  31538. components_hue_slidervue_type_script_lang_js_,
  31539. hue_slidervue_type_template_id_5cdc43b1_render,
  31540. hue_slidervue_type_template_id_5cdc43b1_staticRenderFns,
  31541. false,
  31542. null,
  31543. null,
  31544. null
  31545. )
  31546. /* hot reload */
  31547. if (false) { var hue_slider_api; }
  31548. hue_slider_component.options.__file = "packages/color-picker/src/components/hue-slider.vue"
  31549. /* harmony default export */ var hue_slider = (hue_slider_component.exports);
  31550. // 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&
  31551. var alpha_slidervue_type_template_id_068c66cb_render = function() {
  31552. var _vm = this
  31553. var _h = _vm.$createElement
  31554. var _c = _vm._self._c || _h
  31555. return _c(
  31556. "div",
  31557. {
  31558. staticClass: "el-color-alpha-slider",
  31559. class: { "is-vertical": _vm.vertical }
  31560. },
  31561. [
  31562. _c("div", {
  31563. ref: "bar",
  31564. staticClass: "el-color-alpha-slider__bar",
  31565. style: {
  31566. background: _vm.background
  31567. },
  31568. on: { click: _vm.handleClick }
  31569. }),
  31570. _c("div", {
  31571. ref: "thumb",
  31572. staticClass: "el-color-alpha-slider__thumb",
  31573. style: {
  31574. left: _vm.thumbLeft + "px",
  31575. top: _vm.thumbTop + "px"
  31576. }
  31577. })
  31578. ]
  31579. )
  31580. }
  31581. var alpha_slidervue_type_template_id_068c66cb_staticRenderFns = []
  31582. alpha_slidervue_type_template_id_068c66cb_render._withStripped = true
  31583. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  31584. // 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&
  31585. //
  31586. //
  31587. //
  31588. //
  31589. //
  31590. //
  31591. //
  31592. //
  31593. //
  31594. //
  31595. //
  31596. //
  31597. //
  31598. //
  31599. //
  31600. //
  31601. //
  31602. //
  31603. //
  31604. /* harmony default export */ var alpha_slidervue_type_script_lang_js_ = ({
  31605. name: 'el-color-alpha-slider',
  31606. props: {
  31607. color: {
  31608. required: true
  31609. },
  31610. vertical: Boolean
  31611. },
  31612. watch: {
  31613. 'color._alpha': function color_alpha() {
  31614. this.update();
  31615. },
  31616. 'color.value': function colorValue() {
  31617. this.update();
  31618. }
  31619. },
  31620. methods: {
  31621. handleClick: function handleClick(event) {
  31622. var thumb = this.$refs.thumb;
  31623. var target = event.target;
  31624. if (target !== thumb) {
  31625. this.handleDrag(event);
  31626. }
  31627. },
  31628. handleDrag: function handleDrag(event) {
  31629. var rect = this.$el.getBoundingClientRect();
  31630. var thumb = this.$refs.thumb;
  31631. if (!this.vertical) {
  31632. var left = event.clientX - rect.left;
  31633. left = Math.max(thumb.offsetWidth / 2, left);
  31634. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31635. this.color.set('alpha', Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 100));
  31636. } else {
  31637. var top = event.clientY - rect.top;
  31638. top = Math.max(thumb.offsetHeight / 2, top);
  31639. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31640. this.color.set('alpha', Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 100));
  31641. }
  31642. },
  31643. getThumbLeft: function getThumbLeft() {
  31644. if (this.vertical) return 0;
  31645. var el = this.$el;
  31646. var alpha = this.color._alpha;
  31647. if (!el) return 0;
  31648. var thumb = this.$refs.thumb;
  31649. return Math.round(alpha * (el.offsetWidth - thumb.offsetWidth / 2) / 100);
  31650. },
  31651. getThumbTop: function getThumbTop() {
  31652. if (!this.vertical) return 0;
  31653. var el = this.$el;
  31654. var alpha = this.color._alpha;
  31655. if (!el) return 0;
  31656. var thumb = this.$refs.thumb;
  31657. return Math.round(alpha * (el.offsetHeight - thumb.offsetHeight / 2) / 100);
  31658. },
  31659. getBackground: function getBackground() {
  31660. if (this.color && this.color.value) {
  31661. var _color$toRgb = this.color.toRgb(),
  31662. r = _color$toRgb.r,
  31663. g = _color$toRgb.g,
  31664. b = _color$toRgb.b;
  31665. return 'linear-gradient(to right, rgba(' + r + ', ' + g + ', ' + b + ', 0) 0%, rgba(' + r + ', ' + g + ', ' + b + ', 1) 100%)';
  31666. }
  31667. return null;
  31668. },
  31669. update: function update() {
  31670. this.thumbLeft = this.getThumbLeft();
  31671. this.thumbTop = this.getThumbTop();
  31672. this.background = this.getBackground();
  31673. }
  31674. },
  31675. data: function data() {
  31676. return {
  31677. thumbLeft: 0,
  31678. thumbTop: 0,
  31679. background: null
  31680. };
  31681. },
  31682. mounted: function mounted() {
  31683. var _this = this;
  31684. var _$refs = this.$refs,
  31685. bar = _$refs.bar,
  31686. thumb = _$refs.thumb;
  31687. var dragConfig = {
  31688. drag: function drag(event) {
  31689. _this.handleDrag(event);
  31690. },
  31691. end: function end(event) {
  31692. _this.handleDrag(event);
  31693. }
  31694. };
  31695. draggable(bar, dragConfig);
  31696. draggable(thumb, dragConfig);
  31697. this.update();
  31698. }
  31699. });
  31700. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  31701. /* harmony default export */ var components_alpha_slidervue_type_script_lang_js_ = (alpha_slidervue_type_script_lang_js_);
  31702. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue
  31703. /* normalize component */
  31704. var alpha_slider_component = normalizeComponent(
  31705. components_alpha_slidervue_type_script_lang_js_,
  31706. alpha_slidervue_type_template_id_068c66cb_render,
  31707. alpha_slidervue_type_template_id_068c66cb_staticRenderFns,
  31708. false,
  31709. null,
  31710. null,
  31711. null
  31712. )
  31713. /* hot reload */
  31714. if (false) { var alpha_slider_api; }
  31715. alpha_slider_component.options.__file = "packages/color-picker/src/components/alpha-slider.vue"
  31716. /* harmony default export */ var alpha_slider = (alpha_slider_component.exports);
  31717. // 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&
  31718. var predefinevue_type_template_id_06e03093_render = function() {
  31719. var _vm = this
  31720. var _h = _vm.$createElement
  31721. var _c = _vm._self._c || _h
  31722. return _c("div", { staticClass: "el-color-predefine" }, [
  31723. _c(
  31724. "div",
  31725. { staticClass: "el-color-predefine__colors" },
  31726. _vm._l(_vm.rgbaColors, function(item, index) {
  31727. return _c(
  31728. "div",
  31729. {
  31730. key: _vm.colors[index],
  31731. staticClass: "el-color-predefine__color-selector",
  31732. class: { selected: item.selected, "is-alpha": item._alpha < 100 },
  31733. on: {
  31734. click: function($event) {
  31735. _vm.handleSelect(index)
  31736. }
  31737. }
  31738. },
  31739. [_c("div", { style: { "background-color": item.value } })]
  31740. )
  31741. }),
  31742. 0
  31743. )
  31744. ])
  31745. }
  31746. var predefinevue_type_template_id_06e03093_staticRenderFns = []
  31747. predefinevue_type_template_id_06e03093_render._withStripped = true
  31748. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  31749. // 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&
  31750. //
  31751. //
  31752. //
  31753. //
  31754. //
  31755. //
  31756. //
  31757. //
  31758. //
  31759. //
  31760. //
  31761. //
  31762. //
  31763. //
  31764. //
  31765. /* harmony default export */ var predefinevue_type_script_lang_js_ = ({
  31766. props: {
  31767. colors: { type: Array, required: true },
  31768. color: { required: true }
  31769. },
  31770. data: function data() {
  31771. return {
  31772. rgbaColors: this.parseColors(this.colors, this.color)
  31773. };
  31774. },
  31775. methods: {
  31776. handleSelect: function handleSelect(index) {
  31777. this.color.fromString(this.colors[index]);
  31778. },
  31779. parseColors: function parseColors(colors, color) {
  31780. return colors.map(function (value) {
  31781. var c = new src_color();
  31782. c.enableAlpha = true;
  31783. c.format = 'rgba';
  31784. c.fromString(value);
  31785. c.selected = c.value === color.value;
  31786. return c;
  31787. });
  31788. }
  31789. },
  31790. watch: {
  31791. '$parent.currentColor': function $parentCurrentColor(val) {
  31792. var color = new src_color();
  31793. color.fromString(val);
  31794. this.rgbaColors.forEach(function (item) {
  31795. item.selected = color.compare(item);
  31796. });
  31797. },
  31798. colors: function colors(newVal) {
  31799. this.rgbaColors = this.parseColors(newVal, this.color);
  31800. },
  31801. color: function color(newVal) {
  31802. this.rgbaColors = this.parseColors(this.colors, newVal);
  31803. }
  31804. }
  31805. });
  31806. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  31807. /* harmony default export */ var components_predefinevue_type_script_lang_js_ = (predefinevue_type_script_lang_js_);
  31808. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue
  31809. /* normalize component */
  31810. var predefine_component = normalizeComponent(
  31811. components_predefinevue_type_script_lang_js_,
  31812. predefinevue_type_template_id_06e03093_render,
  31813. predefinevue_type_template_id_06e03093_staticRenderFns,
  31814. false,
  31815. null,
  31816. null,
  31817. null
  31818. )
  31819. /* hot reload */
  31820. if (false) { var predefine_api; }
  31821. predefine_component.options.__file = "packages/color-picker/src/components/predefine.vue"
  31822. /* harmony default export */ var predefine = (predefine_component.exports);
  31823. // 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&
  31824. //
  31825. //
  31826. //
  31827. //
  31828. //
  31829. //
  31830. //
  31831. //
  31832. //
  31833. //
  31834. //
  31835. //
  31836. //
  31837. //
  31838. //
  31839. //
  31840. //
  31841. //
  31842. //
  31843. //
  31844. //
  31845. //
  31846. //
  31847. //
  31848. //
  31849. //
  31850. //
  31851. //
  31852. //
  31853. //
  31854. //
  31855. //
  31856. //
  31857. //
  31858. //
  31859. //
  31860. //
  31861. //
  31862. //
  31863. //
  31864. /* harmony default export */ var picker_dropdownvue_type_script_lang_js_ = ({
  31865. name: 'el-color-picker-dropdown',
  31866. mixins: [vue_popper_default.a, locale_default.a],
  31867. components: {
  31868. SvPanel: sv_panel,
  31869. HueSlider: hue_slider,
  31870. AlphaSlider: alpha_slider,
  31871. ElInput: input_default.a,
  31872. ElButton: button_default.a,
  31873. Predefine: predefine
  31874. },
  31875. props: {
  31876. color: {
  31877. required: true
  31878. },
  31879. showAlpha: Boolean,
  31880. predefine: Array
  31881. },
  31882. data: function data() {
  31883. return {
  31884. customInput: ''
  31885. };
  31886. },
  31887. computed: {
  31888. currentColor: function currentColor() {
  31889. var parent = this.$parent;
  31890. return !parent.value && !parent.showPanelColor ? '' : parent.color.value;
  31891. }
  31892. },
  31893. methods: {
  31894. confirmValue: function confirmValue() {
  31895. this.$emit('pick');
  31896. },
  31897. handleConfirm: function handleConfirm() {
  31898. this.color.fromString(this.customInput);
  31899. }
  31900. },
  31901. mounted: function mounted() {
  31902. this.$parent.popperElm = this.popperElm = this.$el;
  31903. this.referenceElm = this.$parent.$el;
  31904. },
  31905. watch: {
  31906. showPopper: function showPopper(val) {
  31907. var _this = this;
  31908. if (val === true) {
  31909. this.$nextTick(function () {
  31910. var _$refs = _this.$refs,
  31911. sl = _$refs.sl,
  31912. hue = _$refs.hue,
  31913. alpha = _$refs.alpha;
  31914. sl && sl.update();
  31915. hue && hue.update();
  31916. alpha && alpha.update();
  31917. });
  31918. }
  31919. },
  31920. currentColor: {
  31921. immediate: true,
  31922. handler: function handler(val) {
  31923. this.customInput = val;
  31924. }
  31925. }
  31926. }
  31927. });
  31928. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  31929. /* harmony default export */ var components_picker_dropdownvue_type_script_lang_js_ = (picker_dropdownvue_type_script_lang_js_);
  31930. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue
  31931. /* normalize component */
  31932. var picker_dropdown_component = normalizeComponent(
  31933. components_picker_dropdownvue_type_script_lang_js_,
  31934. picker_dropdownvue_type_template_id_06601625_render,
  31935. picker_dropdownvue_type_template_id_06601625_staticRenderFns,
  31936. false,
  31937. null,
  31938. null,
  31939. null
  31940. )
  31941. /* hot reload */
  31942. if (false) { var picker_dropdown_api; }
  31943. picker_dropdown_component.options.__file = "packages/color-picker/src/components/picker-dropdown.vue"
  31944. /* harmony default export */ var picker_dropdown = (picker_dropdown_component.exports);
  31945. // 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&
  31946. //
  31947. //
  31948. //
  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. /* harmony default export */ var color_picker_src_mainvue_type_script_lang_js_ = ({
  31979. name: 'ElColorPicker',
  31980. mixins: [emitter_default.a],
  31981. props: {
  31982. value: String,
  31983. showAlpha: Boolean,
  31984. colorFormat: String,
  31985. disabled: Boolean,
  31986. size: String,
  31987. popperClass: String,
  31988. predefine: Array
  31989. },
  31990. inject: {
  31991. elForm: {
  31992. default: ''
  31993. },
  31994. elFormItem: {
  31995. default: ''
  31996. }
  31997. },
  31998. directives: { Clickoutside: clickoutside_default.a },
  31999. computed: {
  32000. displayedColor: function displayedColor() {
  32001. if (!this.value && !this.showPanelColor) {
  32002. return 'transparent';
  32003. }
  32004. return this.displayedRgb(this.color, this.showAlpha);
  32005. },
  32006. _elFormItemSize: function _elFormItemSize() {
  32007. return (this.elFormItem || {}).elFormItemSize;
  32008. },
  32009. colorSize: function colorSize() {
  32010. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  32011. },
  32012. colorDisabled: function colorDisabled() {
  32013. return this.disabled || (this.elForm || {}).disabled;
  32014. }
  32015. },
  32016. watch: {
  32017. value: function value(val) {
  32018. if (!val) {
  32019. this.showPanelColor = false;
  32020. } else if (val && val !== this.color.value) {
  32021. this.color.fromString(val);
  32022. }
  32023. },
  32024. color: {
  32025. deep: true,
  32026. handler: function handler() {
  32027. this.showPanelColor = true;
  32028. }
  32029. },
  32030. displayedColor: function displayedColor(val) {
  32031. if (!this.showPicker) return;
  32032. var currentValueColor = new src_color({
  32033. enableAlpha: this.showAlpha,
  32034. format: this.colorFormat
  32035. });
  32036. currentValueColor.fromString(this.value);
  32037. var currentValueColorRgb = this.displayedRgb(currentValueColor, this.showAlpha);
  32038. if (val !== currentValueColorRgb) {
  32039. this.$emit('active-change', val);
  32040. }
  32041. }
  32042. },
  32043. methods: {
  32044. handleTrigger: function handleTrigger() {
  32045. if (this.colorDisabled) return;
  32046. this.showPicker = !this.showPicker;
  32047. },
  32048. confirmValue: function confirmValue() {
  32049. var value = this.color.value;
  32050. this.$emit('input', value);
  32051. this.$emit('change', value);
  32052. this.dispatch('ElFormItem', 'el.form.change', value);
  32053. this.showPicker = false;
  32054. },
  32055. clearValue: function clearValue() {
  32056. this.$emit('input', null);
  32057. this.$emit('change', null);
  32058. if (this.value !== null) {
  32059. this.dispatch('ElFormItem', 'el.form.change', null);
  32060. }
  32061. this.showPanelColor = false;
  32062. this.showPicker = false;
  32063. this.resetColor();
  32064. },
  32065. hide: function hide() {
  32066. this.showPicker = false;
  32067. this.resetColor();
  32068. },
  32069. resetColor: function resetColor() {
  32070. var _this = this;
  32071. this.$nextTick(function (_) {
  32072. if (_this.value) {
  32073. _this.color.fromString(_this.value);
  32074. } else {
  32075. _this.showPanelColor = false;
  32076. }
  32077. });
  32078. },
  32079. displayedRgb: function displayedRgb(color, showAlpha) {
  32080. if (!(color instanceof src_color)) {
  32081. throw Error('color should be instance of Color Class');
  32082. }
  32083. var _color$toRgb = color.toRgb(),
  32084. r = _color$toRgb.r,
  32085. g = _color$toRgb.g,
  32086. b = _color$toRgb.b;
  32087. return showAlpha ? 'rgba(' + r + ', ' + g + ', ' + b + ', ' + color.get('alpha') / 100 + ')' : 'rgb(' + r + ', ' + g + ', ' + b + ')';
  32088. }
  32089. },
  32090. mounted: function mounted() {
  32091. var value = this.value;
  32092. if (value) {
  32093. this.color.fromString(value);
  32094. }
  32095. this.popperElm = this.$refs.dropdown.$el;
  32096. },
  32097. data: function data() {
  32098. var color = new src_color({
  32099. enableAlpha: this.showAlpha,
  32100. format: this.colorFormat
  32101. });
  32102. return {
  32103. color: color,
  32104. showPicker: false,
  32105. showPanelColor: false
  32106. };
  32107. },
  32108. components: {
  32109. PickerDropdown: picker_dropdown
  32110. }
  32111. });
  32112. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  32113. /* harmony default export */ var packages_color_picker_src_mainvue_type_script_lang_js_ = (color_picker_src_mainvue_type_script_lang_js_);
  32114. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue
  32115. /* normalize component */
  32116. var color_picker_src_main_component = normalizeComponent(
  32117. packages_color_picker_src_mainvue_type_script_lang_js_,
  32118. mainvue_type_template_id_55c8ade7_render,
  32119. mainvue_type_template_id_55c8ade7_staticRenderFns,
  32120. false,
  32121. null,
  32122. null,
  32123. null
  32124. )
  32125. /* hot reload */
  32126. if (false) { var color_picker_src_main_api; }
  32127. color_picker_src_main_component.options.__file = "packages/color-picker/src/main.vue"
  32128. /* harmony default export */ var color_picker_src_main = (color_picker_src_main_component.exports);
  32129. // CONCATENATED MODULE: ./packages/color-picker/index.js
  32130. /* istanbul ignore next */
  32131. color_picker_src_main.install = function (Vue) {
  32132. Vue.component(color_picker_src_main.name, color_picker_src_main);
  32133. };
  32134. /* harmony default export */ var color_picker = (color_picker_src_main);
  32135. // 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&
  32136. var mainvue_type_template_id_5c654dd8_render = function() {
  32137. var _vm = this
  32138. var _h = _vm.$createElement
  32139. var _c = _vm._self._c || _h
  32140. return _c(
  32141. "div",
  32142. { staticClass: "el-transfer" },
  32143. [
  32144. _c(
  32145. "transfer-panel",
  32146. _vm._b(
  32147. {
  32148. ref: "leftPanel",
  32149. attrs: {
  32150. data: _vm.sourceData,
  32151. title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
  32152. "default-checked": _vm.leftDefaultChecked,
  32153. placeholder:
  32154. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32155. },
  32156. on: { "checked-change": _vm.onSourceCheckedChange }
  32157. },
  32158. "transfer-panel",
  32159. _vm.$props,
  32160. false
  32161. ),
  32162. [_vm._t("left-footer")],
  32163. 2
  32164. ),
  32165. _c(
  32166. "div",
  32167. { staticClass: "el-transfer__buttons" },
  32168. [
  32169. _c(
  32170. "el-button",
  32171. {
  32172. class: [
  32173. "el-transfer__button",
  32174. _vm.hasButtonTexts ? "is-with-texts" : ""
  32175. ],
  32176. attrs: {
  32177. type: "primary",
  32178. disabled: _vm.rightChecked.length === 0
  32179. },
  32180. nativeOn: {
  32181. click: function($event) {
  32182. return _vm.addToLeft($event)
  32183. }
  32184. }
  32185. },
  32186. [
  32187. _c("i", { staticClass: "el-icon-arrow-left" }),
  32188. _vm.buttonTexts[0] !== undefined
  32189. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
  32190. : _vm._e()
  32191. ]
  32192. ),
  32193. _c(
  32194. "el-button",
  32195. {
  32196. class: [
  32197. "el-transfer__button",
  32198. _vm.hasButtonTexts ? "is-with-texts" : ""
  32199. ],
  32200. attrs: {
  32201. type: "primary",
  32202. disabled: _vm.leftChecked.length === 0
  32203. },
  32204. nativeOn: {
  32205. click: function($event) {
  32206. return _vm.addToRight($event)
  32207. }
  32208. }
  32209. },
  32210. [
  32211. _vm.buttonTexts[1] !== undefined
  32212. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
  32213. : _vm._e(),
  32214. _c("i", { staticClass: "el-icon-arrow-right" })
  32215. ]
  32216. )
  32217. ],
  32218. 1
  32219. ),
  32220. _c(
  32221. "transfer-panel",
  32222. _vm._b(
  32223. {
  32224. ref: "rightPanel",
  32225. attrs: {
  32226. data: _vm.targetData,
  32227. title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
  32228. "default-checked": _vm.rightDefaultChecked,
  32229. placeholder:
  32230. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32231. },
  32232. on: { "checked-change": _vm.onTargetCheckedChange }
  32233. },
  32234. "transfer-panel",
  32235. _vm.$props,
  32236. false
  32237. ),
  32238. [_vm._t("right-footer")],
  32239. 2
  32240. )
  32241. ],
  32242. 1
  32243. )
  32244. }
  32245. var mainvue_type_template_id_5c654dd8_staticRenderFns = []
  32246. mainvue_type_template_id_5c654dd8_render._withStripped = true
  32247. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
  32248. // 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&
  32249. var transfer_panelvue_type_template_id_2ddab8bd_render = function() {
  32250. var _vm = this
  32251. var _h = _vm.$createElement
  32252. var _c = _vm._self._c || _h
  32253. return _c("div", { staticClass: "el-transfer-panel" }, [
  32254. _c(
  32255. "p",
  32256. { staticClass: "el-transfer-panel__header" },
  32257. [
  32258. _c(
  32259. "el-checkbox",
  32260. {
  32261. attrs: { indeterminate: _vm.isIndeterminate },
  32262. on: { change: _vm.handleAllCheckedChange },
  32263. model: {
  32264. value: _vm.allChecked,
  32265. callback: function($$v) {
  32266. _vm.allChecked = $$v
  32267. },
  32268. expression: "allChecked"
  32269. }
  32270. },
  32271. [
  32272. _vm._v("\n " + _vm._s(_vm.title) + "\n "),
  32273. _c("span", [_vm._v(_vm._s(_vm.checkedSummary))])
  32274. ]
  32275. )
  32276. ],
  32277. 1
  32278. ),
  32279. _c(
  32280. "div",
  32281. {
  32282. class: [
  32283. "el-transfer-panel__body",
  32284. _vm.hasFooter ? "is-with-footer" : ""
  32285. ]
  32286. },
  32287. [
  32288. _vm.filterable
  32289. ? _c(
  32290. "el-input",
  32291. {
  32292. staticClass: "el-transfer-panel__filter",
  32293. attrs: { size: "small", placeholder: _vm.placeholder },
  32294. nativeOn: {
  32295. mouseenter: function($event) {
  32296. _vm.inputHover = true
  32297. },
  32298. mouseleave: function($event) {
  32299. _vm.inputHover = false
  32300. }
  32301. },
  32302. model: {
  32303. value: _vm.query,
  32304. callback: function($$v) {
  32305. _vm.query = $$v
  32306. },
  32307. expression: "query"
  32308. }
  32309. },
  32310. [
  32311. _c("i", {
  32312. class: ["el-input__icon", "el-icon-" + _vm.inputIcon],
  32313. attrs: { slot: "prefix" },
  32314. on: { click: _vm.clearQuery },
  32315. slot: "prefix"
  32316. })
  32317. ]
  32318. )
  32319. : _vm._e(),
  32320. _c(
  32321. "el-checkbox-group",
  32322. {
  32323. directives: [
  32324. {
  32325. name: "show",
  32326. rawName: "v-show",
  32327. value: !_vm.hasNoMatch && _vm.data.length > 0,
  32328. expression: "!hasNoMatch && data.length > 0"
  32329. }
  32330. ],
  32331. staticClass: "el-transfer-panel__list",
  32332. class: { "is-filterable": _vm.filterable },
  32333. model: {
  32334. value: _vm.checked,
  32335. callback: function($$v) {
  32336. _vm.checked = $$v
  32337. },
  32338. expression: "checked"
  32339. }
  32340. },
  32341. _vm._l(_vm.filteredData, function(item) {
  32342. return _c(
  32343. "el-checkbox",
  32344. {
  32345. key: item[_vm.keyProp],
  32346. staticClass: "el-transfer-panel__item",
  32347. attrs: {
  32348. label: item[_vm.keyProp],
  32349. disabled: item[_vm.disabledProp]
  32350. }
  32351. },
  32352. [_c("option-content", { attrs: { option: item } })],
  32353. 1
  32354. )
  32355. }),
  32356. 1
  32357. ),
  32358. _c(
  32359. "p",
  32360. {
  32361. directives: [
  32362. {
  32363. name: "show",
  32364. rawName: "v-show",
  32365. value: _vm.hasNoMatch,
  32366. expression: "hasNoMatch"
  32367. }
  32368. ],
  32369. staticClass: "el-transfer-panel__empty"
  32370. },
  32371. [_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
  32372. ),
  32373. _c(
  32374. "p",
  32375. {
  32376. directives: [
  32377. {
  32378. name: "show",
  32379. rawName: "v-show",
  32380. value: _vm.data.length === 0 && !_vm.hasNoMatch,
  32381. expression: "data.length === 0 && !hasNoMatch"
  32382. }
  32383. ],
  32384. staticClass: "el-transfer-panel__empty"
  32385. },
  32386. [_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
  32387. )
  32388. ],
  32389. 1
  32390. ),
  32391. _vm.hasFooter
  32392. ? _c(
  32393. "p",
  32394. { staticClass: "el-transfer-panel__footer" },
  32395. [_vm._t("default")],
  32396. 2
  32397. )
  32398. : _vm._e()
  32399. ])
  32400. }
  32401. var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
  32402. transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
  32403. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
  32404. // 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&
  32405. //
  32406. //
  32407. //
  32408. //
  32409. //
  32410. //
  32411. //
  32412. //
  32413. //
  32414. //
  32415. //
  32416. //
  32417. //
  32418. //
  32419. //
  32420. //
  32421. //
  32422. //
  32423. //
  32424. //
  32425. //
  32426. //
  32427. //
  32428. //
  32429. //
  32430. //
  32431. //
  32432. //
  32433. //
  32434. //
  32435. //
  32436. //
  32437. //
  32438. //
  32439. //
  32440. //
  32441. //
  32442. //
  32443. //
  32444. //
  32445. //
  32446. //
  32447. //
  32448. //
  32449. //
  32450. //
  32451. //
  32452. //
  32453. //
  32454. //
  32455. //
  32456. //
  32457. //
  32458. /* harmony default export */ var transfer_panelvue_type_script_lang_js_ = ({
  32459. mixins: [locale_default.a],
  32460. name: 'ElTransferPanel',
  32461. componentName: 'ElTransferPanel',
  32462. components: {
  32463. ElCheckboxGroup: checkbox_group_default.a,
  32464. ElCheckbox: checkbox_default.a,
  32465. ElInput: input_default.a,
  32466. OptionContent: {
  32467. props: {
  32468. option: Object
  32469. },
  32470. render: function render(h) {
  32471. var getParent = function getParent(vm) {
  32472. if (vm.$options.componentName === 'ElTransferPanel') {
  32473. return vm;
  32474. } else if (vm.$parent) {
  32475. return getParent(vm.$parent);
  32476. } else {
  32477. return vm;
  32478. }
  32479. };
  32480. var panel = getParent(this);
  32481. var transfer = panel.$parent || panel;
  32482. 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]]);
  32483. }
  32484. }
  32485. },
  32486. props: {
  32487. data: {
  32488. type: Array,
  32489. default: function _default() {
  32490. return [];
  32491. }
  32492. },
  32493. renderContent: Function,
  32494. placeholder: String,
  32495. title: String,
  32496. filterable: Boolean,
  32497. format: Object,
  32498. filterMethod: Function,
  32499. defaultChecked: Array,
  32500. props: Object
  32501. },
  32502. data: function data() {
  32503. return {
  32504. checked: [],
  32505. allChecked: false,
  32506. query: '',
  32507. inputHover: false,
  32508. checkChangeByUser: true
  32509. };
  32510. },
  32511. watch: {
  32512. checked: function checked(val, oldVal) {
  32513. this.updateAllChecked();
  32514. if (this.checkChangeByUser) {
  32515. var movedKeys = val.concat(oldVal).filter(function (v) {
  32516. return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
  32517. });
  32518. this.$emit('checked-change', val, movedKeys);
  32519. } else {
  32520. this.$emit('checked-change', val);
  32521. this.checkChangeByUser = true;
  32522. }
  32523. },
  32524. data: function data() {
  32525. var _this = this;
  32526. var checked = [];
  32527. var filteredDataKeys = this.filteredData.map(function (item) {
  32528. return item[_this.keyProp];
  32529. });
  32530. this.checked.forEach(function (item) {
  32531. if (filteredDataKeys.indexOf(item) > -1) {
  32532. checked.push(item);
  32533. }
  32534. });
  32535. this.checkChangeByUser = false;
  32536. this.checked = checked;
  32537. },
  32538. checkableData: function checkableData() {
  32539. this.updateAllChecked();
  32540. },
  32541. defaultChecked: {
  32542. immediate: true,
  32543. handler: function handler(val, oldVal) {
  32544. var _this2 = this;
  32545. if (oldVal && val.length === oldVal.length && val.every(function (item) {
  32546. return oldVal.indexOf(item) > -1;
  32547. })) return;
  32548. var checked = [];
  32549. var checkableDataKeys = this.checkableData.map(function (item) {
  32550. return item[_this2.keyProp];
  32551. });
  32552. val.forEach(function (item) {
  32553. if (checkableDataKeys.indexOf(item) > -1) {
  32554. checked.push(item);
  32555. }
  32556. });
  32557. this.checkChangeByUser = false;
  32558. this.checked = checked;
  32559. }
  32560. }
  32561. },
  32562. computed: {
  32563. filteredData: function filteredData() {
  32564. var _this3 = this;
  32565. return this.data.filter(function (item) {
  32566. if (typeof _this3.filterMethod === 'function') {
  32567. return _this3.filterMethod(_this3.query, item);
  32568. } else {
  32569. var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
  32570. return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
  32571. }
  32572. });
  32573. },
  32574. checkableData: function checkableData() {
  32575. var _this4 = this;
  32576. return this.filteredData.filter(function (item) {
  32577. return !item[_this4.disabledProp];
  32578. });
  32579. },
  32580. checkedSummary: function checkedSummary() {
  32581. var checkedLength = this.checked.length;
  32582. var dataLength = this.data.length;
  32583. var _format = this.format,
  32584. noChecked = _format.noChecked,
  32585. hasChecked = _format.hasChecked;
  32586. if (noChecked && hasChecked) {
  32587. return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
  32588. } else {
  32589. return checkedLength + '/' + dataLength;
  32590. }
  32591. },
  32592. isIndeterminate: function isIndeterminate() {
  32593. var checkedLength = this.checked.length;
  32594. return checkedLength > 0 && checkedLength < this.checkableData.length;
  32595. },
  32596. hasNoMatch: function hasNoMatch() {
  32597. return this.query.length > 0 && this.filteredData.length === 0;
  32598. },
  32599. inputIcon: function inputIcon() {
  32600. return this.query.length > 0 && this.inputHover ? 'circle-close' : 'search';
  32601. },
  32602. labelProp: function labelProp() {
  32603. return this.props.label || 'label';
  32604. },
  32605. keyProp: function keyProp() {
  32606. return this.props.key || 'key';
  32607. },
  32608. disabledProp: function disabledProp() {
  32609. return this.props.disabled || 'disabled';
  32610. },
  32611. hasFooter: function hasFooter() {
  32612. return !!this.$slots.default;
  32613. }
  32614. },
  32615. methods: {
  32616. updateAllChecked: function updateAllChecked() {
  32617. var _this5 = this;
  32618. var checkableDataKeys = this.checkableData.map(function (item) {
  32619. return item[_this5.keyProp];
  32620. });
  32621. this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
  32622. return _this5.checked.indexOf(item) > -1;
  32623. });
  32624. },
  32625. handleAllCheckedChange: function handleAllCheckedChange(value) {
  32626. var _this6 = this;
  32627. this.checked = value ? this.checkableData.map(function (item) {
  32628. return item[_this6.keyProp];
  32629. }) : [];
  32630. },
  32631. clearQuery: function clearQuery() {
  32632. if (this.inputIcon === 'circle-close') {
  32633. this.query = '';
  32634. }
  32635. }
  32636. }
  32637. });
  32638. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
  32639. /* harmony default export */ var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
  32640. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue
  32641. /* normalize component */
  32642. var transfer_panel_component = normalizeComponent(
  32643. src_transfer_panelvue_type_script_lang_js_,
  32644. transfer_panelvue_type_template_id_2ddab8bd_render,
  32645. transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
  32646. false,
  32647. null,
  32648. null,
  32649. null
  32650. )
  32651. /* hot reload */
  32652. if (false) { var transfer_panel_api; }
  32653. transfer_panel_component.options.__file = "packages/transfer/src/transfer-panel.vue"
  32654. /* harmony default export */ var transfer_panel = (transfer_panel_component.exports);
  32655. // 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&
  32656. //
  32657. //
  32658. //
  32659. //
  32660. //
  32661. //
  32662. //
  32663. //
  32664. //
  32665. //
  32666. //
  32667. //
  32668. //
  32669. //
  32670. //
  32671. //
  32672. //
  32673. //
  32674. //
  32675. //
  32676. //
  32677. //
  32678. //
  32679. //
  32680. //
  32681. //
  32682. //
  32683. //
  32684. //
  32685. //
  32686. //
  32687. //
  32688. //
  32689. //
  32690. //
  32691. //
  32692. //
  32693. //
  32694. //
  32695. //
  32696. //
  32697. //
  32698. //
  32699. /* harmony default export */ var transfer_src_mainvue_type_script_lang_js_ = ({
  32700. name: 'ElTransfer',
  32701. mixins: [emitter_default.a, locale_default.a, migrating_default.a],
  32702. components: {
  32703. TransferPanel: transfer_panel,
  32704. ElButton: button_default.a
  32705. },
  32706. props: {
  32707. data: {
  32708. type: Array,
  32709. default: function _default() {
  32710. return [];
  32711. }
  32712. },
  32713. titles: {
  32714. type: Array,
  32715. default: function _default() {
  32716. return [];
  32717. }
  32718. },
  32719. buttonTexts: {
  32720. type: Array,
  32721. default: function _default() {
  32722. return [];
  32723. }
  32724. },
  32725. filterPlaceholder: {
  32726. type: String,
  32727. default: ''
  32728. },
  32729. filterMethod: Function,
  32730. leftDefaultChecked: {
  32731. type: Array,
  32732. default: function _default() {
  32733. return [];
  32734. }
  32735. },
  32736. rightDefaultChecked: {
  32737. type: Array,
  32738. default: function _default() {
  32739. return [];
  32740. }
  32741. },
  32742. renderContent: Function,
  32743. value: {
  32744. type: Array,
  32745. default: function _default() {
  32746. return [];
  32747. }
  32748. },
  32749. format: {
  32750. type: Object,
  32751. default: function _default() {
  32752. return {};
  32753. }
  32754. },
  32755. filterable: Boolean,
  32756. props: {
  32757. type: Object,
  32758. default: function _default() {
  32759. return {
  32760. label: 'label',
  32761. key: 'key',
  32762. disabled: 'disabled'
  32763. };
  32764. }
  32765. },
  32766. targetOrder: {
  32767. type: String,
  32768. default: 'original'
  32769. }
  32770. },
  32771. data: function data() {
  32772. return {
  32773. leftChecked: [],
  32774. rightChecked: []
  32775. };
  32776. },
  32777. computed: {
  32778. dataObj: function dataObj() {
  32779. var key = this.props.key;
  32780. return this.data.reduce(function (o, cur) {
  32781. return (o[cur[key]] = cur) && o;
  32782. }, {});
  32783. },
  32784. sourceData: function sourceData() {
  32785. var _this = this;
  32786. return this.data.filter(function (item) {
  32787. return _this.value.indexOf(item[_this.props.key]) === -1;
  32788. });
  32789. },
  32790. targetData: function targetData() {
  32791. var _this2 = this;
  32792. if (this.targetOrder === 'original') {
  32793. return this.data.filter(function (item) {
  32794. return _this2.value.indexOf(item[_this2.props.key]) > -1;
  32795. });
  32796. } else {
  32797. return this.value.reduce(function (arr, cur) {
  32798. var val = _this2.dataObj[cur];
  32799. if (val) {
  32800. arr.push(val);
  32801. }
  32802. return arr;
  32803. }, []);
  32804. }
  32805. },
  32806. hasButtonTexts: function hasButtonTexts() {
  32807. return this.buttonTexts.length === 2;
  32808. }
  32809. },
  32810. watch: {
  32811. value: function value(val) {
  32812. this.dispatch('ElFormItem', 'el.form.change', val);
  32813. }
  32814. },
  32815. methods: {
  32816. getMigratingConfig: function getMigratingConfig() {
  32817. return {
  32818. props: {
  32819. 'footer-format': 'footer-format is renamed to format.'
  32820. }
  32821. };
  32822. },
  32823. onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
  32824. this.leftChecked = val;
  32825. if (movedKeys === undefined) return;
  32826. this.$emit('left-check-change', val, movedKeys);
  32827. },
  32828. onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
  32829. this.rightChecked = val;
  32830. if (movedKeys === undefined) return;
  32831. this.$emit('right-check-change', val, movedKeys);
  32832. },
  32833. addToLeft: function addToLeft() {
  32834. var currentValue = this.value.slice();
  32835. this.rightChecked.forEach(function (item) {
  32836. var index = currentValue.indexOf(item);
  32837. if (index > -1) {
  32838. currentValue.splice(index, 1);
  32839. }
  32840. });
  32841. this.$emit('input', currentValue);
  32842. this.$emit('change', currentValue, 'left', this.rightChecked);
  32843. },
  32844. addToRight: function addToRight() {
  32845. var _this3 = this;
  32846. var currentValue = this.value.slice();
  32847. var itemsToBeMoved = [];
  32848. var key = this.props.key;
  32849. this.data.forEach(function (item) {
  32850. var itemKey = item[key];
  32851. if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
  32852. itemsToBeMoved.push(itemKey);
  32853. }
  32854. });
  32855. currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  32856. this.$emit('input', currentValue);
  32857. this.$emit('change', currentValue, 'right', this.leftChecked);
  32858. },
  32859. clearQuery: function clearQuery(which) {
  32860. if (which === 'left') {
  32861. this.$refs.leftPanel.query = '';
  32862. } else if (which === 'right') {
  32863. this.$refs.rightPanel.query = '';
  32864. }
  32865. }
  32866. }
  32867. });
  32868. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=script&lang=js&
  32869. /* harmony default export */ var packages_transfer_src_mainvue_type_script_lang_js_ = (transfer_src_mainvue_type_script_lang_js_);
  32870. // CONCATENATED MODULE: ./packages/transfer/src/main.vue
  32871. /* normalize component */
  32872. var transfer_src_main_component = normalizeComponent(
  32873. packages_transfer_src_mainvue_type_script_lang_js_,
  32874. mainvue_type_template_id_5c654dd8_render,
  32875. mainvue_type_template_id_5c654dd8_staticRenderFns,
  32876. false,
  32877. null,
  32878. null,
  32879. null
  32880. )
  32881. /* hot reload */
  32882. if (false) { var transfer_src_main_api; }
  32883. transfer_src_main_component.options.__file = "packages/transfer/src/main.vue"
  32884. /* harmony default export */ var transfer_src_main = (transfer_src_main_component.exports);
  32885. // CONCATENATED MODULE: ./packages/transfer/index.js
  32886. /* istanbul ignore next */
  32887. transfer_src_main.install = function (Vue) {
  32888. Vue.component(transfer_src_main.name, transfer_src_main);
  32889. };
  32890. /* harmony default export */ var transfer = (transfer_src_main);
  32891. // 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&
  32892. var mainvue_type_template_id_5bf181d4_render = function() {
  32893. var _vm = this
  32894. var _h = _vm.$createElement
  32895. var _c = _vm._self._c || _h
  32896. return _c(
  32897. "section",
  32898. { staticClass: "el-container", class: { "is-vertical": _vm.isVertical } },
  32899. [_vm._t("default")],
  32900. 2
  32901. )
  32902. }
  32903. var mainvue_type_template_id_5bf181d4_staticRenderFns = []
  32904. mainvue_type_template_id_5bf181d4_render._withStripped = true
  32905. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=template&id=5bf181d4&
  32906. // 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&
  32907. //
  32908. //
  32909. //
  32910. //
  32911. //
  32912. //
  32913. /* harmony default export */ var container_src_mainvue_type_script_lang_js_ = ({
  32914. name: 'ElContainer',
  32915. componentName: 'ElContainer',
  32916. props: {
  32917. direction: String
  32918. },
  32919. computed: {
  32920. isVertical: function isVertical() {
  32921. if (this.direction === 'vertical') {
  32922. return true;
  32923. } else if (this.direction === 'horizontal') {
  32924. return false;
  32925. }
  32926. return this.$slots && this.$slots.default ? this.$slots.default.some(function (vnode) {
  32927. var tag = vnode.componentOptions && vnode.componentOptions.tag;
  32928. return tag === 'el-header' || tag === 'el-footer';
  32929. }) : false;
  32930. }
  32931. }
  32932. });
  32933. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=script&lang=js&
  32934. /* harmony default export */ var packages_container_src_mainvue_type_script_lang_js_ = (container_src_mainvue_type_script_lang_js_);
  32935. // CONCATENATED MODULE: ./packages/container/src/main.vue
  32936. /* normalize component */
  32937. var container_src_main_component = normalizeComponent(
  32938. packages_container_src_mainvue_type_script_lang_js_,
  32939. mainvue_type_template_id_5bf181d4_render,
  32940. mainvue_type_template_id_5bf181d4_staticRenderFns,
  32941. false,
  32942. null,
  32943. null,
  32944. null
  32945. )
  32946. /* hot reload */
  32947. if (false) { var container_src_main_api; }
  32948. container_src_main_component.options.__file = "packages/container/src/main.vue"
  32949. /* harmony default export */ var container_src_main = (container_src_main_component.exports);
  32950. // CONCATENATED MODULE: ./packages/container/index.js
  32951. /* istanbul ignore next */
  32952. container_src_main.install = function (Vue) {
  32953. Vue.component(container_src_main.name, container_src_main);
  32954. };
  32955. /* harmony default export */ var packages_container = (container_src_main);
  32956. // 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&
  32957. var mainvue_type_template_id_2b296ab2_render = function() {
  32958. var _vm = this
  32959. var _h = _vm.$createElement
  32960. var _c = _vm._self._c || _h
  32961. return _c(
  32962. "header",
  32963. { staticClass: "el-header", style: { height: _vm.height } },
  32964. [_vm._t("default")],
  32965. 2
  32966. )
  32967. }
  32968. var mainvue_type_template_id_2b296ab2_staticRenderFns = []
  32969. mainvue_type_template_id_2b296ab2_render._withStripped = true
  32970. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=template&id=2b296ab2&
  32971. // 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&
  32972. //
  32973. //
  32974. //
  32975. //
  32976. //
  32977. //
  32978. /* harmony default export */ var header_src_mainvue_type_script_lang_js_ = ({
  32979. name: 'ElHeader',
  32980. componentName: 'ElHeader',
  32981. props: {
  32982. height: {
  32983. type: String,
  32984. default: '60px'
  32985. }
  32986. }
  32987. });
  32988. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=script&lang=js&
  32989. /* harmony default export */ var packages_header_src_mainvue_type_script_lang_js_ = (header_src_mainvue_type_script_lang_js_);
  32990. // CONCATENATED MODULE: ./packages/header/src/main.vue
  32991. /* normalize component */
  32992. var header_src_main_component = normalizeComponent(
  32993. packages_header_src_mainvue_type_script_lang_js_,
  32994. mainvue_type_template_id_2b296ab2_render,
  32995. mainvue_type_template_id_2b296ab2_staticRenderFns,
  32996. false,
  32997. null,
  32998. null,
  32999. null
  33000. )
  33001. /* hot reload */
  33002. if (false) { var header_src_main_api; }
  33003. header_src_main_component.options.__file = "packages/header/src/main.vue"
  33004. /* harmony default export */ var header_src_main = (header_src_main_component.exports);
  33005. // CONCATENATED MODULE: ./packages/header/index.js
  33006. /* istanbul ignore next */
  33007. header_src_main.install = function (Vue) {
  33008. Vue.component(header_src_main.name, header_src_main);
  33009. };
  33010. /* harmony default export */ var header = (header_src_main);
  33011. // 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&
  33012. var mainvue_type_template_id_03411dbf_render = function() {
  33013. var _vm = this
  33014. var _h = _vm.$createElement
  33015. var _c = _vm._self._c || _h
  33016. return _c(
  33017. "aside",
  33018. { staticClass: "el-aside", style: { width: _vm.width } },
  33019. [_vm._t("default")],
  33020. 2
  33021. )
  33022. }
  33023. var mainvue_type_template_id_03411dbf_staticRenderFns = []
  33024. mainvue_type_template_id_03411dbf_render._withStripped = true
  33025. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=template&id=03411dbf&
  33026. // 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&
  33027. //
  33028. //
  33029. //
  33030. //
  33031. //
  33032. //
  33033. /* harmony default export */ var aside_src_mainvue_type_script_lang_js_ = ({
  33034. name: 'ElAside',
  33035. componentName: 'ElAside',
  33036. props: {
  33037. width: {
  33038. type: String,
  33039. default: '300px'
  33040. }
  33041. }
  33042. });
  33043. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=script&lang=js&
  33044. /* harmony default export */ var packages_aside_src_mainvue_type_script_lang_js_ = (aside_src_mainvue_type_script_lang_js_);
  33045. // CONCATENATED MODULE: ./packages/aside/src/main.vue
  33046. /* normalize component */
  33047. var aside_src_main_component = normalizeComponent(
  33048. packages_aside_src_mainvue_type_script_lang_js_,
  33049. mainvue_type_template_id_03411dbf_render,
  33050. mainvue_type_template_id_03411dbf_staticRenderFns,
  33051. false,
  33052. null,
  33053. null,
  33054. null
  33055. )
  33056. /* hot reload */
  33057. if (false) { var aside_src_main_api; }
  33058. aside_src_main_component.options.__file = "packages/aside/src/main.vue"
  33059. /* harmony default export */ var aside_src_main = (aside_src_main_component.exports);
  33060. // CONCATENATED MODULE: ./packages/aside/index.js
  33061. /* istanbul ignore next */
  33062. aside_src_main.install = function (Vue) {
  33063. Vue.component(aside_src_main.name, aside_src_main);
  33064. };
  33065. /* harmony default export */ var aside = (aside_src_main);
  33066. // 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&
  33067. var mainvue_type_template_id_2a3a7406_render = function() {
  33068. var _vm = this
  33069. var _h = _vm.$createElement
  33070. var _c = _vm._self._c || _h
  33071. return _c("main", { staticClass: "el-main" }, [_vm._t("default")], 2)
  33072. }
  33073. var mainvue_type_template_id_2a3a7406_staticRenderFns = []
  33074. mainvue_type_template_id_2a3a7406_render._withStripped = true
  33075. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=2a3a7406&
  33076. // 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&
  33077. //
  33078. //
  33079. //
  33080. //
  33081. //
  33082. //
  33083. /* harmony default export */ var main_src_mainvue_type_script_lang_js_ = ({
  33084. name: 'ElMain',
  33085. componentName: 'ElMain'
  33086. });
  33087. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=script&lang=js&
  33088. /* harmony default export */ var packages_main_src_mainvue_type_script_lang_js_ = (main_src_mainvue_type_script_lang_js_);
  33089. // CONCATENATED MODULE: ./packages/main/src/main.vue
  33090. /* normalize component */
  33091. var main_src_main_component = normalizeComponent(
  33092. packages_main_src_mainvue_type_script_lang_js_,
  33093. mainvue_type_template_id_2a3a7406_render,
  33094. mainvue_type_template_id_2a3a7406_staticRenderFns,
  33095. false,
  33096. null,
  33097. null,
  33098. null
  33099. )
  33100. /* hot reload */
  33101. if (false) { var main_src_main_api; }
  33102. main_src_main_component.options.__file = "packages/main/src/main.vue"
  33103. /* harmony default export */ var main_src_main = (main_src_main_component.exports);
  33104. // CONCATENATED MODULE: ./packages/main/index.js
  33105. /* istanbul ignore next */
  33106. main_src_main.install = function (Vue) {
  33107. Vue.component(main_src_main.name, main_src_main);
  33108. };
  33109. /* harmony default export */ var packages_main = (main_src_main);
  33110. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/footer/src/main.vue?vue&type=template&id=80210338&
  33111. var mainvue_type_template_id_80210338_render = function() {
  33112. var _vm = this
  33113. var _h = _vm.$createElement
  33114. var _c = _vm._self._c || _h
  33115. return _c(
  33116. "footer",
  33117. { staticClass: "el-footer", style: { height: _vm.height } },
  33118. [_vm._t("default")],
  33119. 2
  33120. )
  33121. }
  33122. var mainvue_type_template_id_80210338_staticRenderFns = []
  33123. mainvue_type_template_id_80210338_render._withStripped = true
  33124. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=template&id=80210338&
  33125. // 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&
  33126. //
  33127. //
  33128. //
  33129. //
  33130. //
  33131. //
  33132. /* harmony default export */ var footer_src_mainvue_type_script_lang_js_ = ({
  33133. name: 'ElFooter',
  33134. componentName: 'ElFooter',
  33135. props: {
  33136. height: {
  33137. type: String,
  33138. default: '60px'
  33139. }
  33140. }
  33141. });
  33142. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=script&lang=js&
  33143. /* harmony default export */ var packages_footer_src_mainvue_type_script_lang_js_ = (footer_src_mainvue_type_script_lang_js_);
  33144. // CONCATENATED MODULE: ./packages/footer/src/main.vue
  33145. /* normalize component */
  33146. var footer_src_main_component = normalizeComponent(
  33147. packages_footer_src_mainvue_type_script_lang_js_,
  33148. mainvue_type_template_id_80210338_render,
  33149. mainvue_type_template_id_80210338_staticRenderFns,
  33150. false,
  33151. null,
  33152. null,
  33153. null
  33154. )
  33155. /* hot reload */
  33156. if (false) { var footer_src_main_api; }
  33157. footer_src_main_component.options.__file = "packages/footer/src/main.vue"
  33158. /* harmony default export */ var footer_src_main = (footer_src_main_component.exports);
  33159. // CONCATENATED MODULE: ./packages/footer/index.js
  33160. /* istanbul ignore next */
  33161. footer_src_main.install = function (Vue) {
  33162. Vue.component(footer_src_main.name, footer_src_main);
  33163. };
  33164. /* harmony default export */ var footer = (footer_src_main);
  33165. // 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&
  33166. /* harmony default export */ var timeline_src_mainvue_type_script_lang_js_ = ({
  33167. name: 'ElTimeline',
  33168. props: {
  33169. reverse: {
  33170. type: Boolean,
  33171. default: false
  33172. }
  33173. },
  33174. provide: function provide() {
  33175. return {
  33176. timeline: this
  33177. };
  33178. },
  33179. render: function render() {
  33180. var h = arguments[0];
  33181. var reverse = this.reverse;
  33182. var classes = {
  33183. 'el-timeline': true,
  33184. 'is-reverse': reverse
  33185. };
  33186. var slots = this.$slots.default || [];
  33187. if (reverse) {
  33188. slots = slots.reverse();
  33189. }
  33190. return h(
  33191. 'ul',
  33192. { 'class': classes },
  33193. [slots]
  33194. );
  33195. }
  33196. });
  33197. // CONCATENATED MODULE: ./packages/timeline/src/main.vue?vue&type=script&lang=js&
  33198. /* harmony default export */ var packages_timeline_src_mainvue_type_script_lang_js_ = (timeline_src_mainvue_type_script_lang_js_);
  33199. // CONCATENATED MODULE: ./packages/timeline/src/main.vue
  33200. var main_render, main_staticRenderFns
  33201. /* normalize component */
  33202. var timeline_src_main_component = normalizeComponent(
  33203. packages_timeline_src_mainvue_type_script_lang_js_,
  33204. main_render,
  33205. main_staticRenderFns,
  33206. false,
  33207. null,
  33208. null,
  33209. null
  33210. )
  33211. /* hot reload */
  33212. if (false) { var timeline_src_main_api; }
  33213. timeline_src_main_component.options.__file = "packages/timeline/src/main.vue"
  33214. /* harmony default export */ var timeline_src_main = (timeline_src_main_component.exports);
  33215. // CONCATENATED MODULE: ./packages/timeline/index.js
  33216. /* istanbul ignore next */
  33217. timeline_src_main.install = function (Vue) {
  33218. Vue.component(timeline_src_main.name, timeline_src_main);
  33219. };
  33220. /* harmony default export */ var timeline = (timeline_src_main);
  33221. // 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&
  33222. var itemvue_type_template_id_61a69e50_render = function() {
  33223. var _vm = this
  33224. var _h = _vm.$createElement
  33225. var _c = _vm._self._c || _h
  33226. return _c("li", { staticClass: "el-timeline-item" }, [
  33227. _c("div", { staticClass: "el-timeline-item__tail" }),
  33228. !_vm.$slots.dot
  33229. ? _c(
  33230. "div",
  33231. {
  33232. staticClass: "el-timeline-item__node",
  33233. class: [
  33234. "el-timeline-item__node--" + (_vm.size || ""),
  33235. "el-timeline-item__node--" + (_vm.type || "")
  33236. ],
  33237. style: {
  33238. backgroundColor: _vm.color
  33239. }
  33240. },
  33241. [
  33242. _vm.icon
  33243. ? _c("i", {
  33244. staticClass: "el-timeline-item__icon",
  33245. class: _vm.icon
  33246. })
  33247. : _vm._e()
  33248. ]
  33249. )
  33250. : _vm._e(),
  33251. _vm.$slots.dot
  33252. ? _c("div", { staticClass: "el-timeline-item__dot" }, [_vm._t("dot")], 2)
  33253. : _vm._e(),
  33254. _c("div", { staticClass: "el-timeline-item__wrapper" }, [
  33255. !_vm.hideTimestamp && _vm.placement === "top"
  33256. ? _c("div", { staticClass: "el-timeline-item__timestamp is-top" }, [
  33257. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33258. ])
  33259. : _vm._e(),
  33260. _c(
  33261. "div",
  33262. { staticClass: "el-timeline-item__content" },
  33263. [_vm._t("default")],
  33264. 2
  33265. ),
  33266. !_vm.hideTimestamp && _vm.placement === "bottom"
  33267. ? _c("div", { staticClass: "el-timeline-item__timestamp is-bottom" }, [
  33268. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33269. ])
  33270. : _vm._e()
  33271. ])
  33272. ])
  33273. }
  33274. var itemvue_type_template_id_61a69e50_staticRenderFns = []
  33275. itemvue_type_template_id_61a69e50_render._withStripped = true
  33276. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=template&id=61a69e50&
  33277. // 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&
  33278. //
  33279. //
  33280. //
  33281. //
  33282. //
  33283. //
  33284. //
  33285. //
  33286. //
  33287. //
  33288. //
  33289. //
  33290. //
  33291. //
  33292. //
  33293. //
  33294. //
  33295. //
  33296. //
  33297. //
  33298. //
  33299. //
  33300. //
  33301. //
  33302. //
  33303. //
  33304. //
  33305. //
  33306. //
  33307. //
  33308. //
  33309. //
  33310. //
  33311. //
  33312. //
  33313. //
  33314. //
  33315. //
  33316. //
  33317. //
  33318. //
  33319. /* harmony default export */ var timeline_src_itemvue_type_script_lang_js_ = ({
  33320. name: 'ElTimelineItem',
  33321. inject: ['timeline'],
  33322. props: {
  33323. timestamp: String,
  33324. hideTimestamp: {
  33325. type: Boolean,
  33326. default: false
  33327. },
  33328. placement: {
  33329. type: String,
  33330. default: 'bottom'
  33331. },
  33332. type: String,
  33333. color: String,
  33334. size: {
  33335. type: String,
  33336. default: 'normal'
  33337. },
  33338. icon: String
  33339. }
  33340. });
  33341. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=script&lang=js&
  33342. /* harmony default export */ var packages_timeline_src_itemvue_type_script_lang_js_ = (timeline_src_itemvue_type_script_lang_js_);
  33343. // CONCATENATED MODULE: ./packages/timeline/src/item.vue
  33344. /* normalize component */
  33345. var src_item_component = normalizeComponent(
  33346. packages_timeline_src_itemvue_type_script_lang_js_,
  33347. itemvue_type_template_id_61a69e50_render,
  33348. itemvue_type_template_id_61a69e50_staticRenderFns,
  33349. false,
  33350. null,
  33351. null,
  33352. null
  33353. )
  33354. /* hot reload */
  33355. if (false) { var src_item_api; }
  33356. src_item_component.options.__file = "packages/timeline/src/item.vue"
  33357. /* harmony default export */ var timeline_src_item = (src_item_component.exports);
  33358. // CONCATENATED MODULE: ./packages/timeline-item/index.js
  33359. /* istanbul ignore next */
  33360. timeline_src_item.install = function (Vue) {
  33361. Vue.component(timeline_src_item.name, timeline_src_item);
  33362. };
  33363. /* harmony default export */ var timeline_item = (timeline_src_item);
  33364. // 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&
  33365. var mainvue_type_template_id_01cf3b65_render = function() {
  33366. var _vm = this
  33367. var _h = _vm.$createElement
  33368. var _c = _vm._self._c || _h
  33369. return _c(
  33370. "a",
  33371. _vm._b(
  33372. {
  33373. class: [
  33374. "el-link",
  33375. _vm.type ? "el-link--" + _vm.type : "",
  33376. _vm.disabled && "is-disabled",
  33377. _vm.underline && !_vm.disabled && "is-underline"
  33378. ],
  33379. attrs: { href: _vm.disabled ? null : _vm.href },
  33380. on: { click: _vm.handleClick }
  33381. },
  33382. "a",
  33383. _vm.$attrs,
  33384. false
  33385. ),
  33386. [
  33387. _vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(),
  33388. _vm.$slots.default
  33389. ? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
  33390. : _vm._e(),
  33391. _vm.$slots.icon ? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()] : _vm._e()
  33392. ],
  33393. 2
  33394. )
  33395. }
  33396. var mainvue_type_template_id_01cf3b65_staticRenderFns = []
  33397. mainvue_type_template_id_01cf3b65_render._withStripped = true
  33398. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=01cf3b65&
  33399. // 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&
  33400. //
  33401. //
  33402. //
  33403. //
  33404. //
  33405. //
  33406. //
  33407. //
  33408. //
  33409. //
  33410. //
  33411. //
  33412. //
  33413. //
  33414. //
  33415. //
  33416. //
  33417. //
  33418. //
  33419. //
  33420. //
  33421. //
  33422. //
  33423. /* harmony default export */ var link_src_mainvue_type_script_lang_js_ = ({
  33424. name: 'ElLink',
  33425. props: {
  33426. type: {
  33427. type: String,
  33428. default: 'default'
  33429. },
  33430. underline: {
  33431. type: Boolean,
  33432. default: true
  33433. },
  33434. disabled: Boolean,
  33435. href: String,
  33436. icon: String
  33437. },
  33438. methods: {
  33439. handleClick: function handleClick(event) {
  33440. if (!this.disabled) {
  33441. if (!this.href) {
  33442. this.$emit('click', event);
  33443. }
  33444. }
  33445. }
  33446. }
  33447. });
  33448. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js&
  33449. /* harmony default export */ var packages_link_src_mainvue_type_script_lang_js_ = (link_src_mainvue_type_script_lang_js_);
  33450. // CONCATENATED MODULE: ./packages/link/src/main.vue
  33451. /* normalize component */
  33452. var link_src_main_component = normalizeComponent(
  33453. packages_link_src_mainvue_type_script_lang_js_,
  33454. mainvue_type_template_id_01cf3b65_render,
  33455. mainvue_type_template_id_01cf3b65_staticRenderFns,
  33456. false,
  33457. null,
  33458. null,
  33459. null
  33460. )
  33461. /* hot reload */
  33462. if (false) { var link_src_main_api; }
  33463. link_src_main_component.options.__file = "packages/link/src/main.vue"
  33464. /* harmony default export */ var link_src_main = (link_src_main_component.exports);
  33465. // CONCATENATED MODULE: ./packages/link/index.js
  33466. /* istanbul ignore next */
  33467. link_src_main.install = function (Vue) {
  33468. Vue.component(link_src_main.name, link_src_main);
  33469. };
  33470. /* harmony default export */ var packages_link = (link_src_main);
  33471. // 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&
  33472. var mainvue_type_template_id_7fa02a7e_functional_true_render = function(_h, _vm) {
  33473. var _c = _vm._c
  33474. return _c(
  33475. "div",
  33476. _vm._g(
  33477. _vm._b(
  33478. {
  33479. class: [
  33480. _vm.data.staticClass,
  33481. "el-divider",
  33482. "el-divider--" + _vm.props.direction
  33483. ]
  33484. },
  33485. "div",
  33486. _vm.data.attrs,
  33487. false
  33488. ),
  33489. _vm.listeners
  33490. ),
  33491. [
  33492. _vm.slots().default && _vm.props.direction !== "vertical"
  33493. ? _c(
  33494. "div",
  33495. { class: ["el-divider__text", "is-" + _vm.props.contentPosition] },
  33496. [_vm._t("default")],
  33497. 2
  33498. )
  33499. : _vm._e()
  33500. ]
  33501. )
  33502. }
  33503. var mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns = []
  33504. mainvue_type_template_id_7fa02a7e_functional_true_render._withStripped = true
  33505. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=template&id=7fa02a7e&functional=true&
  33506. // 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&
  33507. //
  33508. //
  33509. //
  33510. //
  33511. //
  33512. //
  33513. //
  33514. //
  33515. //
  33516. //
  33517. //
  33518. //
  33519. //
  33520. //
  33521. //
  33522. /* harmony default export */ var divider_src_mainvue_type_script_lang_js_ = ({
  33523. name: 'ElDivider',
  33524. props: {
  33525. direction: {
  33526. type: String,
  33527. default: 'horizontal',
  33528. validator: function validator(val) {
  33529. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  33530. }
  33531. },
  33532. contentPosition: {
  33533. type: String,
  33534. default: 'center',
  33535. validator: function validator(val) {
  33536. return ['left', 'center', 'right'].indexOf(val) !== -1;
  33537. }
  33538. }
  33539. }
  33540. });
  33541. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=script&lang=js&
  33542. /* harmony default export */ var packages_divider_src_mainvue_type_script_lang_js_ = (divider_src_mainvue_type_script_lang_js_);
  33543. // CONCATENATED MODULE: ./packages/divider/src/main.vue
  33544. /* normalize component */
  33545. var divider_src_main_component = normalizeComponent(
  33546. packages_divider_src_mainvue_type_script_lang_js_,
  33547. mainvue_type_template_id_7fa02a7e_functional_true_render,
  33548. mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns,
  33549. true,
  33550. null,
  33551. null,
  33552. null
  33553. )
  33554. /* hot reload */
  33555. if (false) { var divider_src_main_api; }
  33556. divider_src_main_component.options.__file = "packages/divider/src/main.vue"
  33557. /* harmony default export */ var divider_src_main = (divider_src_main_component.exports);
  33558. // CONCATENATED MODULE: ./packages/divider/index.js
  33559. /* istanbul ignore next */
  33560. divider_src_main.install = function (Vue) {
  33561. Vue.component(divider_src_main.name, divider_src_main);
  33562. };
  33563. /* harmony default export */ var divider = (divider_src_main);
  33564. // 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&
  33565. var mainvue_type_template_id_44d84a7c_render = function() {
  33566. var _vm = this
  33567. var _h = _vm.$createElement
  33568. var _c = _vm._self._c || _h
  33569. return _c(
  33570. "div",
  33571. { staticClass: "el-image" },
  33572. [
  33573. _vm.loading
  33574. ? _vm._t("placeholder", [
  33575. _c("div", { staticClass: "el-image__placeholder" })
  33576. ])
  33577. : _vm.error
  33578. ? _vm._t("error", [
  33579. _c("div", { staticClass: "el-image__error" }, [
  33580. _vm._v(_vm._s(_vm.t("el.image.error")))
  33581. ])
  33582. ])
  33583. : _c(
  33584. "img",
  33585. _vm._g(
  33586. _vm._b(
  33587. {
  33588. staticClass: "el-image__inner",
  33589. class: {
  33590. "el-image__inner--center": _vm.alignCenter,
  33591. "el-image__preview": _vm.preview
  33592. },
  33593. style: _vm.imageStyle,
  33594. attrs: { src: _vm.src },
  33595. on: { click: _vm.clickHandler }
  33596. },
  33597. "img",
  33598. _vm.$attrs,
  33599. false
  33600. ),
  33601. _vm.$listeners
  33602. )
  33603. ),
  33604. _vm.preview
  33605. ? [
  33606. _vm.showViewer
  33607. ? _c("image-viewer", {
  33608. attrs: {
  33609. "z-index": _vm.zIndex,
  33610. "initial-index": _vm.imageIndex,
  33611. "on-close": _vm.closeViewer,
  33612. "url-list": _vm.previewSrcList
  33613. }
  33614. })
  33615. : _vm._e()
  33616. ]
  33617. : _vm._e()
  33618. ],
  33619. 2
  33620. )
  33621. }
  33622. var mainvue_type_template_id_44d84a7c_staticRenderFns = []
  33623. mainvue_type_template_id_44d84a7c_render._withStripped = true
  33624. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=template&id=44d84a7c&
  33625. // 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&
  33626. var image_viewervue_type_template_id_5e73b307_render = function() {
  33627. var _vm = this
  33628. var _h = _vm.$createElement
  33629. var _c = _vm._self._c || _h
  33630. return _c("transition", { attrs: { name: "viewer-fade" } }, [
  33631. _c(
  33632. "div",
  33633. {
  33634. ref: "el-image-viewer__wrapper",
  33635. staticClass: "el-image-viewer__wrapper",
  33636. style: { "z-index": _vm.viewerZIndex },
  33637. attrs: { tabindex: "-1" }
  33638. },
  33639. [
  33640. _c("div", {
  33641. staticClass: "el-image-viewer__mask",
  33642. on: {
  33643. click: function($event) {
  33644. if ($event.target !== $event.currentTarget) {
  33645. return null
  33646. }
  33647. return _vm.handleMaskClick($event)
  33648. }
  33649. }
  33650. }),
  33651. _c(
  33652. "span",
  33653. {
  33654. staticClass: "el-image-viewer__btn el-image-viewer__close",
  33655. on: { click: _vm.hide }
  33656. },
  33657. [_c("i", { staticClass: "el-icon-close" })]
  33658. ),
  33659. !_vm.isSingle
  33660. ? [
  33661. _c(
  33662. "span",
  33663. {
  33664. staticClass: "el-image-viewer__btn el-image-viewer__prev",
  33665. class: { "is-disabled": !_vm.infinite && _vm.isFirst },
  33666. on: { click: _vm.prev }
  33667. },
  33668. [_c("i", { staticClass: "el-icon-arrow-left" })]
  33669. ),
  33670. _c(
  33671. "span",
  33672. {
  33673. staticClass: "el-image-viewer__btn el-image-viewer__next",
  33674. class: { "is-disabled": !_vm.infinite && _vm.isLast },
  33675. on: { click: _vm.next }
  33676. },
  33677. [_c("i", { staticClass: "el-icon-arrow-right" })]
  33678. )
  33679. ]
  33680. : _vm._e(),
  33681. _c(
  33682. "div",
  33683. { staticClass: "el-image-viewer__btn el-image-viewer__actions" },
  33684. [
  33685. _c("div", { staticClass: "el-image-viewer__actions__inner" }, [
  33686. _c("i", {
  33687. staticClass: "el-icon-zoom-out",
  33688. on: {
  33689. click: function($event) {
  33690. _vm.handleActions("zoomOut")
  33691. }
  33692. }
  33693. }),
  33694. _c("i", {
  33695. staticClass: "el-icon-zoom-in",
  33696. on: {
  33697. click: function($event) {
  33698. _vm.handleActions("zoomIn")
  33699. }
  33700. }
  33701. }),
  33702. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33703. _c("i", { class: _vm.mode.icon, on: { click: _vm.toggleMode } }),
  33704. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33705. _c("i", {
  33706. staticClass: "el-icon-refresh-left",
  33707. on: {
  33708. click: function($event) {
  33709. _vm.handleActions("anticlocelise")
  33710. }
  33711. }
  33712. }),
  33713. _c("i", {
  33714. staticClass: "el-icon-refresh-right",
  33715. on: {
  33716. click: function($event) {
  33717. _vm.handleActions("clocelise")
  33718. }
  33719. }
  33720. })
  33721. ])
  33722. ]
  33723. ),
  33724. _c(
  33725. "div",
  33726. { staticClass: "el-image-viewer__canvas" },
  33727. _vm._l(_vm.urlList, function(url, i) {
  33728. return i === _vm.index
  33729. ? _c("img", {
  33730. key: url,
  33731. ref: "img",
  33732. refInFor: true,
  33733. staticClass: "el-image-viewer__img",
  33734. style: _vm.imgStyle,
  33735. attrs: { src: _vm.currentImg },
  33736. on: {
  33737. load: _vm.handleImgLoad,
  33738. error: _vm.handleImgError,
  33739. mousedown: _vm.handleMouseDown
  33740. }
  33741. })
  33742. : _vm._e()
  33743. }),
  33744. 0
  33745. )
  33746. ],
  33747. 2
  33748. )
  33749. ])
  33750. }
  33751. var image_viewervue_type_template_id_5e73b307_staticRenderFns = []
  33752. image_viewervue_type_template_id_5e73b307_render._withStripped = true
  33753. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=template&id=5e73b307&
  33754. // 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&
  33755. 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; };
  33756. //
  33757. //
  33758. //
  33759. //
  33760. //
  33761. //
  33762. //
  33763. //
  33764. //
  33765. //
  33766. //
  33767. //
  33768. //
  33769. //
  33770. //
  33771. //
  33772. //
  33773. //
  33774. //
  33775. //
  33776. //
  33777. //
  33778. //
  33779. //
  33780. //
  33781. //
  33782. //
  33783. //
  33784. //
  33785. //
  33786. //
  33787. //
  33788. //
  33789. //
  33790. //
  33791. //
  33792. //
  33793. //
  33794. //
  33795. //
  33796. //
  33797. //
  33798. //
  33799. //
  33800. //
  33801. //
  33802. //
  33803. //
  33804. //
  33805. //
  33806. //
  33807. //
  33808. //
  33809. var Mode = {
  33810. CONTAIN: {
  33811. name: 'contain',
  33812. icon: 'el-icon-full-screen'
  33813. },
  33814. ORIGINAL: {
  33815. name: 'original',
  33816. icon: 'el-icon-c-scale-to-original'
  33817. }
  33818. };
  33819. var mousewheelEventName = Object(util_["isFirefox"])() ? 'DOMMouseScroll' : 'mousewheel';
  33820. /* harmony default export */ var image_viewervue_type_script_lang_js_ = ({
  33821. name: 'elImageViewer',
  33822. props: {
  33823. urlList: {
  33824. type: Array,
  33825. default: function _default() {
  33826. return [];
  33827. }
  33828. },
  33829. zIndex: {
  33830. type: Number,
  33831. default: 2000
  33832. },
  33833. onSwitch: {
  33834. type: Function,
  33835. default: function _default() {}
  33836. },
  33837. onClose: {
  33838. type: Function,
  33839. default: function _default() {}
  33840. },
  33841. initialIndex: {
  33842. type: Number,
  33843. default: 0
  33844. },
  33845. appendToBody: {
  33846. type: Boolean,
  33847. default: true
  33848. },
  33849. maskClosable: {
  33850. type: Boolean,
  33851. default: true
  33852. }
  33853. },
  33854. data: function data() {
  33855. return {
  33856. index: this.initialIndex,
  33857. isShow: false,
  33858. infinite: true,
  33859. loading: false,
  33860. mode: Mode.CONTAIN,
  33861. transform: {
  33862. scale: 1,
  33863. deg: 0,
  33864. offsetX: 0,
  33865. offsetY: 0,
  33866. enableTransition: false
  33867. }
  33868. };
  33869. },
  33870. computed: {
  33871. isSingle: function isSingle() {
  33872. return this.urlList.length <= 1;
  33873. },
  33874. isFirst: function isFirst() {
  33875. return this.index === 0;
  33876. },
  33877. isLast: function isLast() {
  33878. return this.index === this.urlList.length - 1;
  33879. },
  33880. currentImg: function currentImg() {
  33881. return this.urlList[this.index];
  33882. },
  33883. imgStyle: function imgStyle() {
  33884. var _transform = this.transform,
  33885. scale = _transform.scale,
  33886. deg = _transform.deg,
  33887. offsetX = _transform.offsetX,
  33888. offsetY = _transform.offsetY,
  33889. enableTransition = _transform.enableTransition;
  33890. var style = {
  33891. transform: 'scale(' + scale + ') rotate(' + deg + 'deg)',
  33892. transition: enableTransition ? 'transform .3s' : '',
  33893. 'margin-left': offsetX + 'px',
  33894. 'margin-top': offsetY + 'px'
  33895. };
  33896. if (this.mode === Mode.CONTAIN) {
  33897. style.maxWidth = style.maxHeight = '100%';
  33898. }
  33899. return style;
  33900. },
  33901. viewerZIndex: function viewerZIndex() {
  33902. var nextZIndex = popup_["PopupManager"].nextZIndex();
  33903. return this.zIndex > nextZIndex ? this.zIndex : nextZIndex;
  33904. }
  33905. },
  33906. watch: {
  33907. index: {
  33908. handler: function handler(val) {
  33909. this.reset();
  33910. this.onSwitch(val);
  33911. }
  33912. },
  33913. currentImg: function currentImg(val) {
  33914. var _this = this;
  33915. this.$nextTick(function (_) {
  33916. var $img = _this.$refs.img[0];
  33917. if (!$img.complete) {
  33918. _this.loading = true;
  33919. }
  33920. });
  33921. }
  33922. },
  33923. methods: {
  33924. hide: function hide() {
  33925. this.deviceSupportUninstall();
  33926. this.onClose();
  33927. },
  33928. deviceSupportInstall: function deviceSupportInstall() {
  33929. var _this2 = this;
  33930. this._keyDownHandler = function (e) {
  33931. e.stopPropagation();
  33932. var keyCode = e.keyCode;
  33933. switch (keyCode) {
  33934. // ESC
  33935. case 27:
  33936. _this2.hide();
  33937. break;
  33938. // SPACE
  33939. case 32:
  33940. _this2.toggleMode();
  33941. break;
  33942. // LEFT_ARROW
  33943. case 37:
  33944. _this2.prev();
  33945. break;
  33946. // UP_ARROW
  33947. case 38:
  33948. _this2.handleActions('zoomIn');
  33949. break;
  33950. // RIGHT_ARROW
  33951. case 39:
  33952. _this2.next();
  33953. break;
  33954. // DOWN_ARROW
  33955. case 40:
  33956. _this2.handleActions('zoomOut');
  33957. break;
  33958. }
  33959. };
  33960. this._mouseWheelHandler = Object(util_["rafThrottle"])(function (e) {
  33961. var delta = e.wheelDelta ? e.wheelDelta : -e.detail;
  33962. if (delta > 0) {
  33963. _this2.handleActions('zoomIn', {
  33964. zoomRate: 0.015,
  33965. enableTransition: false
  33966. });
  33967. } else {
  33968. _this2.handleActions('zoomOut', {
  33969. zoomRate: 0.015,
  33970. enableTransition: false
  33971. });
  33972. }
  33973. });
  33974. Object(dom_["on"])(document, 'keydown', this._keyDownHandler);
  33975. Object(dom_["on"])(document, mousewheelEventName, this._mouseWheelHandler);
  33976. },
  33977. deviceSupportUninstall: function deviceSupportUninstall() {
  33978. Object(dom_["off"])(document, 'keydown', this._keyDownHandler);
  33979. Object(dom_["off"])(document, mousewheelEventName, this._mouseWheelHandler);
  33980. this._keyDownHandler = null;
  33981. this._mouseWheelHandler = null;
  33982. },
  33983. handleImgLoad: function handleImgLoad(e) {
  33984. this.loading = false;
  33985. },
  33986. handleImgError: function handleImgError(e) {
  33987. this.loading = false;
  33988. e.target.alt = '加载失败';
  33989. },
  33990. handleMouseDown: function handleMouseDown(e) {
  33991. var _this3 = this;
  33992. if (this.loading || e.button !== 0) return;
  33993. var _transform2 = this.transform,
  33994. offsetX = _transform2.offsetX,
  33995. offsetY = _transform2.offsetY;
  33996. var startX = e.pageX;
  33997. var startY = e.pageY;
  33998. this._dragHandler = Object(util_["rafThrottle"])(function (ev) {
  33999. _this3.transform.offsetX = offsetX + ev.pageX - startX;
  34000. _this3.transform.offsetY = offsetY + ev.pageY - startY;
  34001. });
  34002. Object(dom_["on"])(document, 'mousemove', this._dragHandler);
  34003. Object(dom_["on"])(document, 'mouseup', function (ev) {
  34004. Object(dom_["off"])(document, 'mousemove', _this3._dragHandler);
  34005. });
  34006. e.preventDefault();
  34007. },
  34008. handleMaskClick: function handleMaskClick() {
  34009. if (this.maskClosable) {
  34010. this.hide();
  34011. }
  34012. },
  34013. reset: function reset() {
  34014. this.transform = {
  34015. scale: 1,
  34016. deg: 0,
  34017. offsetX: 0,
  34018. offsetY: 0,
  34019. enableTransition: false
  34020. };
  34021. },
  34022. toggleMode: function toggleMode() {
  34023. if (this.loading) return;
  34024. var modeNames = Object.keys(Mode);
  34025. var modeValues = Object.values(Mode);
  34026. var index = modeValues.indexOf(this.mode);
  34027. var nextIndex = (index + 1) % modeNames.length;
  34028. this.mode = Mode[modeNames[nextIndex]];
  34029. this.reset();
  34030. },
  34031. prev: function prev() {
  34032. if (this.isFirst && !this.infinite) return;
  34033. var len = this.urlList.length;
  34034. this.index = (this.index - 1 + len) % len;
  34035. },
  34036. next: function next() {
  34037. if (this.isLast && !this.infinite) return;
  34038. var len = this.urlList.length;
  34039. this.index = (this.index + 1) % len;
  34040. },
  34041. handleActions: function handleActions(action) {
  34042. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  34043. if (this.loading) return;
  34044. var _zoomRate$rotateDeg$e = image_viewervue_type_script_lang_js_extends({
  34045. zoomRate: 0.2,
  34046. rotateDeg: 90,
  34047. enableTransition: true
  34048. }, options),
  34049. zoomRate = _zoomRate$rotateDeg$e.zoomRate,
  34050. rotateDeg = _zoomRate$rotateDeg$e.rotateDeg,
  34051. enableTransition = _zoomRate$rotateDeg$e.enableTransition;
  34052. var transform = this.transform;
  34053. switch (action) {
  34054. case 'zoomOut':
  34055. if (transform.scale > 0.2) {
  34056. transform.scale = parseFloat((transform.scale - zoomRate).toFixed(3));
  34057. }
  34058. break;
  34059. case 'zoomIn':
  34060. transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3));
  34061. break;
  34062. case 'clocelise':
  34063. transform.deg += rotateDeg;
  34064. break;
  34065. case 'anticlocelise':
  34066. transform.deg -= rotateDeg;
  34067. break;
  34068. }
  34069. transform.enableTransition = enableTransition;
  34070. }
  34071. },
  34072. mounted: function mounted() {
  34073. this.deviceSupportInstall();
  34074. if (this.appendToBody) {
  34075. document.body.appendChild(this.$el);
  34076. }
  34077. // add tabindex then wrapper can be focusable via Javascript
  34078. // focus wrapper so arrow key can't cause inner scroll behavior underneath
  34079. this.$refs['el-image-viewer__wrapper'].focus();
  34080. },
  34081. destroyed: function destroyed() {
  34082. // if appendToBody is true, remove DOM node after destroy
  34083. if (this.appendToBody && this.$el && this.$el.parentNode) {
  34084. this.$el.parentNode.removeChild(this.$el);
  34085. }
  34086. }
  34087. });
  34088. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=script&lang=js&
  34089. /* harmony default export */ var src_image_viewervue_type_script_lang_js_ = (image_viewervue_type_script_lang_js_);
  34090. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue
  34091. /* normalize component */
  34092. var image_viewer_component = normalizeComponent(
  34093. src_image_viewervue_type_script_lang_js_,
  34094. image_viewervue_type_template_id_5e73b307_render,
  34095. image_viewervue_type_template_id_5e73b307_staticRenderFns,
  34096. false,
  34097. null,
  34098. null,
  34099. null
  34100. )
  34101. /* hot reload */
  34102. if (false) { var image_viewer_api; }
  34103. image_viewer_component.options.__file = "packages/image/src/image-viewer.vue"
  34104. /* harmony default export */ var image_viewer = (image_viewer_component.exports);
  34105. // 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&
  34106. //
  34107. //
  34108. //
  34109. //
  34110. //
  34111. //
  34112. //
  34113. //
  34114. //
  34115. //
  34116. //
  34117. //
  34118. //
  34119. //
  34120. //
  34121. //
  34122. //
  34123. //
  34124. //
  34125. //
  34126. //
  34127. //
  34128. //
  34129. var isSupportObjectFit = function isSupportObjectFit() {
  34130. return document.documentElement.style.objectFit !== undefined;
  34131. };
  34132. var ObjectFit = {
  34133. NONE: 'none',
  34134. CONTAIN: 'contain',
  34135. COVER: 'cover',
  34136. FILL: 'fill',
  34137. SCALE_DOWN: 'scale-down'
  34138. };
  34139. var prevOverflow = '';
  34140. /* harmony default export */ var image_src_mainvue_type_script_lang_js_ = ({
  34141. name: 'ElImage',
  34142. mixins: [locale_default.a],
  34143. inheritAttrs: false,
  34144. components: {
  34145. ImageViewer: image_viewer
  34146. },
  34147. props: {
  34148. src: String,
  34149. fit: String,
  34150. lazy: Boolean,
  34151. scrollContainer: {},
  34152. previewSrcList: {
  34153. type: Array,
  34154. default: function _default() {
  34155. return [];
  34156. }
  34157. },
  34158. zIndex: {
  34159. type: Number,
  34160. default: 2000
  34161. }
  34162. },
  34163. data: function data() {
  34164. return {
  34165. loading: true,
  34166. error: false,
  34167. show: !this.lazy,
  34168. imageWidth: 0,
  34169. imageHeight: 0,
  34170. showViewer: false
  34171. };
  34172. },
  34173. computed: {
  34174. imageStyle: function imageStyle() {
  34175. var fit = this.fit;
  34176. if (!this.$isServer && fit) {
  34177. return isSupportObjectFit() ? { 'object-fit': fit } : this.getImageStyle(fit);
  34178. }
  34179. return {};
  34180. },
  34181. alignCenter: function alignCenter() {
  34182. return !this.$isServer && !isSupportObjectFit() && this.fit !== ObjectFit.FILL;
  34183. },
  34184. preview: function preview() {
  34185. var previewSrcList = this.previewSrcList;
  34186. return Array.isArray(previewSrcList) && previewSrcList.length > 0;
  34187. },
  34188. imageIndex: function imageIndex() {
  34189. var previewIndex = 0;
  34190. var srcIndex = this.previewSrcList.indexOf(this.src);
  34191. if (srcIndex >= 0) {
  34192. previewIndex = srcIndex;
  34193. }
  34194. return previewIndex;
  34195. }
  34196. },
  34197. watch: {
  34198. src: function src(val) {
  34199. this.show && this.loadImage();
  34200. },
  34201. show: function show(val) {
  34202. val && this.loadImage();
  34203. }
  34204. },
  34205. mounted: function mounted() {
  34206. if (this.lazy) {
  34207. this.addLazyLoadListener();
  34208. } else {
  34209. this.loadImage();
  34210. }
  34211. },
  34212. beforeDestroy: function beforeDestroy() {
  34213. this.lazy && this.removeLazyLoadListener();
  34214. },
  34215. methods: {
  34216. loadImage: function loadImage() {
  34217. var _this = this;
  34218. if (this.$isServer) return;
  34219. // reset status
  34220. this.loading = true;
  34221. this.error = false;
  34222. var img = new Image();
  34223. img.onload = function (e) {
  34224. return _this.handleLoad(e, img);
  34225. };
  34226. img.onerror = this.handleError.bind(this);
  34227. // bind html attrs
  34228. // so it can behave consistently
  34229. Object.keys(this.$attrs).forEach(function (key) {
  34230. var value = _this.$attrs[key];
  34231. img.setAttribute(key, value);
  34232. });
  34233. img.src = this.src;
  34234. },
  34235. handleLoad: function handleLoad(e, img) {
  34236. this.imageWidth = img.width;
  34237. this.imageHeight = img.height;
  34238. this.loading = false;
  34239. this.error = false;
  34240. },
  34241. handleError: function handleError(e) {
  34242. this.loading = false;
  34243. this.error = true;
  34244. this.$emit('error', e);
  34245. },
  34246. handleLazyLoad: function handleLazyLoad() {
  34247. if (Object(dom_["isInContainer"])(this.$el, this._scrollContainer)) {
  34248. this.show = true;
  34249. this.removeLazyLoadListener();
  34250. }
  34251. },
  34252. addLazyLoadListener: function addLazyLoadListener() {
  34253. if (this.$isServer) return;
  34254. var scrollContainer = this.scrollContainer;
  34255. var _scrollContainer = null;
  34256. if (Object(types_["isHtmlElement"])(scrollContainer)) {
  34257. _scrollContainer = scrollContainer;
  34258. } else if (Object(types_["isString"])(scrollContainer)) {
  34259. _scrollContainer = document.querySelector(scrollContainer);
  34260. } else {
  34261. _scrollContainer = Object(dom_["getScrollContainer"])(this.$el);
  34262. }
  34263. if (_scrollContainer) {
  34264. this._scrollContainer = _scrollContainer;
  34265. this._lazyLoadHandler = throttle_default()(200, this.handleLazyLoad);
  34266. Object(dom_["on"])(_scrollContainer, 'scroll', this._lazyLoadHandler);
  34267. this.handleLazyLoad();
  34268. }
  34269. },
  34270. removeLazyLoadListener: function removeLazyLoadListener() {
  34271. var _scrollContainer = this._scrollContainer,
  34272. _lazyLoadHandler = this._lazyLoadHandler;
  34273. if (this.$isServer || !_scrollContainer || !_lazyLoadHandler) return;
  34274. Object(dom_["off"])(_scrollContainer, 'scroll', _lazyLoadHandler);
  34275. this._scrollContainer = null;
  34276. this._lazyLoadHandler = null;
  34277. },
  34278. /**
  34279. * simulate object-fit behavior to compatible with IE11 and other browsers which not support object-fit
  34280. */
  34281. getImageStyle: function getImageStyle(fit) {
  34282. var imageWidth = this.imageWidth,
  34283. imageHeight = this.imageHeight;
  34284. var _$el = this.$el,
  34285. containerWidth = _$el.clientWidth,
  34286. containerHeight = _$el.clientHeight;
  34287. if (!imageWidth || !imageHeight || !containerWidth || !containerHeight) return {};
  34288. var imageAspectRatio = imageWidth / imageHeight;
  34289. var containerAspectRatio = containerWidth / containerHeight;
  34290. if (fit === ObjectFit.SCALE_DOWN) {
  34291. var isSmaller = imageWidth < containerWidth && imageHeight < containerHeight;
  34292. fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
  34293. }
  34294. switch (fit) {
  34295. case ObjectFit.NONE:
  34296. return { width: 'auto', height: 'auto' };
  34297. case ObjectFit.CONTAIN:
  34298. return imageAspectRatio < containerAspectRatio ? { width: 'auto' } : { height: 'auto' };
  34299. case ObjectFit.COVER:
  34300. return imageAspectRatio < containerAspectRatio ? { height: 'auto' } : { width: 'auto' };
  34301. default:
  34302. return {};
  34303. }
  34304. },
  34305. clickHandler: function clickHandler() {
  34306. // don't show viewer when preview is false
  34307. if (!this.preview) {
  34308. return;
  34309. }
  34310. // prevent body scroll
  34311. prevOverflow = document.body.style.overflow;
  34312. document.body.style.overflow = 'hidden';
  34313. this.showViewer = true;
  34314. },
  34315. closeViewer: function closeViewer() {
  34316. document.body.style.overflow = prevOverflow;
  34317. this.showViewer = false;
  34318. }
  34319. }
  34320. });
  34321. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=script&lang=js&
  34322. /* harmony default export */ var packages_image_src_mainvue_type_script_lang_js_ = (image_src_mainvue_type_script_lang_js_);
  34323. // CONCATENATED MODULE: ./packages/image/src/main.vue
  34324. /* normalize component */
  34325. var image_src_main_component = normalizeComponent(
  34326. packages_image_src_mainvue_type_script_lang_js_,
  34327. mainvue_type_template_id_44d84a7c_render,
  34328. mainvue_type_template_id_44d84a7c_staticRenderFns,
  34329. false,
  34330. null,
  34331. null,
  34332. null
  34333. )
  34334. /* hot reload */
  34335. if (false) { var image_src_main_api; }
  34336. image_src_main_component.options.__file = "packages/image/src/main.vue"
  34337. /* harmony default export */ var image_src_main = (image_src_main_component.exports);
  34338. // CONCATENATED MODULE: ./packages/image/index.js
  34339. /* istanbul ignore next */
  34340. image_src_main.install = function (Vue) {
  34341. Vue.component(image_src_main.name, image_src_main);
  34342. };
  34343. /* harmony default export */ var packages_image = (image_src_main);
  34344. // 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&
  34345. var mainvue_type_template_id_6d9756be_render = function() {
  34346. var _vm = this
  34347. var _h = _vm.$createElement
  34348. var _c = _vm._self._c || _h
  34349. return _c("div", { staticClass: "el-calendar" }, [
  34350. _c("div", { staticClass: "el-calendar__header" }, [
  34351. _c("div", { staticClass: "el-calendar__title" }, [
  34352. _vm._v("\n " + _vm._s(_vm.i18nDate) + "\n ")
  34353. ]),
  34354. _vm.validatedRange.length === 0
  34355. ? _c(
  34356. "div",
  34357. { staticClass: "el-calendar__button-group" },
  34358. [
  34359. _c(
  34360. "el-button-group",
  34361. [
  34362. _c(
  34363. "el-button",
  34364. {
  34365. attrs: { type: "plain", size: "mini" },
  34366. on: {
  34367. click: function($event) {
  34368. _vm.selectDate("prev-month")
  34369. }
  34370. }
  34371. },
  34372. [
  34373. _vm._v(
  34374. "\n " +
  34375. _vm._s(_vm.t("el.datepicker.prevMonth")) +
  34376. "\n "
  34377. )
  34378. ]
  34379. ),
  34380. _c(
  34381. "el-button",
  34382. {
  34383. attrs: { type: "plain", size: "mini" },
  34384. on: {
  34385. click: function($event) {
  34386. _vm.selectDate("today")
  34387. }
  34388. }
  34389. },
  34390. [
  34391. _vm._v(
  34392. "\n " +
  34393. _vm._s(_vm.t("el.datepicker.today")) +
  34394. "\n "
  34395. )
  34396. ]
  34397. ),
  34398. _c(
  34399. "el-button",
  34400. {
  34401. attrs: { type: "plain", size: "mini" },
  34402. on: {
  34403. click: function($event) {
  34404. _vm.selectDate("next-month")
  34405. }
  34406. }
  34407. },
  34408. [
  34409. _vm._v(
  34410. "\n " +
  34411. _vm._s(_vm.t("el.datepicker.nextMonth")) +
  34412. "\n "
  34413. )
  34414. ]
  34415. )
  34416. ],
  34417. 1
  34418. )
  34419. ],
  34420. 1
  34421. )
  34422. : _vm._e()
  34423. ]),
  34424. _vm.validatedRange.length === 0
  34425. ? _c(
  34426. "div",
  34427. { key: "no-range", staticClass: "el-calendar__body" },
  34428. [
  34429. _c("date-table", {
  34430. attrs: {
  34431. date: _vm.date,
  34432. "selected-day": _vm.realSelectedDay,
  34433. "first-day-of-week": _vm.realFirstDayOfWeek
  34434. },
  34435. on: { pick: _vm.pickDay }
  34436. })
  34437. ],
  34438. 1
  34439. )
  34440. : _c(
  34441. "div",
  34442. { key: "has-range", staticClass: "el-calendar__body" },
  34443. _vm._l(_vm.validatedRange, function(range, index) {
  34444. return _c("date-table", {
  34445. key: index,
  34446. attrs: {
  34447. date: range[0],
  34448. "selected-day": _vm.realSelectedDay,
  34449. range: range,
  34450. "hide-header": index !== 0,
  34451. "first-day-of-week": _vm.realFirstDayOfWeek
  34452. },
  34453. on: { pick: _vm.pickDay }
  34454. })
  34455. }),
  34456. 1
  34457. )
  34458. ])
  34459. }
  34460. var mainvue_type_template_id_6d9756be_staticRenderFns = []
  34461. mainvue_type_template_id_6d9756be_render._withStripped = true
  34462. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
  34463. // EXTERNAL MODULE: external "element-ui/lib/utils/date"
  34464. var date_ = __webpack_require__(20);
  34465. var date_default = /*#__PURE__*/__webpack_require__.n(date_);
  34466. // 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&
  34467. /* harmony default export */ var src_date_tablevue_type_script_lang_js_ = ({
  34468. props: {
  34469. selectedDay: String, // formated date yyyy-MM-dd
  34470. range: {
  34471. type: Array,
  34472. validator: function validator(val) {
  34473. if (!(val && val.length)) return true;
  34474. var start = val[0],
  34475. end = val[1];
  34476. return Object(date_util_["validateRangeInOneMonth"])(start, end);
  34477. }
  34478. },
  34479. date: Date,
  34480. hideHeader: Boolean,
  34481. firstDayOfWeek: Number
  34482. },
  34483. inject: ['elCalendar'],
  34484. methods: {
  34485. toNestedArr: function toNestedArr(days) {
  34486. return Object(date_util_["range"])(days.length / 7).map(function (_, index) {
  34487. var start = index * 7;
  34488. return days.slice(start, start + 7);
  34489. });
  34490. },
  34491. getFormateDate: function getFormateDate(day, type) {
  34492. if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) {
  34493. throw new Error('invalid day or type');
  34494. }
  34495. var prefix = this.curMonthDatePrefix;
  34496. if (type === 'prev') {
  34497. prefix = this.prevMonthDatePrefix;
  34498. } else if (type === 'next') {
  34499. prefix = this.nextMonthDatePrefix;
  34500. }
  34501. day = ('00' + day).slice(-2);
  34502. return prefix + '-' + day;
  34503. },
  34504. getCellClass: function getCellClass(_ref) {
  34505. var text = _ref.text,
  34506. type = _ref.type;
  34507. var classes = [type];
  34508. if (type === 'current') {
  34509. var date = this.getFormateDate(text, type);
  34510. if (date === this.selectedDay) {
  34511. classes.push('is-selected');
  34512. }
  34513. if (date === this.formatedToday) {
  34514. classes.push('is-today');
  34515. }
  34516. }
  34517. return classes;
  34518. },
  34519. pickDay: function pickDay(_ref2) {
  34520. var text = _ref2.text,
  34521. type = _ref2.type;
  34522. var date = this.getFormateDate(text, type);
  34523. this.$emit('pick', date);
  34524. },
  34525. cellRenderProxy: function cellRenderProxy(_ref3) {
  34526. var text = _ref3.text,
  34527. type = _ref3.type;
  34528. var h = this.$createElement;
  34529. var render = this.elCalendar.$scopedSlots.dateCell;
  34530. if (!render) return h('span', [text]);
  34531. var day = this.getFormateDate(text, type);
  34532. var date = new Date(day);
  34533. var data = {
  34534. isSelected: this.selectedDay === day,
  34535. type: type + '-month',
  34536. day: day
  34537. };
  34538. return render({ date: date, data: data });
  34539. }
  34540. },
  34541. computed: {
  34542. WEEK_DAYS: function WEEK_DAYS() {
  34543. return Object(date_util_["getI18nSettings"])().dayNames;
  34544. },
  34545. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34546. var temp = new Date(this.date.getTime());
  34547. temp.setDate(0);
  34548. return date_default.a.format(temp, 'yyyy-MM');
  34549. },
  34550. curMonthDatePrefix: function curMonthDatePrefix() {
  34551. return date_default.a.format(this.date, 'yyyy-MM');
  34552. },
  34553. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34554. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34555. return date_default.a.format(temp, 'yyyy-MM');
  34556. },
  34557. formatedToday: function formatedToday() {
  34558. return this.elCalendar.formatedToday;
  34559. },
  34560. isInRange: function isInRange() {
  34561. return this.range && this.range.length;
  34562. },
  34563. rows: function rows() {
  34564. var days = [];
  34565. // if range exists, should render days in range.
  34566. if (this.isInRange) {
  34567. var _range = this.range,
  34568. start = _range[0],
  34569. end = _range[1];
  34570. var currentMonthRange = Object(date_util_["range"])(end.getDate() - start.getDate() + 1).map(function (_, index) {
  34571. return {
  34572. text: start.getDate() + index,
  34573. type: 'current'
  34574. };
  34575. });
  34576. var remaining = currentMonthRange.length % 7;
  34577. remaining = remaining === 0 ? 0 : 7 - remaining;
  34578. var nextMonthRange = Object(date_util_["range"])(remaining).map(function (_, index) {
  34579. return {
  34580. text: index + 1,
  34581. type: 'next'
  34582. };
  34583. });
  34584. days = currentMonthRange.concat(nextMonthRange);
  34585. } else {
  34586. var date = this.date;
  34587. var firstDay = Object(date_util_["getFirstDayOfMonth"])(date);
  34588. firstDay = firstDay === 0 ? 7 : firstDay;
  34589. var firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
  34590. var offset = (7 + firstDay - firstDayOfWeek) % 7;
  34591. var prevMonthDays = Object(date_util_["getPrevMonthLastDays"])(date, offset).map(function (day) {
  34592. return {
  34593. text: day,
  34594. type: 'prev'
  34595. };
  34596. });
  34597. var currentMonthDays = Object(date_util_["getMonthDays"])(date).map(function (day) {
  34598. return {
  34599. text: day,
  34600. type: 'current'
  34601. };
  34602. });
  34603. days = [].concat(prevMonthDays, currentMonthDays);
  34604. var nextMonthDays = Object(date_util_["range"])(42 - days.length).map(function (_, index) {
  34605. return {
  34606. text: index + 1,
  34607. type: 'next'
  34608. };
  34609. });
  34610. days = days.concat(nextMonthDays);
  34611. }
  34612. return this.toNestedArr(days);
  34613. },
  34614. weekDays: function weekDays() {
  34615. var start = this.firstDayOfWeek;
  34616. var WEEK_DAYS = this.WEEK_DAYS;
  34617. if (typeof start !== 'number' || start === 0) {
  34618. return WEEK_DAYS.slice();
  34619. } else {
  34620. return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start));
  34621. }
  34622. }
  34623. },
  34624. render: function render() {
  34625. var _this = this;
  34626. var h = arguments[0];
  34627. var thead = this.hideHeader ? null : h('thead', [this.weekDays.map(function (day) {
  34628. return h(
  34629. 'th',
  34630. { key: day },
  34631. [day]
  34632. );
  34633. })]);
  34634. return h(
  34635. 'table',
  34636. {
  34637. 'class': {
  34638. 'el-calendar-table': true,
  34639. 'is-range': this.isInRange
  34640. },
  34641. attrs: { cellspacing: '0',
  34642. cellpadding: '0' }
  34643. },
  34644. [thead, h('tbody', [this.rows.map(function (row, index) {
  34645. return h(
  34646. 'tr',
  34647. {
  34648. 'class': {
  34649. 'el-calendar-table__row': true,
  34650. 'el-calendar-table__row--hide-border': index === 0 && _this.hideHeader
  34651. },
  34652. key: index },
  34653. [row.map(function (cell, key) {
  34654. return h(
  34655. 'td',
  34656. { key: key,
  34657. 'class': _this.getCellClass(cell),
  34658. on: {
  34659. 'click': _this.pickDay.bind(_this, cell)
  34660. }
  34661. },
  34662. [h(
  34663. 'div',
  34664. { 'class': 'el-calendar-day' },
  34665. [_this.cellRenderProxy(cell)]
  34666. )]
  34667. );
  34668. })]
  34669. );
  34670. })])]
  34671. );
  34672. }
  34673. });
  34674. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
  34675. /* harmony default export */ var calendar_src_date_tablevue_type_script_lang_js_ = (src_date_tablevue_type_script_lang_js_);
  34676. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue
  34677. var date_table_render, date_table_staticRenderFns
  34678. /* normalize component */
  34679. var src_date_table_component = normalizeComponent(
  34680. calendar_src_date_tablevue_type_script_lang_js_,
  34681. date_table_render,
  34682. date_table_staticRenderFns,
  34683. false,
  34684. null,
  34685. null,
  34686. null
  34687. )
  34688. /* hot reload */
  34689. if (false) { var src_date_table_api; }
  34690. src_date_table_component.options.__file = "packages/calendar/src/date-table.vue"
  34691. /* harmony default export */ var src_date_table = (src_date_table_component.exports);
  34692. // 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&
  34693. //
  34694. //
  34695. //
  34696. //
  34697. //
  34698. //
  34699. //
  34700. //
  34701. //
  34702. //
  34703. //
  34704. //
  34705. //
  34706. //
  34707. //
  34708. //
  34709. //
  34710. //
  34711. //
  34712. //
  34713. //
  34714. //
  34715. //
  34716. //
  34717. //
  34718. //
  34719. //
  34720. //
  34721. //
  34722. //
  34723. //
  34724. //
  34725. //
  34726. //
  34727. //
  34728. //
  34729. //
  34730. //
  34731. //
  34732. //
  34733. //
  34734. //
  34735. //
  34736. //
  34737. //
  34738. //
  34739. //
  34740. //
  34741. //
  34742. //
  34743. //
  34744. //
  34745. //
  34746. //
  34747. //
  34748. //
  34749. //
  34750. //
  34751. var validTypes = ['prev-month', 'today', 'next-month'];
  34752. var weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
  34753. var oneDay = 86400000;
  34754. /* harmony default export */ var calendar_src_mainvue_type_script_lang_js_ = ({
  34755. name: 'ElCalendar',
  34756. mixins: [locale_default.a],
  34757. components: {
  34758. DateTable: src_date_table,
  34759. ElButton: button_default.a,
  34760. ElButtonGroup: button_group_default.a
  34761. },
  34762. props: {
  34763. value: [Date, String, Number],
  34764. range: {
  34765. type: Array,
  34766. validator: function validator(range) {
  34767. if (Array.isArray(range)) {
  34768. return range.length === 2 && range.every(function (item) {
  34769. return typeof item === 'string' || typeof item === 'number' || item instanceof Date;
  34770. });
  34771. } else {
  34772. return true;
  34773. }
  34774. }
  34775. },
  34776. firstDayOfWeek: {
  34777. type: Number,
  34778. default: 1
  34779. }
  34780. },
  34781. provide: function provide() {
  34782. return {
  34783. elCalendar: this
  34784. };
  34785. },
  34786. methods: {
  34787. pickDay: function pickDay(day) {
  34788. this.realSelectedDay = day;
  34789. },
  34790. selectDate: function selectDate(type) {
  34791. if (validTypes.indexOf(type) === -1) {
  34792. throw new Error('invalid type ' + type);
  34793. }
  34794. var day = '';
  34795. if (type === 'prev-month') {
  34796. day = this.prevMonthDatePrefix + '-01';
  34797. } else if (type === 'next-month') {
  34798. day = this.nextMonthDatePrefix + '-01';
  34799. } else {
  34800. day = this.formatedToday;
  34801. }
  34802. if (day === this.formatedDate) return;
  34803. this.pickDay(day);
  34804. },
  34805. toDate: function toDate(val) {
  34806. if (!val) {
  34807. throw new Error('invalid val');
  34808. }
  34809. return val instanceof Date ? val : new Date(val);
  34810. },
  34811. rangeValidator: function rangeValidator(date, isStart) {
  34812. var firstDayOfWeek = this.realFirstDayOfWeek;
  34813. var expected = isStart ? firstDayOfWeek : firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
  34814. var message = (isStart ? 'start' : 'end') + ' of range should be ' + weekDays[expected] + '.';
  34815. if (date.getDay() !== expected) {
  34816. console.warn('[ElementCalendar]', message, 'Invalid range will be ignored.');
  34817. return false;
  34818. }
  34819. return true;
  34820. }
  34821. },
  34822. computed: {
  34823. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34824. var temp = new Date(this.date.getTime());
  34825. temp.setDate(0);
  34826. return date_default.a.format(temp, 'yyyy-MM');
  34827. },
  34828. curMonthDatePrefix: function curMonthDatePrefix() {
  34829. return date_default.a.format(this.date, 'yyyy-MM');
  34830. },
  34831. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34832. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34833. return date_default.a.format(temp, 'yyyy-MM');
  34834. },
  34835. formatedDate: function formatedDate() {
  34836. return date_default.a.format(this.date, 'yyyy-MM-dd');
  34837. },
  34838. i18nDate: function i18nDate() {
  34839. var year = this.date.getFullYear();
  34840. var month = this.date.getMonth() + 1;
  34841. return year + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + month);
  34842. },
  34843. formatedToday: function formatedToday() {
  34844. return date_default.a.format(this.now, 'yyyy-MM-dd');
  34845. },
  34846. realSelectedDay: {
  34847. get: function get() {
  34848. if (!this.value) return this.selectedDay;
  34849. return this.formatedDate;
  34850. },
  34851. set: function set(val) {
  34852. this.selectedDay = val;
  34853. var date = new Date(val);
  34854. this.$emit('input', date);
  34855. }
  34856. },
  34857. date: function date() {
  34858. if (!this.value) {
  34859. if (this.realSelectedDay) {
  34860. var d = this.selectedDay.split('-');
  34861. return new Date(d[0], d[1] - 1, d[2]);
  34862. } else if (this.validatedRange.length) {
  34863. return this.validatedRange[0][0];
  34864. }
  34865. return this.now;
  34866. } else {
  34867. return this.toDate(this.value);
  34868. }
  34869. },
  34870. // if range is valid, we get a two-digit array
  34871. validatedRange: function validatedRange() {
  34872. var _this = this;
  34873. var range = this.range;
  34874. if (!range) return [];
  34875. range = range.reduce(function (prev, val, index) {
  34876. var date = _this.toDate(val);
  34877. if (_this.rangeValidator(date, index === 0)) {
  34878. prev = prev.concat(date);
  34879. }
  34880. return prev;
  34881. }, []);
  34882. if (range.length === 2) {
  34883. var _range = range,
  34884. start = _range[0],
  34885. end = _range[1];
  34886. if (start > end) {
  34887. console.warn('[ElementCalendar]end time should be greater than start time');
  34888. return [];
  34889. }
  34890. // start time and end time in one month
  34891. if (Object(date_util_["validateRangeInOneMonth"])(start, end)) {
  34892. return [[start, end]];
  34893. }
  34894. var data = [];
  34895. var startDay = new Date(start.getFullYear(), start.getMonth() + 1, 1);
  34896. var lastDay = this.toDate(startDay.getTime() - oneDay);
  34897. if (!Object(date_util_["validateRangeInOneMonth"])(startDay, end)) {
  34898. console.warn('[ElementCalendar]start time and end time interval must not exceed two months');
  34899. return [];
  34900. }
  34901. // 第一个月的时间范围
  34902. data.push([start, lastDay]);
  34903. // 下一月的时间范围,需要计算一下该月的第一个周起始日
  34904. var firstDayOfWeek = this.realFirstDayOfWeek;
  34905. var nextMontFirstDay = startDay.getDay();
  34906. var interval = 0;
  34907. if (nextMontFirstDay !== firstDayOfWeek) {
  34908. if (firstDayOfWeek === 0) {
  34909. interval = 7 - nextMontFirstDay;
  34910. } else {
  34911. interval = firstDayOfWeek - nextMontFirstDay;
  34912. interval = interval > 0 ? interval : 7 + interval;
  34913. }
  34914. }
  34915. startDay = this.toDate(startDay.getTime() + interval * oneDay);
  34916. if (startDay.getDate() < end.getDate()) {
  34917. data.push([startDay, end]);
  34918. }
  34919. return data;
  34920. }
  34921. return [];
  34922. },
  34923. realFirstDayOfWeek: function realFirstDayOfWeek() {
  34924. if (this.firstDayOfWeek < 1 || this.firstDayOfWeek > 6) {
  34925. return 0;
  34926. }
  34927. return Math.floor(this.firstDayOfWeek);
  34928. }
  34929. },
  34930. data: function data() {
  34931. return {
  34932. selectedDay: '',
  34933. now: new Date()
  34934. };
  34935. }
  34936. });
  34937. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=script&lang=js&
  34938. /* harmony default export */ var packages_calendar_src_mainvue_type_script_lang_js_ = (calendar_src_mainvue_type_script_lang_js_);
  34939. // CONCATENATED MODULE: ./packages/calendar/src/main.vue
  34940. /* normalize component */
  34941. var calendar_src_main_component = normalizeComponent(
  34942. packages_calendar_src_mainvue_type_script_lang_js_,
  34943. mainvue_type_template_id_6d9756be_render,
  34944. mainvue_type_template_id_6d9756be_staticRenderFns,
  34945. false,
  34946. null,
  34947. null,
  34948. null
  34949. )
  34950. /* hot reload */
  34951. if (false) { var calendar_src_main_api; }
  34952. calendar_src_main_component.options.__file = "packages/calendar/src/main.vue"
  34953. /* harmony default export */ var calendar_src_main = (calendar_src_main_component.exports);
  34954. // CONCATENATED MODULE: ./packages/calendar/index.js
  34955. /* istanbul ignore next */
  34956. calendar_src_main.install = function (Vue) {
  34957. Vue.component(calendar_src_main.name, calendar_src_main);
  34958. };
  34959. /* harmony default export */ var calendar = (calendar_src_main);
  34960. // 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&
  34961. var mainvue_type_template_id_257dd4a9_render = function() {
  34962. var _vm = this
  34963. var _h = _vm.$createElement
  34964. var _c = _vm._self._c || _h
  34965. return _c("transition", { attrs: { name: "el-fade-in" } }, [
  34966. _vm.visible
  34967. ? _c(
  34968. "div",
  34969. {
  34970. staticClass: "el-backtop",
  34971. style: {
  34972. right: _vm.styleRight,
  34973. bottom: _vm.styleBottom
  34974. },
  34975. on: {
  34976. click: function($event) {
  34977. $event.stopPropagation()
  34978. return _vm.handleClick($event)
  34979. }
  34980. }
  34981. },
  34982. [
  34983. _vm._t("default", [_c("el-icon", { attrs: { name: "caret-top" } })])
  34984. ],
  34985. 2
  34986. )
  34987. : _vm._e()
  34988. ])
  34989. }
  34990. var mainvue_type_template_id_257dd4a9_staticRenderFns = []
  34991. mainvue_type_template_id_257dd4a9_render._withStripped = true
  34992. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=template&id=257dd4a9&
  34993. // 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&
  34994. //
  34995. //
  34996. //
  34997. //
  34998. //
  34999. //
  35000. //
  35001. //
  35002. //
  35003. //
  35004. //
  35005. //
  35006. //
  35007. //
  35008. //
  35009. //
  35010. //
  35011. var cubic = function cubic(value) {
  35012. return Math.pow(value, 3);
  35013. };
  35014. var easeInOutCubic = function easeInOutCubic(value) {
  35015. return value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2;
  35016. };
  35017. /* harmony default export */ var backtop_src_mainvue_type_script_lang_js_ = ({
  35018. name: 'ElBacktop',
  35019. props: {
  35020. visibilityHeight: {
  35021. type: Number,
  35022. default: 200
  35023. },
  35024. target: [String],
  35025. right: {
  35026. type: Number,
  35027. default: 40
  35028. },
  35029. bottom: {
  35030. type: Number,
  35031. default: 40
  35032. }
  35033. },
  35034. data: function data() {
  35035. return {
  35036. el: null,
  35037. container: null,
  35038. visible: false
  35039. };
  35040. },
  35041. computed: {
  35042. styleBottom: function styleBottom() {
  35043. return this.bottom + 'px';
  35044. },
  35045. styleRight: function styleRight() {
  35046. return this.right + 'px';
  35047. }
  35048. },
  35049. mounted: function mounted() {
  35050. this.init();
  35051. this.throttledScrollHandler = throttle_default()(300, this.onScroll);
  35052. this.container.addEventListener('scroll', this.throttledScrollHandler);
  35053. },
  35054. methods: {
  35055. init: function init() {
  35056. this.container = document;
  35057. this.el = document.documentElement;
  35058. if (this.target) {
  35059. this.el = document.querySelector(this.target);
  35060. if (!this.el) {
  35061. throw new Error('target is not existed: ' + this.target);
  35062. }
  35063. this.container = this.el;
  35064. }
  35065. },
  35066. onScroll: function onScroll() {
  35067. var scrollTop = this.el.scrollTop;
  35068. this.visible = scrollTop >= this.visibilityHeight;
  35069. },
  35070. handleClick: function handleClick(e) {
  35071. this.scrollToTop();
  35072. this.$emit('click', e);
  35073. },
  35074. scrollToTop: function scrollToTop() {
  35075. var el = this.el;
  35076. var beginTime = Date.now();
  35077. var beginValue = el.scrollTop;
  35078. var rAF = window.requestAnimationFrame || function (func) {
  35079. return setTimeout(func, 16);
  35080. };
  35081. var frameFunc = function frameFunc() {
  35082. var progress = (Date.now() - beginTime) / 500;
  35083. if (progress < 1) {
  35084. el.scrollTop = beginValue * (1 - easeInOutCubic(progress));
  35085. rAF(frameFunc);
  35086. } else {
  35087. el.scrollTop = 0;
  35088. }
  35089. };
  35090. rAF(frameFunc);
  35091. }
  35092. },
  35093. beforeDestroy: function beforeDestroy() {
  35094. this.container.removeEventListener('scroll', this.throttledScrollHandler);
  35095. }
  35096. });
  35097. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=script&lang=js&
  35098. /* harmony default export */ var packages_backtop_src_mainvue_type_script_lang_js_ = (backtop_src_mainvue_type_script_lang_js_);
  35099. // CONCATENATED MODULE: ./packages/backtop/src/main.vue
  35100. /* normalize component */
  35101. var backtop_src_main_component = normalizeComponent(
  35102. packages_backtop_src_mainvue_type_script_lang_js_,
  35103. mainvue_type_template_id_257dd4a9_render,
  35104. mainvue_type_template_id_257dd4a9_staticRenderFns,
  35105. false,
  35106. null,
  35107. null,
  35108. null
  35109. )
  35110. /* hot reload */
  35111. if (false) { var backtop_src_main_api; }
  35112. backtop_src_main_component.options.__file = "packages/backtop/src/main.vue"
  35113. /* harmony default export */ var backtop_src_main = (backtop_src_main_component.exports);
  35114. // CONCATENATED MODULE: ./packages/backtop/index.js
  35115. /* istanbul ignore next */
  35116. backtop_src_main.install = function (Vue) {
  35117. Vue.component(backtop_src_main.name, backtop_src_main);
  35118. };
  35119. /* harmony default export */ var backtop = (backtop_src_main);
  35120. // CONCATENATED MODULE: ./packages/infinite-scroll/src/main.js
  35121. var getStyleComputedProperty = function getStyleComputedProperty(element, property) {
  35122. if (element === window) {
  35123. element = document.documentElement;
  35124. }
  35125. if (element.nodeType !== 1) {
  35126. return [];
  35127. }
  35128. // NOTE: 1 DOM access here
  35129. var css = window.getComputedStyle(element, null);
  35130. return property ? css[property] : css;
  35131. };
  35132. var entries = function entries(obj) {
  35133. return Object.keys(obj || {}).map(function (key) {
  35134. return [key, obj[key]];
  35135. });
  35136. };
  35137. var getPositionSize = function getPositionSize(el, prop) {
  35138. return el === window || el === document ? document.documentElement[prop] : el[prop];
  35139. };
  35140. var getOffsetHeight = function getOffsetHeight(el) {
  35141. return getPositionSize(el, 'offsetHeight');
  35142. };
  35143. var getClientHeight = function getClientHeight(el) {
  35144. return getPositionSize(el, 'clientHeight');
  35145. };
  35146. var scope = 'ElInfiniteScroll';
  35147. var attributes = {
  35148. delay: {
  35149. type: Number,
  35150. default: 200
  35151. },
  35152. distance: {
  35153. type: Number,
  35154. default: 0
  35155. },
  35156. disabled: {
  35157. type: Boolean,
  35158. default: false
  35159. },
  35160. immediate: {
  35161. type: Boolean,
  35162. default: true
  35163. }
  35164. };
  35165. var main_getScrollOptions = function getScrollOptions(el, vm) {
  35166. if (!Object(types_["isHtmlElement"])(el)) return {};
  35167. return entries(attributes).reduce(function (map, _ref) {
  35168. var key = _ref[0],
  35169. option = _ref[1];
  35170. var type = option.type,
  35171. defaultValue = option.default;
  35172. var value = el.getAttribute('infinite-scroll-' + key);
  35173. value = Object(types_["isUndefined"])(vm[value]) ? value : vm[value];
  35174. switch (type) {
  35175. case Number:
  35176. value = Number(value);
  35177. value = Number.isNaN(value) ? defaultValue : value;
  35178. break;
  35179. case Boolean:
  35180. value = Object(types_["isDefined"])(value) ? value === 'false' ? false : Boolean(value) : defaultValue;
  35181. break;
  35182. default:
  35183. value = type(value);
  35184. }
  35185. map[key] = value;
  35186. return map;
  35187. }, {});
  35188. };
  35189. var getElementTop = function getElementTop(el) {
  35190. return el.getBoundingClientRect().top;
  35191. };
  35192. var main_handleScroll = function handleScroll(cb) {
  35193. var _scope = this[scope],
  35194. el = _scope.el,
  35195. vm = _scope.vm,
  35196. container = _scope.container,
  35197. observer = _scope.observer;
  35198. var _getScrollOptions = main_getScrollOptions(el, vm),
  35199. distance = _getScrollOptions.distance,
  35200. disabled = _getScrollOptions.disabled;
  35201. if (disabled) return;
  35202. var containerInfo = container.getBoundingClientRect();
  35203. if (!containerInfo.width && !containerInfo.height) return;
  35204. var shouldTrigger = false;
  35205. if (container === el) {
  35206. // be aware of difference between clientHeight & offsetHeight & window.getComputedStyle().height
  35207. var scrollBottom = container.scrollTop + getClientHeight(container);
  35208. shouldTrigger = container.scrollHeight - scrollBottom <= distance;
  35209. } else {
  35210. var heightBelowTop = getOffsetHeight(el) + getElementTop(el) - getElementTop(container);
  35211. var offsetHeight = getOffsetHeight(container);
  35212. var borderBottom = Number.parseFloat(getStyleComputedProperty(container, 'borderBottomWidth'));
  35213. shouldTrigger = heightBelowTop - offsetHeight + borderBottom <= distance;
  35214. }
  35215. if (shouldTrigger && Object(types_["isFunction"])(cb)) {
  35216. cb.call(vm);
  35217. } else if (observer) {
  35218. observer.disconnect();
  35219. this[scope].observer = null;
  35220. }
  35221. };
  35222. /* harmony default export */ var infinite_scroll_src_main = ({
  35223. name: 'InfiniteScroll',
  35224. inserted: function inserted(el, binding, vnode) {
  35225. var cb = binding.value;
  35226. var vm = vnode.context;
  35227. // only include vertical scroll
  35228. var container = Object(dom_["getScrollContainer"])(el, true);
  35229. var _getScrollOptions2 = main_getScrollOptions(el, vm),
  35230. delay = _getScrollOptions2.delay,
  35231. immediate = _getScrollOptions2.immediate;
  35232. var onScroll = debounce_default()(delay, main_handleScroll.bind(el, cb));
  35233. el[scope] = { el: el, vm: vm, container: container, onScroll: onScroll };
  35234. if (container) {
  35235. container.addEventListener('scroll', onScroll);
  35236. if (immediate) {
  35237. var observer = el[scope].observer = new MutationObserver(onScroll);
  35238. observer.observe(container, { childList: true, subtree: true });
  35239. onScroll();
  35240. }
  35241. }
  35242. },
  35243. unbind: function unbind(el) {
  35244. var _el$scope = el[scope],
  35245. container = _el$scope.container,
  35246. onScroll = _el$scope.onScroll;
  35247. if (container) {
  35248. container.removeEventListener('scroll', onScroll);
  35249. }
  35250. }
  35251. });
  35252. // CONCATENATED MODULE: ./packages/infinite-scroll/index.js
  35253. /* istanbul ignore next */
  35254. infinite_scroll_src_main.install = function (Vue) {
  35255. Vue.directive(infinite_scroll_src_main.name, infinite_scroll_src_main);
  35256. };
  35257. /* harmony default export */ var infinite_scroll = (infinite_scroll_src_main);
  35258. // 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&
  35259. var mainvue_type_template_id_5070954c_render = function() {
  35260. var _vm = this
  35261. var _h = _vm.$createElement
  35262. var _c = _vm._self._c || _h
  35263. return _c("div", { staticClass: "el-page-header" }, [
  35264. _c(
  35265. "div",
  35266. {
  35267. staticClass: "el-page-header__left",
  35268. on: {
  35269. click: function($event) {
  35270. _vm.$emit("back")
  35271. }
  35272. }
  35273. },
  35274. [
  35275. _c("i", { staticClass: "el-icon-back" }),
  35276. _c(
  35277. "div",
  35278. { staticClass: "el-page-header__title" },
  35279. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  35280. 2
  35281. )
  35282. ]
  35283. ),
  35284. _c(
  35285. "div",
  35286. { staticClass: "el-page-header__content" },
  35287. [_vm._t("content", [_vm._v(_vm._s(_vm.content))])],
  35288. 2
  35289. )
  35290. ])
  35291. }
  35292. var mainvue_type_template_id_5070954c_staticRenderFns = []
  35293. mainvue_type_template_id_5070954c_render._withStripped = true
  35294. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=template&id=5070954c&
  35295. // 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&
  35296. //
  35297. //
  35298. //
  35299. //
  35300. //
  35301. //
  35302. //
  35303. //
  35304. //
  35305. //
  35306. //
  35307. //
  35308. //
  35309. //
  35310. /* harmony default export */ var page_header_src_mainvue_type_script_lang_js_ = ({
  35311. name: 'ElPageHeader',
  35312. props: {
  35313. title: {
  35314. type: String,
  35315. default: function _default() {
  35316. return Object(lib_locale_["t"])('el.pageHeader.title');
  35317. }
  35318. },
  35319. content: String
  35320. }
  35321. });
  35322. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=script&lang=js&
  35323. /* harmony default export */ var packages_page_header_src_mainvue_type_script_lang_js_ = (page_header_src_mainvue_type_script_lang_js_);
  35324. // CONCATENATED MODULE: ./packages/page-header/src/main.vue
  35325. /* normalize component */
  35326. var page_header_src_main_component = normalizeComponent(
  35327. packages_page_header_src_mainvue_type_script_lang_js_,
  35328. mainvue_type_template_id_5070954c_render,
  35329. mainvue_type_template_id_5070954c_staticRenderFns,
  35330. false,
  35331. null,
  35332. null,
  35333. null
  35334. )
  35335. /* hot reload */
  35336. if (false) { var page_header_src_main_api; }
  35337. page_header_src_main_component.options.__file = "packages/page-header/src/main.vue"
  35338. /* harmony default export */ var page_header_src_main = (page_header_src_main_component.exports);
  35339. // CONCATENATED MODULE: ./packages/page-header/index.js
  35340. /* istanbul ignore next */
  35341. page_header_src_main.install = function (Vue) {
  35342. Vue.component(page_header_src_main.name, page_header_src_main);
  35343. };
  35344. /* harmony default export */ var page_header = (page_header_src_main);
  35345. // 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&
  35346. var cascader_panelvue_type_template_id_34932346_render = function() {
  35347. var _vm = this
  35348. var _h = _vm.$createElement
  35349. var _c = _vm._self._c || _h
  35350. return _c(
  35351. "div",
  35352. {
  35353. class: ["el-cascader-panel", _vm.border && "is-bordered"],
  35354. on: { keydown: _vm.handleKeyDown }
  35355. },
  35356. _vm._l(_vm.menus, function(menu, index) {
  35357. return _c("cascader-menu", {
  35358. key: index,
  35359. ref: "menu",
  35360. refInFor: true,
  35361. attrs: { index: index, nodes: menu }
  35362. })
  35363. }),
  35364. 1
  35365. )
  35366. }
  35367. var cascader_panelvue_type_template_id_34932346_staticRenderFns = []
  35368. cascader_panelvue_type_template_id_34932346_render._withStripped = true
  35369. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346&
  35370. // EXTERNAL MODULE: external "element-ui/lib/radio"
  35371. var radio_ = __webpack_require__(43);
  35372. var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
  35373. // 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&
  35374. var stopPropagation = function stopPropagation(e) {
  35375. return e.stopPropagation();
  35376. };
  35377. /* harmony default export */ var cascader_nodevue_type_script_lang_js_ = ({
  35378. inject: ['panel'],
  35379. components: {
  35380. ElCheckbox: checkbox_default.a,
  35381. ElRadio: radio_default.a
  35382. },
  35383. props: {
  35384. node: {
  35385. required: true
  35386. },
  35387. nodeId: String
  35388. },
  35389. computed: {
  35390. config: function config() {
  35391. return this.panel.config;
  35392. },
  35393. isLeaf: function isLeaf() {
  35394. return this.node.isLeaf;
  35395. },
  35396. isDisabled: function isDisabled() {
  35397. return this.node.isDisabled;
  35398. },
  35399. checkedValue: function checkedValue() {
  35400. return this.panel.checkedValue;
  35401. },
  35402. isChecked: function isChecked() {
  35403. return this.node.isSameNode(this.checkedValue);
  35404. },
  35405. inActivePath: function inActivePath() {
  35406. return this.isInPath(this.panel.activePath);
  35407. },
  35408. inCheckedPath: function inCheckedPath() {
  35409. var _this = this;
  35410. if (!this.config.checkStrictly) return false;
  35411. return this.panel.checkedNodePaths.some(function (checkedPath) {
  35412. return _this.isInPath(checkedPath);
  35413. });
  35414. },
  35415. value: function value() {
  35416. return this.node.getValueByOption();
  35417. }
  35418. },
  35419. methods: {
  35420. handleExpand: function handleExpand() {
  35421. var _this2 = this;
  35422. var panel = this.panel,
  35423. node = this.node,
  35424. isDisabled = this.isDisabled,
  35425. config = this.config;
  35426. var multiple = config.multiple,
  35427. checkStrictly = config.checkStrictly;
  35428. if (!checkStrictly && isDisabled || node.loading) return;
  35429. if (config.lazy && !node.loaded) {
  35430. panel.lazyLoad(node, function () {
  35431. // do not use cached leaf value here, invoke this.isLeaf to get new value.
  35432. var isLeaf = _this2.isLeaf;
  35433. if (!isLeaf) _this2.handleExpand();
  35434. if (multiple) {
  35435. // if leaf sync checked state, else clear checked state
  35436. var checked = isLeaf ? node.checked : false;
  35437. _this2.handleMultiCheckChange(checked);
  35438. }
  35439. });
  35440. } else {
  35441. panel.handleExpand(node);
  35442. }
  35443. },
  35444. handleCheckChange: function handleCheckChange() {
  35445. var panel = this.panel,
  35446. value = this.value,
  35447. node = this.node;
  35448. panel.handleCheckChange(value);
  35449. panel.handleExpand(node);
  35450. },
  35451. handleMultiCheckChange: function handleMultiCheckChange(checked) {
  35452. this.node.doCheck(checked);
  35453. this.panel.calculateMultiCheckedValue();
  35454. },
  35455. isInPath: function isInPath(pathNodes) {
  35456. var node = this.node;
  35457. var selectedPathNode = pathNodes[node.level - 1] || {};
  35458. return selectedPathNode.uid === node.uid;
  35459. },
  35460. renderPrefix: function renderPrefix(h) {
  35461. var isLeaf = this.isLeaf,
  35462. isChecked = this.isChecked,
  35463. config = this.config;
  35464. var checkStrictly = config.checkStrictly,
  35465. multiple = config.multiple;
  35466. if (multiple) {
  35467. return this.renderCheckbox(h);
  35468. } else if (checkStrictly) {
  35469. return this.renderRadio(h);
  35470. } else if (isLeaf && isChecked) {
  35471. return this.renderCheckIcon(h);
  35472. }
  35473. return null;
  35474. },
  35475. renderPostfix: function renderPostfix(h) {
  35476. var node = this.node,
  35477. isLeaf = this.isLeaf;
  35478. if (node.loading) {
  35479. return this.renderLoadingIcon(h);
  35480. } else if (!isLeaf) {
  35481. return this.renderExpandIcon(h);
  35482. }
  35483. return null;
  35484. },
  35485. renderCheckbox: function renderCheckbox(h) {
  35486. var node = this.node,
  35487. config = this.config,
  35488. isDisabled = this.isDisabled;
  35489. var events = {
  35490. on: { change: this.handleMultiCheckChange },
  35491. nativeOn: {}
  35492. };
  35493. if (config.checkStrictly) {
  35494. // when every node is selectable, click event should not trigger expand event.
  35495. events.nativeOn.click = stopPropagation;
  35496. }
  35497. return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{
  35498. attrs: {
  35499. value: node.checked,
  35500. indeterminate: node.indeterminate,
  35501. disabled: isDisabled
  35502. }
  35503. }, events]));
  35504. },
  35505. renderRadio: function renderRadio(h) {
  35506. var checkedValue = this.checkedValue,
  35507. value = this.value,
  35508. isDisabled = this.isDisabled;
  35509. // to keep same reference if value cause radio's checked state is calculated by reference comparision;
  35510. if (Object(util_["isEqual"])(value, checkedValue)) {
  35511. value = checkedValue;
  35512. }
  35513. return h(
  35514. 'el-radio',
  35515. {
  35516. attrs: {
  35517. value: checkedValue,
  35518. label: value,
  35519. disabled: isDisabled
  35520. },
  35521. on: {
  35522. 'change': this.handleCheckChange
  35523. },
  35524. nativeOn: {
  35525. 'click': stopPropagation
  35526. }
  35527. },
  35528. [h('span')]
  35529. );
  35530. },
  35531. renderCheckIcon: function renderCheckIcon(h) {
  35532. return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' });
  35533. },
  35534. renderLoadingIcon: function renderLoadingIcon(h) {
  35535. return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' });
  35536. },
  35537. renderExpandIcon: function renderExpandIcon(h) {
  35538. return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' });
  35539. },
  35540. renderContent: function renderContent(h) {
  35541. var panel = this.panel,
  35542. node = this.node;
  35543. var render = panel.renderLabelFn;
  35544. var vnode = render ? render({ node: node, data: node.data }) : null;
  35545. return h(
  35546. 'span',
  35547. { 'class': 'el-cascader-node__label' },
  35548. [vnode || node.label]
  35549. );
  35550. }
  35551. },
  35552. render: function render(h) {
  35553. var _this3 = this;
  35554. var inActivePath = this.inActivePath,
  35555. inCheckedPath = this.inCheckedPath,
  35556. isChecked = this.isChecked,
  35557. isLeaf = this.isLeaf,
  35558. isDisabled = this.isDisabled,
  35559. config = this.config,
  35560. nodeId = this.nodeId;
  35561. var expandTrigger = config.expandTrigger,
  35562. checkStrictly = config.checkStrictly,
  35563. multiple = config.multiple;
  35564. var disabled = !checkStrictly && isDisabled;
  35565. var events = { on: {} };
  35566. if (expandTrigger === 'click') {
  35567. events.on.click = this.handleExpand;
  35568. } else {
  35569. events.on.mouseenter = function (e) {
  35570. _this3.handleExpand();
  35571. _this3.$emit('expand', e);
  35572. };
  35573. events.on.focus = function (e) {
  35574. _this3.handleExpand();
  35575. _this3.$emit('expand', e);
  35576. };
  35577. }
  35578. if (isLeaf && !isDisabled && !checkStrictly && !multiple) {
  35579. events.on.click = this.handleCheckChange;
  35580. }
  35581. return h(
  35582. 'li',
  35583. external_babel_helper_vue_jsx_merge_props_default()([{
  35584. attrs: {
  35585. role: 'menuitem',
  35586. id: nodeId,
  35587. 'aria-expanded': inActivePath,
  35588. tabindex: disabled ? null : -1
  35589. },
  35590. 'class': {
  35591. 'el-cascader-node': true,
  35592. 'is-selectable': checkStrictly,
  35593. 'in-active-path': inActivePath,
  35594. 'in-checked-path': inCheckedPath,
  35595. 'is-active': isChecked,
  35596. 'is-disabled': disabled
  35597. }
  35598. }, events]),
  35599. [this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)]
  35600. );
  35601. }
  35602. });
  35603. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js&
  35604. /* harmony default export */ var src_cascader_nodevue_type_script_lang_js_ = (cascader_nodevue_type_script_lang_js_);
  35605. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue
  35606. var cascader_node_render, cascader_node_staticRenderFns
  35607. /* normalize component */
  35608. var cascader_node_component = normalizeComponent(
  35609. src_cascader_nodevue_type_script_lang_js_,
  35610. cascader_node_render,
  35611. cascader_node_staticRenderFns,
  35612. false,
  35613. null,
  35614. null,
  35615. null
  35616. )
  35617. /* hot reload */
  35618. if (false) { var cascader_node_api; }
  35619. cascader_node_component.options.__file = "packages/cascader-panel/src/cascader-node.vue"
  35620. /* harmony default export */ var cascader_node = (cascader_node_component.exports);
  35621. // 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&
  35622. /* harmony default export */ var cascader_menuvue_type_script_lang_js_ = ({
  35623. name: 'ElCascaderMenu',
  35624. mixins: [locale_default.a],
  35625. inject: ['panel'],
  35626. components: {
  35627. ElScrollbar: scrollbar_default.a,
  35628. CascaderNode: cascader_node
  35629. },
  35630. props: {
  35631. nodes: {
  35632. type: Array,
  35633. required: true
  35634. },
  35635. index: Number
  35636. },
  35637. data: function data() {
  35638. return {
  35639. activeNode: null,
  35640. hoverTimer: null,
  35641. id: Object(util_["generateId"])()
  35642. };
  35643. },
  35644. computed: {
  35645. isEmpty: function isEmpty() {
  35646. return !this.nodes.length;
  35647. },
  35648. menuId: function menuId() {
  35649. return 'cascader-menu-' + this.id + '-' + this.index;
  35650. }
  35651. },
  35652. methods: {
  35653. handleExpand: function handleExpand(e) {
  35654. this.activeNode = e.target;
  35655. },
  35656. handleMouseMove: function handleMouseMove(e) {
  35657. var activeNode = this.activeNode,
  35658. hoverTimer = this.hoverTimer;
  35659. var hoverZone = this.$refs.hoverZone;
  35660. if (!activeNode || !hoverZone) return;
  35661. if (activeNode.contains(e.target)) {
  35662. clearTimeout(hoverTimer);
  35663. var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
  35664. left = _$el$getBoundingClien.left;
  35665. var startX = e.clientX - left;
  35666. var _$el = this.$el,
  35667. offsetWidth = _$el.offsetWidth,
  35668. offsetHeight = _$el.offsetHeight;
  35669. var top = activeNode.offsetTop;
  35670. var bottom = top + activeNode.offsetHeight;
  35671. 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 ';
  35672. } else if (!hoverTimer) {
  35673. this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold);
  35674. }
  35675. },
  35676. clearHoverZone: function clearHoverZone() {
  35677. var hoverZone = this.$refs.hoverZone;
  35678. if (!hoverZone) return;
  35679. hoverZone.innerHTML = '';
  35680. },
  35681. renderEmptyText: function renderEmptyText(h) {
  35682. return h(
  35683. 'div',
  35684. { 'class': 'el-cascader-menu__empty-text' },
  35685. [this.t('el.cascader.noData')]
  35686. );
  35687. },
  35688. renderNodeList: function renderNodeList(h) {
  35689. var menuId = this.menuId;
  35690. var isHoverMenu = this.panel.isHoverMenu;
  35691. var events = { on: {} };
  35692. if (isHoverMenu) {
  35693. events.on.expand = this.handleExpand;
  35694. }
  35695. var nodes = this.nodes.map(function (node, index) {
  35696. var hasChildren = node.hasChildren;
  35697. return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{
  35698. key: node.uid,
  35699. attrs: { node: node,
  35700. 'node-id': menuId + '-' + index,
  35701. 'aria-haspopup': hasChildren,
  35702. 'aria-owns': hasChildren ? menuId : null
  35703. }
  35704. }, events]));
  35705. });
  35706. return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]);
  35707. }
  35708. },
  35709. render: function render(h) {
  35710. var isEmpty = this.isEmpty,
  35711. menuId = this.menuId;
  35712. var events = { nativeOn: {} };
  35713. // optimize hover to expand experience (#8010)
  35714. if (this.panel.isHoverMenu) {
  35715. events.nativeOn.mousemove = this.handleMouseMove;
  35716. // events.nativeOn.mouseleave = this.clearHoverZone;
  35717. }
  35718. return h(
  35719. 'el-scrollbar',
  35720. external_babel_helper_vue_jsx_merge_props_default()([{
  35721. attrs: {
  35722. tag: 'ul',
  35723. role: 'menu',
  35724. id: menuId,
  35725. 'wrap-class': 'el-cascader-menu__wrap',
  35726. 'view-class': {
  35727. 'el-cascader-menu__list': true,
  35728. 'is-empty': isEmpty
  35729. }
  35730. },
  35731. 'class': 'el-cascader-menu' }, events]),
  35732. [isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)]
  35733. );
  35734. }
  35735. });
  35736. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js&
  35737. /* harmony default export */ var src_cascader_menuvue_type_script_lang_js_ = (cascader_menuvue_type_script_lang_js_);
  35738. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue
  35739. var cascader_menu_render, cascader_menu_staticRenderFns
  35740. /* normalize component */
  35741. var cascader_menu_component = normalizeComponent(
  35742. src_cascader_menuvue_type_script_lang_js_,
  35743. cascader_menu_render,
  35744. cascader_menu_staticRenderFns,
  35745. false,
  35746. null,
  35747. null,
  35748. null
  35749. )
  35750. /* hot reload */
  35751. if (false) { var cascader_menu_api; }
  35752. cascader_menu_component.options.__file = "packages/cascader-panel/src/cascader-menu.vue"
  35753. /* harmony default export */ var cascader_menu = (cascader_menu_component.exports);
  35754. // CONCATENATED MODULE: ./packages/cascader-panel/src/node.js
  35755. 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; }; }();
  35756. function src_node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35757. var uid = 0;
  35758. var src_node_Node = function () {
  35759. function Node(data, config, parentNode) {
  35760. src_node_classCallCheck(this, Node);
  35761. this.data = data;
  35762. this.config = config;
  35763. this.parent = parentNode || null;
  35764. this.level = !this.parent ? 1 : this.parent.level + 1;
  35765. this.uid = uid++;
  35766. this.initState();
  35767. this.initChildren();
  35768. }
  35769. Node.prototype.initState = function initState() {
  35770. var _config = this.config,
  35771. valueKey = _config.value,
  35772. labelKey = _config.label;
  35773. this.value = this.data[valueKey];
  35774. this.label = this.data[labelKey];
  35775. this.pathNodes = this.calculatePathNodes();
  35776. this.path = this.pathNodes.map(function (node) {
  35777. return node.value;
  35778. });
  35779. this.pathLabels = this.pathNodes.map(function (node) {
  35780. return node.label;
  35781. });
  35782. // lazy load
  35783. this.loading = false;
  35784. this.loaded = false;
  35785. };
  35786. Node.prototype.initChildren = function initChildren() {
  35787. var _this = this;
  35788. var config = this.config;
  35789. var childrenKey = config.children;
  35790. var childrenData = this.data[childrenKey];
  35791. this.hasChildren = Array.isArray(childrenData);
  35792. this.children = (childrenData || []).map(function (child) {
  35793. return new Node(child, config, _this);
  35794. });
  35795. };
  35796. Node.prototype.calculatePathNodes = function calculatePathNodes() {
  35797. var nodes = [this];
  35798. var parent = this.parent;
  35799. while (parent) {
  35800. nodes.unshift(parent);
  35801. parent = parent.parent;
  35802. }
  35803. return nodes;
  35804. };
  35805. Node.prototype.getPath = function getPath() {
  35806. return this.path;
  35807. };
  35808. Node.prototype.getValue = function getValue() {
  35809. return this.value;
  35810. };
  35811. Node.prototype.getValueByOption = function getValueByOption() {
  35812. return this.config.emitPath ? this.getPath() : this.getValue();
  35813. };
  35814. Node.prototype.getText = function getText(allLevels, separator) {
  35815. return allLevels ? this.pathLabels.join(separator) : this.label;
  35816. };
  35817. Node.prototype.isSameNode = function isSameNode(checkedValue) {
  35818. var value = this.getValueByOption();
  35819. return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
  35820. return Object(util_["isEqual"])(val, value);
  35821. }) : Object(util_["isEqual"])(checkedValue, value);
  35822. };
  35823. Node.prototype.broadcast = function broadcast(event) {
  35824. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  35825. args[_key - 1] = arguments[_key];
  35826. }
  35827. var handlerName = 'onParent' + Object(util_["capitalize"])(event);
  35828. this.children.forEach(function (child) {
  35829. if (child) {
  35830. // bottom up
  35831. child.broadcast.apply(child, [event].concat(args));
  35832. child[handlerName] && child[handlerName].apply(child, args);
  35833. }
  35834. });
  35835. };
  35836. Node.prototype.emit = function emit(event) {
  35837. var parent = this.parent;
  35838. var handlerName = 'onChild' + Object(util_["capitalize"])(event);
  35839. if (parent) {
  35840. for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  35841. args[_key2 - 1] = arguments[_key2];
  35842. }
  35843. parent[handlerName] && parent[handlerName].apply(parent, args);
  35844. parent.emit.apply(parent, [event].concat(args));
  35845. }
  35846. };
  35847. Node.prototype.onParentCheck = function onParentCheck(checked) {
  35848. if (!this.isDisabled) {
  35849. this.setCheckState(checked);
  35850. }
  35851. };
  35852. Node.prototype.onChildCheck = function onChildCheck() {
  35853. var children = this.children;
  35854. var validChildren = children.filter(function (child) {
  35855. return !child.isDisabled;
  35856. });
  35857. var checked = validChildren.length ? validChildren.every(function (child) {
  35858. return child.checked;
  35859. }) : false;
  35860. this.setCheckState(checked);
  35861. };
  35862. Node.prototype.setCheckState = function setCheckState(checked) {
  35863. var totalNum = this.children.length;
  35864. var checkedNum = this.children.reduce(function (c, p) {
  35865. var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
  35866. return c + num;
  35867. }, 0);
  35868. this.checked = checked;
  35869. this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
  35870. };
  35871. Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
  35872. var value = this.getValueByOption();
  35873. var checked = this.isSameNode(checkedValue, value);
  35874. this.doCheck(checked);
  35875. };
  35876. Node.prototype.doCheck = function doCheck(checked) {
  35877. if (this.checked !== checked) {
  35878. if (this.config.checkStrictly) {
  35879. this.checked = checked;
  35880. } else {
  35881. // bottom up to unify the calculation of the indeterminate state
  35882. this.broadcast('check', checked);
  35883. this.setCheckState(checked);
  35884. this.emit('check');
  35885. }
  35886. }
  35887. };
  35888. node_createClass(Node, [{
  35889. key: 'isDisabled',
  35890. get: function get() {
  35891. var data = this.data,
  35892. parent = this.parent,
  35893. config = this.config;
  35894. var disabledKey = config.disabled;
  35895. var checkStrictly = config.checkStrictly;
  35896. return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
  35897. }
  35898. }, {
  35899. key: 'isLeaf',
  35900. get: function get() {
  35901. var data = this.data,
  35902. loaded = this.loaded,
  35903. hasChildren = this.hasChildren,
  35904. children = this.children;
  35905. var _config2 = this.config,
  35906. lazy = _config2.lazy,
  35907. leafKey = _config2.leaf;
  35908. if (lazy) {
  35909. var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false;
  35910. this.hasChildren = !isLeaf;
  35911. return isLeaf;
  35912. }
  35913. return !hasChildren;
  35914. }
  35915. }]);
  35916. return Node;
  35917. }();
  35918. /* harmony default export */ var src_node = (src_node_Node);
  35919. // CONCATENATED MODULE: ./packages/cascader-panel/src/store.js
  35920. function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35921. var flatNodes = function flatNodes(data, leafOnly) {
  35922. return data.reduce(function (res, node) {
  35923. if (node.isLeaf) {
  35924. res.push(node);
  35925. } else {
  35926. !leafOnly && res.push(node);
  35927. res = res.concat(flatNodes(node.children, leafOnly));
  35928. }
  35929. return res;
  35930. }, []);
  35931. };
  35932. var store_Store = function () {
  35933. function Store(data, config) {
  35934. store_classCallCheck(this, Store);
  35935. this.config = config;
  35936. this.initNodes(data);
  35937. }
  35938. Store.prototype.initNodes = function initNodes(data) {
  35939. var _this = this;
  35940. data = Object(util_["coerceTruthyValueToArray"])(data);
  35941. this.nodes = data.map(function (nodeData) {
  35942. return new src_node(nodeData, _this.config);
  35943. });
  35944. this.flattedNodes = this.getFlattedNodes(false, false);
  35945. this.leafNodes = this.getFlattedNodes(true, false);
  35946. };
  35947. Store.prototype.appendNode = function appendNode(nodeData, parentNode) {
  35948. var node = new src_node(nodeData, this.config, parentNode);
  35949. var children = parentNode ? parentNode.children : this.nodes;
  35950. children.push(node);
  35951. };
  35952. Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) {
  35953. var _this2 = this;
  35954. nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList);
  35955. nodeDataList.forEach(function (nodeData) {
  35956. return _this2.appendNode(nodeData, parentNode);
  35957. });
  35958. };
  35959. Store.prototype.getNodes = function getNodes() {
  35960. return this.nodes;
  35961. };
  35962. Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) {
  35963. var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35964. var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes;
  35965. return cached ? cachedNodes : flatNodes(this.nodes, leafOnly);
  35966. };
  35967. Store.prototype.getNodeByValue = function getNodeByValue(value) {
  35968. var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) {
  35969. return Object(util_["valueEquals"])(node.path, value) || node.value === value;
  35970. });
  35971. return nodes && nodes.length ? nodes[0] : null;
  35972. };
  35973. return Store;
  35974. }();
  35975. /* harmony default export */ var cascader_panel_src_store = (store_Store);
  35976. // 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&
  35977. 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; };
  35978. //
  35979. //
  35980. //
  35981. //
  35982. //
  35983. //
  35984. //
  35985. //
  35986. //
  35987. //
  35988. //
  35989. //
  35990. //
  35991. //
  35992. //
  35993. //
  35994. var cascader_panelvue_type_script_lang_js_KeyCode = aria_utils_default.a.keys;
  35995. var DefaultProps = {
  35996. expandTrigger: 'click', // or hover
  35997. multiple: false,
  35998. checkStrictly: false, // whether all nodes can be selected
  35999. emitPath: true, // wether to emit an array of all levels value in which node is located
  36000. lazy: false,
  36001. lazyLoad: util_["noop"],
  36002. value: 'value',
  36003. label: 'label',
  36004. children: 'children',
  36005. leaf: 'leaf',
  36006. disabled: 'disabled',
  36007. hoverThreshold: 500
  36008. };
  36009. var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) {
  36010. return !el.getAttribute('aria-owns');
  36011. };
  36012. var getSibling = function getSibling(el, distance) {
  36013. var parentNode = el.parentNode;
  36014. if (parentNode) {
  36015. var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]');
  36016. var index = Array.prototype.indexOf.call(siblings, el);
  36017. return siblings[index + distance] || null;
  36018. }
  36019. return null;
  36020. };
  36021. var getMenuIndex = function getMenuIndex(el, distance) {
  36022. if (!el) return;
  36023. var pieces = el.id.split('-');
  36024. return Number(pieces[pieces.length - 2]);
  36025. };
  36026. var focusNode = function focusNode(el) {
  36027. if (!el) return;
  36028. el.focus();
  36029. !cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click();
  36030. };
  36031. var checkNode = function checkNode(el) {
  36032. if (!el) return;
  36033. var input = el.querySelector('input');
  36034. if (input) {
  36035. input.click();
  36036. } else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) {
  36037. el.click();
  36038. }
  36039. };
  36040. /* harmony default export */ var cascader_panelvue_type_script_lang_js_ = ({
  36041. name: 'ElCascaderPanel',
  36042. components: {
  36043. CascaderMenu: cascader_menu
  36044. },
  36045. props: {
  36046. value: {},
  36047. options: Array,
  36048. props: Object,
  36049. border: {
  36050. type: Boolean,
  36051. default: true
  36052. },
  36053. renderLabel: Function
  36054. },
  36055. provide: function provide() {
  36056. return {
  36057. panel: this
  36058. };
  36059. },
  36060. data: function data() {
  36061. return {
  36062. checkedValue: null,
  36063. checkedNodePaths: [],
  36064. store: [],
  36065. menus: [],
  36066. activePath: [],
  36067. loadCount: 0
  36068. };
  36069. },
  36070. computed: {
  36071. config: function config() {
  36072. return merge_default()(cascader_panelvue_type_script_lang_js_extends({}, DefaultProps), this.props || {});
  36073. },
  36074. multiple: function multiple() {
  36075. return this.config.multiple;
  36076. },
  36077. checkStrictly: function checkStrictly() {
  36078. return this.config.checkStrictly;
  36079. },
  36080. leafOnly: function leafOnly() {
  36081. return !this.checkStrictly;
  36082. },
  36083. isHoverMenu: function isHoverMenu() {
  36084. return this.config.expandTrigger === 'hover';
  36085. },
  36086. renderLabelFn: function renderLabelFn() {
  36087. return this.renderLabel || this.$scopedSlots.default;
  36088. }
  36089. },
  36090. watch: {
  36091. options: {
  36092. handler: function handler() {
  36093. this.initStore();
  36094. },
  36095. immediate: true,
  36096. deep: true
  36097. },
  36098. value: function value() {
  36099. this.syncCheckedValue();
  36100. this.checkStrictly && this.calculateCheckedNodePaths();
  36101. },
  36102. checkedValue: function checkedValue(val) {
  36103. if (!Object(util_["isEqual"])(val, this.value)) {
  36104. this.checkStrictly && this.calculateCheckedNodePaths();
  36105. this.$emit('input', val);
  36106. this.$emit('change', val);
  36107. }
  36108. }
  36109. },
  36110. mounted: function mounted() {
  36111. if (!this.isEmptyValue(this.value)) {
  36112. this.syncCheckedValue();
  36113. }
  36114. },
  36115. methods: {
  36116. initStore: function initStore() {
  36117. var config = this.config,
  36118. options = this.options;
  36119. if (config.lazy && Object(util_["isEmpty"])(options)) {
  36120. this.lazyLoad();
  36121. } else {
  36122. this.store = new cascader_panel_src_store(options, config);
  36123. this.menus = [this.store.getNodes()];
  36124. this.syncMenuState();
  36125. }
  36126. },
  36127. syncCheckedValue: function syncCheckedValue() {
  36128. var value = this.value,
  36129. checkedValue = this.checkedValue;
  36130. if (!Object(util_["isEqual"])(value, checkedValue)) {
  36131. this.activePath = [];
  36132. this.checkedValue = value;
  36133. this.syncMenuState();
  36134. }
  36135. },
  36136. syncMenuState: function syncMenuState() {
  36137. var multiple = this.multiple,
  36138. checkStrictly = this.checkStrictly;
  36139. this.syncActivePath();
  36140. multiple && this.syncMultiCheckState();
  36141. checkStrictly && this.calculateCheckedNodePaths();
  36142. this.$nextTick(this.scrollIntoView);
  36143. },
  36144. syncMultiCheckState: function syncMultiCheckState() {
  36145. var _this = this;
  36146. var nodes = this.getFlattedNodes(this.leafOnly);
  36147. nodes.forEach(function (node) {
  36148. node.syncCheckState(_this.checkedValue);
  36149. });
  36150. },
  36151. isEmptyValue: function isEmptyValue(val) {
  36152. var multiple = this.multiple,
  36153. config = this.config;
  36154. var emitPath = config.emitPath;
  36155. if (multiple || emitPath) {
  36156. return Object(util_["isEmpty"])(val);
  36157. }
  36158. return false;
  36159. },
  36160. syncActivePath: function syncActivePath() {
  36161. var _this2 = this;
  36162. var store = this.store,
  36163. multiple = this.multiple,
  36164. activePath = this.activePath,
  36165. checkedValue = this.checkedValue;
  36166. if (!Object(util_["isEmpty"])(activePath)) {
  36167. var nodes = activePath.map(function (node) {
  36168. return _this2.getNodeByValue(node.getValue());
  36169. });
  36170. this.expandNodes(nodes);
  36171. } else if (!this.isEmptyValue(checkedValue)) {
  36172. var value = multiple ? checkedValue[0] : checkedValue;
  36173. var checkedNode = this.getNodeByValue(value) || {};
  36174. var _nodes = (checkedNode.pathNodes || []).slice(0, -1);
  36175. this.expandNodes(_nodes);
  36176. } else {
  36177. this.activePath = [];
  36178. this.menus = [store.getNodes()];
  36179. }
  36180. },
  36181. expandNodes: function expandNodes(nodes) {
  36182. var _this3 = this;
  36183. nodes.forEach(function (node) {
  36184. return _this3.handleExpand(node, true /* silent */);
  36185. });
  36186. },
  36187. calculateCheckedNodePaths: function calculateCheckedNodePaths() {
  36188. var _this4 = this;
  36189. var checkedValue = this.checkedValue,
  36190. multiple = this.multiple;
  36191. var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue];
  36192. this.checkedNodePaths = checkedValues.map(function (v) {
  36193. var checkedNode = _this4.getNodeByValue(v);
  36194. return checkedNode ? checkedNode.pathNodes : [];
  36195. });
  36196. },
  36197. handleKeyDown: function handleKeyDown(e) {
  36198. var target = e.target,
  36199. keyCode = e.keyCode;
  36200. switch (keyCode) {
  36201. case cascader_panelvue_type_script_lang_js_KeyCode.up:
  36202. var prev = getSibling(target, -1);
  36203. focusNode(prev);
  36204. break;
  36205. case cascader_panelvue_type_script_lang_js_KeyCode.down:
  36206. var next = getSibling(target, 1);
  36207. focusNode(next);
  36208. break;
  36209. case cascader_panelvue_type_script_lang_js_KeyCode.left:
  36210. var preMenu = this.$refs.menu[getMenuIndex(target) - 1];
  36211. if (preMenu) {
  36212. var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]');
  36213. focusNode(expandedNode);
  36214. }
  36215. break;
  36216. case cascader_panelvue_type_script_lang_js_KeyCode.right:
  36217. var nextMenu = this.$refs.menu[getMenuIndex(target) + 1];
  36218. if (nextMenu) {
  36219. var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]');
  36220. focusNode(firstNode);
  36221. }
  36222. break;
  36223. case cascader_panelvue_type_script_lang_js_KeyCode.enter:
  36224. checkNode(target);
  36225. break;
  36226. case cascader_panelvue_type_script_lang_js_KeyCode.esc:
  36227. case cascader_panelvue_type_script_lang_js_KeyCode.tab:
  36228. this.$emit('close');
  36229. break;
  36230. default:
  36231. return;
  36232. }
  36233. },
  36234. handleExpand: function handleExpand(node, silent) {
  36235. var activePath = this.activePath;
  36236. var level = node.level;
  36237. var path = activePath.slice(0, level - 1);
  36238. var menus = this.menus.slice(0, level);
  36239. if (!node.isLeaf) {
  36240. path.push(node);
  36241. menus.push(node.children);
  36242. }
  36243. this.activePath = path;
  36244. this.menus = menus;
  36245. if (!silent) {
  36246. var pathValues = path.map(function (node) {
  36247. return node.getValue();
  36248. });
  36249. var activePathValues = activePath.map(function (node) {
  36250. return node.getValue();
  36251. });
  36252. if (!Object(util_["valueEquals"])(pathValues, activePathValues)) {
  36253. this.$emit('active-item-change', pathValues); // Deprecated
  36254. this.$emit('expand-change', pathValues);
  36255. }
  36256. }
  36257. },
  36258. handleCheckChange: function handleCheckChange(value) {
  36259. this.checkedValue = value;
  36260. },
  36261. lazyLoad: function lazyLoad(node, onFullfiled) {
  36262. var _this5 = this;
  36263. var config = this.config;
  36264. if (!node) {
  36265. node = node || { root: true, level: 0 };
  36266. this.store = new cascader_panel_src_store([], config);
  36267. this.menus = [this.store.getNodes()];
  36268. }
  36269. node.loading = true;
  36270. var resolve = function resolve(dataList) {
  36271. var parent = node.root ? null : node;
  36272. dataList && dataList.length && _this5.store.appendNodes(dataList, parent);
  36273. node.loading = false;
  36274. node.loaded = true;
  36275. // dispose default value on lazy load mode
  36276. if (Array.isArray(_this5.checkedValue)) {
  36277. var nodeValue = _this5.checkedValue[_this5.loadCount++];
  36278. var valueKey = _this5.config.value;
  36279. var leafKey = _this5.config.leaf;
  36280. if (Array.isArray(dataList) && dataList.filter(function (item) {
  36281. return item[valueKey] === nodeValue;
  36282. }).length > 0) {
  36283. var checkedNode = _this5.store.getNodeByValue(nodeValue);
  36284. if (!checkedNode.data[leafKey]) {
  36285. _this5.lazyLoad(checkedNode, function () {
  36286. _this5.handleExpand(checkedNode);
  36287. });
  36288. }
  36289. if (_this5.loadCount === _this5.checkedValue.length) {
  36290. _this5.$parent.computePresentText();
  36291. }
  36292. }
  36293. }
  36294. onFullfiled && onFullfiled(dataList);
  36295. };
  36296. config.lazyLoad(node, resolve);
  36297. },
  36298. /**
  36299. * public methods
  36300. */
  36301. calculateMultiCheckedValue: function calculateMultiCheckedValue() {
  36302. this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) {
  36303. return node.getValueByOption();
  36304. });
  36305. },
  36306. scrollIntoView: function scrollIntoView() {
  36307. if (this.$isServer) return;
  36308. var menus = this.$refs.menu || [];
  36309. menus.forEach(function (menu) {
  36310. var menuElement = menu.$el;
  36311. if (menuElement) {
  36312. var container = menuElement.querySelector('.el-scrollbar__wrap');
  36313. var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path');
  36314. scroll_into_view_default()(container, activeNode);
  36315. }
  36316. });
  36317. },
  36318. getNodeByValue: function getNodeByValue(val) {
  36319. return this.store.getNodeByValue(val);
  36320. },
  36321. getFlattedNodes: function getFlattedNodes(leafOnly) {
  36322. var cached = !this.config.lazy;
  36323. return this.store.getFlattedNodes(leafOnly, cached);
  36324. },
  36325. getCheckedNodes: function getCheckedNodes(leafOnly) {
  36326. var checkedValue = this.checkedValue,
  36327. multiple = this.multiple;
  36328. if (multiple) {
  36329. var nodes = this.getFlattedNodes(leafOnly);
  36330. return nodes.filter(function (node) {
  36331. return node.checked;
  36332. });
  36333. } else {
  36334. return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)];
  36335. }
  36336. },
  36337. clearCheckedNodes: function clearCheckedNodes() {
  36338. var config = this.config,
  36339. leafOnly = this.leafOnly;
  36340. var multiple = config.multiple,
  36341. emitPath = config.emitPath;
  36342. if (multiple) {
  36343. this.getCheckedNodes(leafOnly).filter(function (node) {
  36344. return !node.isDisabled;
  36345. }).forEach(function (node) {
  36346. return node.doCheck(false);
  36347. });
  36348. this.calculateMultiCheckedValue();
  36349. } else {
  36350. this.checkedValue = emitPath ? [] : null;
  36351. }
  36352. }
  36353. }
  36354. });
  36355. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js&
  36356. /* harmony default export */ var src_cascader_panelvue_type_script_lang_js_ = (cascader_panelvue_type_script_lang_js_);
  36357. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue
  36358. /* normalize component */
  36359. var cascader_panel_component = normalizeComponent(
  36360. src_cascader_panelvue_type_script_lang_js_,
  36361. cascader_panelvue_type_template_id_34932346_render,
  36362. cascader_panelvue_type_template_id_34932346_staticRenderFns,
  36363. false,
  36364. null,
  36365. null,
  36366. null
  36367. )
  36368. /* hot reload */
  36369. if (false) { var cascader_panel_api; }
  36370. cascader_panel_component.options.__file = "packages/cascader-panel/src/cascader-panel.vue"
  36371. /* harmony default export */ var cascader_panel = (cascader_panel_component.exports);
  36372. // CONCATENATED MODULE: ./packages/cascader-panel/index.js
  36373. /* istanbul ignore next */
  36374. cascader_panel.install = function (Vue) {
  36375. Vue.component(cascader_panel.name, cascader_panel);
  36376. };
  36377. /* harmony default export */ var packages_cascader_panel = (cascader_panel);
  36378. // 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&
  36379. /* harmony default export */ var avatar_src_mainvue_type_script_lang_js_ = ({
  36380. name: 'ElAvatar',
  36381. props: {
  36382. size: {
  36383. type: [Number, String],
  36384. validator: function validator(val) {
  36385. if (typeof val === 'string') {
  36386. return ['large', 'medium', 'small'].includes(val);
  36387. }
  36388. return typeof val === 'number';
  36389. }
  36390. },
  36391. shape: {
  36392. type: String,
  36393. default: 'circle',
  36394. validator: function validator(val) {
  36395. return ['circle', 'square'].includes(val);
  36396. }
  36397. },
  36398. icon: String,
  36399. src: String,
  36400. alt: String,
  36401. srcSet: String,
  36402. error: Function,
  36403. fit: {
  36404. type: String,
  36405. default: 'cover'
  36406. }
  36407. },
  36408. data: function data() {
  36409. return {
  36410. isImageExist: true
  36411. };
  36412. },
  36413. computed: {
  36414. avatarClass: function avatarClass() {
  36415. var size = this.size,
  36416. icon = this.icon,
  36417. shape = this.shape;
  36418. var classList = ['el-avatar'];
  36419. if (size && typeof size === 'string') {
  36420. classList.push('el-avatar--' + size);
  36421. }
  36422. if (icon) {
  36423. classList.push('el-avatar--icon');
  36424. }
  36425. if (shape) {
  36426. classList.push('el-avatar--' + shape);
  36427. }
  36428. return classList.join(' ');
  36429. }
  36430. },
  36431. methods: {
  36432. handleError: function handleError() {
  36433. var error = this.error;
  36434. var errorFlag = error ? error() : undefined;
  36435. if (errorFlag !== false) {
  36436. this.isImageExist = false;
  36437. }
  36438. },
  36439. renderAvatar: function renderAvatar() {
  36440. var h = this.$createElement;
  36441. var icon = this.icon,
  36442. src = this.src,
  36443. alt = this.alt,
  36444. isImageExist = this.isImageExist,
  36445. srcSet = this.srcSet,
  36446. fit = this.fit;
  36447. if (isImageExist && src) {
  36448. return h('img', {
  36449. attrs: {
  36450. src: src,
  36451. alt: alt,
  36452. srcSet: srcSet
  36453. },
  36454. on: {
  36455. 'error': this.handleError
  36456. },
  36457. style: { 'object-fit': fit } });
  36458. }
  36459. if (icon) {
  36460. return h('i', { 'class': icon });
  36461. }
  36462. return this.$slots.default;
  36463. }
  36464. },
  36465. render: function render() {
  36466. var h = arguments[0];
  36467. var avatarClass = this.avatarClass,
  36468. size = this.size;
  36469. var sizeStyle = typeof size === 'number' ? {
  36470. height: size + 'px',
  36471. width: size + 'px',
  36472. lineHeight: size + 'px'
  36473. } : {};
  36474. return h(
  36475. 'span',
  36476. { 'class': avatarClass, style: sizeStyle },
  36477. [this.renderAvatar()]
  36478. );
  36479. }
  36480. });
  36481. // CONCATENATED MODULE: ./packages/avatar/src/main.vue?vue&type=script&lang=js&
  36482. /* harmony default export */ var packages_avatar_src_mainvue_type_script_lang_js_ = (avatar_src_mainvue_type_script_lang_js_);
  36483. // CONCATENATED MODULE: ./packages/avatar/src/main.vue
  36484. var src_main_render, src_main_staticRenderFns
  36485. /* normalize component */
  36486. var avatar_src_main_component = normalizeComponent(
  36487. packages_avatar_src_mainvue_type_script_lang_js_,
  36488. src_main_render,
  36489. src_main_staticRenderFns,
  36490. false,
  36491. null,
  36492. null,
  36493. null
  36494. )
  36495. /* hot reload */
  36496. if (false) { var avatar_src_main_api; }
  36497. avatar_src_main_component.options.__file = "packages/avatar/src/main.vue"
  36498. /* harmony default export */ var avatar_src_main = (avatar_src_main_component.exports);
  36499. // CONCATENATED MODULE: ./packages/avatar/index.js
  36500. /* istanbul ignore next */
  36501. avatar_src_main.install = function (Vue) {
  36502. Vue.component(avatar_src_main.name, avatar_src_main);
  36503. };
  36504. /* harmony default export */ var avatar = (avatar_src_main);
  36505. // 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&
  36506. var mainvue_type_template_id_a4885264_render = function() {
  36507. var _vm = this
  36508. var _h = _vm.$createElement
  36509. var _c = _vm._self._c || _h
  36510. return _c(
  36511. "transition",
  36512. {
  36513. attrs: { name: "el-drawer-fade" },
  36514. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  36515. },
  36516. [
  36517. _c(
  36518. "div",
  36519. {
  36520. directives: [
  36521. {
  36522. name: "show",
  36523. rawName: "v-show",
  36524. value: _vm.visible,
  36525. expression: "visible"
  36526. }
  36527. ],
  36528. staticClass: "el-drawer__wrapper",
  36529. attrs: { tabindex: "-1" }
  36530. },
  36531. [
  36532. _c(
  36533. "div",
  36534. {
  36535. staticClass: "el-drawer__container",
  36536. class: _vm.visible && "el-drawer__open",
  36537. attrs: { role: "document", tabindex: "-1" },
  36538. on: {
  36539. click: function($event) {
  36540. if ($event.target !== $event.currentTarget) {
  36541. return null
  36542. }
  36543. return _vm.handleWrapperClick($event)
  36544. }
  36545. }
  36546. },
  36547. [
  36548. _c(
  36549. "div",
  36550. {
  36551. ref: "drawer",
  36552. staticClass: "el-drawer",
  36553. class: [_vm.direction, _vm.customClass],
  36554. style: _vm.isHorizontal
  36555. ? "width: " + _vm.drawerSize
  36556. : "height: " + _vm.drawerSize,
  36557. attrs: {
  36558. "aria-modal": "true",
  36559. "aria-labelledby": "el-drawer__title",
  36560. "aria-label": _vm.title,
  36561. role: "dialog",
  36562. tabindex: "-1"
  36563. }
  36564. },
  36565. [
  36566. _vm.withHeader
  36567. ? _c(
  36568. "header",
  36569. {
  36570. staticClass: "el-drawer__header",
  36571. attrs: { id: "el-drawer__title" }
  36572. },
  36573. [
  36574. _vm._t("title", [
  36575. _c(
  36576. "span",
  36577. { attrs: { role: "heading", title: _vm.title } },
  36578. [_vm._v(_vm._s(_vm.title))]
  36579. )
  36580. ]),
  36581. _vm.showClose
  36582. ? _c(
  36583. "button",
  36584. {
  36585. staticClass: "el-drawer__close-btn",
  36586. attrs: {
  36587. "aria-label":
  36588. "close " + (_vm.title || "drawer"),
  36589. type: "button"
  36590. },
  36591. on: { click: _vm.closeDrawer }
  36592. },
  36593. [
  36594. _c("i", {
  36595. staticClass:
  36596. "el-dialog__close el-icon el-icon-close"
  36597. })
  36598. ]
  36599. )
  36600. : _vm._e()
  36601. ],
  36602. 2
  36603. )
  36604. : _vm._e(),
  36605. _vm.rendered
  36606. ? _c(
  36607. "section",
  36608. { staticClass: "el-drawer__body" },
  36609. [_vm._t("default")],
  36610. 2
  36611. )
  36612. : _vm._e()
  36613. ]
  36614. )
  36615. ]
  36616. )
  36617. ]
  36618. )
  36619. ]
  36620. )
  36621. }
  36622. var mainvue_type_template_id_a4885264_staticRenderFns = []
  36623. mainvue_type_template_id_a4885264_render._withStripped = true
  36624. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=template&id=a4885264&
  36625. // 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&
  36626. //
  36627. //
  36628. //
  36629. //
  36630. //
  36631. //
  36632. //
  36633. //
  36634. //
  36635. //
  36636. //
  36637. //
  36638. //
  36639. //
  36640. //
  36641. //
  36642. //
  36643. //
  36644. //
  36645. //
  36646. //
  36647. //
  36648. //
  36649. //
  36650. //
  36651. //
  36652. //
  36653. //
  36654. //
  36655. //
  36656. //
  36657. //
  36658. //
  36659. //
  36660. //
  36661. //
  36662. //
  36663. //
  36664. //
  36665. //
  36666. //
  36667. //
  36668. //
  36669. //
  36670. //
  36671. //
  36672. //
  36673. //
  36674. /* harmony default export */ var drawer_src_mainvue_type_script_lang_js_ = ({
  36675. name: 'ElDrawer',
  36676. mixins: [popup_default.a, emitter_default.a],
  36677. props: {
  36678. appendToBody: {
  36679. type: Boolean,
  36680. default: false
  36681. },
  36682. beforeClose: {
  36683. type: Function
  36684. },
  36685. customClass: {
  36686. type: String,
  36687. default: ''
  36688. },
  36689. closeOnPressEscape: {
  36690. type: Boolean,
  36691. default: true
  36692. },
  36693. destroyOnClose: {
  36694. type: Boolean,
  36695. default: false
  36696. },
  36697. modal: {
  36698. type: Boolean,
  36699. default: true
  36700. },
  36701. direction: {
  36702. type: String,
  36703. default: 'rtl',
  36704. validator: function validator(val) {
  36705. return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(val) !== -1;
  36706. }
  36707. },
  36708. modalAppendToBody: {
  36709. type: Boolean,
  36710. default: true
  36711. },
  36712. showClose: {
  36713. type: Boolean,
  36714. default: true
  36715. },
  36716. size: {
  36717. type: [Number, String],
  36718. default: '30%'
  36719. },
  36720. title: {
  36721. type: String,
  36722. default: ''
  36723. },
  36724. visible: {
  36725. type: Boolean
  36726. },
  36727. wrapperClosable: {
  36728. type: Boolean,
  36729. default: true
  36730. },
  36731. withHeader: {
  36732. type: Boolean,
  36733. default: true
  36734. }
  36735. },
  36736. computed: {
  36737. isHorizontal: function isHorizontal() {
  36738. return this.direction === 'rtl' || this.direction === 'ltr';
  36739. },
  36740. drawerSize: function drawerSize() {
  36741. return typeof this.size === 'number' ? this.size + 'px' : this.size;
  36742. }
  36743. },
  36744. data: function data() {
  36745. return {
  36746. closed: false,
  36747. prevActiveElement: null
  36748. };
  36749. },
  36750. watch: {
  36751. visible: function visible(val) {
  36752. var _this = this;
  36753. if (val) {
  36754. this.closed = false;
  36755. this.$emit('open');
  36756. if (this.appendToBody) {
  36757. document.body.appendChild(this.$el);
  36758. }
  36759. this.prevActiveElement = document.activeElement;
  36760. } else {
  36761. if (!this.closed) {
  36762. this.$emit('close');
  36763. if (this.destroyOnClose === true) {
  36764. this.rendered = false;
  36765. }
  36766. }
  36767. this.$nextTick(function () {
  36768. if (_this.prevActiveElement) {
  36769. _this.prevActiveElement.focus();
  36770. }
  36771. });
  36772. }
  36773. }
  36774. },
  36775. methods: {
  36776. afterEnter: function afterEnter() {
  36777. this.$emit('opened');
  36778. },
  36779. afterLeave: function afterLeave() {
  36780. this.$emit('closed');
  36781. },
  36782. hide: function hide(cancel) {
  36783. if (cancel !== false) {
  36784. this.$emit('update:visible', false);
  36785. this.$emit('close');
  36786. if (this.destroyOnClose === true) {
  36787. this.rendered = false;
  36788. }
  36789. this.closed = true;
  36790. }
  36791. },
  36792. handleWrapperClick: function handleWrapperClick() {
  36793. if (this.wrapperClosable) {
  36794. this.closeDrawer();
  36795. }
  36796. },
  36797. closeDrawer: function closeDrawer() {
  36798. if (typeof this.beforeClose === 'function') {
  36799. this.beforeClose(this.hide);
  36800. } else {
  36801. this.hide();
  36802. }
  36803. },
  36804. handleClose: function handleClose() {
  36805. // This method here will be called by PopupManger, when the `closeOnPressEscape` was set to true
  36806. // pressing `ESC` will call this method, and also close the drawer.
  36807. // This method also calls `beforeClose` if there was one.
  36808. this.closeDrawer();
  36809. }
  36810. },
  36811. mounted: function mounted() {
  36812. if (this.visible) {
  36813. this.rendered = true;
  36814. this.open();
  36815. if (this.appendToBody) {
  36816. document.body.appendChild(this.$el);
  36817. }
  36818. }
  36819. },
  36820. destroyed: function destroyed() {
  36821. // if appendToBody is true, remove DOM node after destroy
  36822. if (this.appendToBody && this.$el && this.$el.parentNode) {
  36823. this.$el.parentNode.removeChild(this.$el);
  36824. }
  36825. }
  36826. });
  36827. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=script&lang=js&
  36828. /* harmony default export */ var packages_drawer_src_mainvue_type_script_lang_js_ = (drawer_src_mainvue_type_script_lang_js_);
  36829. // CONCATENATED MODULE: ./packages/drawer/src/main.vue
  36830. /* normalize component */
  36831. var drawer_src_main_component = normalizeComponent(
  36832. packages_drawer_src_mainvue_type_script_lang_js_,
  36833. mainvue_type_template_id_a4885264_render,
  36834. mainvue_type_template_id_a4885264_staticRenderFns,
  36835. false,
  36836. null,
  36837. null,
  36838. null
  36839. )
  36840. /* hot reload */
  36841. if (false) { var drawer_src_main_api; }
  36842. drawer_src_main_component.options.__file = "packages/drawer/src/main.vue"
  36843. /* harmony default export */ var drawer_src_main = (drawer_src_main_component.exports);
  36844. // CONCATENATED MODULE: ./packages/drawer/index.js
  36845. /* istanbul ignore next */
  36846. drawer_src_main.install = function (Vue) {
  36847. Vue.component(drawer_src_main.name, drawer_src_main);
  36848. };
  36849. /* harmony default export */ var drawer = (drawer_src_main);
  36850. // 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&
  36851. var mainvue_type_template_id_048de730_render = function() {
  36852. var _vm = this
  36853. var _h = _vm.$createElement
  36854. var _c = _vm._self._c || _h
  36855. return _c(
  36856. "el-popover",
  36857. _vm._b(
  36858. {
  36859. attrs: { trigger: "click" },
  36860. model: {
  36861. value: _vm.visible,
  36862. callback: function($$v) {
  36863. _vm.visible = $$v
  36864. },
  36865. expression: "visible"
  36866. }
  36867. },
  36868. "el-popover",
  36869. _vm.$attrs,
  36870. false
  36871. ),
  36872. [
  36873. _c("div", { staticClass: "el-popconfirm" }, [
  36874. _c("p", { staticClass: "el-popconfirm__main" }, [
  36875. !_vm.hideIcon
  36876. ? _c("i", {
  36877. staticClass: "el-popconfirm__icon",
  36878. class: _vm.icon,
  36879. style: { color: _vm.iconColor }
  36880. })
  36881. : _vm._e(),
  36882. _vm._v("\n " + _vm._s(_vm.title) + "\n ")
  36883. ]),
  36884. _c(
  36885. "div",
  36886. { staticClass: "el-popconfirm__action" },
  36887. [
  36888. _c(
  36889. "el-button",
  36890. {
  36891. attrs: { size: "mini", type: _vm.cancelButtonType },
  36892. on: { click: _vm.cancel }
  36893. },
  36894. [
  36895. _vm._v(
  36896. "\n " +
  36897. _vm._s(_vm.displayCancelButtonText) +
  36898. "\n "
  36899. )
  36900. ]
  36901. ),
  36902. _c(
  36903. "el-button",
  36904. {
  36905. attrs: { size: "mini", type: _vm.confirmButtonType },
  36906. on: { click: _vm.confirm }
  36907. },
  36908. [
  36909. _vm._v(
  36910. "\n " +
  36911. _vm._s(_vm.displayConfirmButtonText) +
  36912. "\n "
  36913. )
  36914. ]
  36915. )
  36916. ],
  36917. 1
  36918. )
  36919. ]),
  36920. _vm._t("reference", null, { slot: "reference" })
  36921. ],
  36922. 2
  36923. )
  36924. }
  36925. var mainvue_type_template_id_048de730_staticRenderFns = []
  36926. mainvue_type_template_id_048de730_render._withStripped = true
  36927. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=template&id=048de730&
  36928. // EXTERNAL MODULE: external "element-ui/lib/popover"
  36929. var popover_ = __webpack_require__(44);
  36930. var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
  36931. // 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&
  36932. //
  36933. //
  36934. //
  36935. //
  36936. //
  36937. //
  36938. //
  36939. //
  36940. //
  36941. //
  36942. //
  36943. //
  36944. //
  36945. //
  36946. //
  36947. //
  36948. //
  36949. //
  36950. //
  36951. //
  36952. //
  36953. //
  36954. //
  36955. //
  36956. //
  36957. //
  36958. //
  36959. //
  36960. //
  36961. //
  36962. //
  36963. //
  36964. //
  36965. //
  36966. //
  36967. //
  36968. //
  36969. /* harmony default export */ var popconfirm_src_mainvue_type_script_lang_js_ = ({
  36970. name: 'ElPopconfirm',
  36971. props: {
  36972. title: {
  36973. type: String
  36974. },
  36975. confirmButtonText: {
  36976. type: String
  36977. },
  36978. cancelButtonText: {
  36979. type: String
  36980. },
  36981. confirmButtonType: {
  36982. type: String,
  36983. default: 'primary'
  36984. },
  36985. cancelButtonType: {
  36986. type: String,
  36987. default: 'text'
  36988. },
  36989. icon: {
  36990. type: String,
  36991. default: 'el-icon-question'
  36992. },
  36993. iconColor: {
  36994. type: String,
  36995. default: '#f90'
  36996. },
  36997. hideIcon: {
  36998. type: Boolean,
  36999. default: false
  37000. }
  37001. },
  37002. components: {
  37003. ElPopover: popover_default.a,
  37004. ElButton: button_default.a
  37005. },
  37006. data: function data() {
  37007. return {
  37008. visible: false
  37009. };
  37010. },
  37011. computed: {
  37012. displayConfirmButtonText: function displayConfirmButtonText() {
  37013. return this.confirmButtonText || Object(lib_locale_["t"])('el.popconfirm.confirmButtonText');
  37014. },
  37015. displayCancelButtonText: function displayCancelButtonText() {
  37016. return this.cancelButtonText || Object(lib_locale_["t"])('el.popconfirm.cancelButtonText');
  37017. }
  37018. },
  37019. methods: {
  37020. confirm: function confirm() {
  37021. this.visible = false;
  37022. this.$emit('confirm');
  37023. },
  37024. cancel: function cancel() {
  37025. this.visible = false;
  37026. this.$emit('cancel');
  37027. }
  37028. }
  37029. });
  37030. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=script&lang=js&
  37031. /* harmony default export */ var packages_popconfirm_src_mainvue_type_script_lang_js_ = (popconfirm_src_mainvue_type_script_lang_js_);
  37032. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue
  37033. /* normalize component */
  37034. var popconfirm_src_main_component = normalizeComponent(
  37035. packages_popconfirm_src_mainvue_type_script_lang_js_,
  37036. mainvue_type_template_id_048de730_render,
  37037. mainvue_type_template_id_048de730_staticRenderFns,
  37038. false,
  37039. null,
  37040. null,
  37041. null
  37042. )
  37043. /* hot reload */
  37044. if (false) { var popconfirm_src_main_api; }
  37045. popconfirm_src_main_component.options.__file = "packages/popconfirm/src/main.vue"
  37046. /* harmony default export */ var popconfirm_src_main = (popconfirm_src_main_component.exports);
  37047. // CONCATENATED MODULE: ./packages/popconfirm/index.js
  37048. /* istanbul ignore next */
  37049. popconfirm_src_main.install = function (Vue) {
  37050. Vue.component(popconfirm_src_main.name, popconfirm_src_main);
  37051. };
  37052. /* harmony default export */ var popconfirm = (popconfirm_src_main);
  37053. // 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&
  37054. var srcvue_type_template_id_7f659269_render = function() {
  37055. var _vm = this
  37056. var _h = _vm.$createElement
  37057. var _c = _vm._self._c || _h
  37058. return _c(
  37059. "div",
  37060. [
  37061. _vm.uiLoading
  37062. ? [
  37063. _c(
  37064. "div",
  37065. _vm._b(
  37066. { class: ["el-skeleton", _vm.animated ? "is-animated" : ""] },
  37067. "div",
  37068. _vm.$attrs,
  37069. false
  37070. ),
  37071. [
  37072. _vm._l(_vm.count, function(i) {
  37073. return [
  37074. _vm.loading
  37075. ? _vm._t(
  37076. "template",
  37077. _vm._l(_vm.rows, function(item) {
  37078. return _c("el-skeleton-item", {
  37079. key: i + "-" + item,
  37080. class: {
  37081. "el-skeleton__paragraph": item !== 1,
  37082. "is-first": item === 1,
  37083. "is-last": item === _vm.rows && _vm.rows > 1
  37084. },
  37085. attrs: { variant: "p" }
  37086. })
  37087. })
  37088. )
  37089. : _vm._e()
  37090. ]
  37091. })
  37092. ],
  37093. 2
  37094. )
  37095. ]
  37096. : [_vm._t("default", null, null, _vm.$attrs)]
  37097. ],
  37098. 2
  37099. )
  37100. }
  37101. var srcvue_type_template_id_7f659269_staticRenderFns = []
  37102. srcvue_type_template_id_7f659269_render._withStripped = true
  37103. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=template&id=7f659269&
  37104. // 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&
  37105. //
  37106. //
  37107. //
  37108. //
  37109. //
  37110. //
  37111. //
  37112. //
  37113. //
  37114. //
  37115. //
  37116. //
  37117. //
  37118. //
  37119. //
  37120. //
  37121. //
  37122. //
  37123. //
  37124. //
  37125. //
  37126. //
  37127. //
  37128. //
  37129. //
  37130. /* harmony default export */ var skeleton_srcvue_type_script_lang_js_ = ({
  37131. name: 'ElSkeleton',
  37132. props: {
  37133. animated: {
  37134. type: Boolean,
  37135. default: false
  37136. },
  37137. count: {
  37138. type: Number,
  37139. default: 1
  37140. },
  37141. rows: {
  37142. type: Number,
  37143. default: 4
  37144. },
  37145. loading: {
  37146. type: Boolean,
  37147. default: true
  37148. },
  37149. throttle: {
  37150. type: Number,
  37151. default: 0
  37152. }
  37153. },
  37154. watch: {
  37155. loading: {
  37156. handler: function handler(loading) {
  37157. var _this = this;
  37158. if (this.throttle <= 0) {
  37159. this.uiLoading = loading;
  37160. return;
  37161. }
  37162. if (loading) {
  37163. clearTimeout(this.timeoutHandle);
  37164. this.timeoutHandle = setTimeout(function () {
  37165. _this.uiLoading = _this.loading;
  37166. }, this.throttle);
  37167. } else {
  37168. this.uiLoading = loading;
  37169. }
  37170. },
  37171. immediate: true
  37172. }
  37173. },
  37174. data: function data() {
  37175. return {
  37176. uiLoading: this.throttle <= 0 ? this.loading : false
  37177. };
  37178. }
  37179. });
  37180. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=script&lang=js&
  37181. /* harmony default export */ var packages_skeleton_srcvue_type_script_lang_js_ = (skeleton_srcvue_type_script_lang_js_);
  37182. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue
  37183. /* normalize component */
  37184. var skeleton_src_component = normalizeComponent(
  37185. packages_skeleton_srcvue_type_script_lang_js_,
  37186. srcvue_type_template_id_7f659269_render,
  37187. srcvue_type_template_id_7f659269_staticRenderFns,
  37188. false,
  37189. null,
  37190. null,
  37191. null
  37192. )
  37193. /* hot reload */
  37194. if (false) { var skeleton_src_api; }
  37195. skeleton_src_component.options.__file = "packages/skeleton/src/index.vue"
  37196. /* harmony default export */ var skeleton_src = (skeleton_src_component.exports);
  37197. // CONCATENATED MODULE: ./packages/skeleton/index.js
  37198. /* istanbul ignore next */
  37199. skeleton_src.install = function (Vue) {
  37200. Vue.component(skeleton_src.name, skeleton_src);
  37201. };
  37202. /* harmony default export */ var skeleton = (skeleton_src);
  37203. // 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&
  37204. var itemvue_type_template_id_4bc8804c_render = function() {
  37205. var _vm = this
  37206. var _h = _vm.$createElement
  37207. var _c = _vm._self._c || _h
  37208. return _c(
  37209. "div",
  37210. { class: ["el-skeleton__item", "el-skeleton__" + _vm.variant] },
  37211. [_vm.variant === "image" ? _c("img-placeholder") : _vm._e()],
  37212. 1
  37213. )
  37214. }
  37215. var itemvue_type_template_id_4bc8804c_staticRenderFns = []
  37216. itemvue_type_template_id_4bc8804c_render._withStripped = true
  37217. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=template&id=4bc8804c&
  37218. // 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&
  37219. var img_placeholdervue_type_template_id_1b2cb5c0_render = function() {
  37220. var _vm = this
  37221. var _h = _vm.$createElement
  37222. var _c = _vm._self._c || _h
  37223. return _c(
  37224. "svg",
  37225. {
  37226. attrs: { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg" }
  37227. },
  37228. [
  37229. _c("path", {
  37230. attrs: {
  37231. d:
  37232. "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"
  37233. }
  37234. })
  37235. ]
  37236. )
  37237. }
  37238. var img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns = []
  37239. img_placeholdervue_type_template_id_1b2cb5c0_render._withStripped = true
  37240. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=template&id=1b2cb5c0&
  37241. // 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&
  37242. //
  37243. //
  37244. //
  37245. //
  37246. //
  37247. //
  37248. //
  37249. //
  37250. //
  37251. //
  37252. //
  37253. /* harmony default export */ var img_placeholdervue_type_script_lang_js_ = ({
  37254. name: 'ImgPlaceholder'
  37255. });
  37256. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=script&lang=js&
  37257. /* harmony default export */ var src_img_placeholdervue_type_script_lang_js_ = (img_placeholdervue_type_script_lang_js_);
  37258. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue
  37259. /* normalize component */
  37260. var img_placeholder_component = normalizeComponent(
  37261. src_img_placeholdervue_type_script_lang_js_,
  37262. img_placeholdervue_type_template_id_1b2cb5c0_render,
  37263. img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns,
  37264. false,
  37265. null,
  37266. null,
  37267. null
  37268. )
  37269. /* hot reload */
  37270. if (false) { var img_placeholder_api; }
  37271. img_placeholder_component.options.__file = "packages/skeleton/src/img-placeholder.vue"
  37272. /* harmony default export */ var img_placeholder = (img_placeholder_component.exports);
  37273. // 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&
  37274. var _components;
  37275. //
  37276. //
  37277. //
  37278. //
  37279. //
  37280. //
  37281. /* harmony default export */ var skeleton_src_itemvue_type_script_lang_js_ = ({
  37282. name: 'ElSkeletonItem',
  37283. props: {
  37284. variant: {
  37285. type: String,
  37286. default: 'text'
  37287. }
  37288. },
  37289. components: (_components = {}, _components[img_placeholder.name] = img_placeholder, _components)
  37290. });
  37291. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=script&lang=js&
  37292. /* harmony default export */ var packages_skeleton_src_itemvue_type_script_lang_js_ = (skeleton_src_itemvue_type_script_lang_js_);
  37293. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue
  37294. /* normalize component */
  37295. var skeleton_src_item_component = normalizeComponent(
  37296. packages_skeleton_src_itemvue_type_script_lang_js_,
  37297. itemvue_type_template_id_4bc8804c_render,
  37298. itemvue_type_template_id_4bc8804c_staticRenderFns,
  37299. false,
  37300. null,
  37301. null,
  37302. null
  37303. )
  37304. /* hot reload */
  37305. if (false) { var skeleton_src_item_api; }
  37306. skeleton_src_item_component.options.__file = "packages/skeleton/src/item.vue"
  37307. /* harmony default export */ var skeleton_src_item = (skeleton_src_item_component.exports);
  37308. // CONCATENATED MODULE: ./packages/skeleton-item/index.js
  37309. /* istanbul ignore next */
  37310. skeleton_src_item.install = function (Vue) {
  37311. Vue.component(skeleton_src_item.name, skeleton_src_item);
  37312. };
  37313. /* harmony default export */ var skeleton_item = (skeleton_src_item);
  37314. // 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&
  37315. var srcvue_type_template_id_347ced91_render = function() {
  37316. var _vm = this
  37317. var _h = _vm.$createElement
  37318. var _c = _vm._self._c || _h
  37319. return _c("div", { staticClass: "el-empty" }, [
  37320. _c(
  37321. "div",
  37322. { staticClass: "el-empty__image", style: _vm.imageStyle },
  37323. [
  37324. _vm.image
  37325. ? _c("img", {
  37326. attrs: { src: _vm.image, ondragstart: "return false" }
  37327. })
  37328. : _vm._t("image", [_c("img-empty")])
  37329. ],
  37330. 2
  37331. ),
  37332. _c(
  37333. "div",
  37334. { staticClass: "el-empty__description" },
  37335. [
  37336. _vm.$slots.description
  37337. ? _vm._t("description")
  37338. : _c("p", [_vm._v(_vm._s(_vm.emptyDescription))])
  37339. ],
  37340. 2
  37341. ),
  37342. _vm.$slots.default
  37343. ? _c("div", { staticClass: "el-empty__bottom" }, [_vm._t("default")], 2)
  37344. : _vm._e()
  37345. ])
  37346. }
  37347. var srcvue_type_template_id_347ced91_staticRenderFns = []
  37348. srcvue_type_template_id_347ced91_render._withStripped = true
  37349. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=template&id=347ced91&
  37350. // 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&
  37351. var img_emptyvue_type_template_id_42918b82_render = function() {
  37352. var _vm = this
  37353. var _h = _vm.$createElement
  37354. var _c = _vm._self._c || _h
  37355. return _c(
  37356. "svg",
  37357. {
  37358. attrs: {
  37359. viewBox: "0 0 79 86",
  37360. version: "1.1",
  37361. xmlns: "http://www.w3.org/2000/svg",
  37362. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  37363. }
  37364. },
  37365. [
  37366. _c(
  37367. "defs",
  37368. [
  37369. _c(
  37370. "linearGradient",
  37371. {
  37372. attrs: {
  37373. id: "linearGradient-1-" + _vm.id,
  37374. x1: "38.8503086%",
  37375. y1: "0%",
  37376. x2: "61.1496914%",
  37377. y2: "100%"
  37378. }
  37379. },
  37380. [
  37381. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37382. _c("stop", { attrs: { "stop-color": "#EEEFF3", offset: "100%" } })
  37383. ],
  37384. 1
  37385. ),
  37386. _c(
  37387. "linearGradient",
  37388. {
  37389. attrs: {
  37390. id: "linearGradient-2-" + _vm.id,
  37391. x1: "0%",
  37392. y1: "9.5%",
  37393. x2: "100%",
  37394. y2: "90.5%"
  37395. }
  37396. },
  37397. [
  37398. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37399. _c("stop", { attrs: { "stop-color": "#E9EBEF", offset: "100%" } })
  37400. ],
  37401. 1
  37402. ),
  37403. _c("rect", {
  37404. attrs: {
  37405. id: "path-3-" + _vm.id,
  37406. x: "0",
  37407. y: "0",
  37408. width: "17",
  37409. height: "36"
  37410. }
  37411. })
  37412. ],
  37413. 1
  37414. ),
  37415. _c(
  37416. "g",
  37417. {
  37418. attrs: {
  37419. id: "Illustrations",
  37420. stroke: "none",
  37421. "stroke-width": "1",
  37422. fill: "none",
  37423. "fill-rule": "evenodd"
  37424. }
  37425. },
  37426. [
  37427. _c(
  37428. "g",
  37429. {
  37430. attrs: {
  37431. id: "B-type",
  37432. transform: "translate(-1268.000000, -535.000000)"
  37433. }
  37434. },
  37435. [
  37436. _c(
  37437. "g",
  37438. {
  37439. attrs: {
  37440. id: "Group-2",
  37441. transform: "translate(1268.000000, 535.000000)"
  37442. }
  37443. },
  37444. [
  37445. _c("path", {
  37446. attrs: {
  37447. id: "Oval-Copy-2",
  37448. d:
  37449. "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",
  37450. fill: "#F7F8FC"
  37451. }
  37452. }),
  37453. _c("polygon", {
  37454. attrs: {
  37455. id: "Rectangle-Copy-14",
  37456. fill: "#E5E7E9",
  37457. transform:
  37458. "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  37459. points: "13 58 53 58 42 45 2 45"
  37460. }
  37461. }),
  37462. _c(
  37463. "g",
  37464. {
  37465. attrs: {
  37466. id: "Group-Copy",
  37467. transform:
  37468. "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"
  37469. }
  37470. },
  37471. [
  37472. _c("polygon", {
  37473. attrs: {
  37474. id: "Rectangle-Copy-10",
  37475. fill: "#E5E7E9",
  37476. transform:
  37477. "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  37478. points: "2.84078316e-14 3 18 3 23 7 5 7"
  37479. }
  37480. }),
  37481. _c("polygon", {
  37482. attrs: {
  37483. id: "Rectangle-Copy-11",
  37484. fill: "#EDEEF2",
  37485. points:
  37486. "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  37487. }
  37488. }),
  37489. _c("rect", {
  37490. attrs: {
  37491. id: "Rectangle-Copy-12",
  37492. fill: "url(#linearGradient-1-" + _vm.id + ")",
  37493. transform:
  37494. "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  37495. x: "38",
  37496. y: "7",
  37497. width: "17",
  37498. height: "36"
  37499. }
  37500. }),
  37501. _c("polygon", {
  37502. attrs: {
  37503. id: "Rectangle-Copy-13",
  37504. fill: "#F8F9FB",
  37505. transform:
  37506. "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  37507. points:
  37508. "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  37509. }
  37510. })
  37511. ]
  37512. ),
  37513. _c("rect", {
  37514. attrs: {
  37515. id: "Rectangle-Copy-15",
  37516. fill: "url(#linearGradient-2-" + _vm.id + ")",
  37517. x: "13",
  37518. y: "45",
  37519. width: "40",
  37520. height: "36"
  37521. }
  37522. }),
  37523. _c(
  37524. "g",
  37525. {
  37526. attrs: {
  37527. id: "Rectangle-Copy-17",
  37528. transform: "translate(53.000000, 45.000000)"
  37529. }
  37530. },
  37531. [
  37532. _c(
  37533. "mask",
  37534. { attrs: { id: "mask-4-" + _vm.id, fill: "white" } },
  37535. [
  37536. _c("use", {
  37537. attrs: { "xlink:href": "#path-3-" + _vm.id }
  37538. })
  37539. ]
  37540. ),
  37541. _c("use", {
  37542. attrs: {
  37543. id: "Mask",
  37544. fill: "#E0E3E9",
  37545. transform:
  37546. "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  37547. "xlink:href": "#path-3-" + _vm.id
  37548. }
  37549. }),
  37550. _c("polygon", {
  37551. attrs: {
  37552. id: "Rectangle-Copy",
  37553. fill: "#D5D7DE",
  37554. mask: "url(#mask-4-" + _vm.id + ")",
  37555. transform:
  37556. "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  37557. points: "7 0 24 0 20 18 -1.70530257e-13 16"
  37558. }
  37559. })
  37560. ]
  37561. ),
  37562. _c("polygon", {
  37563. attrs: {
  37564. id: "Rectangle-Copy-18",
  37565. fill: "#F8F9FB",
  37566. transform:
  37567. "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  37568. points: "62 45 79 45 70 58 53 58"
  37569. }
  37570. })
  37571. ]
  37572. )
  37573. ]
  37574. )
  37575. ]
  37576. )
  37577. ]
  37578. )
  37579. }
  37580. var img_emptyvue_type_template_id_42918b82_staticRenderFns = []
  37581. img_emptyvue_type_template_id_42918b82_render._withStripped = true
  37582. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=template&id=42918b82&
  37583. // 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&
  37584. //
  37585. //
  37586. //
  37587. //
  37588. //
  37589. //
  37590. //
  37591. //
  37592. //
  37593. //
  37594. //
  37595. //
  37596. //
  37597. //
  37598. //
  37599. //
  37600. //
  37601. //
  37602. //
  37603. //
  37604. //
  37605. //
  37606. //
  37607. //
  37608. //
  37609. //
  37610. //
  37611. //
  37612. //
  37613. //
  37614. //
  37615. //
  37616. //
  37617. //
  37618. //
  37619. //
  37620. //
  37621. //
  37622. //
  37623. //
  37624. //
  37625. //
  37626. //
  37627. //
  37628. //
  37629. //
  37630. //
  37631. //
  37632. //
  37633. //
  37634. //
  37635. //
  37636. //
  37637. //
  37638. //
  37639. //
  37640. //
  37641. //
  37642. //
  37643. //
  37644. //
  37645. //
  37646. //
  37647. //
  37648. //
  37649. //
  37650. //
  37651. //
  37652. //
  37653. //
  37654. //
  37655. //
  37656. //
  37657. //
  37658. //
  37659. //
  37660. //
  37661. //
  37662. //
  37663. //
  37664. //
  37665. //
  37666. //
  37667. //
  37668. //
  37669. //
  37670. //
  37671. //
  37672. //
  37673. //
  37674. //
  37675. //
  37676. //
  37677. //
  37678. //
  37679. //
  37680. //
  37681. //
  37682. //
  37683. //
  37684. //
  37685. //
  37686. //
  37687. //
  37688. //
  37689. //
  37690. //
  37691. //
  37692. //
  37693. //
  37694. //
  37695. //
  37696. //
  37697. //
  37698. //
  37699. //
  37700. //
  37701. //
  37702. //
  37703. //
  37704. //
  37705. var img_emptyvue_type_script_lang_js_id = 0;
  37706. /* harmony default export */ var img_emptyvue_type_script_lang_js_ = ({
  37707. name: 'ImgEmpty',
  37708. data: function data() {
  37709. return {
  37710. id: ++img_emptyvue_type_script_lang_js_id
  37711. };
  37712. }
  37713. });
  37714. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=script&lang=js&
  37715. /* harmony default export */ var src_img_emptyvue_type_script_lang_js_ = (img_emptyvue_type_script_lang_js_);
  37716. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue
  37717. /* normalize component */
  37718. var img_empty_component = normalizeComponent(
  37719. src_img_emptyvue_type_script_lang_js_,
  37720. img_emptyvue_type_template_id_42918b82_render,
  37721. img_emptyvue_type_template_id_42918b82_staticRenderFns,
  37722. false,
  37723. null,
  37724. null,
  37725. null
  37726. )
  37727. /* hot reload */
  37728. if (false) { var img_empty_api; }
  37729. img_empty_component.options.__file = "packages/empty/src/img-empty.vue"
  37730. /* harmony default export */ var img_empty = (img_empty_component.exports);
  37731. // 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&
  37732. var srcvue_type_script_lang_js_components;
  37733. //
  37734. //
  37735. //
  37736. //
  37737. //
  37738. //
  37739. //
  37740. //
  37741. //
  37742. //
  37743. //
  37744. //
  37745. //
  37746. //
  37747. //
  37748. //
  37749. //
  37750. //
  37751. /* harmony default export */ var empty_srcvue_type_script_lang_js_ = ({
  37752. name: 'ElEmpty',
  37753. components: (srcvue_type_script_lang_js_components = {}, srcvue_type_script_lang_js_components[img_empty.name] = img_empty, srcvue_type_script_lang_js_components),
  37754. props: {
  37755. image: {
  37756. type: String,
  37757. default: ''
  37758. },
  37759. imageSize: Number,
  37760. description: {
  37761. type: String,
  37762. default: ''
  37763. }
  37764. },
  37765. computed: {
  37766. emptyDescription: function emptyDescription() {
  37767. return this.description || Object(lib_locale_["t"])('el.empty.description');
  37768. },
  37769. imageStyle: function imageStyle() {
  37770. return {
  37771. width: this.imageSize ? this.imageSize + 'px' : ''
  37772. };
  37773. }
  37774. }
  37775. });
  37776. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=script&lang=js&
  37777. /* harmony default export */ var packages_empty_srcvue_type_script_lang_js_ = (empty_srcvue_type_script_lang_js_);
  37778. // CONCATENATED MODULE: ./packages/empty/src/index.vue
  37779. /* normalize component */
  37780. var empty_src_component = normalizeComponent(
  37781. packages_empty_srcvue_type_script_lang_js_,
  37782. srcvue_type_template_id_347ced91_render,
  37783. srcvue_type_template_id_347ced91_staticRenderFns,
  37784. false,
  37785. null,
  37786. null,
  37787. null
  37788. )
  37789. /* hot reload */
  37790. if (false) { var empty_src_api; }
  37791. empty_src_component.options.__file = "packages/empty/src/index.vue"
  37792. /* harmony default export */ var empty_src = (empty_src_component.exports);
  37793. // CONCATENATED MODULE: ./packages/empty/index.js
  37794. empty_src.install = function (Vue) {
  37795. Vue.component(empty_src.name, empty_src);
  37796. };
  37797. /* harmony default export */ var empty = (empty_src);
  37798. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-row.js
  37799. 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; };
  37800. /* harmony default export */ var descriptions_row = ({
  37801. name: 'ElDescriptionsRow',
  37802. props: {
  37803. row: {
  37804. type: Array
  37805. }
  37806. },
  37807. inject: ['elDescriptions'],
  37808. render: function render(h) {
  37809. var elDescriptions = this.elDescriptions;
  37810. var row = (this.row || []).map(function (item) {
  37811. return descriptions_row_extends({}, item, {
  37812. label: item.slots.label || item.props.label
  37813. }, ['labelClassName', 'contentClassName', 'labelStyle', 'contentStyle'].reduce(function (res, key) {
  37814. res[key] = item.props[key] || elDescriptions[key];
  37815. return res;
  37816. }, {}));
  37817. });
  37818. if (elDescriptions.direction === 'vertical') {
  37819. return h('tbody', [h(
  37820. 'tr',
  37821. { 'class': 'el-descriptions-row' },
  37822. [row.map(function (item) {
  37823. var _ref;
  37824. return h(
  37825. 'th',
  37826. {
  37827. 'class': (_ref = {
  37828. 'el-descriptions-item__cell': true,
  37829. 'el-descriptions-item__label': true,
  37830. 'has-colon': elDescriptions.border ? false : elDescriptions.colon,
  37831. 'is-bordered-label': elDescriptions.border
  37832. }, _ref[item.labelClassName] = true, _ref),
  37833. style: item.labelStyle,
  37834. attrs: { colSpan: item.props.span
  37835. }
  37836. },
  37837. [item.label]
  37838. );
  37839. })]
  37840. ), h(
  37841. 'tr',
  37842. { 'class': 'el-descriptions-row' },
  37843. [row.map(function (item) {
  37844. return h(
  37845. 'td',
  37846. {
  37847. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  37848. style: item.contentStyle,
  37849. attrs: { colSpan: item.props.span
  37850. }
  37851. },
  37852. [item.slots.default]
  37853. );
  37854. })]
  37855. )]);
  37856. }
  37857. if (elDescriptions.border) {
  37858. return h('tbody', [h(
  37859. 'tr',
  37860. { 'class': 'el-descriptions-row' },
  37861. [row.map(function (item) {
  37862. var _ref2;
  37863. return [h(
  37864. 'th',
  37865. {
  37866. 'class': (_ref2 = {
  37867. 'el-descriptions-item__cell': true,
  37868. 'el-descriptions-item__label': true,
  37869. 'is-bordered-label': elDescriptions.border
  37870. }, _ref2[item.labelClassName] = true, _ref2),
  37871. style: item.labelStyle,
  37872. attrs: { colSpan: '1'
  37873. }
  37874. },
  37875. [item.label]
  37876. ), h(
  37877. 'td',
  37878. {
  37879. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  37880. style: item.contentStyle,
  37881. attrs: { colSpan: item.props.span * 2 - 1
  37882. }
  37883. },
  37884. [item.slots.default]
  37885. )];
  37886. })]
  37887. )]);
  37888. }
  37889. return h('tbody', [h(
  37890. 'tr',
  37891. { 'class': 'el-descriptions-row' },
  37892. [row.map(function (item) {
  37893. var _ref3;
  37894. return h(
  37895. 'td',
  37896. { 'class': 'el-descriptions-item el-descriptions-item__cell', attrs: { colSpan: item.props.span }
  37897. },
  37898. [h(
  37899. 'div',
  37900. { 'class': 'el-descriptions-item__container' },
  37901. [h(
  37902. 'span',
  37903. {
  37904. 'class': (_ref3 = {
  37905. 'el-descriptions-item__label': true,
  37906. 'has-colon': elDescriptions.colon
  37907. }, _ref3[item.labelClassName] = true, _ref3),
  37908. style: item.labelStyle
  37909. },
  37910. [item.label]
  37911. ), h(
  37912. 'span',
  37913. {
  37914. 'class': ['el-descriptions-item__content', item.contentClassName],
  37915. style: item.contentStyle
  37916. },
  37917. [item.slots.default]
  37918. )]
  37919. )]
  37920. );
  37921. })]
  37922. )]);
  37923. }
  37924. });
  37925. // CONCATENATED MODULE: ./packages/descriptions/src/index.js
  37926. 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; };
  37927. var src_components;
  37928. /* harmony default export */ var descriptions_src = ({
  37929. name: 'ElDescriptions',
  37930. components: (src_components = {}, src_components[descriptions_row.name] = descriptions_row, src_components),
  37931. props: {
  37932. border: {
  37933. type: Boolean,
  37934. default: false
  37935. },
  37936. column: {
  37937. type: Number,
  37938. default: 3
  37939. },
  37940. direction: {
  37941. type: String,
  37942. default: 'horizontal'
  37943. },
  37944. size: {
  37945. type: String
  37946. // validator: isValidComponentSize,
  37947. },
  37948. title: {
  37949. type: String,
  37950. default: ''
  37951. },
  37952. extra: {
  37953. type: String,
  37954. default: ''
  37955. },
  37956. labelStyle: {
  37957. type: Object
  37958. },
  37959. contentStyle: {
  37960. type: Object
  37961. },
  37962. labelClassName: {
  37963. type: String,
  37964. default: ''
  37965. },
  37966. contentClassName: {
  37967. type: String,
  37968. default: ''
  37969. },
  37970. colon: {
  37971. type: Boolean,
  37972. default: true
  37973. }
  37974. },
  37975. computed: {
  37976. descriptionsSize: function descriptionsSize() {
  37977. return this.size || (this.$ELEMENT || {}).size;
  37978. }
  37979. },
  37980. provide: function provide() {
  37981. return {
  37982. elDescriptions: this
  37983. };
  37984. },
  37985. methods: {
  37986. getOptionProps: function getOptionProps(vnode) {
  37987. if (vnode.componentOptions) {
  37988. var componentOptions = vnode.componentOptions;
  37989. var _componentOptions$pro = componentOptions.propsData,
  37990. propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro,
  37991. _componentOptions$Cto = componentOptions.Ctor,
  37992. Ctor = _componentOptions$Cto === undefined ? {} : _componentOptions$Cto;
  37993. var props = (Ctor.options || {}).props || {};
  37994. var res = {};
  37995. for (var k in props) {
  37996. var v = props[k];
  37997. var defaultValue = v.default;
  37998. if (defaultValue !== undefined) {
  37999. res[k] = Object(types_["isFunction"])(defaultValue) ? defaultValue.call(vnode) : defaultValue;
  38000. }
  38001. }
  38002. return src_extends({}, res, propsData);
  38003. }
  38004. return {};
  38005. },
  38006. getSlots: function getSlots(vnode) {
  38007. var _this = this;
  38008. var componentOptions = vnode.componentOptions || {};
  38009. var children = vnode.children || componentOptions.children || [];
  38010. var slots = {};
  38011. children.forEach(function (child) {
  38012. if (!_this.isEmptyElement(child)) {
  38013. var name = child.data && child.data.slot || 'default';
  38014. slots[name] = slots[name] || [];
  38015. if (child.tag === 'template') {
  38016. slots[name].push(child.children);
  38017. } else {
  38018. slots[name].push(child);
  38019. }
  38020. }
  38021. });
  38022. return src_extends({}, slots);
  38023. },
  38024. isEmptyElement: function isEmptyElement(c) {
  38025. return !(c.tag || c.text && c.text.trim() !== '');
  38026. },
  38027. filledNode: function filledNode(node, span, count) {
  38028. var isLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  38029. if (!node.props) {
  38030. node.props = {};
  38031. }
  38032. if (span > count) {
  38033. node.props.span = count;
  38034. }
  38035. if (isLast) {
  38036. // set the max span, cause of the last td
  38037. node.props.span = count;
  38038. }
  38039. return node;
  38040. },
  38041. getRows: function getRows() {
  38042. var _this2 = this;
  38043. var children = (this.$slots.default || []).filter(function (vnode) {
  38044. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElDescriptionsItem';
  38045. });
  38046. var nodes = children.map(function (vnode) {
  38047. return {
  38048. props: _this2.getOptionProps(vnode),
  38049. slots: _this2.getSlots(vnode),
  38050. vnode: vnode
  38051. };
  38052. });
  38053. var rows = [];
  38054. var temp = [];
  38055. var count = this.column;
  38056. nodes.forEach(function (node, index) {
  38057. var span = node.props.span || 1;
  38058. if (index === children.length - 1) {
  38059. temp.push(_this2.filledNode(node, span, count, true));
  38060. rows.push(temp);
  38061. return;
  38062. }
  38063. if (span < count) {
  38064. count -= span;
  38065. temp.push(node);
  38066. } else {
  38067. temp.push(_this2.filledNode(node, span, count));
  38068. rows.push(temp);
  38069. count = _this2.column;
  38070. temp = [];
  38071. }
  38072. });
  38073. return rows;
  38074. }
  38075. },
  38076. render: function render() {
  38077. var h = arguments[0];
  38078. var title = this.title,
  38079. extra = this.extra,
  38080. border = this.border,
  38081. descriptionsSize = this.descriptionsSize,
  38082. $slots = this.$slots;
  38083. var rows = this.getRows();
  38084. return h(
  38085. 'div',
  38086. { 'class': 'el-descriptions' },
  38087. [title || extra || $slots.title || $slots.extra ? h(
  38088. 'div',
  38089. { 'class': 'el-descriptions__header' },
  38090. [h(
  38091. 'div',
  38092. { 'class': 'el-descriptions__title' },
  38093. [$slots.title ? $slots.title : title]
  38094. ), h(
  38095. 'div',
  38096. { 'class': 'el-descriptions__extra' },
  38097. [$slots.extra ? $slots.extra : extra]
  38098. )]
  38099. ) : null, h(
  38100. 'div',
  38101. { 'class': 'el-descriptions__body' },
  38102. [h(
  38103. 'table',
  38104. { 'class': ['el-descriptions__table', { 'is-bordered': border }, descriptionsSize ? 'el-descriptions--' + descriptionsSize : ''] },
  38105. [rows.map(function (row) {
  38106. return h(descriptions_row, {
  38107. attrs: { row: row }
  38108. });
  38109. })]
  38110. )]
  38111. )]
  38112. );
  38113. }
  38114. });
  38115. // CONCATENATED MODULE: ./packages/descriptions/index.js
  38116. /* istanbul ignore next */
  38117. descriptions_src.install = function install(Vue) {
  38118. Vue.component(descriptions_src.name, descriptions_src);
  38119. };
  38120. /* harmony default export */ var descriptions = (descriptions_src);
  38121. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-item.js
  38122. /* harmony default export */ var descriptions_item = ({
  38123. name: 'ElDescriptionsItem',
  38124. props: {
  38125. label: {
  38126. type: String,
  38127. default: ''
  38128. },
  38129. span: {
  38130. type: Number,
  38131. default: 1
  38132. },
  38133. contentClassName: {
  38134. type: String,
  38135. default: ''
  38136. },
  38137. contentStyle: {
  38138. type: Object
  38139. },
  38140. labelClassName: {
  38141. type: String,
  38142. default: ''
  38143. },
  38144. labelStyle: {
  38145. type: Object
  38146. }
  38147. },
  38148. render: function render() {
  38149. return null;
  38150. }
  38151. });
  38152. // CONCATENATED MODULE: ./packages/descriptions-item/index.js
  38153. /* istanbul ignore next */
  38154. descriptions_item.install = function install(Vue) {
  38155. Vue.component(descriptions_item.name, descriptions_item);
  38156. };
  38157. /* harmony default export */ var packages_descriptions_item = (descriptions_item);
  38158. // 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&
  38159. var srcvue_type_template_id_3408b139_render = function() {
  38160. var _vm = this
  38161. var _h = _vm.$createElement
  38162. var _c = _vm._self._c || _h
  38163. return _c("div", { staticClass: "el-result" }, [
  38164. _c(
  38165. "div",
  38166. { staticClass: "el-result__icon" },
  38167. [
  38168. _vm._t("icon", [
  38169. _c(_vm.iconElement, { tag: "component", class: _vm.iconElement })
  38170. ])
  38171. ],
  38172. 2
  38173. ),
  38174. _vm.title || _vm.$slots.title
  38175. ? _c(
  38176. "div",
  38177. { staticClass: "el-result__title" },
  38178. [_vm._t("title", [_c("p", [_vm._v(_vm._s(_vm.title))])])],
  38179. 2
  38180. )
  38181. : _vm._e(),
  38182. _vm.subTitle || _vm.$slots.subTitle
  38183. ? _c(
  38184. "div",
  38185. { staticClass: "el-result__subtitle" },
  38186. [_vm._t("subTitle", [_c("p", [_vm._v(_vm._s(_vm.subTitle))])])],
  38187. 2
  38188. )
  38189. : _vm._e(),
  38190. _vm.$slots.extra
  38191. ? _c("div", { staticClass: "el-result__extra" }, [_vm._t("extra")], 2)
  38192. : _vm._e()
  38193. ])
  38194. }
  38195. var srcvue_type_template_id_3408b139_staticRenderFns = []
  38196. srcvue_type_template_id_3408b139_render._withStripped = true
  38197. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=template&id=3408b139&
  38198. // 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&
  38199. var icon_successvue_type_template_id_18119418_render = function() {
  38200. var _vm = this
  38201. var _h = _vm.$createElement
  38202. var _c = _vm._self._c || _h
  38203. return _c(
  38204. "svg",
  38205. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38206. [
  38207. _c("path", {
  38208. attrs: {
  38209. d:
  38210. "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"
  38211. }
  38212. })
  38213. ]
  38214. )
  38215. }
  38216. var icon_successvue_type_template_id_18119418_staticRenderFns = []
  38217. icon_successvue_type_template_id_18119418_render._withStripped = true
  38218. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=template&id=18119418&
  38219. // 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&
  38220. //
  38221. //
  38222. //
  38223. //
  38224. //
  38225. //
  38226. //
  38227. //
  38228. /* harmony default export */ var icon_successvue_type_script_lang_js_ = ({
  38229. name: 'IconSuccess'
  38230. });
  38231. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=script&lang=js&
  38232. /* harmony default export */ var src_icon_successvue_type_script_lang_js_ = (icon_successvue_type_script_lang_js_);
  38233. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue
  38234. /* normalize component */
  38235. var icon_success_component = normalizeComponent(
  38236. src_icon_successvue_type_script_lang_js_,
  38237. icon_successvue_type_template_id_18119418_render,
  38238. icon_successvue_type_template_id_18119418_staticRenderFns,
  38239. false,
  38240. null,
  38241. null,
  38242. null
  38243. )
  38244. /* hot reload */
  38245. if (false) { var icon_success_api; }
  38246. icon_success_component.options.__file = "packages/result/src/icon-success.vue"
  38247. /* harmony default export */ var icon_success = (icon_success_component.exports);
  38248. // 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&
  38249. var icon_errorvue_type_template_id_21199246_render = function() {
  38250. var _vm = this
  38251. var _h = _vm.$createElement
  38252. var _c = _vm._self._c || _h
  38253. return _c(
  38254. "svg",
  38255. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38256. [
  38257. _c("path", {
  38258. attrs: {
  38259. d:
  38260. "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"
  38261. }
  38262. })
  38263. ]
  38264. )
  38265. }
  38266. var icon_errorvue_type_template_id_21199246_staticRenderFns = []
  38267. icon_errorvue_type_template_id_21199246_render._withStripped = true
  38268. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=template&id=21199246&
  38269. // 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&
  38270. //
  38271. //
  38272. //
  38273. //
  38274. //
  38275. //
  38276. //
  38277. //
  38278. /* harmony default export */ var icon_errorvue_type_script_lang_js_ = ({
  38279. name: 'IconError'
  38280. });
  38281. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=script&lang=js&
  38282. /* harmony default export */ var src_icon_errorvue_type_script_lang_js_ = (icon_errorvue_type_script_lang_js_);
  38283. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue
  38284. /* normalize component */
  38285. var icon_error_component = normalizeComponent(
  38286. src_icon_errorvue_type_script_lang_js_,
  38287. icon_errorvue_type_template_id_21199246_render,
  38288. icon_errorvue_type_template_id_21199246_staticRenderFns,
  38289. false,
  38290. null,
  38291. null,
  38292. null
  38293. )
  38294. /* hot reload */
  38295. if (false) { var icon_error_api; }
  38296. icon_error_component.options.__file = "packages/result/src/icon-error.vue"
  38297. /* harmony default export */ var icon_error = (icon_error_component.exports);
  38298. // 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&
  38299. var icon_warningvue_type_template_id_46fe8f31_render = function() {
  38300. var _vm = this
  38301. var _h = _vm.$createElement
  38302. var _c = _vm._self._c || _h
  38303. return _c(
  38304. "svg",
  38305. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38306. [
  38307. _c("path", {
  38308. attrs: {
  38309. d:
  38310. "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"
  38311. }
  38312. })
  38313. ]
  38314. )
  38315. }
  38316. var icon_warningvue_type_template_id_46fe8f31_staticRenderFns = []
  38317. icon_warningvue_type_template_id_46fe8f31_render._withStripped = true
  38318. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=template&id=46fe8f31&
  38319. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38320. /* harmony default export */ var icon_warningvue_type_script_lang_ts_ = ({
  38321. name: 'IconWarning'
  38322. });
  38323. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38324. /* harmony default export */ var src_icon_warningvue_type_script_lang_ts_ = (icon_warningvue_type_script_lang_ts_);
  38325. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue
  38326. /* normalize component */
  38327. var icon_warning_component = normalizeComponent(
  38328. src_icon_warningvue_type_script_lang_ts_,
  38329. icon_warningvue_type_template_id_46fe8f31_render,
  38330. icon_warningvue_type_template_id_46fe8f31_staticRenderFns,
  38331. false,
  38332. null,
  38333. null,
  38334. null
  38335. )
  38336. /* hot reload */
  38337. if (false) { var icon_warning_api; }
  38338. icon_warning_component.options.__file = "packages/result/src/icon-warning.vue"
  38339. /* harmony default export */ var icon_warning = (icon_warning_component.exports);
  38340. // 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&
  38341. var icon_infovue_type_template_id_19e3de69_render = function() {
  38342. var _vm = this
  38343. var _h = _vm.$createElement
  38344. var _c = _vm._self._c || _h
  38345. return _c(
  38346. "svg",
  38347. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38348. [
  38349. _c("path", {
  38350. attrs: {
  38351. d:
  38352. "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"
  38353. }
  38354. })
  38355. ]
  38356. )
  38357. }
  38358. var icon_infovue_type_template_id_19e3de69_staticRenderFns = []
  38359. icon_infovue_type_template_id_19e3de69_render._withStripped = true
  38360. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=template&id=19e3de69&
  38361. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38362. /* harmony default export */ var icon_infovue_type_script_lang_ts_ = ({
  38363. name: 'IconInfo'
  38364. });
  38365. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38366. /* harmony default export */ var src_icon_infovue_type_script_lang_ts_ = (icon_infovue_type_script_lang_ts_);
  38367. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue
  38368. /* normalize component */
  38369. var icon_info_component = normalizeComponent(
  38370. src_icon_infovue_type_script_lang_ts_,
  38371. icon_infovue_type_template_id_19e3de69_render,
  38372. icon_infovue_type_template_id_19e3de69_staticRenderFns,
  38373. false,
  38374. null,
  38375. null,
  38376. null
  38377. )
  38378. /* hot reload */
  38379. if (false) { var icon_info_api; }
  38380. icon_info_component.options.__file = "packages/result/src/icon-info.vue"
  38381. /* harmony default export */ var icon_info = (icon_info_component.exports);
  38382. // 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&
  38383. var result_srcvue_type_script_lang_js_components;
  38384. //
  38385. //
  38386. //
  38387. //
  38388. //
  38389. //
  38390. //
  38391. //
  38392. //
  38393. //
  38394. //
  38395. //
  38396. //
  38397. //
  38398. //
  38399. //
  38400. //
  38401. //
  38402. //
  38403. //
  38404. //
  38405. //
  38406. var IconMap = {
  38407. success: 'icon-success',
  38408. warning: 'icon-warning',
  38409. error: 'icon-error',
  38410. info: 'icon-info'
  38411. };
  38412. /* harmony default export */ var result_srcvue_type_script_lang_js_ = ({
  38413. name: 'ElResult',
  38414. 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),
  38415. props: {
  38416. title: {
  38417. type: String,
  38418. default: ''
  38419. },
  38420. subTitle: {
  38421. type: String,
  38422. default: ''
  38423. },
  38424. icon: {
  38425. type: String,
  38426. default: 'info'
  38427. }
  38428. },
  38429. computed: {
  38430. iconElement: function iconElement() {
  38431. var icon = this.icon;
  38432. return icon && IconMap[icon] ? IconMap[icon] : 'icon-info';
  38433. }
  38434. }
  38435. });
  38436. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=script&lang=js&
  38437. /* harmony default export */ var packages_result_srcvue_type_script_lang_js_ = (result_srcvue_type_script_lang_js_);
  38438. // CONCATENATED MODULE: ./packages/result/src/index.vue
  38439. /* normalize component */
  38440. var result_src_component = normalizeComponent(
  38441. packages_result_srcvue_type_script_lang_js_,
  38442. srcvue_type_template_id_3408b139_render,
  38443. srcvue_type_template_id_3408b139_staticRenderFns,
  38444. false,
  38445. null,
  38446. null,
  38447. null
  38448. )
  38449. /* hot reload */
  38450. if (false) { var result_src_api; }
  38451. result_src_component.options.__file = "packages/result/src/index.vue"
  38452. /* harmony default export */ var result_src = (result_src_component.exports);
  38453. // CONCATENATED MODULE: ./packages/result/index.js
  38454. /* istanbul ignore next */
  38455. result_src.install = function (Vue) {
  38456. Vue.component(result_src.name, result_src);
  38457. };
  38458. /* harmony default export */ var result = (result_src);
  38459. // CONCATENATED MODULE: ./src/index.js
  38460. /* Automatically generated by './build/bin/build-entry.js' */
  38461. 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, 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, popconfirm, skeleton, skeleton_item, empty, descriptions, packages_descriptions_item, result, collapse_transition_default.a];
  38462. var src_install = function install(Vue) {
  38463. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  38464. lib_locale_default.a.use(opts.locale);
  38465. lib_locale_default.a.i18n(opts.i18n);
  38466. components.forEach(function (component) {
  38467. Vue.component(component.name, component);
  38468. });
  38469. Vue.use(infinite_scroll);
  38470. Vue.use(packages_loading.directive);
  38471. Vue.prototype.$ELEMENT = {
  38472. size: opts.size || '',
  38473. zIndex: opts.zIndex || 2000
  38474. };
  38475. Vue.prototype.$loading = packages_loading.service;
  38476. Vue.prototype.$msgbox = message_box;
  38477. Vue.prototype.$alert = message_box.alert;
  38478. Vue.prototype.$confirm = message_box.confirm;
  38479. Vue.prototype.$prompt = message_box.prompt;
  38480. Vue.prototype.$notify = notification;
  38481. Vue.prototype.$message = packages_message;
  38482. };
  38483. /* istanbul ignore if */
  38484. if (typeof window !== 'undefined' && window.Vue) {
  38485. src_install(window.Vue);
  38486. }
  38487. /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
  38488. version: '2.15.8',
  38489. locale: lib_locale_default.a.use,
  38490. i18n: lib_locale_default.a.i18n,
  38491. install: src_install,
  38492. CollapseTransition: collapse_transition_default.a,
  38493. Loading: packages_loading,
  38494. Pagination: packages_pagination,
  38495. Dialog: dialog,
  38496. Autocomplete: packages_autocomplete,
  38497. Dropdown: packages_dropdown,
  38498. DropdownMenu: packages_dropdown_menu,
  38499. DropdownItem: packages_dropdown_item,
  38500. Menu: packages_menu,
  38501. Submenu: packages_submenu,
  38502. MenuItem: packages_menu_item,
  38503. MenuItemGroup: packages_menu_item_group,
  38504. Input: packages_input,
  38505. InputNumber: packages_input_number,
  38506. Radio: packages_radio,
  38507. RadioGroup: packages_radio_group,
  38508. RadioButton: packages_radio_button,
  38509. Checkbox: packages_checkbox,
  38510. CheckboxButton: packages_checkbox_button,
  38511. CheckboxGroup: packages_checkbox_group,
  38512. Switch: packages_switch,
  38513. Select: packages_select,
  38514. Option: packages_option,
  38515. OptionGroup: packages_option_group,
  38516. Button: packages_button,
  38517. ButtonGroup: packages_button_group,
  38518. Table: packages_table,
  38519. TableColumn: packages_table_column,
  38520. DatePicker: packages_date_picker,
  38521. TimeSelect: packages_time_select,
  38522. TimePicker: packages_time_picker,
  38523. Popover: popover,
  38524. Tooltip: packages_tooltip,
  38525. MessageBox: message_box,
  38526. Breadcrumb: packages_breadcrumb,
  38527. BreadcrumbItem: packages_breadcrumb_item,
  38528. Form: packages_form,
  38529. FormItem: packages_form_item,
  38530. Tabs: packages_tabs,
  38531. TabPane: packages_tab_pane,
  38532. Tag: packages_tag,
  38533. Tree: packages_tree,
  38534. Alert: packages_alert,
  38535. Notification: notification,
  38536. Slider: slider,
  38537. Icon: packages_icon,
  38538. Row: packages_row,
  38539. Col: packages_col,
  38540. Upload: packages_upload,
  38541. Progress: packages_progress,
  38542. Spinner: packages_spinner,
  38543. Message: packages_message,
  38544. Badge: badge,
  38545. Card: card,
  38546. Rate: rate,
  38547. Steps: packages_steps,
  38548. Step: packages_step,
  38549. Carousel: carousel,
  38550. Scrollbar: scrollbar,
  38551. CarouselItem: carousel_item,
  38552. Collapse: packages_collapse,
  38553. CollapseItem: packages_collapse_item,
  38554. Cascader: packages_cascader,
  38555. ColorPicker: color_picker,
  38556. Transfer: transfer,
  38557. Container: packages_container,
  38558. Header: header,
  38559. Aside: aside,
  38560. Main: packages_main,
  38561. Footer: footer,
  38562. Timeline: timeline,
  38563. TimelineItem: timeline_item,
  38564. Link: packages_link,
  38565. Divider: divider,
  38566. Image: packages_image,
  38567. Calendar: calendar,
  38568. Backtop: backtop,
  38569. InfiniteScroll: infinite_scroll,
  38570. PageHeader: page_header,
  38571. CascaderPanel: packages_cascader_panel,
  38572. Avatar: avatar,
  38573. Drawer: drawer,
  38574. Popconfirm: popconfirm,
  38575. Skeleton: skeleton,
  38576. SkeletonItem: skeleton_item,
  38577. Empty: empty,
  38578. Descriptions: descriptions,
  38579. DescriptionsItem: packages_descriptions_item,
  38580. Result: result
  38581. });
  38582. /***/ })
  38583. /******/ ])["default"];