element-ui.common.js 1022 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786
  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 = 40);
  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("vue");
  108. /***/ }),
  109. /* 5 */
  110. /***/ (function(module, exports) {
  111. module.exports = require("element-ui/lib/mixins/locale");
  112. /***/ }),
  113. /* 6 */
  114. /***/ (function(module, exports) {
  115. module.exports = require("element-ui/lib/utils/vue-popper");
  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("throttle-debounce/debounce");
  140. /***/ }),
  141. /* 13 */
  142. /***/ (function(module, exports) {
  143. module.exports = require("element-ui/lib/utils/resize-event");
  144. /***/ }),
  145. /* 14 */
  146. /***/ (function(module, exports) {
  147. module.exports = require("element-ui/lib/button");
  148. /***/ }),
  149. /* 15 */
  150. /***/ (function(module, exports) {
  151. module.exports = require("element-ui/lib/checkbox");
  152. /***/ }),
  153. /* 16 */
  154. /***/ (function(module, exports) {
  155. module.exports = require("element-ui/lib/locale");
  156. /***/ }),
  157. /* 17 */
  158. /***/ (function(module, exports) {
  159. module.exports = require("element-ui/lib/utils/date");
  160. /***/ }),
  161. /* 18 */
  162. /***/ (function(module, exports) {
  163. module.exports = require("element-ui/lib/transitions/collapse-transition");
  164. /***/ }),
  165. /* 19 */
  166. /***/ (function(module, exports) {
  167. module.exports = require("element-ui/lib/scrollbar");
  168. /***/ }),
  169. /* 20 */
  170. /***/ (function(module, exports) {
  171. module.exports = require("element-ui/lib/mixins/focus");
  172. /***/ }),
  173. /* 21 */
  174. /***/ (function(module, exports) {
  175. module.exports = require("element-ui/lib/utils/vdom");
  176. /***/ }),
  177. /* 22 */
  178. /***/ (function(module, exports) {
  179. module.exports = require("element-ui/lib/tooltip");
  180. /***/ }),
  181. /* 23 */
  182. /***/ (function(module, exports) {
  183. module.exports = require("element-ui/lib/tag");
  184. /***/ }),
  185. /* 24 */
  186. /***/ (function(module, exports) {
  187. module.exports = require("element-ui/lib/utils/scroll-into-view");
  188. /***/ }),
  189. /* 25 */
  190. /***/ (function(module, exports) {
  191. module.exports = require("element-ui/lib/utils/types");
  192. /***/ }),
  193. /* 26 */
  194. /***/ (function(module, exports) {
  195. module.exports = require("babel-helper-vue-jsx-merge-props");
  196. /***/ }),
  197. /* 27 */
  198. /***/ (function(module, exports) {
  199. module.exports = require("throttle-debounce/throttle");
  200. /***/ }),
  201. /* 28 */
  202. /***/ (function(module, exports) {
  203. module.exports = require("element-ui/lib/utils/shared");
  204. /***/ }),
  205. /* 29 */
  206. /***/ (function(module, exports) {
  207. module.exports = require("element-ui/lib/utils/scrollbar-width");
  208. /***/ }),
  209. /* 30 */
  210. /***/ (function(module, exports) {
  211. module.exports = require("element-ui/lib/checkbox-group");
  212. /***/ }),
  213. /* 31 */
  214. /***/ (function(module, exports) {
  215. module.exports = require("element-ui/lib/utils/after-leave");
  216. /***/ }),
  217. /* 32 */
  218. /***/ (function(module, exports) {
  219. module.exports = require("element-ui/lib/progress");
  220. /***/ }),
  221. /* 33 */
  222. /***/ (function(module, exports) {
  223. module.exports = require("element-ui/lib/select");
  224. /***/ }),
  225. /* 34 */
  226. /***/ (function(module, exports) {
  227. module.exports = require("element-ui/lib/option");
  228. /***/ }),
  229. /* 35 */
  230. /***/ (function(module, exports) {
  231. module.exports = require("element-ui/lib/button-group");
  232. /***/ }),
  233. /* 36 */
  234. /***/ (function(module, exports) {
  235. module.exports = require("normalize-wheel");
  236. /***/ }),
  237. /* 37 */
  238. /***/ (function(module, exports) {
  239. module.exports = require("element-ui/lib/utils/aria-dialog");
  240. /***/ }),
  241. /* 38 */
  242. /***/ (function(module, exports) {
  243. module.exports = require("async-validator");
  244. /***/ }),
  245. /* 39 */
  246. /***/ (function(module, exports) {
  247. module.exports = require("element-ui/lib/input-number");
  248. /***/ }),
  249. /* 40 */
  250. /***/ (function(module, exports, __webpack_require__) {
  251. module.exports = __webpack_require__(41);
  252. /***/ }),
  253. /* 41 */
  254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  255. "use strict";
  256. __webpack_require__.r(__webpack_exports__);
  257. // 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&
  258. var pagervue_type_template_id_7274f267_render = function() {
  259. var _vm = this
  260. var _h = _vm.$createElement
  261. var _c = _vm._self._c || _h
  262. return _c(
  263. "ul",
  264. { staticClass: "el-pager", on: { click: _vm.onPagerClick } },
  265. [
  266. _vm.pageCount > 0
  267. ? _c(
  268. "li",
  269. {
  270. staticClass: "number",
  271. class: { active: _vm.currentPage === 1, disabled: _vm.disabled }
  272. },
  273. [_vm._v("1")]
  274. )
  275. : _vm._e(),
  276. _vm.showPrevMore
  277. ? _c("li", {
  278. staticClass: "el-icon more btn-quickprev",
  279. class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
  280. on: {
  281. mouseenter: function($event) {
  282. _vm.onMouseenter("left")
  283. },
  284. mouseleave: function($event) {
  285. _vm.quickprevIconClass = "el-icon-more"
  286. }
  287. }
  288. })
  289. : _vm._e(),
  290. _vm._l(_vm.pagers, function(pager) {
  291. return _c(
  292. "li",
  293. {
  294. key: pager,
  295. staticClass: "number",
  296. class: { active: _vm.currentPage === pager, disabled: _vm.disabled }
  297. },
  298. [_vm._v(_vm._s(pager))]
  299. )
  300. }),
  301. _vm.showNextMore
  302. ? _c("li", {
  303. staticClass: "el-icon more btn-quicknext",
  304. class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
  305. on: {
  306. mouseenter: function($event) {
  307. _vm.onMouseenter("right")
  308. },
  309. mouseleave: function($event) {
  310. _vm.quicknextIconClass = "el-icon-more"
  311. }
  312. }
  313. })
  314. : _vm._e(),
  315. _vm.pageCount > 1
  316. ? _c(
  317. "li",
  318. {
  319. staticClass: "number",
  320. class: {
  321. active: _vm.currentPage === _vm.pageCount,
  322. disabled: _vm.disabled
  323. }
  324. },
  325. [_vm._v(_vm._s(_vm.pageCount))]
  326. )
  327. : _vm._e()
  328. ],
  329. 2
  330. )
  331. }
  332. var staticRenderFns = []
  333. pagervue_type_template_id_7274f267_render._withStripped = true
  334. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  335. // 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&
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. /* harmony default export */ var pagervue_type_script_lang_js_ = ({
  369. name: 'ElPager',
  370. props: {
  371. currentPage: Number,
  372. pageCount: Number,
  373. pagerCount: Number,
  374. disabled: Boolean
  375. },
  376. watch: {
  377. showPrevMore: function showPrevMore(val) {
  378. if (!val) this.quickprevIconClass = 'el-icon-more';
  379. },
  380. showNextMore: function showNextMore(val) {
  381. if (!val) this.quicknextIconClass = 'el-icon-more';
  382. }
  383. },
  384. methods: {
  385. onPagerClick: function onPagerClick(event) {
  386. var target = event.target;
  387. if (target.tagName === 'UL' || this.disabled) {
  388. return;
  389. }
  390. var newPage = Number(event.target.textContent);
  391. var pageCount = this.pageCount;
  392. var currentPage = this.currentPage;
  393. var pagerCountOffset = this.pagerCount - 2;
  394. if (target.className.indexOf('more') !== -1) {
  395. if (target.className.indexOf('quickprev') !== -1) {
  396. newPage = currentPage - pagerCountOffset;
  397. } else if (target.className.indexOf('quicknext') !== -1) {
  398. newPage = currentPage + pagerCountOffset;
  399. }
  400. }
  401. /* istanbul ignore if */
  402. if (!isNaN(newPage)) {
  403. if (newPage < 1) {
  404. newPage = 1;
  405. }
  406. if (newPage > pageCount) {
  407. newPage = pageCount;
  408. }
  409. }
  410. if (newPage !== currentPage) {
  411. this.$emit('change', newPage);
  412. }
  413. },
  414. onMouseenter: function onMouseenter(direction) {
  415. if (this.disabled) return;
  416. if (direction === 'left') {
  417. this.quickprevIconClass = 'el-icon-d-arrow-left';
  418. } else {
  419. this.quicknextIconClass = 'el-icon-d-arrow-right';
  420. }
  421. }
  422. },
  423. computed: {
  424. pagers: function pagers() {
  425. var pagerCount = this.pagerCount;
  426. var halfPagerCount = (pagerCount - 1) / 2;
  427. var currentPage = Number(this.currentPage);
  428. var pageCount = Number(this.pageCount);
  429. var showPrevMore = false;
  430. var showNextMore = false;
  431. if (pageCount > pagerCount) {
  432. if (currentPage > pagerCount - halfPagerCount) {
  433. showPrevMore = true;
  434. }
  435. if (currentPage < pageCount - halfPagerCount) {
  436. showNextMore = true;
  437. }
  438. }
  439. var array = [];
  440. if (showPrevMore && !showNextMore) {
  441. var startPage = pageCount - (pagerCount - 2);
  442. for (var i = startPage; i < pageCount; i++) {
  443. array.push(i);
  444. }
  445. } else if (!showPrevMore && showNextMore) {
  446. for (var _i = 2; _i < pagerCount; _i++) {
  447. array.push(_i);
  448. }
  449. } else if (showPrevMore && showNextMore) {
  450. var offset = Math.floor(pagerCount / 2) - 1;
  451. for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) {
  452. array.push(_i2);
  453. }
  454. } else {
  455. for (var _i3 = 2; _i3 < pageCount; _i3++) {
  456. array.push(_i3);
  457. }
  458. }
  459. this.showPrevMore = showPrevMore;
  460. this.showNextMore = showNextMore;
  461. return array;
  462. }
  463. },
  464. data: function data() {
  465. return {
  466. current: null,
  467. showPrevMore: false,
  468. showNextMore: false,
  469. quicknextIconClass: 'el-icon-more',
  470. quickprevIconClass: 'el-icon-more'
  471. };
  472. }
  473. });
  474. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  475. /* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
  476. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  477. /* globals __VUE_SSR_CONTEXT__ */
  478. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  479. // This module is a runtime utility for cleaner component module output and will
  480. // be included in the final webpack user bundle.
  481. function normalizeComponent (
  482. scriptExports,
  483. render,
  484. staticRenderFns,
  485. functionalTemplate,
  486. injectStyles,
  487. scopeId,
  488. moduleIdentifier, /* server only */
  489. shadowMode /* vue-cli only */
  490. ) {
  491. // Vue.extend constructor export interop
  492. var options = typeof scriptExports === 'function'
  493. ? scriptExports.options
  494. : scriptExports
  495. // render functions
  496. if (render) {
  497. options.render = render
  498. options.staticRenderFns = staticRenderFns
  499. options._compiled = true
  500. }
  501. // functional template
  502. if (functionalTemplate) {
  503. options.functional = true
  504. }
  505. // scopedId
  506. if (scopeId) {
  507. options._scopeId = 'data-v-' + scopeId
  508. }
  509. var hook
  510. if (moduleIdentifier) { // server build
  511. hook = function (context) {
  512. // 2.3 injection
  513. context =
  514. context || // cached call
  515. (this.$vnode && this.$vnode.ssrContext) || // stateful
  516. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  517. // 2.2 with runInNewContext: true
  518. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  519. context = __VUE_SSR_CONTEXT__
  520. }
  521. // inject component styles
  522. if (injectStyles) {
  523. injectStyles.call(this, context)
  524. }
  525. // register component module identifier for async chunk inferrence
  526. if (context && context._registeredComponents) {
  527. context._registeredComponents.add(moduleIdentifier)
  528. }
  529. }
  530. // used by ssr in case component is cached and beforeCreate
  531. // never gets called
  532. options._ssrRegister = hook
  533. } else if (injectStyles) {
  534. hook = shadowMode
  535. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  536. : injectStyles
  537. }
  538. if (hook) {
  539. if (options.functional) {
  540. // for template-only hot-reload because in that case the render fn doesn't
  541. // go through the normalizer
  542. options._injectStyles = hook
  543. // register for functioal component in vue file
  544. var originalRender = options.render
  545. options.render = function renderWithStyleInjection (h, context) {
  546. hook.call(context)
  547. return originalRender(h, context)
  548. }
  549. } else {
  550. // inject component registration as beforeCreate hook
  551. var existing = options.beforeCreate
  552. options.beforeCreate = existing
  553. ? [].concat(existing, hook)
  554. : [hook]
  555. }
  556. }
  557. return {
  558. exports: scriptExports,
  559. options: options
  560. }
  561. }
  562. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue
  563. /* normalize component */
  564. var component = normalizeComponent(
  565. src_pagervue_type_script_lang_js_,
  566. pagervue_type_template_id_7274f267_render,
  567. staticRenderFns,
  568. false,
  569. null,
  570. null,
  571. null
  572. )
  573. /* hot reload */
  574. if (false) { var api; }
  575. component.options.__file = "packages/pagination/src/pager.vue"
  576. /* harmony default export */ var pager = (component.exports);
  577. // EXTERNAL MODULE: external "element-ui/lib/select"
  578. var select_ = __webpack_require__(33);
  579. var select_default = /*#__PURE__*/__webpack_require__.n(select_);
  580. // EXTERNAL MODULE: external "element-ui/lib/option"
  581. var option_ = __webpack_require__(34);
  582. var option_default = /*#__PURE__*/__webpack_require__.n(option_);
  583. // EXTERNAL MODULE: external "element-ui/lib/input"
  584. var input_ = __webpack_require__(8);
  585. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  586. // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
  587. var locale_ = __webpack_require__(5);
  588. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  589. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  590. var util_ = __webpack_require__(2);
  591. // CONCATENATED MODULE: ./packages/pagination/src/pagination.js
  592. /* harmony default export */ var pagination = ({
  593. name: 'ElPagination',
  594. props: {
  595. pageSize: {
  596. type: Number,
  597. default: 10
  598. },
  599. small: Boolean,
  600. total: Number,
  601. pageCount: Number,
  602. pagerCount: {
  603. type: Number,
  604. validator: function validator(value) {
  605. return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1;
  606. },
  607. default: 7
  608. },
  609. currentPage: {
  610. type: Number,
  611. default: 1
  612. },
  613. layout: {
  614. default: 'prev, pager, next, jumper, ->, total'
  615. },
  616. pageSizes: {
  617. type: Array,
  618. default: function _default() {
  619. return [10, 20, 30, 40, 50, 100];
  620. }
  621. },
  622. popperClass: String,
  623. prevText: String,
  624. nextText: String,
  625. background: Boolean,
  626. disabled: Boolean,
  627. hideOnSinglePage: Boolean
  628. },
  629. data: function data() {
  630. return {
  631. internalCurrentPage: 1,
  632. internalPageSize: 0,
  633. lastEmittedPage: -1,
  634. userChangePageSize: false
  635. };
  636. },
  637. render: function render(h) {
  638. var layout = this.layout;
  639. if (!layout) return null;
  640. if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
  641. var template = h('div', { 'class': ['el-pagination', {
  642. 'is-background': this.background,
  643. 'el-pagination--small': this.small
  644. }] });
  645. var TEMPLATE_MAP = {
  646. prev: h('prev'),
  647. jumper: h('jumper'),
  648. pager: h('pager', {
  649. attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled },
  650. on: {
  651. 'change': this.handleCurrentChange
  652. }
  653. }),
  654. next: h('next'),
  655. sizes: h('sizes', {
  656. attrs: { pageSizes: this.pageSizes }
  657. }),
  658. slot: h('slot', [this.$slots.default ? this.$slots.default : '']),
  659. total: h('total')
  660. };
  661. var components = layout.split(',').map(function (item) {
  662. return item.trim();
  663. });
  664. var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' });
  665. var haveRightWrapper = false;
  666. template.children = template.children || [];
  667. rightWrapper.children = rightWrapper.children || [];
  668. components.forEach(function (compo) {
  669. if (compo === '->') {
  670. haveRightWrapper = true;
  671. return;
  672. }
  673. if (!haveRightWrapper) {
  674. template.children.push(TEMPLATE_MAP[compo]);
  675. } else {
  676. rightWrapper.children.push(TEMPLATE_MAP[compo]);
  677. }
  678. });
  679. if (haveRightWrapper) {
  680. template.children.unshift(rightWrapper);
  681. }
  682. return template;
  683. },
  684. components: {
  685. Prev: {
  686. render: function render(h) {
  687. return h(
  688. 'button',
  689. {
  690. attrs: {
  691. type: 'button',
  692. disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1
  693. },
  694. 'class': 'btn-prev', on: {
  695. 'click': this.$parent.prev
  696. }
  697. },
  698. [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })]
  699. );
  700. }
  701. },
  702. Next: {
  703. render: function render(h) {
  704. return h(
  705. 'button',
  706. {
  707. attrs: {
  708. type: 'button',
  709. disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0
  710. },
  711. 'class': 'btn-next', on: {
  712. 'click': this.$parent.next
  713. }
  714. },
  715. [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  716. );
  717. }
  718. },
  719. Sizes: {
  720. mixins: [locale_default.a],
  721. props: {
  722. pageSizes: Array
  723. },
  724. watch: {
  725. pageSizes: {
  726. immediate: true,
  727. handler: function handler(newVal, oldVal) {
  728. if (Object(util_["valueEquals"])(newVal, oldVal)) return;
  729. if (Array.isArray(newVal)) {
  730. this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
  731. }
  732. }
  733. }
  734. },
  735. render: function render(h) {
  736. var _this = this;
  737. return h(
  738. 'span',
  739. { 'class': 'el-pagination__sizes' },
  740. [h(
  741. 'el-select',
  742. {
  743. attrs: {
  744. value: this.$parent.internalPageSize,
  745. popperClass: this.$parent.popperClass || '',
  746. size: 'mini',
  747. disabled: this.$parent.disabled },
  748. on: {
  749. 'input': this.handleChange
  750. }
  751. },
  752. [this.pageSizes.map(function (item) {
  753. return h('el-option', {
  754. attrs: {
  755. value: item,
  756. label: item + _this.t('el.pagination.pagesize') }
  757. });
  758. })]
  759. )]
  760. );
  761. },
  762. components: {
  763. ElSelect: select_default.a,
  764. ElOption: option_default.a
  765. },
  766. methods: {
  767. handleChange: function handleChange(val) {
  768. if (val !== this.$parent.internalPageSize) {
  769. this.$parent.internalPageSize = val = parseInt(val, 10);
  770. this.$parent.userChangePageSize = true;
  771. this.$parent.$emit('update:pageSize', val);
  772. this.$parent.$emit('size-change', val);
  773. }
  774. }
  775. }
  776. },
  777. Jumper: {
  778. mixins: [locale_default.a],
  779. components: { ElInput: input_default.a },
  780. data: function data() {
  781. return {
  782. userInput: null
  783. };
  784. },
  785. watch: {
  786. '$parent.internalCurrentPage': function $parentInternalCurrentPage() {
  787. this.userInput = null;
  788. }
  789. },
  790. methods: {
  791. handleKeyup: function handleKeyup(_ref) {
  792. var keyCode = _ref.keyCode,
  793. target = _ref.target;
  794. // Chrome, Safari, Firefox triggers change event on Enter
  795. // Hack for IE: https://github.com/ElemeFE/element/issues/11710
  796. // Drop this method when we no longer supports IE
  797. if (keyCode === 13) {
  798. this.handleChange(target.value);
  799. }
  800. },
  801. handleInput: function handleInput(value) {
  802. this.userInput = value;
  803. },
  804. handleChange: function handleChange(value) {
  805. this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
  806. this.$parent.emitChange();
  807. this.userInput = null;
  808. }
  809. },
  810. render: function render(h) {
  811. return h(
  812. 'span',
  813. { 'class': 'el-pagination__jump' },
  814. [this.t('el.pagination.goto'), h('el-input', {
  815. 'class': 'el-pagination__editor is-in-pagination',
  816. attrs: { min: 1,
  817. max: this.$parent.internalPageCount,
  818. value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage,
  819. type: 'number',
  820. disabled: this.$parent.disabled
  821. },
  822. nativeOn: {
  823. 'keyup': this.handleKeyup
  824. },
  825. on: {
  826. 'input': this.handleInput,
  827. 'change': this.handleChange
  828. }
  829. }), this.t('el.pagination.pageClassifier')]
  830. );
  831. }
  832. },
  833. Total: {
  834. mixins: [locale_default.a],
  835. render: function render(h) {
  836. return typeof this.$parent.total === 'number' ? h(
  837. 'span',
  838. { 'class': 'el-pagination__total' },
  839. [this.t('el.pagination.total', { total: this.$parent.total })]
  840. ) : '';
  841. }
  842. },
  843. Pager: pager
  844. },
  845. methods: {
  846. handleCurrentChange: function handleCurrentChange(val) {
  847. this.internalCurrentPage = this.getValidCurrentPage(val);
  848. this.userChangePageSize = true;
  849. this.emitChange();
  850. },
  851. prev: function prev() {
  852. if (this.disabled) return;
  853. var newVal = this.internalCurrentPage - 1;
  854. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  855. this.$emit('prev-click', this.internalCurrentPage);
  856. this.emitChange();
  857. },
  858. next: function next() {
  859. if (this.disabled) return;
  860. var newVal = this.internalCurrentPage + 1;
  861. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  862. this.$emit('next-click', this.internalCurrentPage);
  863. this.emitChange();
  864. },
  865. getValidCurrentPage: function getValidCurrentPage(value) {
  866. value = parseInt(value, 10);
  867. var havePageCount = typeof this.internalPageCount === 'number';
  868. var resetValue = void 0;
  869. if (!havePageCount) {
  870. if (isNaN(value) || value < 1) resetValue = 1;
  871. } else {
  872. if (value < 1) {
  873. resetValue = 1;
  874. } else if (value > this.internalPageCount) {
  875. resetValue = this.internalPageCount;
  876. }
  877. }
  878. if (resetValue === undefined && isNaN(value)) {
  879. resetValue = 1;
  880. } else if (resetValue === 0) {
  881. resetValue = 1;
  882. }
  883. return resetValue === undefined ? value : resetValue;
  884. },
  885. emitChange: function emitChange() {
  886. var _this2 = this;
  887. this.$nextTick(function () {
  888. if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) {
  889. _this2.$emit('current-change', _this2.internalCurrentPage);
  890. _this2.lastEmittedPage = _this2.internalCurrentPage;
  891. _this2.userChangePageSize = false;
  892. }
  893. });
  894. }
  895. },
  896. computed: {
  897. internalPageCount: function internalPageCount() {
  898. if (typeof this.total === 'number') {
  899. return Math.max(1, Math.ceil(this.total / this.internalPageSize));
  900. } else if (typeof this.pageCount === 'number') {
  901. return Math.max(1, this.pageCount);
  902. }
  903. return null;
  904. }
  905. },
  906. watch: {
  907. currentPage: {
  908. immediate: true,
  909. handler: function handler(val) {
  910. this.internalCurrentPage = this.getValidCurrentPage(val);
  911. }
  912. },
  913. pageSize: {
  914. immediate: true,
  915. handler: function handler(val) {
  916. this.internalPageSize = isNaN(val) ? 10 : val;
  917. }
  918. },
  919. internalCurrentPage: {
  920. immediate: true,
  921. handler: function handler(newVal) {
  922. this.$emit('update:currentPage', newVal);
  923. this.lastEmittedPage = -1;
  924. }
  925. },
  926. internalPageCount: function internalPageCount(newVal) {
  927. /* istanbul ignore if */
  928. var oldPage = this.internalCurrentPage;
  929. if (newVal > 0 && oldPage === 0) {
  930. this.internalCurrentPage = 1;
  931. } else if (oldPage > newVal) {
  932. this.internalCurrentPage = newVal === 0 ? 1 : newVal;
  933. this.userChangePageSize && this.emitChange();
  934. }
  935. this.userChangePageSize = false;
  936. }
  937. }
  938. });
  939. // CONCATENATED MODULE: ./packages/pagination/index.js
  940. /* istanbul ignore next */
  941. pagination.install = function (Vue) {
  942. Vue.component(pagination.name, pagination);
  943. };
  944. /* harmony default export */ var packages_pagination = (pagination);
  945. // 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&
  946. var componentvue_type_template_id_60140e62_render = function() {
  947. var _vm = this
  948. var _h = _vm.$createElement
  949. var _c = _vm._self._c || _h
  950. return _c(
  951. "transition",
  952. {
  953. attrs: { name: "dialog-fade" },
  954. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  955. },
  956. [
  957. _c(
  958. "div",
  959. {
  960. directives: [
  961. {
  962. name: "show",
  963. rawName: "v-show",
  964. value: _vm.visible,
  965. expression: "visible"
  966. }
  967. ],
  968. staticClass: "el-dialog__wrapper",
  969. on: {
  970. click: function($event) {
  971. if ($event.target !== $event.currentTarget) {
  972. return null
  973. }
  974. return _vm.handleWrapperClick($event)
  975. }
  976. }
  977. },
  978. [
  979. _c(
  980. "div",
  981. {
  982. ref: "dialog",
  983. staticClass: "el-dialog",
  984. class: [
  985. {
  986. "is-fullscreen": _vm.fullscreen,
  987. "el-dialog--center": _vm.center
  988. },
  989. _vm.customClass
  990. ],
  991. style: _vm.style,
  992. attrs: {
  993. role: "dialog",
  994. "aria-modal": "true",
  995. "aria-label": _vm.title || "dialog"
  996. }
  997. },
  998. [
  999. _c(
  1000. "div",
  1001. { staticClass: "el-dialog__header" },
  1002. [
  1003. _vm._t("title", [
  1004. _c("span", { staticClass: "el-dialog__title" }, [
  1005. _vm._v(_vm._s(_vm.title))
  1006. ])
  1007. ]),
  1008. _vm.showClose
  1009. ? _c(
  1010. "button",
  1011. {
  1012. staticClass: "el-dialog__headerbtn",
  1013. attrs: { type: "button", "aria-label": "Close" },
  1014. on: { click: _vm.handleClose }
  1015. },
  1016. [
  1017. _c("i", {
  1018. staticClass:
  1019. "el-dialog__close el-icon el-icon-close"
  1020. })
  1021. ]
  1022. )
  1023. : _vm._e()
  1024. ],
  1025. 2
  1026. ),
  1027. _vm.rendered
  1028. ? _c(
  1029. "div",
  1030. { staticClass: "el-dialog__body" },
  1031. [_vm._t("default")],
  1032. 2
  1033. )
  1034. : _vm._e(),
  1035. _vm.$slots.footer
  1036. ? _c(
  1037. "div",
  1038. { staticClass: "el-dialog__footer" },
  1039. [_vm._t("footer")],
  1040. 2
  1041. )
  1042. : _vm._e()
  1043. ]
  1044. )
  1045. ]
  1046. )
  1047. ]
  1048. )
  1049. }
  1050. var componentvue_type_template_id_60140e62_staticRenderFns = []
  1051. componentvue_type_template_id_60140e62_render._withStripped = true
  1052. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=template&id=60140e62&
  1053. // EXTERNAL MODULE: external "element-ui/lib/utils/popup"
  1054. var popup_ = __webpack_require__(11);
  1055. var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
  1056. // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
  1057. var migrating_ = __webpack_require__(9);
  1058. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  1059. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  1060. var emitter_ = __webpack_require__(3);
  1061. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  1062. // 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&
  1063. //
  1064. //
  1065. //
  1066. //
  1067. //
  1068. //
  1069. //
  1070. //
  1071. //
  1072. //
  1073. //
  1074. //
  1075. //
  1076. //
  1077. //
  1078. //
  1079. //
  1080. //
  1081. //
  1082. //
  1083. //
  1084. //
  1085. //
  1086. //
  1087. //
  1088. //
  1089. //
  1090. //
  1091. //
  1092. //
  1093. //
  1094. //
  1095. //
  1096. //
  1097. //
  1098. //
  1099. /* harmony default export */ var componentvue_type_script_lang_js_ = ({
  1100. name: 'ElDialog',
  1101. mixins: [popup_default.a, emitter_default.a, migrating_default.a],
  1102. props: {
  1103. title: {
  1104. type: String,
  1105. default: ''
  1106. },
  1107. modal: {
  1108. type: Boolean,
  1109. default: true
  1110. },
  1111. modalAppendToBody: {
  1112. type: Boolean,
  1113. default: true
  1114. },
  1115. appendToBody: {
  1116. type: Boolean,
  1117. default: false
  1118. },
  1119. lockScroll: {
  1120. type: Boolean,
  1121. default: true
  1122. },
  1123. closeOnClickModal: {
  1124. type: Boolean,
  1125. default: true
  1126. },
  1127. closeOnPressEscape: {
  1128. type: Boolean,
  1129. default: true
  1130. },
  1131. showClose: {
  1132. type: Boolean,
  1133. default: true
  1134. },
  1135. width: String,
  1136. fullscreen: Boolean,
  1137. customClass: {
  1138. type: String,
  1139. default: ''
  1140. },
  1141. top: {
  1142. type: String,
  1143. default: '15vh'
  1144. },
  1145. beforeClose: Function,
  1146. center: {
  1147. type: Boolean,
  1148. default: false
  1149. }
  1150. },
  1151. data: function data() {
  1152. return {
  1153. closed: false
  1154. };
  1155. },
  1156. watch: {
  1157. visible: function visible(val) {
  1158. var _this = this;
  1159. if (val) {
  1160. this.closed = false;
  1161. this.$emit('open');
  1162. this.$el.addEventListener('scroll', this.updatePopper);
  1163. this.$nextTick(function () {
  1164. _this.$refs.dialog.scrollTop = 0;
  1165. });
  1166. if (this.appendToBody) {
  1167. document.body.appendChild(this.$el);
  1168. }
  1169. } else {
  1170. this.$el.removeEventListener('scroll', this.updatePopper);
  1171. if (!this.closed) this.$emit('close');
  1172. }
  1173. }
  1174. },
  1175. computed: {
  1176. style: function style() {
  1177. var style = {};
  1178. if (!this.fullscreen) {
  1179. style.marginTop = this.top;
  1180. if (this.width) {
  1181. style.width = this.width;
  1182. }
  1183. }
  1184. return style;
  1185. }
  1186. },
  1187. methods: {
  1188. getMigratingConfig: function getMigratingConfig() {
  1189. return {
  1190. props: {
  1191. 'size': 'size is removed.'
  1192. }
  1193. };
  1194. },
  1195. handleWrapperClick: function handleWrapperClick() {
  1196. if (!this.closeOnClickModal) return;
  1197. this.handleClose();
  1198. },
  1199. handleClose: function handleClose() {
  1200. if (typeof this.beforeClose === 'function') {
  1201. this.beforeClose(this.hide);
  1202. } else {
  1203. this.hide();
  1204. }
  1205. },
  1206. hide: function hide(cancel) {
  1207. if (cancel !== false) {
  1208. this.$emit('update:visible', false);
  1209. this.$emit('close');
  1210. this.closed = true;
  1211. }
  1212. },
  1213. updatePopper: function updatePopper() {
  1214. this.broadcast('ElSelectDropdown', 'updatePopper');
  1215. this.broadcast('ElDropdownMenu', 'updatePopper');
  1216. },
  1217. afterEnter: function afterEnter() {
  1218. this.$emit('opened');
  1219. },
  1220. afterLeave: function afterLeave() {
  1221. this.$emit('closed');
  1222. }
  1223. },
  1224. mounted: function mounted() {
  1225. if (this.visible) {
  1226. this.rendered = true;
  1227. this.open();
  1228. if (this.appendToBody) {
  1229. document.body.appendChild(this.$el);
  1230. }
  1231. }
  1232. },
  1233. destroyed: function destroyed() {
  1234. // if appendToBody is true, remove DOM node after destroy
  1235. if (this.appendToBody && this.$el && this.$el.parentNode) {
  1236. this.$el.parentNode.removeChild(this.$el);
  1237. }
  1238. }
  1239. });
  1240. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=script&lang=js&
  1241. /* harmony default export */ var src_componentvue_type_script_lang_js_ = (componentvue_type_script_lang_js_);
  1242. // CONCATENATED MODULE: ./packages/dialog/src/component.vue
  1243. /* normalize component */
  1244. var component_component = normalizeComponent(
  1245. src_componentvue_type_script_lang_js_,
  1246. componentvue_type_template_id_60140e62_render,
  1247. componentvue_type_template_id_60140e62_staticRenderFns,
  1248. false,
  1249. null,
  1250. null,
  1251. null
  1252. )
  1253. /* hot reload */
  1254. if (false) { var component_api; }
  1255. component_component.options.__file = "packages/dialog/src/component.vue"
  1256. /* harmony default export */ var src_component = (component_component.exports);
  1257. // CONCATENATED MODULE: ./packages/dialog/index.js
  1258. /* istanbul ignore next */
  1259. src_component.install = function (Vue) {
  1260. Vue.component(src_component.name, src_component);
  1261. };
  1262. /* harmony default export */ var dialog = (src_component);
  1263. // 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&
  1264. var autocompletevue_type_template_id_152f2ee6_render = function() {
  1265. var _vm = this
  1266. var _h = _vm.$createElement
  1267. var _c = _vm._self._c || _h
  1268. return _c(
  1269. "div",
  1270. {
  1271. directives: [
  1272. {
  1273. name: "clickoutside",
  1274. rawName: "v-clickoutside",
  1275. value: _vm.close,
  1276. expression: "close"
  1277. }
  1278. ],
  1279. staticClass: "el-autocomplete",
  1280. attrs: {
  1281. "aria-haspopup": "listbox",
  1282. role: "combobox",
  1283. "aria-expanded": _vm.suggestionVisible,
  1284. "aria-owns": _vm.id
  1285. }
  1286. },
  1287. [
  1288. _c(
  1289. "el-input",
  1290. _vm._b(
  1291. {
  1292. ref: "input",
  1293. on: {
  1294. input: _vm.handleChange,
  1295. focus: _vm.handleFocus,
  1296. blur: _vm.handleBlur,
  1297. clear: _vm.handleClear
  1298. },
  1299. nativeOn: {
  1300. keydown: [
  1301. function($event) {
  1302. if (
  1303. !("button" in $event) &&
  1304. _vm._k($event.keyCode, "up", 38, $event.key, [
  1305. "Up",
  1306. "ArrowUp"
  1307. ])
  1308. ) {
  1309. return null
  1310. }
  1311. $event.preventDefault()
  1312. _vm.highlight(_vm.highlightedIndex - 1)
  1313. },
  1314. function($event) {
  1315. if (
  1316. !("button" in $event) &&
  1317. _vm._k($event.keyCode, "down", 40, $event.key, [
  1318. "Down",
  1319. "ArrowDown"
  1320. ])
  1321. ) {
  1322. return null
  1323. }
  1324. $event.preventDefault()
  1325. _vm.highlight(_vm.highlightedIndex + 1)
  1326. },
  1327. function($event) {
  1328. if (
  1329. !("button" in $event) &&
  1330. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  1331. ) {
  1332. return null
  1333. }
  1334. return _vm.handleKeyEnter($event)
  1335. },
  1336. function($event) {
  1337. if (
  1338. !("button" in $event) &&
  1339. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  1340. ) {
  1341. return null
  1342. }
  1343. return _vm.close($event)
  1344. }
  1345. ]
  1346. }
  1347. },
  1348. "el-input",
  1349. [_vm.$props, _vm.$attrs],
  1350. false
  1351. ),
  1352. [
  1353. _vm.$slots.prepend
  1354. ? _c("template", { slot: "prepend" }, [_vm._t("prepend")], 2)
  1355. : _vm._e(),
  1356. _vm.$slots.append
  1357. ? _c("template", { slot: "append" }, [_vm._t("append")], 2)
  1358. : _vm._e(),
  1359. _vm.$slots.prefix
  1360. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  1361. : _vm._e(),
  1362. _vm.$slots.suffix
  1363. ? _c("template", { slot: "suffix" }, [_vm._t("suffix")], 2)
  1364. : _vm._e()
  1365. ],
  1366. 2
  1367. ),
  1368. _c(
  1369. "el-autocomplete-suggestions",
  1370. {
  1371. ref: "suggestions",
  1372. class: [_vm.popperClass ? _vm.popperClass : ""],
  1373. attrs: {
  1374. "visible-arrow": "",
  1375. "popper-options": _vm.popperOptions,
  1376. "append-to-body": _vm.popperAppendToBody,
  1377. placement: _vm.placement,
  1378. id: _vm.id
  1379. }
  1380. },
  1381. _vm._l(_vm.suggestions, function(item, index) {
  1382. return _c(
  1383. "li",
  1384. {
  1385. key: index,
  1386. class: { highlighted: _vm.highlightedIndex === index },
  1387. attrs: {
  1388. id: _vm.id + "-item-" + index,
  1389. role: "option",
  1390. "aria-selected": _vm.highlightedIndex === index
  1391. },
  1392. on: {
  1393. click: function($event) {
  1394. _vm.select(item)
  1395. }
  1396. }
  1397. },
  1398. [
  1399. _vm._t(
  1400. "default",
  1401. [
  1402. _vm._v("\n " + _vm._s(item[_vm.valueKey]) + "\n ")
  1403. ],
  1404. { item: item }
  1405. )
  1406. ],
  1407. 2
  1408. )
  1409. }),
  1410. 0
  1411. )
  1412. ],
  1413. 1
  1414. )
  1415. }
  1416. var autocompletevue_type_template_id_152f2ee6_staticRenderFns = []
  1417. autocompletevue_type_template_id_152f2ee6_render._withStripped = true
  1418. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6&
  1419. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  1420. var debounce_ = __webpack_require__(12);
  1421. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  1422. // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
  1423. var clickoutside_ = __webpack_require__(10);
  1424. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1425. // 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&
  1426. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_render = function() {
  1427. var _vm = this
  1428. var _h = _vm.$createElement
  1429. var _c = _vm._self._c || _h
  1430. return _c(
  1431. "transition",
  1432. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  1433. [
  1434. _c(
  1435. "div",
  1436. {
  1437. directives: [
  1438. {
  1439. name: "show",
  1440. rawName: "v-show",
  1441. value: _vm.showPopper,
  1442. expression: "showPopper"
  1443. }
  1444. ],
  1445. staticClass: "el-autocomplete-suggestion el-popper",
  1446. class: {
  1447. "is-loading": !_vm.parent.hideLoading && _vm.parent.loading
  1448. },
  1449. style: { width: _vm.dropdownWidth },
  1450. attrs: { role: "region" }
  1451. },
  1452. [
  1453. _c(
  1454. "el-scrollbar",
  1455. {
  1456. attrs: {
  1457. tag: "ul",
  1458. "wrap-class": "el-autocomplete-suggestion__wrap",
  1459. "view-class": "el-autocomplete-suggestion__list"
  1460. }
  1461. },
  1462. [
  1463. !_vm.parent.hideLoading && _vm.parent.loading
  1464. ? _c("li", [_c("i", { staticClass: "el-icon-loading" })])
  1465. : _vm._t("default")
  1466. ],
  1467. 2
  1468. )
  1469. ],
  1470. 1
  1471. )
  1472. ]
  1473. )
  1474. }
  1475. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns = []
  1476. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render._withStripped = true
  1477. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0&
  1478. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  1479. var vue_popper_ = __webpack_require__(6);
  1480. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  1481. // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
  1482. var scrollbar_ = __webpack_require__(19);
  1483. var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
  1484. // 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&
  1485. //
  1486. //
  1487. //
  1488. //
  1489. //
  1490. //
  1491. //
  1492. //
  1493. //
  1494. //
  1495. //
  1496. //
  1497. //
  1498. //
  1499. //
  1500. //
  1501. //
  1502. //
  1503. //
  1504. /* harmony default export */ var autocomplete_suggestionsvue_type_script_lang_js_ = ({
  1505. components: { ElScrollbar: scrollbar_default.a },
  1506. mixins: [vue_popper_default.a, emitter_default.a],
  1507. componentName: 'ElAutocompleteSuggestions',
  1508. data: function data() {
  1509. return {
  1510. parent: this.$parent,
  1511. dropdownWidth: ''
  1512. };
  1513. },
  1514. props: {
  1515. options: {
  1516. default: function _default() {
  1517. return {
  1518. gpuAcceleration: false
  1519. };
  1520. }
  1521. },
  1522. id: String
  1523. },
  1524. methods: {
  1525. select: function select(item) {
  1526. this.dispatch('ElAutocomplete', 'item-click', item);
  1527. }
  1528. },
  1529. updated: function updated() {
  1530. var _this = this;
  1531. this.$nextTick(function (_) {
  1532. _this.popperJS && _this.updatePopper();
  1533. });
  1534. },
  1535. mounted: function mounted() {
  1536. this.$parent.popperElm = this.popperElm = this.$el;
  1537. this.referenceElm = this.$parent.$refs.input.$refs.input;
  1538. this.referenceList = this.$el.querySelector('.el-autocomplete-suggestion__list');
  1539. this.referenceList.setAttribute('role', 'listbox');
  1540. this.referenceList.setAttribute('id', this.id);
  1541. },
  1542. created: function created() {
  1543. var _this2 = this;
  1544. this.$on('visible', function (val, inputWidth) {
  1545. _this2.dropdownWidth = inputWidth + 'px';
  1546. _this2.showPopper = val;
  1547. });
  1548. }
  1549. });
  1550. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js&
  1551. /* harmony default export */ var src_autocomplete_suggestionsvue_type_script_lang_js_ = (autocomplete_suggestionsvue_type_script_lang_js_);
  1552. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue
  1553. /* normalize component */
  1554. var autocomplete_suggestions_component = normalizeComponent(
  1555. src_autocomplete_suggestionsvue_type_script_lang_js_,
  1556. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render,
  1557. autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns,
  1558. false,
  1559. null,
  1560. null,
  1561. null
  1562. )
  1563. /* hot reload */
  1564. if (false) { var autocomplete_suggestions_api; }
  1565. autocomplete_suggestions_component.options.__file = "packages/autocomplete/src/autocomplete-suggestions.vue"
  1566. /* harmony default export */ var autocomplete_suggestions = (autocomplete_suggestions_component.exports);
  1567. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  1568. var focus_ = __webpack_require__(20);
  1569. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  1570. // 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&
  1571. //
  1572. //
  1573. //
  1574. //
  1575. //
  1576. //
  1577. //
  1578. //
  1579. //
  1580. //
  1581. //
  1582. //
  1583. //
  1584. //
  1585. //
  1586. //
  1587. //
  1588. //
  1589. //
  1590. //
  1591. //
  1592. //
  1593. //
  1594. //
  1595. //
  1596. //
  1597. //
  1598. //
  1599. //
  1600. //
  1601. //
  1602. //
  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. /* harmony default export */ var autocompletevue_type_script_lang_js_ = ({
  1630. name: 'ElAutocomplete',
  1631. mixins: [emitter_default.a, focus_default()('input'), migrating_default.a],
  1632. inheritAttrs: false,
  1633. componentName: 'ElAutocomplete',
  1634. components: {
  1635. ElInput: input_default.a,
  1636. ElAutocompleteSuggestions: autocomplete_suggestions
  1637. },
  1638. directives: { Clickoutside: clickoutside_default.a },
  1639. props: {
  1640. valueKey: {
  1641. type: String,
  1642. default: 'value'
  1643. },
  1644. popperClass: String,
  1645. popperOptions: Object,
  1646. placeholder: String,
  1647. clearable: {
  1648. type: Boolean,
  1649. default: false
  1650. },
  1651. disabled: Boolean,
  1652. name: String,
  1653. size: String,
  1654. value: String,
  1655. maxlength: Number,
  1656. minlength: Number,
  1657. autofocus: Boolean,
  1658. fetchSuggestions: Function,
  1659. triggerOnFocus: {
  1660. type: Boolean,
  1661. default: true
  1662. },
  1663. customItem: String,
  1664. selectWhenUnmatched: {
  1665. type: Boolean,
  1666. default: false
  1667. },
  1668. prefixIcon: String,
  1669. suffixIcon: String,
  1670. label: String,
  1671. debounce: {
  1672. type: Number,
  1673. default: 300
  1674. },
  1675. placement: {
  1676. type: String,
  1677. default: 'bottom-start'
  1678. },
  1679. hideLoading: Boolean,
  1680. popperAppendToBody: {
  1681. type: Boolean,
  1682. default: true
  1683. },
  1684. highlightFirstItem: {
  1685. type: Boolean,
  1686. default: false
  1687. }
  1688. },
  1689. data: function data() {
  1690. return {
  1691. activated: false,
  1692. suggestions: [],
  1693. loading: false,
  1694. highlightedIndex: -1,
  1695. suggestionDisabled: false
  1696. };
  1697. },
  1698. computed: {
  1699. suggestionVisible: function suggestionVisible() {
  1700. var suggestions = this.suggestions;
  1701. var isValidData = Array.isArray(suggestions) && suggestions.length > 0;
  1702. return (isValidData || this.loading) && this.activated;
  1703. },
  1704. id: function id() {
  1705. return 'el-autocomplete-' + Object(util_["generateId"])();
  1706. }
  1707. },
  1708. watch: {
  1709. suggestionVisible: function suggestionVisible(val) {
  1710. var $input = this.getInput();
  1711. if ($input) {
  1712. this.broadcast('ElAutocompleteSuggestions', 'visible', [val, $input.offsetWidth]);
  1713. }
  1714. }
  1715. },
  1716. methods: {
  1717. getMigratingConfig: function getMigratingConfig() {
  1718. return {
  1719. props: {
  1720. 'custom-item': 'custom-item is removed, use scoped slot instead.',
  1721. 'props': 'props is removed, use value-key instead.'
  1722. }
  1723. };
  1724. },
  1725. getData: function getData(queryString) {
  1726. var _this = this;
  1727. if (this.suggestionDisabled) {
  1728. return;
  1729. }
  1730. this.loading = true;
  1731. this.fetchSuggestions(queryString, function (suggestions) {
  1732. _this.loading = false;
  1733. if (_this.suggestionDisabled) {
  1734. return;
  1735. }
  1736. if (Array.isArray(suggestions)) {
  1737. _this.suggestions = suggestions;
  1738. _this.highlightedIndex = _this.highlightFirstItem ? 0 : -1;
  1739. } else {
  1740. console.error('[Element Error][Autocomplete]autocomplete suggestions must be an array');
  1741. }
  1742. });
  1743. },
  1744. handleChange: function handleChange(value) {
  1745. this.$emit('input', value);
  1746. this.suggestionDisabled = false;
  1747. if (!this.triggerOnFocus && !value) {
  1748. this.suggestionDisabled = true;
  1749. this.suggestions = [];
  1750. return;
  1751. }
  1752. this.debouncedGetData(value);
  1753. },
  1754. handleFocus: function handleFocus(event) {
  1755. this.activated = true;
  1756. this.$emit('focus', event);
  1757. if (this.triggerOnFocus) {
  1758. this.debouncedGetData(this.value);
  1759. }
  1760. },
  1761. handleBlur: function handleBlur(event) {
  1762. this.$emit('blur', event);
  1763. },
  1764. handleClear: function handleClear() {
  1765. this.activated = false;
  1766. this.$emit('clear');
  1767. },
  1768. close: function close(e) {
  1769. this.activated = false;
  1770. },
  1771. handleKeyEnter: function handleKeyEnter(e) {
  1772. var _this2 = this;
  1773. if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
  1774. e.preventDefault();
  1775. this.select(this.suggestions[this.highlightedIndex]);
  1776. } else if (this.selectWhenUnmatched) {
  1777. this.$emit('select', { value: this.value });
  1778. this.$nextTick(function (_) {
  1779. _this2.suggestions = [];
  1780. _this2.highlightedIndex = -1;
  1781. });
  1782. }
  1783. },
  1784. select: function select(item) {
  1785. var _this3 = this;
  1786. this.$emit('input', item[this.valueKey]);
  1787. this.$emit('select', item);
  1788. this.$nextTick(function (_) {
  1789. _this3.suggestions = [];
  1790. _this3.highlightedIndex = -1;
  1791. });
  1792. },
  1793. highlight: function highlight(index) {
  1794. if (!this.suggestionVisible || this.loading) {
  1795. return;
  1796. }
  1797. if (index < 0) {
  1798. this.highlightedIndex = -1;
  1799. return;
  1800. }
  1801. if (index >= this.suggestions.length) {
  1802. index = this.suggestions.length - 1;
  1803. }
  1804. var suggestion = this.$refs.suggestions.$el.querySelector('.el-autocomplete-suggestion__wrap');
  1805. var suggestionList = suggestion.querySelectorAll('.el-autocomplete-suggestion__list li');
  1806. var highlightItem = suggestionList[index];
  1807. var scrollTop = suggestion.scrollTop;
  1808. var offsetTop = highlightItem.offsetTop;
  1809. if (offsetTop + highlightItem.scrollHeight > scrollTop + suggestion.clientHeight) {
  1810. suggestion.scrollTop += highlightItem.scrollHeight;
  1811. }
  1812. if (offsetTop < scrollTop) {
  1813. suggestion.scrollTop -= highlightItem.scrollHeight;
  1814. }
  1815. this.highlightedIndex = index;
  1816. var $input = this.getInput();
  1817. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1818. },
  1819. getInput: function getInput() {
  1820. return this.$refs.input.getInput();
  1821. }
  1822. },
  1823. mounted: function mounted() {
  1824. var _this4 = this;
  1825. this.debouncedGetData = debounce_default()(this.debounce, this.getData);
  1826. this.$on('item-click', function (item) {
  1827. _this4.select(item);
  1828. });
  1829. var $input = this.getInput();
  1830. $input.setAttribute('role', 'textbox');
  1831. $input.setAttribute('aria-autocomplete', 'list');
  1832. $input.setAttribute('aria-controls', 'id');
  1833. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1834. },
  1835. beforeDestroy: function beforeDestroy() {
  1836. this.$refs.suggestions.$destroy();
  1837. }
  1838. });
  1839. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js&
  1840. /* harmony default export */ var src_autocompletevue_type_script_lang_js_ = (autocompletevue_type_script_lang_js_);
  1841. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue
  1842. /* normalize component */
  1843. var autocomplete_component = normalizeComponent(
  1844. src_autocompletevue_type_script_lang_js_,
  1845. autocompletevue_type_template_id_152f2ee6_render,
  1846. autocompletevue_type_template_id_152f2ee6_staticRenderFns,
  1847. false,
  1848. null,
  1849. null,
  1850. null
  1851. )
  1852. /* hot reload */
  1853. if (false) { var autocomplete_api; }
  1854. autocomplete_component.options.__file = "packages/autocomplete/src/autocomplete.vue"
  1855. /* harmony default export */ var autocomplete = (autocomplete_component.exports);
  1856. // CONCATENATED MODULE: ./packages/autocomplete/index.js
  1857. /* istanbul ignore next */
  1858. autocomplete.install = function (Vue) {
  1859. Vue.component(autocomplete.name, autocomplete);
  1860. };
  1861. /* harmony default export */ var packages_autocomplete = (autocomplete);
  1862. // EXTERNAL MODULE: external "element-ui/lib/button"
  1863. var button_ = __webpack_require__(14);
  1864. var button_default = /*#__PURE__*/__webpack_require__.n(button_);
  1865. // EXTERNAL MODULE: external "element-ui/lib/button-group"
  1866. var button_group_ = __webpack_require__(35);
  1867. var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
  1868. // 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&
  1869. /* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
  1870. name: 'ElDropdown',
  1871. componentName: 'ElDropdown',
  1872. mixins: [emitter_default.a, migrating_default.a],
  1873. directives: { Clickoutside: clickoutside_default.a },
  1874. components: {
  1875. ElButton: button_default.a,
  1876. ElButtonGroup: button_group_default.a
  1877. },
  1878. provide: function provide() {
  1879. return {
  1880. dropdown: this
  1881. };
  1882. },
  1883. props: {
  1884. trigger: {
  1885. type: String,
  1886. default: 'hover'
  1887. },
  1888. type: String,
  1889. size: {
  1890. type: String,
  1891. default: ''
  1892. },
  1893. splitButton: Boolean,
  1894. hideOnClick: {
  1895. type: Boolean,
  1896. default: true
  1897. },
  1898. placement: {
  1899. type: String,
  1900. default: 'bottom-end'
  1901. },
  1902. visibleArrow: {
  1903. default: true
  1904. },
  1905. showTimeout: {
  1906. type: Number,
  1907. default: 250
  1908. },
  1909. hideTimeout: {
  1910. type: Number,
  1911. default: 150
  1912. },
  1913. tabindex: {
  1914. type: Number,
  1915. default: 0
  1916. }
  1917. },
  1918. data: function data() {
  1919. return {
  1920. timeout: null,
  1921. visible: false,
  1922. triggerElm: null,
  1923. menuItems: null,
  1924. menuItemsArray: null,
  1925. dropdownElm: null,
  1926. focusing: false,
  1927. listId: 'dropdown-menu-' + Object(util_["generateId"])()
  1928. };
  1929. },
  1930. computed: {
  1931. dropdownSize: function dropdownSize() {
  1932. return this.size || (this.$ELEMENT || {}).size;
  1933. }
  1934. },
  1935. mounted: function mounted() {
  1936. this.$on('menu-item-click', this.handleMenuItemClick);
  1937. },
  1938. watch: {
  1939. visible: function visible(val) {
  1940. this.broadcast('ElDropdownMenu', 'visible', val);
  1941. this.$emit('visible-change', val);
  1942. },
  1943. focusing: function focusing(val) {
  1944. var selfDefine = this.$el.querySelector('.el-dropdown-selfdefine');
  1945. if (selfDefine) {
  1946. // 自定义
  1947. if (val) {
  1948. selfDefine.className += ' focusing';
  1949. } else {
  1950. selfDefine.className = selfDefine.className.replace('focusing', '');
  1951. }
  1952. }
  1953. }
  1954. },
  1955. methods: {
  1956. getMigratingConfig: function getMigratingConfig() {
  1957. return {
  1958. props: {
  1959. 'menu-align': 'menu-align is renamed to placement.'
  1960. }
  1961. };
  1962. },
  1963. show: function show() {
  1964. var _this = this;
  1965. if (this.triggerElm.disabled) return;
  1966. clearTimeout(this.timeout);
  1967. this.timeout = setTimeout(function () {
  1968. _this.visible = true;
  1969. }, this.trigger === 'click' ? 0 : this.showTimeout);
  1970. },
  1971. hide: function hide() {
  1972. var _this2 = this;
  1973. if (this.triggerElm.disabled) return;
  1974. this.removeTabindex();
  1975. if (this.tabindex >= 0) {
  1976. this.resetTabindex(this.triggerElm);
  1977. }
  1978. clearTimeout(this.timeout);
  1979. this.timeout = setTimeout(function () {
  1980. _this2.visible = false;
  1981. }, this.trigger === 'click' ? 0 : this.hideTimeout);
  1982. },
  1983. handleClick: function handleClick() {
  1984. if (this.triggerElm.disabled) return;
  1985. if (this.visible) {
  1986. this.hide();
  1987. } else {
  1988. this.show();
  1989. }
  1990. },
  1991. handleTriggerKeyDown: function handleTriggerKeyDown(ev) {
  1992. var keyCode = ev.keyCode;
  1993. if ([38, 40].indexOf(keyCode) > -1) {
  1994. // up/down
  1995. this.removeTabindex();
  1996. this.resetTabindex(this.menuItems[0]);
  1997. this.menuItems[0].focus();
  1998. ev.preventDefault();
  1999. ev.stopPropagation();
  2000. } else if (keyCode === 13) {
  2001. // space enter选中
  2002. this.handleClick();
  2003. } else if ([9, 27].indexOf(keyCode) > -1) {
  2004. // tab || esc
  2005. this.hide();
  2006. }
  2007. },
  2008. handleItemKeyDown: function handleItemKeyDown(ev) {
  2009. var keyCode = ev.keyCode;
  2010. var target = ev.target;
  2011. var currentIndex = this.menuItemsArray.indexOf(target);
  2012. var max = this.menuItemsArray.length - 1;
  2013. var nextIndex = void 0;
  2014. if ([38, 40].indexOf(keyCode) > -1) {
  2015. // up/down
  2016. if (keyCode === 38) {
  2017. // up
  2018. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  2019. } else {
  2020. // down
  2021. nextIndex = currentIndex < max ? currentIndex + 1 : max;
  2022. }
  2023. this.removeTabindex();
  2024. this.resetTabindex(this.menuItems[nextIndex]);
  2025. this.menuItems[nextIndex].focus();
  2026. ev.preventDefault();
  2027. ev.stopPropagation();
  2028. } else if (keyCode === 13) {
  2029. // enter选中
  2030. this.triggerElmFocus();
  2031. target.click();
  2032. if (this.hideOnClick) {
  2033. // click关闭
  2034. this.visible = false;
  2035. }
  2036. } else if ([9, 27].indexOf(keyCode) > -1) {
  2037. // tab // esc
  2038. this.hide();
  2039. this.triggerElmFocus();
  2040. }
  2041. },
  2042. resetTabindex: function resetTabindex(ele) {
  2043. // 下次tab时组件聚焦元素
  2044. this.removeTabindex();
  2045. ele.setAttribute('tabindex', '0'); // 下次期望的聚焦元素
  2046. },
  2047. removeTabindex: function removeTabindex() {
  2048. this.triggerElm.setAttribute('tabindex', '-1');
  2049. this.menuItemsArray.forEach(function (item) {
  2050. item.setAttribute('tabindex', '-1');
  2051. });
  2052. },
  2053. initAria: function initAria() {
  2054. this.dropdownElm.setAttribute('id', this.listId);
  2055. this.triggerElm.setAttribute('aria-haspopup', 'list');
  2056. this.triggerElm.setAttribute('aria-controls', this.listId);
  2057. if (!this.splitButton) {
  2058. // 自定义
  2059. this.triggerElm.setAttribute('role', 'button');
  2060. this.triggerElm.setAttribute('tabindex', this.tabindex);
  2061. this.triggerElm.setAttribute('class', (this.triggerElm.getAttribute('class') || '') + ' el-dropdown-selfdefine'); // 控制
  2062. }
  2063. },
  2064. initEvent: function initEvent() {
  2065. var _this3 = this;
  2066. var trigger = this.trigger,
  2067. show = this.show,
  2068. hide = this.hide,
  2069. handleClick = this.handleClick,
  2070. splitButton = this.splitButton,
  2071. handleTriggerKeyDown = this.handleTriggerKeyDown,
  2072. handleItemKeyDown = this.handleItemKeyDown;
  2073. this.triggerElm = splitButton ? this.$refs.trigger.$el : this.$slots.default[0].elm;
  2074. var dropdownElm = this.dropdownElm;
  2075. this.triggerElm.addEventListener('keydown', handleTriggerKeyDown); // triggerElm keydown
  2076. dropdownElm.addEventListener('keydown', handleItemKeyDown, true); // item keydown
  2077. // 控制自定义元素的样式
  2078. if (!splitButton) {
  2079. this.triggerElm.addEventListener('focus', function () {
  2080. _this3.focusing = true;
  2081. });
  2082. this.triggerElm.addEventListener('blur', function () {
  2083. _this3.focusing = false;
  2084. });
  2085. this.triggerElm.addEventListener('click', function () {
  2086. _this3.focusing = false;
  2087. });
  2088. }
  2089. if (trigger === 'hover') {
  2090. this.triggerElm.addEventListener('mouseenter', show);
  2091. this.triggerElm.addEventListener('mouseleave', hide);
  2092. dropdownElm.addEventListener('mouseenter', show);
  2093. dropdownElm.addEventListener('mouseleave', hide);
  2094. } else if (trigger === 'click') {
  2095. this.triggerElm.addEventListener('click', handleClick);
  2096. }
  2097. },
  2098. handleMenuItemClick: function handleMenuItemClick(command, instance) {
  2099. if (this.hideOnClick) {
  2100. this.visible = false;
  2101. }
  2102. this.$emit('command', command, instance);
  2103. },
  2104. triggerElmFocus: function triggerElmFocus() {
  2105. this.triggerElm.focus && this.triggerElm.focus();
  2106. },
  2107. initDomOperation: function initDomOperation() {
  2108. this.dropdownElm = this.popperElm;
  2109. this.menuItems = this.dropdownElm.querySelectorAll("[tabindex='-1']");
  2110. this.menuItemsArray = [].slice.call(this.menuItems);
  2111. this.initEvent();
  2112. this.initAria();
  2113. }
  2114. },
  2115. render: function render(h) {
  2116. var _this4 = this;
  2117. var hide = this.hide,
  2118. splitButton = this.splitButton,
  2119. type = this.type,
  2120. dropdownSize = this.dropdownSize;
  2121. var handleMainButtonClick = function handleMainButtonClick(event) {
  2122. _this4.$emit('click', event);
  2123. hide();
  2124. };
  2125. var triggerElm = !splitButton ? this.$slots.default : h('el-button-group', [h(
  2126. 'el-button',
  2127. {
  2128. attrs: { type: type, size: dropdownSize },
  2129. nativeOn: {
  2130. 'click': handleMainButtonClick
  2131. }
  2132. },
  2133. [this.$slots.default]
  2134. ), h(
  2135. 'el-button',
  2136. { ref: 'trigger', attrs: { type: type, size: dropdownSize },
  2137. 'class': 'el-dropdown__caret-button' },
  2138. [h('i', { 'class': 'el-dropdown__icon el-icon-arrow-down' })]
  2139. )]);
  2140. return h(
  2141. 'div',
  2142. { 'class': 'el-dropdown', directives: [{
  2143. name: 'clickoutside',
  2144. value: hide
  2145. }]
  2146. },
  2147. [triggerElm, this.$slots.dropdown]
  2148. );
  2149. }
  2150. });
  2151. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
  2152. /* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
  2153. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
  2154. var dropdown_render, dropdown_staticRenderFns
  2155. /* normalize component */
  2156. var dropdown_component = normalizeComponent(
  2157. src_dropdownvue_type_script_lang_js_,
  2158. dropdown_render,
  2159. dropdown_staticRenderFns,
  2160. false,
  2161. null,
  2162. null,
  2163. null
  2164. )
  2165. /* hot reload */
  2166. if (false) { var dropdown_api; }
  2167. dropdown_component.options.__file = "packages/dropdown/src/dropdown.vue"
  2168. /* harmony default export */ var dropdown = (dropdown_component.exports);
  2169. // CONCATENATED MODULE: ./packages/dropdown/index.js
  2170. /* istanbul ignore next */
  2171. dropdown.install = function (Vue) {
  2172. Vue.component(dropdown.name, dropdown);
  2173. };
  2174. /* harmony default export */ var packages_dropdown = (dropdown);
  2175. // 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&
  2176. var dropdown_menuvue_type_template_id_0da6b714_render = function() {
  2177. var _vm = this
  2178. var _h = _vm.$createElement
  2179. var _c = _vm._self._c || _h
  2180. return _c(
  2181. "transition",
  2182. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  2183. [
  2184. _c(
  2185. "ul",
  2186. {
  2187. directives: [
  2188. {
  2189. name: "show",
  2190. rawName: "v-show",
  2191. value: _vm.showPopper,
  2192. expression: "showPopper"
  2193. }
  2194. ],
  2195. staticClass: "el-dropdown-menu el-popper",
  2196. class: [_vm.size && "el-dropdown-menu--" + _vm.size]
  2197. },
  2198. [_vm._t("default")],
  2199. 2
  2200. )
  2201. ]
  2202. )
  2203. }
  2204. var dropdown_menuvue_type_template_id_0da6b714_staticRenderFns = []
  2205. dropdown_menuvue_type_template_id_0da6b714_render._withStripped = true
  2206. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
  2207. // 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&
  2208. //
  2209. //
  2210. //
  2211. //
  2212. //
  2213. //
  2214. //
  2215. /* harmony default export */ var dropdown_menuvue_type_script_lang_js_ = ({
  2216. name: 'ElDropdownMenu',
  2217. componentName: 'ElDropdownMenu',
  2218. mixins: [vue_popper_default.a],
  2219. props: {
  2220. visibleArrow: {
  2221. type: Boolean,
  2222. default: true
  2223. },
  2224. arrowOffset: {
  2225. type: Number,
  2226. default: 0
  2227. }
  2228. },
  2229. data: function data() {
  2230. return {
  2231. size: this.dropdown.dropdownSize
  2232. };
  2233. },
  2234. inject: ['dropdown'],
  2235. created: function created() {
  2236. var _this = this;
  2237. this.$on('updatePopper', function () {
  2238. if (_this.showPopper) _this.updatePopper();
  2239. });
  2240. this.$on('visible', function (val) {
  2241. _this.showPopper = val;
  2242. });
  2243. },
  2244. mounted: function mounted() {
  2245. this.dropdown.popperElm = this.popperElm = this.$el;
  2246. this.referenceElm = this.dropdown.$el;
  2247. // compatible with 2.6 new v-slot syntax
  2248. // issue link https://github.com/ElemeFE/element/issues/14345
  2249. this.dropdown.initDomOperation();
  2250. },
  2251. watch: {
  2252. 'dropdown.placement': {
  2253. immediate: true,
  2254. handler: function handler(val) {
  2255. this.currentPlacement = val;
  2256. }
  2257. }
  2258. }
  2259. });
  2260. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
  2261. /* harmony default export */ var src_dropdown_menuvue_type_script_lang_js_ = (dropdown_menuvue_type_script_lang_js_);
  2262. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue
  2263. /* normalize component */
  2264. var dropdown_menu_component = normalizeComponent(
  2265. src_dropdown_menuvue_type_script_lang_js_,
  2266. dropdown_menuvue_type_template_id_0da6b714_render,
  2267. dropdown_menuvue_type_template_id_0da6b714_staticRenderFns,
  2268. false,
  2269. null,
  2270. null,
  2271. null
  2272. )
  2273. /* hot reload */
  2274. if (false) { var dropdown_menu_api; }
  2275. dropdown_menu_component.options.__file = "packages/dropdown/src/dropdown-menu.vue"
  2276. /* harmony default export */ var dropdown_menu = (dropdown_menu_component.exports);
  2277. // CONCATENATED MODULE: ./packages/dropdown-menu/index.js
  2278. /* istanbul ignore next */
  2279. dropdown_menu.install = function (Vue) {
  2280. Vue.component(dropdown_menu.name, dropdown_menu);
  2281. };
  2282. /* harmony default export */ var packages_dropdown_menu = (dropdown_menu);
  2283. // 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&
  2284. var dropdown_itemvue_type_template_id_6359102a_render = function() {
  2285. var _vm = this
  2286. var _h = _vm.$createElement
  2287. var _c = _vm._self._c || _h
  2288. return _c(
  2289. "li",
  2290. {
  2291. staticClass: "el-dropdown-menu__item",
  2292. class: {
  2293. "is-disabled": _vm.disabled,
  2294. "el-dropdown-menu__item--divided": _vm.divided
  2295. },
  2296. attrs: {
  2297. "aria-disabled": _vm.disabled,
  2298. tabindex: _vm.disabled ? null : -1
  2299. },
  2300. on: { click: _vm.handleClick }
  2301. },
  2302. [_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(), _vm._t("default")],
  2303. 2
  2304. )
  2305. }
  2306. var dropdown_itemvue_type_template_id_6359102a_staticRenderFns = []
  2307. dropdown_itemvue_type_template_id_6359102a_render._withStripped = true
  2308. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
  2309. // 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&
  2310. //
  2311. //
  2312. //
  2313. //
  2314. //
  2315. //
  2316. //
  2317. //
  2318. //
  2319. //
  2320. //
  2321. //
  2322. //
  2323. //
  2324. //
  2325. /* harmony default export */ var dropdown_itemvue_type_script_lang_js_ = ({
  2326. name: 'ElDropdownItem',
  2327. mixins: [emitter_default.a],
  2328. props: {
  2329. command: {},
  2330. disabled: Boolean,
  2331. divided: Boolean,
  2332. icon: String
  2333. },
  2334. methods: {
  2335. handleClick: function handleClick(e) {
  2336. this.dispatch('ElDropdown', 'menu-item-click', [this.command, this]);
  2337. }
  2338. }
  2339. });
  2340. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
  2341. /* harmony default export */ var src_dropdown_itemvue_type_script_lang_js_ = (dropdown_itemvue_type_script_lang_js_);
  2342. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue
  2343. /* normalize component */
  2344. var dropdown_item_component = normalizeComponent(
  2345. src_dropdown_itemvue_type_script_lang_js_,
  2346. dropdown_itemvue_type_template_id_6359102a_render,
  2347. dropdown_itemvue_type_template_id_6359102a_staticRenderFns,
  2348. false,
  2349. null,
  2350. null,
  2351. null
  2352. )
  2353. /* hot reload */
  2354. if (false) { var dropdown_item_api; }
  2355. dropdown_item_component.options.__file = "packages/dropdown/src/dropdown-item.vue"
  2356. /* harmony default export */ var dropdown_item = (dropdown_item_component.exports);
  2357. // CONCATENATED MODULE: ./packages/dropdown-item/index.js
  2358. /* istanbul ignore next */
  2359. dropdown_item.install = function (Vue) {
  2360. Vue.component(dropdown_item.name, dropdown_item);
  2361. };
  2362. /* harmony default export */ var packages_dropdown_item = (dropdown_item);
  2363. // CONCATENATED MODULE: ./src/utils/aria-utils.js
  2364. var aria = aria || {};
  2365. aria.Utils = aria.Utils || {};
  2366. /**
  2367. * @desc Set focus on descendant nodes until the first focusable element is
  2368. * found.
  2369. * @param element
  2370. * DOM node for which to find the first focusable descendant.
  2371. * @returns
  2372. * true if a focusable element is found and focus is set.
  2373. */
  2374. aria.Utils.focusFirstDescendant = function (element) {
  2375. for (var i = 0; i < element.childNodes.length; i++) {
  2376. var child = element.childNodes[i];
  2377. if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
  2378. return true;
  2379. }
  2380. }
  2381. return false;
  2382. };
  2383. /**
  2384. * @desc Find the last descendant node that is focusable.
  2385. * @param element
  2386. * DOM node for which to find the last focusable descendant.
  2387. * @returns
  2388. * true if a focusable element is found and focus is set.
  2389. */
  2390. aria.Utils.focusLastDescendant = function (element) {
  2391. for (var i = element.childNodes.length - 1; i >= 0; i--) {
  2392. var child = element.childNodes[i];
  2393. if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
  2394. return true;
  2395. }
  2396. }
  2397. return false;
  2398. };
  2399. /**
  2400. * @desc Set Attempt to set focus on the current node.
  2401. * @param element
  2402. * The node to attempt to focus on.
  2403. * @returns
  2404. * true if element is focused.
  2405. */
  2406. aria.Utils.attemptFocus = function (element) {
  2407. if (!aria.Utils.isFocusable(element)) {
  2408. return false;
  2409. }
  2410. aria.Utils.IgnoreUtilFocusChanges = true;
  2411. try {
  2412. element.focus();
  2413. } catch (e) {}
  2414. aria.Utils.IgnoreUtilFocusChanges = false;
  2415. return document.activeElement === element;
  2416. };
  2417. aria.Utils.isFocusable = function (element) {
  2418. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
  2419. return true;
  2420. }
  2421. if (element.disabled) {
  2422. return false;
  2423. }
  2424. switch (element.nodeName) {
  2425. case 'A':
  2426. return !!element.href && element.rel !== 'ignore';
  2427. case 'INPUT':
  2428. return element.type !== 'hidden' && element.type !== 'file';
  2429. case 'BUTTON':
  2430. case 'SELECT':
  2431. case 'TEXTAREA':
  2432. return true;
  2433. default:
  2434. return false;
  2435. }
  2436. };
  2437. /**
  2438. * 触发一个事件
  2439. * mouseenter, mouseleave, mouseover, keyup, change, click 等
  2440. * @param {Element} elm
  2441. * @param {String} name
  2442. * @param {*} opts
  2443. */
  2444. aria.Utils.triggerEvent = function (elm, name) {
  2445. var eventName = void 0;
  2446. if (/^mouse|click/.test(name)) {
  2447. eventName = 'MouseEvents';
  2448. } else if (/^key/.test(name)) {
  2449. eventName = 'KeyboardEvent';
  2450. } else {
  2451. eventName = 'HTMLEvents';
  2452. }
  2453. var evt = document.createEvent(eventName);
  2454. for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  2455. opts[_key - 2] = arguments[_key];
  2456. }
  2457. evt.initEvent.apply(evt, [name].concat(opts));
  2458. elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
  2459. return elm;
  2460. };
  2461. aria.Utils.keys = {
  2462. tab: 9,
  2463. enter: 13,
  2464. space: 32,
  2465. left: 37,
  2466. up: 38,
  2467. right: 39,
  2468. down: 40
  2469. };
  2470. /* harmony default export */ var aria_utils = (aria.Utils);
  2471. // CONCATENATED MODULE: ./src/utils/menu/aria-submenu.js
  2472. var SubMenu = function SubMenu(parent, domNode) {
  2473. this.domNode = domNode;
  2474. this.parent = parent;
  2475. this.subMenuItems = [];
  2476. this.subIndex = 0;
  2477. this.init();
  2478. };
  2479. SubMenu.prototype.init = function () {
  2480. this.subMenuItems = this.domNode.querySelectorAll('li');
  2481. this.addListeners();
  2482. };
  2483. SubMenu.prototype.gotoSubIndex = function (idx) {
  2484. if (idx === this.subMenuItems.length) {
  2485. idx = 0;
  2486. } else if (idx < 0) {
  2487. idx = this.subMenuItems.length - 1;
  2488. }
  2489. this.subMenuItems[idx].focus();
  2490. this.subIndex = idx;
  2491. };
  2492. SubMenu.prototype.addListeners = function () {
  2493. var _this = this;
  2494. var keys = aria_utils.keys;
  2495. var parentNode = this.parent.domNode;
  2496. Array.prototype.forEach.call(this.subMenuItems, function (el) {
  2497. el.addEventListener('keydown', function (event) {
  2498. var prevDef = false;
  2499. switch (event.keyCode) {
  2500. case keys.down:
  2501. _this.gotoSubIndex(_this.subIndex + 1);
  2502. prevDef = true;
  2503. break;
  2504. case keys.up:
  2505. _this.gotoSubIndex(_this.subIndex - 1);
  2506. prevDef = true;
  2507. break;
  2508. case keys.tab:
  2509. aria_utils.triggerEvent(parentNode, 'mouseleave');
  2510. break;
  2511. case keys.enter:
  2512. case keys.space:
  2513. prevDef = true;
  2514. event.currentTarget.click();
  2515. break;
  2516. }
  2517. if (prevDef) {
  2518. event.preventDefault();
  2519. event.stopPropagation();
  2520. }
  2521. return false;
  2522. });
  2523. });
  2524. };
  2525. /* harmony default export */ var aria_submenu = (SubMenu);
  2526. // CONCATENATED MODULE: ./src/utils/menu/aria-menuitem.js
  2527. var MenuItem = function MenuItem(domNode) {
  2528. this.domNode = domNode;
  2529. this.submenu = null;
  2530. this.init();
  2531. };
  2532. MenuItem.prototype.init = function () {
  2533. this.domNode.setAttribute('tabindex', '0');
  2534. var menuChild = this.domNode.querySelector('.el-menu');
  2535. if (menuChild) {
  2536. this.submenu = new aria_submenu(this, menuChild);
  2537. }
  2538. this.addListeners();
  2539. };
  2540. MenuItem.prototype.addListeners = function () {
  2541. var _this = this;
  2542. var keys = aria_utils.keys;
  2543. this.domNode.addEventListener('keydown', function (event) {
  2544. var prevDef = false;
  2545. switch (event.keyCode) {
  2546. case keys.down:
  2547. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2548. _this.submenu && _this.submenu.gotoSubIndex(0);
  2549. prevDef = true;
  2550. break;
  2551. case keys.up:
  2552. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2553. _this.submenu && _this.submenu.gotoSubIndex(_this.submenu.subMenuItems.length - 1);
  2554. prevDef = true;
  2555. break;
  2556. case keys.tab:
  2557. aria_utils.triggerEvent(event.currentTarget, 'mouseleave');
  2558. break;
  2559. case keys.enter:
  2560. case keys.space:
  2561. prevDef = true;
  2562. event.currentTarget.click();
  2563. break;
  2564. }
  2565. if (prevDef) {
  2566. event.preventDefault();
  2567. }
  2568. });
  2569. };
  2570. /* harmony default export */ var aria_menuitem = (MenuItem);
  2571. // CONCATENATED MODULE: ./src/utils/menu/aria-menubar.js
  2572. var Menu = function Menu(domNode) {
  2573. this.domNode = domNode;
  2574. this.init();
  2575. };
  2576. Menu.prototype.init = function () {
  2577. var menuChildren = this.domNode.childNodes;
  2578. [].filter.call(menuChildren, function (child) {
  2579. return child.nodeType === 1;
  2580. }).forEach(function (child) {
  2581. new aria_menuitem(child); // eslint-disable-line
  2582. });
  2583. };
  2584. /* harmony default export */ var aria_menubar = (Menu);
  2585. // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
  2586. var dom_ = __webpack_require__(1);
  2587. // 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&
  2588. /* harmony default export */ var menuvue_type_script_lang_js_ = ({
  2589. name: 'ElMenu',
  2590. render: function render(h) {
  2591. var component = h(
  2592. 'ul',
  2593. {
  2594. attrs: {
  2595. role: 'menubar'
  2596. },
  2597. key: +this.collapse,
  2598. style: { backgroundColor: this.backgroundColor || '' },
  2599. 'class': {
  2600. 'el-menu--horizontal': this.mode === 'horizontal',
  2601. 'el-menu--collapse': this.collapse,
  2602. "el-menu": true
  2603. }
  2604. },
  2605. [this.$slots.default]
  2606. );
  2607. if (this.collapseTransition) {
  2608. return h('el-menu-collapse-transition', [component]);
  2609. } else {
  2610. return component;
  2611. }
  2612. },
  2613. componentName: 'ElMenu',
  2614. mixins: [emitter_default.a, migrating_default.a],
  2615. provide: function provide() {
  2616. return {
  2617. rootMenu: this
  2618. };
  2619. },
  2620. components: {
  2621. 'el-menu-collapse-transition': {
  2622. functional: true,
  2623. render: function render(createElement, context) {
  2624. var data = {
  2625. props: {
  2626. mode: 'out-in'
  2627. },
  2628. on: {
  2629. beforeEnter: function beforeEnter(el) {
  2630. el.style.opacity = 0.2;
  2631. },
  2632. enter: function enter(el) {
  2633. Object(dom_["addClass"])(el, 'el-opacity-transition');
  2634. el.style.opacity = 1;
  2635. },
  2636. afterEnter: function afterEnter(el) {
  2637. Object(dom_["removeClass"])(el, 'el-opacity-transition');
  2638. el.style.opacity = '';
  2639. },
  2640. beforeLeave: function beforeLeave(el) {
  2641. if (!el.dataset) el.dataset = {};
  2642. if (Object(dom_["hasClass"])(el, 'el-menu--collapse')) {
  2643. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2644. el.dataset.oldOverflow = el.style.overflow;
  2645. el.dataset.scrollWidth = el.clientWidth;
  2646. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2647. } else {
  2648. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2649. el.dataset.oldOverflow = el.style.overflow;
  2650. el.dataset.scrollWidth = el.clientWidth;
  2651. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2652. }
  2653. el.style.width = el.scrollWidth + 'px';
  2654. el.style.overflow = 'hidden';
  2655. },
  2656. leave: function leave(el) {
  2657. Object(dom_["addClass"])(el, 'horizontal-collapse-transition');
  2658. el.style.width = el.dataset.scrollWidth + 'px';
  2659. }
  2660. }
  2661. };
  2662. return createElement('transition', data, context.children);
  2663. }
  2664. }
  2665. },
  2666. props: {
  2667. mode: {
  2668. type: String,
  2669. default: 'vertical'
  2670. },
  2671. defaultActive: {
  2672. type: String,
  2673. default: ''
  2674. },
  2675. defaultOpeneds: Array,
  2676. uniqueOpened: Boolean,
  2677. router: Boolean,
  2678. menuTrigger: {
  2679. type: String,
  2680. default: 'hover'
  2681. },
  2682. collapse: Boolean,
  2683. backgroundColor: String,
  2684. textColor: String,
  2685. activeTextColor: String,
  2686. collapseTransition: {
  2687. type: Boolean,
  2688. default: true
  2689. }
  2690. },
  2691. data: function data() {
  2692. return {
  2693. activeIndex: this.defaultActive,
  2694. openedMenus: this.defaultOpeneds && !this.collapse ? this.defaultOpeneds.slice(0) : [],
  2695. items: {},
  2696. submenus: {}
  2697. };
  2698. },
  2699. computed: {
  2700. hoverBackground: function hoverBackground() {
  2701. return this.backgroundColor ? this.mixColor(this.backgroundColor, 0.2) : '';
  2702. },
  2703. isMenuPopup: function isMenuPopup() {
  2704. return this.mode === 'horizontal' || this.mode === 'vertical' && this.collapse;
  2705. }
  2706. },
  2707. watch: {
  2708. defaultActive: function defaultActive(value) {
  2709. if (!this.items[value]) {
  2710. this.activeIndex = null;
  2711. }
  2712. this.updateActiveIndex(value);
  2713. },
  2714. defaultOpeneds: function defaultOpeneds(value) {
  2715. if (!this.collapse) {
  2716. this.openedMenus = value;
  2717. }
  2718. },
  2719. collapse: function collapse(value) {
  2720. if (value) this.openedMenus = [];
  2721. this.broadcast('ElSubmenu', 'toggle-collapse', value);
  2722. }
  2723. },
  2724. methods: {
  2725. updateActiveIndex: function updateActiveIndex(val) {
  2726. var item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];
  2727. if (item) {
  2728. this.activeIndex = item.index;
  2729. this.initOpenedMenu();
  2730. } else {
  2731. this.activeIndex = null;
  2732. }
  2733. },
  2734. getMigratingConfig: function getMigratingConfig() {
  2735. return {
  2736. props: {
  2737. 'theme': 'theme is removed.'
  2738. }
  2739. };
  2740. },
  2741. getColorChannels: function getColorChannels(color) {
  2742. color = color.replace('#', '');
  2743. if (/^[0-9a-fA-F]{3}$/.test(color)) {
  2744. color = color.split('');
  2745. for (var i = 2; i >= 0; i--) {
  2746. color.splice(i, 0, color[i]);
  2747. }
  2748. color = color.join('');
  2749. }
  2750. if (/^[0-9a-fA-F]{6}$/.test(color)) {
  2751. return {
  2752. red: parseInt(color.slice(0, 2), 16),
  2753. green: parseInt(color.slice(2, 4), 16),
  2754. blue: parseInt(color.slice(4, 6), 16)
  2755. };
  2756. } else {
  2757. return {
  2758. red: 255,
  2759. green: 255,
  2760. blue: 255
  2761. };
  2762. }
  2763. },
  2764. mixColor: function mixColor(color, percent) {
  2765. var _getColorChannels = this.getColorChannels(color),
  2766. red = _getColorChannels.red,
  2767. green = _getColorChannels.green,
  2768. blue = _getColorChannels.blue;
  2769. if (percent > 0) {
  2770. // shade given color
  2771. red *= 1 - percent;
  2772. green *= 1 - percent;
  2773. blue *= 1 - percent;
  2774. } else {
  2775. // tint given color
  2776. red += (255 - red) * percent;
  2777. green += (255 - green) * percent;
  2778. blue += (255 - blue) * percent;
  2779. }
  2780. return 'rgb(' + Math.round(red) + ', ' + Math.round(green) + ', ' + Math.round(blue) + ')';
  2781. },
  2782. addItem: function addItem(item) {
  2783. this.$set(this.items, item.index, item);
  2784. },
  2785. removeItem: function removeItem(item) {
  2786. delete this.items[item.index];
  2787. },
  2788. addSubmenu: function addSubmenu(item) {
  2789. this.$set(this.submenus, item.index, item);
  2790. },
  2791. removeSubmenu: function removeSubmenu(item) {
  2792. delete this.submenus[item.index];
  2793. },
  2794. openMenu: function openMenu(index, indexPath) {
  2795. var openedMenus = this.openedMenus;
  2796. if (openedMenus.indexOf(index) !== -1) return;
  2797. // 将不在该菜单路径下的其余菜单收起
  2798. // collapse all menu that are not under current menu item
  2799. if (this.uniqueOpened) {
  2800. this.openedMenus = openedMenus.filter(function (index) {
  2801. return indexPath.indexOf(index) !== -1;
  2802. });
  2803. }
  2804. this.openedMenus.push(index);
  2805. },
  2806. closeMenu: function closeMenu(index) {
  2807. var i = this.openedMenus.indexOf(index);
  2808. if (i !== -1) {
  2809. this.openedMenus.splice(i, 1);
  2810. }
  2811. },
  2812. handleSubmenuClick: function handleSubmenuClick(submenu) {
  2813. var index = submenu.index,
  2814. indexPath = submenu.indexPath;
  2815. var isOpened = this.openedMenus.indexOf(index) !== -1;
  2816. if (isOpened) {
  2817. this.closeMenu(index);
  2818. this.$emit('close', index, indexPath);
  2819. } else {
  2820. this.openMenu(index, indexPath);
  2821. this.$emit('open', index, indexPath);
  2822. }
  2823. },
  2824. handleItemClick: function handleItemClick(item) {
  2825. var _this = this;
  2826. var index = item.index,
  2827. indexPath = item.indexPath;
  2828. var oldActiveIndex = this.activeIndex;
  2829. var hasIndex = item.index !== null;
  2830. if (hasIndex) {
  2831. this.activeIndex = item.index;
  2832. }
  2833. this.$emit('select', index, indexPath, item);
  2834. if (this.mode === 'horizontal' || this.collapse) {
  2835. this.openedMenus = [];
  2836. }
  2837. if (this.router && hasIndex) {
  2838. this.routeToItem(item, function (error) {
  2839. _this.activeIndex = oldActiveIndex;
  2840. if (error) console.error(error);
  2841. });
  2842. }
  2843. },
  2844. // 初始化展开菜单
  2845. // initialize opened menu
  2846. initOpenedMenu: function initOpenedMenu() {
  2847. var _this2 = this;
  2848. var index = this.activeIndex;
  2849. var activeItem = this.items[index];
  2850. if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
  2851. var indexPath = activeItem.indexPath;
  2852. // 展开该菜单项的路径上所有子菜单
  2853. // expand all submenus of the menu item
  2854. indexPath.forEach(function (index) {
  2855. var submenu = _this2.submenus[index];
  2856. submenu && _this2.openMenu(index, submenu.indexPath);
  2857. });
  2858. },
  2859. routeToItem: function routeToItem(item, onError) {
  2860. var route = item.route || item.index;
  2861. try {
  2862. this.$router.push(route, function () {}, onError);
  2863. } catch (e) {
  2864. console.error(e);
  2865. }
  2866. },
  2867. open: function open(index) {
  2868. var _this3 = this;
  2869. var indexPath = this.submenus[index.toString()].indexPath;
  2870. indexPath.forEach(function (i) {
  2871. return _this3.openMenu(i, indexPath);
  2872. });
  2873. },
  2874. close: function close(index) {
  2875. this.closeMenu(index);
  2876. }
  2877. },
  2878. mounted: function mounted() {
  2879. this.initOpenedMenu();
  2880. this.$on('item-click', this.handleItemClick);
  2881. this.$on('submenu-click', this.handleSubmenuClick);
  2882. if (this.mode === 'horizontal') {
  2883. new aria_menubar(this.$el); // eslint-disable-line
  2884. }
  2885. this.$watch('items', this.updateActiveIndex);
  2886. }
  2887. });
  2888. // CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=script&lang=js&
  2889. /* harmony default export */ var src_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_);
  2890. // CONCATENATED MODULE: ./packages/menu/src/menu.vue
  2891. var menu_render, menu_staticRenderFns
  2892. /* normalize component */
  2893. var menu_component = normalizeComponent(
  2894. src_menuvue_type_script_lang_js_,
  2895. menu_render,
  2896. menu_staticRenderFns,
  2897. false,
  2898. null,
  2899. null,
  2900. null
  2901. )
  2902. /* hot reload */
  2903. if (false) { var menu_api; }
  2904. menu_component.options.__file = "packages/menu/src/menu.vue"
  2905. /* harmony default export */ var src_menu = (menu_component.exports);
  2906. // CONCATENATED MODULE: ./packages/menu/index.js
  2907. /* istanbul ignore next */
  2908. src_menu.install = function (Vue) {
  2909. Vue.component(src_menu.name, src_menu);
  2910. };
  2911. /* harmony default export */ var packages_menu = (src_menu);
  2912. // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
  2913. var collapse_transition_ = __webpack_require__(18);
  2914. var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
  2915. // CONCATENATED MODULE: ./packages/menu/src/menu-mixin.js
  2916. /* harmony default export */ var menu_mixin = ({
  2917. inject: ['rootMenu'],
  2918. computed: {
  2919. indexPath: function indexPath() {
  2920. var path = [this.index];
  2921. var parent = this.$parent;
  2922. while (parent.$options.componentName !== 'ElMenu') {
  2923. if (parent.index) {
  2924. path.unshift(parent.index);
  2925. }
  2926. parent = parent.$parent;
  2927. }
  2928. return path;
  2929. },
  2930. parentMenu: function parentMenu() {
  2931. var parent = this.$parent;
  2932. while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
  2933. parent = parent.$parent;
  2934. }
  2935. return parent;
  2936. },
  2937. paddingStyle: function paddingStyle() {
  2938. if (this.rootMenu.mode !== 'vertical') return {};
  2939. var padding = 20;
  2940. var parent = this.$parent;
  2941. if (this.rootMenu.collapse) {
  2942. padding = 20;
  2943. } else {
  2944. while (parent && parent.$options.componentName !== 'ElMenu') {
  2945. if (parent.$options.componentName === 'ElSubmenu') {
  2946. padding += 20;
  2947. }
  2948. parent = parent.$parent;
  2949. }
  2950. }
  2951. return { paddingLeft: padding + 'px' };
  2952. }
  2953. }
  2954. });
  2955. // 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&
  2956. var poperMixins = {
  2957. props: {
  2958. transformOrigin: {
  2959. type: [Boolean, String],
  2960. default: false
  2961. },
  2962. offset: vue_popper_default.a.props.offset,
  2963. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  2964. popperOptions: vue_popper_default.a.props.popperOptions
  2965. },
  2966. data: vue_popper_default.a.data,
  2967. methods: vue_popper_default.a.methods,
  2968. beforeDestroy: vue_popper_default.a.beforeDestroy,
  2969. deactivated: vue_popper_default.a.deactivated
  2970. };
  2971. /* harmony default export */ var submenuvue_type_script_lang_js_ = ({
  2972. name: 'ElSubmenu',
  2973. componentName: 'ElSubmenu',
  2974. mixins: [menu_mixin, emitter_default.a, poperMixins],
  2975. components: { ElCollapseTransition: collapse_transition_default.a },
  2976. props: {
  2977. index: {
  2978. type: String,
  2979. required: true
  2980. },
  2981. showTimeout: {
  2982. type: Number,
  2983. default: 300
  2984. },
  2985. hideTimeout: {
  2986. type: Number,
  2987. default: 300
  2988. },
  2989. popperClass: String,
  2990. disabled: Boolean,
  2991. popperAppendToBody: {
  2992. type: Boolean,
  2993. default: undefined
  2994. }
  2995. },
  2996. data: function data() {
  2997. return {
  2998. popperJS: null,
  2999. timeout: null,
  3000. items: {},
  3001. submenus: {},
  3002. mouseInChild: false
  3003. };
  3004. },
  3005. watch: {
  3006. opened: function opened(val) {
  3007. var _this = this;
  3008. if (this.isMenuPopup) {
  3009. this.$nextTick(function (_) {
  3010. _this.updatePopper();
  3011. });
  3012. }
  3013. }
  3014. },
  3015. computed: {
  3016. // popper option
  3017. appendToBody: function appendToBody() {
  3018. return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
  3019. },
  3020. menuTransitionName: function menuTransitionName() {
  3021. return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
  3022. },
  3023. opened: function opened() {
  3024. return this.rootMenu.openedMenus.indexOf(this.index) > -1;
  3025. },
  3026. active: function active() {
  3027. var isActive = false;
  3028. var submenus = this.submenus;
  3029. var items = this.items;
  3030. Object.keys(items).forEach(function (index) {
  3031. if (items[index].active) {
  3032. isActive = true;
  3033. }
  3034. });
  3035. Object.keys(submenus).forEach(function (index) {
  3036. if (submenus[index].active) {
  3037. isActive = true;
  3038. }
  3039. });
  3040. return isActive;
  3041. },
  3042. hoverBackground: function hoverBackground() {
  3043. return this.rootMenu.hoverBackground;
  3044. },
  3045. backgroundColor: function backgroundColor() {
  3046. return this.rootMenu.backgroundColor || '';
  3047. },
  3048. activeTextColor: function activeTextColor() {
  3049. return this.rootMenu.activeTextColor || '';
  3050. },
  3051. textColor: function textColor() {
  3052. return this.rootMenu.textColor || '';
  3053. },
  3054. mode: function mode() {
  3055. return this.rootMenu.mode;
  3056. },
  3057. isMenuPopup: function isMenuPopup() {
  3058. return this.rootMenu.isMenuPopup;
  3059. },
  3060. titleStyle: function titleStyle() {
  3061. if (this.mode !== 'horizontal') {
  3062. return {
  3063. color: this.textColor
  3064. };
  3065. }
  3066. return {
  3067. borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
  3068. color: this.active ? this.activeTextColor : this.textColor
  3069. };
  3070. },
  3071. isFirstLevel: function isFirstLevel() {
  3072. var isFirstLevel = true;
  3073. var parent = this.$parent;
  3074. while (parent && parent !== this.rootMenu) {
  3075. if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
  3076. isFirstLevel = false;
  3077. break;
  3078. } else {
  3079. parent = parent.$parent;
  3080. }
  3081. }
  3082. return isFirstLevel;
  3083. }
  3084. },
  3085. methods: {
  3086. handleCollapseToggle: function handleCollapseToggle(value) {
  3087. if (value) {
  3088. this.initPopper();
  3089. } else {
  3090. this.doDestroy();
  3091. }
  3092. },
  3093. addItem: function addItem(item) {
  3094. this.$set(this.items, item.index, item);
  3095. },
  3096. removeItem: function removeItem(item) {
  3097. delete this.items[item.index];
  3098. },
  3099. addSubmenu: function addSubmenu(item) {
  3100. this.$set(this.submenus, item.index, item);
  3101. },
  3102. removeSubmenu: function removeSubmenu(item) {
  3103. delete this.submenus[item.index];
  3104. },
  3105. handleClick: function handleClick() {
  3106. var rootMenu = this.rootMenu,
  3107. disabled = this.disabled;
  3108. if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3109. return;
  3110. }
  3111. this.dispatch('ElMenu', 'submenu-click', this);
  3112. },
  3113. handleMouseenter: function handleMouseenter(event) {
  3114. var _this2 = this;
  3115. var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
  3116. if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
  3117. return;
  3118. }
  3119. var rootMenu = this.rootMenu,
  3120. disabled = this.disabled;
  3121. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3122. return;
  3123. }
  3124. this.dispatch('ElSubmenu', 'mouse-enter-child');
  3125. clearTimeout(this.timeout);
  3126. this.timeout = setTimeout(function () {
  3127. _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
  3128. }, showTimeout);
  3129. },
  3130. handleMouseleave: function handleMouseleave() {
  3131. var _this3 = this;
  3132. var rootMenu = this.rootMenu;
  3133. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
  3134. return;
  3135. }
  3136. this.dispatch('ElSubmenu', 'mouse-leave-child');
  3137. clearTimeout(this.timeout);
  3138. this.timeout = setTimeout(function () {
  3139. !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
  3140. }, this.hideTimeout);
  3141. },
  3142. handleTitleMouseenter: function handleTitleMouseenter() {
  3143. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3144. var title = this.$refs['submenu-title'];
  3145. title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
  3146. },
  3147. handleTitleMouseleave: function handleTitleMouseleave() {
  3148. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3149. var title = this.$refs['submenu-title'];
  3150. title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
  3151. },
  3152. updatePlacement: function updatePlacement() {
  3153. this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
  3154. },
  3155. initPopper: function initPopper() {
  3156. this.referenceElm = this.$el;
  3157. this.popperElm = this.$refs.menu;
  3158. this.updatePlacement();
  3159. }
  3160. },
  3161. created: function created() {
  3162. var _this4 = this;
  3163. this.$on('toggle-collapse', this.handleCollapseToggle);
  3164. this.$on('mouse-enter-child', function () {
  3165. _this4.mouseInChild = true;
  3166. clearTimeout(_this4.timeout);
  3167. });
  3168. this.$on('mouse-leave-child', function () {
  3169. _this4.mouseInChild = false;
  3170. clearTimeout(_this4.timeout);
  3171. });
  3172. },
  3173. mounted: function mounted() {
  3174. this.parentMenu.addSubmenu(this);
  3175. this.rootMenu.addSubmenu(this);
  3176. this.initPopper();
  3177. },
  3178. beforeDestroy: function beforeDestroy() {
  3179. this.parentMenu.removeSubmenu(this);
  3180. this.rootMenu.removeSubmenu(this);
  3181. },
  3182. render: function render(h) {
  3183. var _this5 = this;
  3184. var active = this.active,
  3185. opened = this.opened,
  3186. paddingStyle = this.paddingStyle,
  3187. titleStyle = this.titleStyle,
  3188. backgroundColor = this.backgroundColor,
  3189. rootMenu = this.rootMenu,
  3190. currentPlacement = this.currentPlacement,
  3191. menuTransitionName = this.menuTransitionName,
  3192. mode = this.mode,
  3193. disabled = this.disabled,
  3194. popperClass = this.popperClass,
  3195. $slots = this.$slots,
  3196. isFirstLevel = this.isFirstLevel;
  3197. var popupMenu = h(
  3198. 'transition',
  3199. {
  3200. attrs: { name: menuTransitionName }
  3201. },
  3202. [h(
  3203. 'div',
  3204. {
  3205. ref: 'menu',
  3206. directives: [{
  3207. name: 'show',
  3208. value: opened
  3209. }],
  3210. 'class': ['el-menu--' + mode, popperClass],
  3211. on: {
  3212. 'mouseenter': function mouseenter($event) {
  3213. return _this5.handleMouseenter($event, 100);
  3214. },
  3215. 'mouseleave': this.handleMouseleave,
  3216. 'focus': function focus($event) {
  3217. return _this5.handleMouseenter($event, 100);
  3218. }
  3219. }
  3220. },
  3221. [h(
  3222. 'ul',
  3223. {
  3224. attrs: {
  3225. role: 'menu'
  3226. },
  3227. 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
  3228. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3229. [$slots.default]
  3230. )]
  3231. )]
  3232. );
  3233. var inlineMenu = h('el-collapse-transition', [h(
  3234. 'ul',
  3235. {
  3236. attrs: {
  3237. role: 'menu'
  3238. },
  3239. 'class': 'el-menu el-menu--inline',
  3240. directives: [{
  3241. name: 'show',
  3242. value: opened
  3243. }],
  3244. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3245. [$slots.default]
  3246. )]);
  3247. var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
  3248. return h(
  3249. 'li',
  3250. {
  3251. 'class': {
  3252. 'el-submenu': true,
  3253. 'is-active': active,
  3254. 'is-opened': opened,
  3255. 'is-disabled': disabled
  3256. },
  3257. attrs: { role: 'menuitem',
  3258. 'aria-haspopup': 'true',
  3259. 'aria-expanded': opened
  3260. },
  3261. on: {
  3262. 'mouseenter': this.handleMouseenter,
  3263. 'mouseleave': this.handleMouseleave,
  3264. 'focus': this.handleMouseenter
  3265. }
  3266. },
  3267. [h(
  3268. 'div',
  3269. {
  3270. 'class': 'el-submenu__title',
  3271. ref: 'submenu-title',
  3272. on: {
  3273. 'click': this.handleClick,
  3274. 'mouseenter': this.handleTitleMouseenter,
  3275. 'mouseleave': this.handleTitleMouseleave
  3276. },
  3277. style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
  3278. },
  3279. [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
  3280. ), this.isMenuPopup ? popupMenu : inlineMenu]
  3281. );
  3282. }
  3283. });
  3284. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  3285. /* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
  3286. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
  3287. var submenu_render, submenu_staticRenderFns
  3288. /* normalize component */
  3289. var submenu_component = normalizeComponent(
  3290. src_submenuvue_type_script_lang_js_,
  3291. submenu_render,
  3292. submenu_staticRenderFns,
  3293. false,
  3294. null,
  3295. null,
  3296. null
  3297. )
  3298. /* hot reload */
  3299. if (false) { var submenu_api; }
  3300. submenu_component.options.__file = "packages/menu/src/submenu.vue"
  3301. /* harmony default export */ var submenu = (submenu_component.exports);
  3302. // CONCATENATED MODULE: ./packages/submenu/index.js
  3303. /* istanbul ignore next */
  3304. submenu.install = function (Vue) {
  3305. Vue.component(submenu.name, submenu);
  3306. };
  3307. /* harmony default export */ var packages_submenu = (submenu);
  3308. // 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&
  3309. var menu_itemvue_type_template_id_2a5dbfea_render = function() {
  3310. var _vm = this
  3311. var _h = _vm.$createElement
  3312. var _c = _vm._self._c || _h
  3313. return _c(
  3314. "li",
  3315. {
  3316. staticClass: "el-menu-item",
  3317. class: {
  3318. "is-active": _vm.active,
  3319. "is-disabled": _vm.disabled
  3320. },
  3321. style: [
  3322. _vm.paddingStyle,
  3323. _vm.itemStyle,
  3324. { backgroundColor: _vm.backgroundColor }
  3325. ],
  3326. attrs: { role: "menuitem", tabindex: "-1" },
  3327. on: {
  3328. click: _vm.handleClick,
  3329. mouseenter: _vm.onMouseEnter,
  3330. focus: _vm.onMouseEnter,
  3331. blur: _vm.onMouseLeave,
  3332. mouseleave: _vm.onMouseLeave
  3333. }
  3334. },
  3335. [
  3336. _vm.parentMenu.$options.componentName === "ElMenu" &&
  3337. _vm.rootMenu.collapse &&
  3338. _vm.$slots.title
  3339. ? _c("el-tooltip", { attrs: { effect: "dark", placement: "right" } }, [
  3340. _c(
  3341. "div",
  3342. { attrs: { slot: "content" }, slot: "content" },
  3343. [_vm._t("title")],
  3344. 2
  3345. ),
  3346. _c(
  3347. "div",
  3348. {
  3349. staticStyle: {
  3350. position: "absolute",
  3351. left: "0",
  3352. top: "0",
  3353. height: "100%",
  3354. width: "100%",
  3355. display: "inline-block",
  3356. "box-sizing": "border-box",
  3357. padding: "0 20px"
  3358. }
  3359. },
  3360. [_vm._t("default")],
  3361. 2
  3362. )
  3363. ])
  3364. : [_vm._t("default"), _vm._t("title")]
  3365. ],
  3366. 2
  3367. )
  3368. }
  3369. var menu_itemvue_type_template_id_2a5dbfea_staticRenderFns = []
  3370. menu_itemvue_type_template_id_2a5dbfea_render._withStripped = true
  3371. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
  3372. // EXTERNAL MODULE: external "element-ui/lib/tooltip"
  3373. var tooltip_ = __webpack_require__(22);
  3374. var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
  3375. // 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&
  3376. //
  3377. //
  3378. //
  3379. //
  3380. //
  3381. //
  3382. //
  3383. //
  3384. //
  3385. //
  3386. //
  3387. //
  3388. //
  3389. //
  3390. //
  3391. //
  3392. //
  3393. //
  3394. //
  3395. //
  3396. //
  3397. //
  3398. //
  3399. //
  3400. //
  3401. //
  3402. //
  3403. //
  3404. //
  3405. //
  3406. /* harmony default export */ var menu_itemvue_type_script_lang_js_ = ({
  3407. name: 'ElMenuItem',
  3408. componentName: 'ElMenuItem',
  3409. mixins: [menu_mixin, emitter_default.a],
  3410. components: { ElTooltip: tooltip_default.a },
  3411. props: {
  3412. index: {
  3413. default: null,
  3414. validator: function validator(val) {
  3415. return typeof val === 'string' || val === null;
  3416. }
  3417. },
  3418. route: [String, Object],
  3419. disabled: Boolean
  3420. },
  3421. computed: {
  3422. active: function active() {
  3423. return this.index === this.rootMenu.activeIndex;
  3424. },
  3425. hoverBackground: function hoverBackground() {
  3426. return this.rootMenu.hoverBackground;
  3427. },
  3428. backgroundColor: function backgroundColor() {
  3429. return this.rootMenu.backgroundColor || '';
  3430. },
  3431. activeTextColor: function activeTextColor() {
  3432. return this.rootMenu.activeTextColor || '';
  3433. },
  3434. textColor: function textColor() {
  3435. return this.rootMenu.textColor || '';
  3436. },
  3437. mode: function mode() {
  3438. return this.rootMenu.mode;
  3439. },
  3440. itemStyle: function itemStyle() {
  3441. var style = {
  3442. color: this.active ? this.activeTextColor : this.textColor
  3443. };
  3444. if (this.mode === 'horizontal' && !this.isNested) {
  3445. style.borderBottomColor = this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent';
  3446. }
  3447. return style;
  3448. },
  3449. isNested: function isNested() {
  3450. return this.parentMenu !== this.rootMenu;
  3451. }
  3452. },
  3453. methods: {
  3454. onMouseEnter: function onMouseEnter() {
  3455. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3456. this.$el.style.backgroundColor = this.hoverBackground;
  3457. },
  3458. onMouseLeave: function onMouseLeave() {
  3459. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3460. this.$el.style.backgroundColor = this.backgroundColor;
  3461. },
  3462. handleClick: function handleClick() {
  3463. if (!this.disabled) {
  3464. this.dispatch('ElMenu', 'item-click', this);
  3465. this.$emit('click', this);
  3466. }
  3467. }
  3468. },
  3469. mounted: function mounted() {
  3470. this.parentMenu.addItem(this);
  3471. this.rootMenu.addItem(this);
  3472. },
  3473. beforeDestroy: function beforeDestroy() {
  3474. this.parentMenu.removeItem(this);
  3475. this.rootMenu.removeItem(this);
  3476. }
  3477. });
  3478. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
  3479. /* harmony default export */ var src_menu_itemvue_type_script_lang_js_ = (menu_itemvue_type_script_lang_js_);
  3480. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue
  3481. /* normalize component */
  3482. var menu_item_component = normalizeComponent(
  3483. src_menu_itemvue_type_script_lang_js_,
  3484. menu_itemvue_type_template_id_2a5dbfea_render,
  3485. menu_itemvue_type_template_id_2a5dbfea_staticRenderFns,
  3486. false,
  3487. null,
  3488. null,
  3489. null
  3490. )
  3491. /* hot reload */
  3492. if (false) { var menu_item_api; }
  3493. menu_item_component.options.__file = "packages/menu/src/menu-item.vue"
  3494. /* harmony default export */ var menu_item = (menu_item_component.exports);
  3495. // CONCATENATED MODULE: ./packages/menu-item/index.js
  3496. /* istanbul ignore next */
  3497. menu_item.install = function (Vue) {
  3498. Vue.component(menu_item.name, menu_item);
  3499. };
  3500. /* harmony default export */ var packages_menu_item = (menu_item);
  3501. // 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&
  3502. var menu_item_groupvue_type_template_id_543b7bdc_render = function() {
  3503. var _vm = this
  3504. var _h = _vm.$createElement
  3505. var _c = _vm._self._c || _h
  3506. return _c("li", { staticClass: "el-menu-item-group" }, [
  3507. _c(
  3508. "div",
  3509. {
  3510. staticClass: "el-menu-item-group__title",
  3511. style: { paddingLeft: _vm.levelPadding + "px" }
  3512. },
  3513. [!_vm.$slots.title ? [_vm._v(_vm._s(_vm.title))] : _vm._t("title")],
  3514. 2
  3515. ),
  3516. _c("ul", [_vm._t("default")], 2)
  3517. ])
  3518. }
  3519. var menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns = []
  3520. menu_item_groupvue_type_template_id_543b7bdc_render._withStripped = true
  3521. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
  3522. // 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&
  3523. //
  3524. //
  3525. //
  3526. //
  3527. //
  3528. //
  3529. //
  3530. //
  3531. //
  3532. //
  3533. //
  3534. /* harmony default export */ var menu_item_groupvue_type_script_lang_js_ = ({
  3535. name: 'ElMenuItemGroup',
  3536. componentName: 'ElMenuItemGroup',
  3537. inject: ['rootMenu'],
  3538. props: {
  3539. title: {
  3540. type: String
  3541. }
  3542. },
  3543. data: function data() {
  3544. return {
  3545. paddingLeft: 20
  3546. };
  3547. },
  3548. computed: {
  3549. levelPadding: function levelPadding() {
  3550. var padding = 20;
  3551. var parent = this.$parent;
  3552. if (this.rootMenu.collapse) return 20;
  3553. while (parent && parent.$options.componentName !== 'ElMenu') {
  3554. if (parent.$options.componentName === 'ElSubmenu') {
  3555. padding += 20;
  3556. }
  3557. parent = parent.$parent;
  3558. }
  3559. return padding;
  3560. }
  3561. }
  3562. });
  3563. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
  3564. /* harmony default export */ var src_menu_item_groupvue_type_script_lang_js_ = (menu_item_groupvue_type_script_lang_js_);
  3565. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue
  3566. /* normalize component */
  3567. var menu_item_group_component = normalizeComponent(
  3568. src_menu_item_groupvue_type_script_lang_js_,
  3569. menu_item_groupvue_type_template_id_543b7bdc_render,
  3570. menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns,
  3571. false,
  3572. null,
  3573. null,
  3574. null
  3575. )
  3576. /* hot reload */
  3577. if (false) { var menu_item_group_api; }
  3578. menu_item_group_component.options.__file = "packages/menu/src/menu-item-group.vue"
  3579. /* harmony default export */ var menu_item_group = (menu_item_group_component.exports);
  3580. // CONCATENATED MODULE: ./packages/menu-item-group/index.js
  3581. /* istanbul ignore next */
  3582. menu_item_group.install = function (Vue) {
  3583. Vue.component(menu_item_group.name, menu_item_group);
  3584. };
  3585. /* harmony default export */ var packages_menu_item_group = (menu_item_group);
  3586. // 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&
  3587. var inputvue_type_template_id_343dd774_render = function() {
  3588. var _vm = this
  3589. var _h = _vm.$createElement
  3590. var _c = _vm._self._c || _h
  3591. return _c(
  3592. "div",
  3593. {
  3594. class: [
  3595. _vm.type === "textarea" ? "el-textarea" : "el-input",
  3596. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  3597. {
  3598. "is-disabled": _vm.inputDisabled,
  3599. "is-exceed": _vm.inputExceed,
  3600. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  3601. "el-input-group--append": _vm.$slots.append,
  3602. "el-input-group--prepend": _vm.$slots.prepend,
  3603. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  3604. "el-input--suffix":
  3605. _vm.$slots.suffix ||
  3606. _vm.suffixIcon ||
  3607. _vm.clearable ||
  3608. _vm.showPassword
  3609. }
  3610. ],
  3611. on: {
  3612. mouseenter: function($event) {
  3613. _vm.hovering = true
  3614. },
  3615. mouseleave: function($event) {
  3616. _vm.hovering = false
  3617. }
  3618. }
  3619. },
  3620. [
  3621. _vm.type !== "textarea"
  3622. ? [
  3623. _vm.$slots.prepend
  3624. ? _c(
  3625. "div",
  3626. { staticClass: "el-input-group__prepend" },
  3627. [_vm._t("prepend")],
  3628. 2
  3629. )
  3630. : _vm._e(),
  3631. _vm.type !== "textarea"
  3632. ? _c(
  3633. "input",
  3634. _vm._b(
  3635. {
  3636. ref: "input",
  3637. staticClass: "el-input__inner",
  3638. attrs: {
  3639. tabindex: _vm.tabindex,
  3640. type: _vm.showPassword
  3641. ? _vm.passwordVisible
  3642. ? "text"
  3643. : "password"
  3644. : _vm.type,
  3645. disabled: _vm.inputDisabled,
  3646. readonly: _vm.readonly,
  3647. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3648. "aria-label": _vm.label
  3649. },
  3650. on: {
  3651. compositionstart: _vm.handleCompositionStart,
  3652. compositionend: _vm.handleCompositionEnd,
  3653. input: _vm.handleInput,
  3654. focus: _vm.handleFocus,
  3655. blur: _vm.handleBlur,
  3656. change: _vm.handleChange
  3657. }
  3658. },
  3659. "input",
  3660. _vm.$attrs,
  3661. false
  3662. )
  3663. )
  3664. : _vm._e(),
  3665. _vm.$slots.prefix || _vm.prefixIcon
  3666. ? _c(
  3667. "span",
  3668. { staticClass: "el-input__prefix" },
  3669. [
  3670. _vm._t("prefix"),
  3671. _vm.prefixIcon
  3672. ? _c("i", {
  3673. staticClass: "el-input__icon",
  3674. class: _vm.prefixIcon
  3675. })
  3676. : _vm._e()
  3677. ],
  3678. 2
  3679. )
  3680. : _vm._e(),
  3681. _vm.getSuffixVisible()
  3682. ? _c("span", { staticClass: "el-input__suffix" }, [
  3683. _c(
  3684. "span",
  3685. { staticClass: "el-input__suffix-inner" },
  3686. [
  3687. !_vm.showClear ||
  3688. !_vm.showPwdVisible ||
  3689. !_vm.isWordLimitVisible
  3690. ? [
  3691. _vm._t("suffix"),
  3692. _vm.suffixIcon
  3693. ? _c("i", {
  3694. staticClass: "el-input__icon",
  3695. class: _vm.suffixIcon
  3696. })
  3697. : _vm._e()
  3698. ]
  3699. : _vm._e(),
  3700. _vm.showClear
  3701. ? _c("i", {
  3702. staticClass:
  3703. "el-input__icon el-icon-circle-close el-input__clear",
  3704. on: { click: _vm.clear }
  3705. })
  3706. : _vm._e(),
  3707. _vm.showPwdVisible
  3708. ? _c("i", {
  3709. staticClass:
  3710. "el-input__icon el-icon-view el-input__clear",
  3711. on: { click: _vm.handlePasswordVisible }
  3712. })
  3713. : _vm._e(),
  3714. _vm.isWordLimitVisible
  3715. ? _c("span", { staticClass: "el-input__count" }, [
  3716. _c(
  3717. "span",
  3718. { staticClass: "el-input__count-inner" },
  3719. [
  3720. _vm._v(
  3721. "\n " +
  3722. _vm._s(_vm.textLength) +
  3723. "/" +
  3724. _vm._s(_vm.upperLimit) +
  3725. "\n "
  3726. )
  3727. ]
  3728. )
  3729. ])
  3730. : _vm._e()
  3731. ],
  3732. 2
  3733. ),
  3734. _vm.validateState
  3735. ? _c("i", {
  3736. staticClass: "el-input__icon",
  3737. class: ["el-input__validateIcon", _vm.validateIcon]
  3738. })
  3739. : _vm._e()
  3740. ])
  3741. : _vm._e(),
  3742. _vm.$slots.append
  3743. ? _c(
  3744. "div",
  3745. { staticClass: "el-input-group__append" },
  3746. [_vm._t("append")],
  3747. 2
  3748. )
  3749. : _vm._e()
  3750. ]
  3751. : _c(
  3752. "textarea",
  3753. _vm._b(
  3754. {
  3755. ref: "textarea",
  3756. staticClass: "el-textarea__inner",
  3757. style: _vm.textareaStyle,
  3758. attrs: {
  3759. tabindex: _vm.tabindex,
  3760. disabled: _vm.inputDisabled,
  3761. readonly: _vm.readonly,
  3762. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3763. "aria-label": _vm.label
  3764. },
  3765. on: {
  3766. compositionstart: _vm.handleCompositionStart,
  3767. compositionend: _vm.handleCompositionEnd,
  3768. input: _vm.handleInput,
  3769. focus: _vm.handleFocus,
  3770. blur: _vm.handleBlur,
  3771. change: _vm.handleChange
  3772. }
  3773. },
  3774. "textarea",
  3775. _vm.$attrs,
  3776. false
  3777. )
  3778. ),
  3779. _vm.isWordLimitVisible && _vm.type === "textarea"
  3780. ? _c("span", { staticClass: "el-input__count" }, [
  3781. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  3782. ])
  3783. : _vm._e()
  3784. ],
  3785. 2
  3786. )
  3787. }
  3788. var inputvue_type_template_id_343dd774_staticRenderFns = []
  3789. inputvue_type_template_id_343dd774_render._withStripped = true
  3790. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  3791. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  3792. var hiddenTextarea = void 0;
  3793. 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';
  3794. 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'];
  3795. function calculateNodeStyling(targetElement) {
  3796. var style = window.getComputedStyle(targetElement);
  3797. var boxSizing = style.getPropertyValue('box-sizing');
  3798. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  3799. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  3800. var contextStyle = CONTEXT_STYLE.map(function (name) {
  3801. return name + ':' + style.getPropertyValue(name);
  3802. }).join(';');
  3803. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  3804. }
  3805. function calcTextareaHeight(targetElement) {
  3806. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  3807. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  3808. if (!hiddenTextarea) {
  3809. hiddenTextarea = document.createElement('textarea');
  3810. document.body.appendChild(hiddenTextarea);
  3811. }
  3812. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  3813. paddingSize = _calculateNodeStyling.paddingSize,
  3814. borderSize = _calculateNodeStyling.borderSize,
  3815. boxSizing = _calculateNodeStyling.boxSizing,
  3816. contextStyle = _calculateNodeStyling.contextStyle;
  3817. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  3818. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  3819. var height = hiddenTextarea.scrollHeight;
  3820. var result = {};
  3821. if (boxSizing === 'border-box') {
  3822. height = height + borderSize;
  3823. } else if (boxSizing === 'content-box') {
  3824. height = height - paddingSize;
  3825. }
  3826. hiddenTextarea.value = '';
  3827. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  3828. if (minRows !== null) {
  3829. var minHeight = singleRowHeight * minRows;
  3830. if (boxSizing === 'border-box') {
  3831. minHeight = minHeight + paddingSize + borderSize;
  3832. }
  3833. height = Math.max(minHeight, height);
  3834. result.minHeight = minHeight + 'px';
  3835. }
  3836. if (maxRows !== null) {
  3837. var maxHeight = singleRowHeight * maxRows;
  3838. if (boxSizing === 'border-box') {
  3839. maxHeight = maxHeight + paddingSize + borderSize;
  3840. }
  3841. height = Math.min(maxHeight, height);
  3842. }
  3843. result.height = height + 'px';
  3844. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  3845. hiddenTextarea = null;
  3846. return result;
  3847. };
  3848. // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
  3849. var merge_ = __webpack_require__(7);
  3850. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  3851. // 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&
  3852. //
  3853. //
  3854. //
  3855. //
  3856. //
  3857. //
  3858. //
  3859. //
  3860. //
  3861. //
  3862. //
  3863. //
  3864. //
  3865. //
  3866. //
  3867. //
  3868. //
  3869. //
  3870. //
  3871. //
  3872. //
  3873. //
  3874. //
  3875. //
  3876. //
  3877. //
  3878. //
  3879. //
  3880. //
  3881. //
  3882. //
  3883. //
  3884. //
  3885. //
  3886. //
  3887. //
  3888. //
  3889. //
  3890. //
  3891. //
  3892. //
  3893. //
  3894. //
  3895. //
  3896. //
  3897. //
  3898. //
  3899. //
  3900. //
  3901. //
  3902. //
  3903. //
  3904. //
  3905. //
  3906. //
  3907. //
  3908. //
  3909. //
  3910. //
  3911. //
  3912. //
  3913. //
  3914. //
  3915. //
  3916. //
  3917. //
  3918. //
  3919. //
  3920. //
  3921. //
  3922. //
  3923. //
  3924. //
  3925. //
  3926. //
  3927. //
  3928. //
  3929. //
  3930. //
  3931. //
  3932. //
  3933. //
  3934. //
  3935. //
  3936. //
  3937. //
  3938. //
  3939. //
  3940. //
  3941. //
  3942. //
  3943. //
  3944. //
  3945. //
  3946. //
  3947. //
  3948. //
  3949. //
  3950. //
  3951. //
  3952. //
  3953. //
  3954. //
  3955. //
  3956. //
  3957. //
  3958. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  3959. name: 'ElInput',
  3960. componentName: 'ElInput',
  3961. mixins: [emitter_default.a, migrating_default.a],
  3962. inheritAttrs: false,
  3963. inject: {
  3964. elForm: {
  3965. default: ''
  3966. },
  3967. elFormItem: {
  3968. default: ''
  3969. }
  3970. },
  3971. data: function data() {
  3972. return {
  3973. textareaCalcStyle: {},
  3974. hovering: false,
  3975. focused: false,
  3976. isComposing: false,
  3977. passwordVisible: false
  3978. };
  3979. },
  3980. props: {
  3981. value: [String, Number],
  3982. size: String,
  3983. resize: String,
  3984. form: String,
  3985. disabled: Boolean,
  3986. readonly: Boolean,
  3987. type: {
  3988. type: String,
  3989. default: 'text'
  3990. },
  3991. autosize: {
  3992. type: [Boolean, Object],
  3993. default: false
  3994. },
  3995. autocomplete: {
  3996. type: String,
  3997. default: 'off'
  3998. },
  3999. /** @Deprecated in next major version */
  4000. autoComplete: {
  4001. type: String,
  4002. validator: function validator(val) {
  4003. false && false;
  4004. return true;
  4005. }
  4006. },
  4007. validateEvent: {
  4008. type: Boolean,
  4009. default: true
  4010. },
  4011. suffixIcon: String,
  4012. prefixIcon: String,
  4013. label: String,
  4014. clearable: {
  4015. type: Boolean,
  4016. default: false
  4017. },
  4018. showPassword: {
  4019. type: Boolean,
  4020. default: false
  4021. },
  4022. showWordLimit: {
  4023. type: Boolean,
  4024. default: false
  4025. },
  4026. tabindex: String
  4027. },
  4028. computed: {
  4029. _elFormItemSize: function _elFormItemSize() {
  4030. return (this.elFormItem || {}).elFormItemSize;
  4031. },
  4032. validateState: function validateState() {
  4033. return this.elFormItem ? this.elFormItem.validateState : '';
  4034. },
  4035. needStatusIcon: function needStatusIcon() {
  4036. return this.elForm ? this.elForm.statusIcon : false;
  4037. },
  4038. validateIcon: function validateIcon() {
  4039. return {
  4040. validating: 'el-icon-loading',
  4041. success: 'el-icon-circle-check',
  4042. error: 'el-icon-circle-close'
  4043. }[this.validateState];
  4044. },
  4045. textareaStyle: function textareaStyle() {
  4046. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  4047. },
  4048. inputSize: function inputSize() {
  4049. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4050. },
  4051. inputDisabled: function inputDisabled() {
  4052. return this.disabled || (this.elForm || {}).disabled;
  4053. },
  4054. nativeInputValue: function nativeInputValue() {
  4055. return this.value === null || this.value === undefined ? '' : String(this.value);
  4056. },
  4057. showClear: function showClear() {
  4058. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  4059. },
  4060. showPwdVisible: function showPwdVisible() {
  4061. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  4062. },
  4063. isWordLimitVisible: function isWordLimitVisible() {
  4064. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  4065. },
  4066. upperLimit: function upperLimit() {
  4067. return this.$attrs.maxlength;
  4068. },
  4069. textLength: function textLength() {
  4070. if (typeof this.value === 'number') {
  4071. return String(this.value).length;
  4072. }
  4073. return (this.value || '').length;
  4074. },
  4075. inputExceed: function inputExceed() {
  4076. // show exceed style if length of initial value greater then maxlength
  4077. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  4078. }
  4079. },
  4080. watch: {
  4081. value: function value(val) {
  4082. this.$nextTick(this.resizeTextarea);
  4083. if (this.validateEvent) {
  4084. this.dispatch('ElFormItem', 'el.form.change', [val]);
  4085. }
  4086. },
  4087. // native input value is set explicitly
  4088. // do not use v-model / :value in template
  4089. // see: https://github.com/ElemeFE/element/issues/14521
  4090. nativeInputValue: function nativeInputValue() {
  4091. this.setNativeInputValue();
  4092. },
  4093. // when change between <input> and <textarea>,
  4094. // update DOM dependent value and styles
  4095. // https://github.com/ElemeFE/element/issues/14857
  4096. type: function type() {
  4097. var _this = this;
  4098. this.$nextTick(function () {
  4099. _this.setNativeInputValue();
  4100. _this.resizeTextarea();
  4101. _this.updateIconOffset();
  4102. });
  4103. }
  4104. },
  4105. methods: {
  4106. focus: function focus() {
  4107. this.getInput().focus();
  4108. },
  4109. blur: function blur() {
  4110. this.getInput().blur();
  4111. },
  4112. getMigratingConfig: function getMigratingConfig() {
  4113. return {
  4114. props: {
  4115. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  4116. 'on-icon-click': 'on-icon-click is removed.'
  4117. },
  4118. events: {
  4119. 'click': 'click is removed.'
  4120. }
  4121. };
  4122. },
  4123. handleBlur: function handleBlur(event) {
  4124. this.focused = false;
  4125. this.$emit('blur', event);
  4126. if (this.validateEvent) {
  4127. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  4128. }
  4129. },
  4130. select: function select() {
  4131. this.getInput().select();
  4132. },
  4133. resizeTextarea: function resizeTextarea() {
  4134. if (this.$isServer) return;
  4135. var autosize = this.autosize,
  4136. type = this.type;
  4137. if (type !== 'textarea') return;
  4138. if (!autosize) {
  4139. this.textareaCalcStyle = {
  4140. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  4141. };
  4142. return;
  4143. }
  4144. var minRows = autosize.minRows;
  4145. var maxRows = autosize.maxRows;
  4146. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  4147. },
  4148. setNativeInputValue: function setNativeInputValue() {
  4149. var input = this.getInput();
  4150. if (!input) return;
  4151. if (input.value === this.nativeInputValue) return;
  4152. input.value = this.nativeInputValue;
  4153. },
  4154. handleFocus: function handleFocus(event) {
  4155. this.focused = true;
  4156. this.$emit('focus', event);
  4157. },
  4158. handleCompositionStart: function handleCompositionStart() {
  4159. this.isComposing = true;
  4160. },
  4161. handleCompositionEnd: function handleCompositionEnd(event) {
  4162. this.isComposing = false;
  4163. this.handleInput(event);
  4164. },
  4165. handleInput: function handleInput(event) {
  4166. // should not emit input during composition
  4167. // see: https://github.com/ElemeFE/element/issues/10516
  4168. if (this.isComposing) return;
  4169. // hack for https://github.com/ElemeFE/element/issues/8548
  4170. // should remove the following line when we don't support IE
  4171. if (event.target.value === this.nativeInputValue) return;
  4172. this.$emit('input', event.target.value);
  4173. // ensure native input value is controlled
  4174. // see: https://github.com/ElemeFE/element/issues/12850
  4175. this.$nextTick(this.setNativeInputValue);
  4176. },
  4177. handleChange: function handleChange(event) {
  4178. this.$emit('change', event.target.value);
  4179. },
  4180. calcIconOffset: function calcIconOffset(place) {
  4181. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  4182. if (!elList.length) return;
  4183. var el = null;
  4184. for (var i = 0; i < elList.length; i++) {
  4185. if (elList[i].parentNode === this.$el) {
  4186. el = elList[i];
  4187. break;
  4188. }
  4189. }
  4190. if (!el) return;
  4191. var pendantMap = {
  4192. suffix: 'append',
  4193. prefix: 'prepend'
  4194. };
  4195. var pendant = pendantMap[place];
  4196. if (this.$slots[pendant]) {
  4197. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  4198. } else {
  4199. el.removeAttribute('style');
  4200. }
  4201. },
  4202. updateIconOffset: function updateIconOffset() {
  4203. this.calcIconOffset('prefix');
  4204. this.calcIconOffset('suffix');
  4205. },
  4206. clear: function clear() {
  4207. this.$emit('input', '');
  4208. this.$emit('change', '');
  4209. this.$emit('clear');
  4210. },
  4211. handlePasswordVisible: function handlePasswordVisible() {
  4212. this.passwordVisible = !this.passwordVisible;
  4213. this.focus();
  4214. },
  4215. getInput: function getInput() {
  4216. return this.$refs.input || this.$refs.textarea;
  4217. },
  4218. getSuffixVisible: function getSuffixVisible() {
  4219. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  4220. }
  4221. },
  4222. created: function created() {
  4223. this.$on('inputSelect', this.select);
  4224. },
  4225. mounted: function mounted() {
  4226. this.setNativeInputValue();
  4227. this.resizeTextarea();
  4228. this.updateIconOffset();
  4229. },
  4230. updated: function updated() {
  4231. this.$nextTick(this.updateIconOffset);
  4232. }
  4233. });
  4234. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  4235. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  4236. // CONCATENATED MODULE: ./packages/input/src/input.vue
  4237. /* normalize component */
  4238. var input_component = normalizeComponent(
  4239. src_inputvue_type_script_lang_js_,
  4240. inputvue_type_template_id_343dd774_render,
  4241. inputvue_type_template_id_343dd774_staticRenderFns,
  4242. false,
  4243. null,
  4244. null,
  4245. null
  4246. )
  4247. /* hot reload */
  4248. if (false) { var input_api; }
  4249. input_component.options.__file = "packages/input/src/input.vue"
  4250. /* harmony default export */ var input = (input_component.exports);
  4251. // CONCATENATED MODULE: ./packages/input/index.js
  4252. /* istanbul ignore next */
  4253. input.install = function (Vue) {
  4254. Vue.component(input.name, input);
  4255. };
  4256. /* harmony default export */ var packages_input = (input);
  4257. // 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&
  4258. var input_numbervue_type_template_id_42f8cf66_render = function() {
  4259. var _vm = this
  4260. var _h = _vm.$createElement
  4261. var _c = _vm._self._c || _h
  4262. return _c(
  4263. "div",
  4264. {
  4265. class: [
  4266. "el-input-number",
  4267. _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "",
  4268. { "is-disabled": _vm.inputNumberDisabled },
  4269. { "is-without-controls": !_vm.controls },
  4270. { "is-controls-right": _vm.controlsAtRight }
  4271. ],
  4272. on: {
  4273. dragstart: function($event) {
  4274. $event.preventDefault()
  4275. }
  4276. }
  4277. },
  4278. [
  4279. _vm.controls
  4280. ? _c(
  4281. "span",
  4282. {
  4283. directives: [
  4284. {
  4285. name: "repeat-click",
  4286. rawName: "v-repeat-click",
  4287. value: _vm.decrease,
  4288. expression: "decrease"
  4289. }
  4290. ],
  4291. staticClass: "el-input-number__decrease",
  4292. class: { "is-disabled": _vm.minDisabled },
  4293. attrs: { role: "button" },
  4294. on: {
  4295. keydown: function($event) {
  4296. if (
  4297. !("button" in $event) &&
  4298. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4299. ) {
  4300. return null
  4301. }
  4302. return _vm.decrease($event)
  4303. }
  4304. }
  4305. },
  4306. [
  4307. _c("i", {
  4308. class:
  4309. "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus")
  4310. })
  4311. ]
  4312. )
  4313. : _vm._e(),
  4314. _vm.controls
  4315. ? _c(
  4316. "span",
  4317. {
  4318. directives: [
  4319. {
  4320. name: "repeat-click",
  4321. rawName: "v-repeat-click",
  4322. value: _vm.increase,
  4323. expression: "increase"
  4324. }
  4325. ],
  4326. staticClass: "el-input-number__increase",
  4327. class: { "is-disabled": _vm.maxDisabled },
  4328. attrs: { role: "button" },
  4329. on: {
  4330. keydown: function($event) {
  4331. if (
  4332. !("button" in $event) &&
  4333. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4334. ) {
  4335. return null
  4336. }
  4337. return _vm.increase($event)
  4338. }
  4339. }
  4340. },
  4341. [
  4342. _c("i", {
  4343. class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus")
  4344. })
  4345. ]
  4346. )
  4347. : _vm._e(),
  4348. _c("el-input", {
  4349. ref: "input",
  4350. attrs: {
  4351. value: _vm.displayValue,
  4352. placeholder: _vm.placeholder,
  4353. disabled: _vm.inputNumberDisabled,
  4354. size: _vm.inputNumberSize,
  4355. max: _vm.max,
  4356. min: _vm.min,
  4357. name: _vm.name,
  4358. label: _vm.label
  4359. },
  4360. on: {
  4361. blur: _vm.handleBlur,
  4362. focus: _vm.handleFocus,
  4363. input: _vm.handleInput,
  4364. change: _vm.handleInputChange
  4365. },
  4366. nativeOn: {
  4367. keydown: [
  4368. function($event) {
  4369. if (
  4370. !("button" in $event) &&
  4371. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  4372. ) {
  4373. return null
  4374. }
  4375. $event.preventDefault()
  4376. return _vm.increase($event)
  4377. },
  4378. function($event) {
  4379. if (
  4380. !("button" in $event) &&
  4381. _vm._k($event.keyCode, "down", 40, $event.key, [
  4382. "Down",
  4383. "ArrowDown"
  4384. ])
  4385. ) {
  4386. return null
  4387. }
  4388. $event.preventDefault()
  4389. return _vm.decrease($event)
  4390. }
  4391. ]
  4392. }
  4393. })
  4394. ],
  4395. 1
  4396. )
  4397. }
  4398. var input_numbervue_type_template_id_42f8cf66_staticRenderFns = []
  4399. input_numbervue_type_template_id_42f8cf66_render._withStripped = true
  4400. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  4401. // CONCATENATED MODULE: ./src/directives/repeat-click.js
  4402. /* harmony default export */ var repeat_click = ({
  4403. bind: function bind(el, binding, vnode) {
  4404. var interval = null;
  4405. var startTime = void 0;
  4406. var handler = function handler() {
  4407. return vnode.context[binding.expression].apply();
  4408. };
  4409. var clear = function clear() {
  4410. if (Date.now() - startTime < 100) {
  4411. handler();
  4412. }
  4413. clearInterval(interval);
  4414. interval = null;
  4415. };
  4416. Object(dom_["on"])(el, 'mousedown', function (e) {
  4417. if (e.button !== 0) return;
  4418. startTime = Date.now();
  4419. Object(dom_["once"])(document, 'mouseup', clear);
  4420. clearInterval(interval);
  4421. interval = setInterval(handler, 100);
  4422. });
  4423. }
  4424. });
  4425. // 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&
  4426. //
  4427. //
  4428. //
  4429. //
  4430. //
  4431. //
  4432. //
  4433. //
  4434. //
  4435. //
  4436. //
  4437. //
  4438. //
  4439. //
  4440. //
  4441. //
  4442. //
  4443. //
  4444. //
  4445. //
  4446. //
  4447. //
  4448. //
  4449. //
  4450. //
  4451. //
  4452. //
  4453. //
  4454. //
  4455. //
  4456. //
  4457. //
  4458. //
  4459. //
  4460. //
  4461. //
  4462. //
  4463. //
  4464. //
  4465. //
  4466. //
  4467. //
  4468. //
  4469. //
  4470. //
  4471. //
  4472. //
  4473. /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({
  4474. name: 'ElInputNumber',
  4475. mixins: [focus_default()('input')],
  4476. inject: {
  4477. elForm: {
  4478. default: ''
  4479. },
  4480. elFormItem: {
  4481. default: ''
  4482. }
  4483. },
  4484. directives: {
  4485. repeatClick: repeat_click
  4486. },
  4487. components: {
  4488. ElInput: input_default.a
  4489. },
  4490. props: {
  4491. step: {
  4492. type: Number,
  4493. default: 1
  4494. },
  4495. stepStrictly: {
  4496. type: Boolean,
  4497. default: false
  4498. },
  4499. max: {
  4500. type: Number,
  4501. default: Infinity
  4502. },
  4503. min: {
  4504. type: Number,
  4505. default: -Infinity
  4506. },
  4507. value: {},
  4508. disabled: Boolean,
  4509. size: String,
  4510. controls: {
  4511. type: Boolean,
  4512. default: true
  4513. },
  4514. controlsPosition: {
  4515. type: String,
  4516. default: ''
  4517. },
  4518. name: String,
  4519. label: String,
  4520. placeholder: String,
  4521. precision: {
  4522. type: Number,
  4523. validator: function validator(val) {
  4524. return val >= 0 && val === parseInt(val, 10);
  4525. }
  4526. }
  4527. },
  4528. data: function data() {
  4529. return {
  4530. currentValue: 0,
  4531. userInput: null
  4532. };
  4533. },
  4534. watch: {
  4535. value: {
  4536. immediate: true,
  4537. handler: function handler(value) {
  4538. var newVal = value === undefined ? value : Number(value);
  4539. if (newVal !== undefined) {
  4540. if (isNaN(newVal)) {
  4541. return;
  4542. }
  4543. if (this.stepStrictly) {
  4544. var stepPrecision = this.getPrecision(this.step);
  4545. var precisionFactor = Math.pow(10, stepPrecision);
  4546. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  4547. }
  4548. if (this.precision !== undefined) {
  4549. newVal = this.toPrecision(newVal, this.precision);
  4550. }
  4551. }
  4552. if (newVal >= this.max) newVal = this.max;
  4553. if (newVal <= this.min) newVal = this.min;
  4554. this.currentValue = newVal;
  4555. this.userInput = null;
  4556. this.$emit('input', newVal);
  4557. }
  4558. }
  4559. },
  4560. computed: {
  4561. minDisabled: function minDisabled() {
  4562. return this._decrease(this.value, this.step) < this.min;
  4563. },
  4564. maxDisabled: function maxDisabled() {
  4565. return this._increase(this.value, this.step) > this.max;
  4566. },
  4567. numPrecision: function numPrecision() {
  4568. var value = this.value,
  4569. step = this.step,
  4570. getPrecision = this.getPrecision,
  4571. precision = this.precision;
  4572. var stepPrecision = getPrecision(step);
  4573. if (precision !== undefined) {
  4574. if (stepPrecision > precision) {
  4575. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  4576. }
  4577. return precision;
  4578. } else {
  4579. return Math.max(getPrecision(value), stepPrecision);
  4580. }
  4581. },
  4582. controlsAtRight: function controlsAtRight() {
  4583. return this.controls && this.controlsPosition === 'right';
  4584. },
  4585. _elFormItemSize: function _elFormItemSize() {
  4586. return (this.elFormItem || {}).elFormItemSize;
  4587. },
  4588. inputNumberSize: function inputNumberSize() {
  4589. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4590. },
  4591. inputNumberDisabled: function inputNumberDisabled() {
  4592. return this.disabled || (this.elForm || {}).disabled;
  4593. },
  4594. displayValue: function displayValue() {
  4595. if (this.userInput !== null) {
  4596. return this.userInput;
  4597. }
  4598. var currentValue = this.currentValue;
  4599. if (typeof currentValue === 'number') {
  4600. if (this.stepStrictly) {
  4601. var stepPrecision = this.getPrecision(this.step);
  4602. var precisionFactor = Math.pow(10, stepPrecision);
  4603. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  4604. }
  4605. if (this.precision !== undefined) {
  4606. currentValue = currentValue.toFixed(this.precision);
  4607. }
  4608. }
  4609. return currentValue;
  4610. }
  4611. },
  4612. methods: {
  4613. toPrecision: function toPrecision(num, precision) {
  4614. if (precision === undefined) precision = this.numPrecision;
  4615. return parseFloat(Number(num).toFixed(precision));
  4616. },
  4617. getPrecision: function getPrecision(value) {
  4618. if (value === undefined) return 0;
  4619. var valueString = value.toString();
  4620. var dotPosition = valueString.indexOf('.');
  4621. var precision = 0;
  4622. if (dotPosition !== -1) {
  4623. precision = valueString.length - dotPosition - 1;
  4624. }
  4625. return precision;
  4626. },
  4627. _increase: function _increase(val, step) {
  4628. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4629. var precisionFactor = Math.pow(10, this.numPrecision);
  4630. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  4631. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  4632. },
  4633. _decrease: function _decrease(val, step) {
  4634. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4635. var precisionFactor = Math.pow(10, this.numPrecision);
  4636. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  4637. },
  4638. increase: function increase() {
  4639. if (this.inputNumberDisabled || this.maxDisabled) return;
  4640. var value = this.value || 0;
  4641. var newVal = this._increase(value, this.step);
  4642. this.setCurrentValue(newVal);
  4643. },
  4644. decrease: function decrease() {
  4645. if (this.inputNumberDisabled || this.minDisabled) return;
  4646. var value = this.value || 0;
  4647. var newVal = this._decrease(value, this.step);
  4648. this.setCurrentValue(newVal);
  4649. },
  4650. handleBlur: function handleBlur(event) {
  4651. this.$emit('blur', event);
  4652. },
  4653. handleFocus: function handleFocus(event) {
  4654. this.$emit('focus', event);
  4655. },
  4656. setCurrentValue: function setCurrentValue(newVal) {
  4657. var oldVal = this.currentValue;
  4658. if (typeof newVal === 'number' && this.precision !== undefined) {
  4659. newVal = this.toPrecision(newVal, this.precision);
  4660. }
  4661. if (newVal >= this.max) newVal = this.max;
  4662. if (newVal <= this.min) newVal = this.min;
  4663. if (oldVal === newVal) return;
  4664. this.userInput = null;
  4665. this.$emit('input', newVal);
  4666. this.$emit('change', newVal, oldVal);
  4667. this.currentValue = newVal;
  4668. },
  4669. handleInput: function handleInput(value) {
  4670. this.userInput = value;
  4671. },
  4672. handleInputChange: function handleInputChange(value) {
  4673. var newVal = value === '' ? undefined : Number(value);
  4674. if (!isNaN(newVal) || value === '') {
  4675. this.setCurrentValue(newVal);
  4676. }
  4677. this.userInput = null;
  4678. },
  4679. select: function select() {
  4680. this.$refs.input.select();
  4681. }
  4682. },
  4683. mounted: function mounted() {
  4684. var innerInput = this.$refs.input.$refs.input;
  4685. innerInput.setAttribute('role', 'spinbutton');
  4686. innerInput.setAttribute('aria-valuemax', this.max);
  4687. innerInput.setAttribute('aria-valuemin', this.min);
  4688. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4689. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  4690. },
  4691. updated: function updated() {
  4692. if (!this.$refs || !this.$refs.input) return;
  4693. var innerInput = this.$refs.input.$refs.input;
  4694. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4695. }
  4696. });
  4697. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  4698. /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_);
  4699. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue
  4700. /* normalize component */
  4701. var input_number_component = normalizeComponent(
  4702. src_input_numbervue_type_script_lang_js_,
  4703. input_numbervue_type_template_id_42f8cf66_render,
  4704. input_numbervue_type_template_id_42f8cf66_staticRenderFns,
  4705. false,
  4706. null,
  4707. null,
  4708. null
  4709. )
  4710. /* hot reload */
  4711. if (false) { var input_number_api; }
  4712. input_number_component.options.__file = "packages/input-number/src/input-number.vue"
  4713. /* harmony default export */ var input_number = (input_number_component.exports);
  4714. // CONCATENATED MODULE: ./packages/input-number/index.js
  4715. /* istanbul ignore next */
  4716. input_number.install = function (Vue) {
  4717. Vue.component(input_number.name, input_number);
  4718. };
  4719. /* harmony default export */ var packages_input_number = (input_number);
  4720. // 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&
  4721. var radiovue_type_template_id_69cd6268_render = function() {
  4722. var _vm = this
  4723. var _h = _vm.$createElement
  4724. var _c = _vm._self._c || _h
  4725. return _c(
  4726. "label",
  4727. {
  4728. staticClass: "el-radio",
  4729. class: [
  4730. _vm.border && _vm.radioSize ? "el-radio--" + _vm.radioSize : "",
  4731. { "is-disabled": _vm.isDisabled },
  4732. { "is-focus": _vm.focus },
  4733. { "is-bordered": _vm.border },
  4734. { "is-checked": _vm.model === _vm.label }
  4735. ],
  4736. attrs: {
  4737. role: "radio",
  4738. "aria-checked": _vm.model === _vm.label,
  4739. "aria-disabled": _vm.isDisabled,
  4740. tabindex: _vm.tabIndex
  4741. },
  4742. on: {
  4743. keydown: function($event) {
  4744. if (
  4745. !("button" in $event) &&
  4746. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  4747. ) {
  4748. return null
  4749. }
  4750. $event.stopPropagation()
  4751. $event.preventDefault()
  4752. _vm.model = _vm.isDisabled ? _vm.model : _vm.label
  4753. }
  4754. }
  4755. },
  4756. [
  4757. _c(
  4758. "span",
  4759. {
  4760. staticClass: "el-radio__input",
  4761. class: {
  4762. "is-disabled": _vm.isDisabled,
  4763. "is-checked": _vm.model === _vm.label
  4764. }
  4765. },
  4766. [
  4767. _c("span", { staticClass: "el-radio__inner" }),
  4768. _c("input", {
  4769. directives: [
  4770. {
  4771. name: "model",
  4772. rawName: "v-model",
  4773. value: _vm.model,
  4774. expression: "model"
  4775. }
  4776. ],
  4777. staticClass: "el-radio__original",
  4778. attrs: {
  4779. type: "radio",
  4780. "aria-hidden": "true",
  4781. name: _vm.name,
  4782. disabled: _vm.isDisabled,
  4783. tabindex: "-1"
  4784. },
  4785. domProps: {
  4786. value: _vm.label,
  4787. checked: _vm._q(_vm.model, _vm.label)
  4788. },
  4789. on: {
  4790. focus: function($event) {
  4791. _vm.focus = true
  4792. },
  4793. blur: function($event) {
  4794. _vm.focus = false
  4795. },
  4796. change: [
  4797. function($event) {
  4798. _vm.model = _vm.label
  4799. },
  4800. _vm.handleChange
  4801. ]
  4802. }
  4803. })
  4804. ]
  4805. ),
  4806. _c(
  4807. "span",
  4808. {
  4809. staticClass: "el-radio__label",
  4810. on: {
  4811. keydown: function($event) {
  4812. $event.stopPropagation()
  4813. }
  4814. }
  4815. },
  4816. [
  4817. _vm._t("default"),
  4818. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  4819. ],
  4820. 2
  4821. )
  4822. ]
  4823. )
  4824. }
  4825. var radiovue_type_template_id_69cd6268_staticRenderFns = []
  4826. radiovue_type_template_id_69cd6268_render._withStripped = true
  4827. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=template&id=69cd6268&
  4828. // 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&
  4829. //
  4830. //
  4831. //
  4832. //
  4833. //
  4834. //
  4835. //
  4836. //
  4837. //
  4838. //
  4839. //
  4840. //
  4841. //
  4842. //
  4843. //
  4844. //
  4845. //
  4846. //
  4847. //
  4848. //
  4849. //
  4850. //
  4851. //
  4852. //
  4853. //
  4854. //
  4855. //
  4856. //
  4857. //
  4858. //
  4859. //
  4860. //
  4861. //
  4862. //
  4863. //
  4864. //
  4865. //
  4866. //
  4867. //
  4868. //
  4869. //
  4870. //
  4871. //
  4872. /* harmony default export */ var radiovue_type_script_lang_js_ = ({
  4873. name: 'ElRadio',
  4874. mixins: [emitter_default.a],
  4875. inject: {
  4876. elForm: {
  4877. default: ''
  4878. },
  4879. elFormItem: {
  4880. default: ''
  4881. }
  4882. },
  4883. componentName: 'ElRadio',
  4884. props: {
  4885. value: {},
  4886. label: {},
  4887. disabled: Boolean,
  4888. name: String,
  4889. border: Boolean,
  4890. size: String
  4891. },
  4892. data: function data() {
  4893. return {
  4894. focus: false
  4895. };
  4896. },
  4897. computed: {
  4898. isGroup: function isGroup() {
  4899. var parent = this.$parent;
  4900. while (parent) {
  4901. if (parent.$options.componentName !== 'ElRadioGroup') {
  4902. parent = parent.$parent;
  4903. } else {
  4904. this._radioGroup = parent;
  4905. return true;
  4906. }
  4907. }
  4908. return false;
  4909. },
  4910. model: {
  4911. get: function get() {
  4912. return this.isGroup ? this._radioGroup.value : this.value;
  4913. },
  4914. set: function set(val) {
  4915. if (this.isGroup) {
  4916. this.dispatch('ElRadioGroup', 'input', [val]);
  4917. } else {
  4918. this.$emit('input', val);
  4919. }
  4920. }
  4921. },
  4922. _elFormItemSize: function _elFormItemSize() {
  4923. return (this.elFormItem || {}).elFormItemSize;
  4924. },
  4925. radioSize: function radioSize() {
  4926. var temRadioSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4927. return this.isGroup ? this._radioGroup.radioGroupSize || temRadioSize : temRadioSize;
  4928. },
  4929. isDisabled: function isDisabled() {
  4930. return this.isGroup ? this._radioGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
  4931. },
  4932. tabIndex: function tabIndex() {
  4933. return this.isDisabled || this.isGroup && this.model !== this.label ? -1 : 0;
  4934. }
  4935. },
  4936. methods: {
  4937. handleChange: function handleChange() {
  4938. var _this = this;
  4939. this.$nextTick(function () {
  4940. _this.$emit('change', _this.model);
  4941. _this.isGroup && _this.dispatch('ElRadioGroup', 'handleChange', _this.model);
  4942. });
  4943. }
  4944. }
  4945. });
  4946. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=script&lang=js&
  4947. /* harmony default export */ var src_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
  4948. // CONCATENATED MODULE: ./packages/radio/src/radio.vue
  4949. /* normalize component */
  4950. var radio_component = normalizeComponent(
  4951. src_radiovue_type_script_lang_js_,
  4952. radiovue_type_template_id_69cd6268_render,
  4953. radiovue_type_template_id_69cd6268_staticRenderFns,
  4954. false,
  4955. null,
  4956. null,
  4957. null
  4958. )
  4959. /* hot reload */
  4960. if (false) { var radio_api; }
  4961. radio_component.options.__file = "packages/radio/src/radio.vue"
  4962. /* harmony default export */ var src_radio = (radio_component.exports);
  4963. // CONCATENATED MODULE: ./packages/radio/index.js
  4964. /* istanbul ignore next */
  4965. src_radio.install = function (Vue) {
  4966. Vue.component(src_radio.name, src_radio);
  4967. };
  4968. /* harmony default export */ var packages_radio = (src_radio);
  4969. // 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&
  4970. var radio_groupvue_type_template_id_818a704c_render = function() {
  4971. var _vm = this
  4972. var _h = _vm.$createElement
  4973. var _c = _vm._self._c || _h
  4974. return _c(
  4975. "div",
  4976. {
  4977. staticClass: "el-radio-group",
  4978. attrs: { role: "radiogroup" },
  4979. on: { keydown: _vm.handleKeydown }
  4980. },
  4981. [_vm._t("default")],
  4982. 2
  4983. )
  4984. }
  4985. var radio_groupvue_type_template_id_818a704c_staticRenderFns = []
  4986. radio_groupvue_type_template_id_818a704c_render._withStripped = true
  4987. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=template&id=818a704c&
  4988. // 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&
  4989. //
  4990. //
  4991. //
  4992. //
  4993. //
  4994. //
  4995. //
  4996. //
  4997. //
  4998. var keyCode = Object.freeze({
  4999. LEFT: 37,
  5000. UP: 38,
  5001. RIGHT: 39,
  5002. DOWN: 40
  5003. });
  5004. /* harmony default export */ var radio_groupvue_type_script_lang_js_ = ({
  5005. name: 'ElRadioGroup',
  5006. componentName: 'ElRadioGroup',
  5007. inject: {
  5008. elFormItem: {
  5009. default: ''
  5010. }
  5011. },
  5012. mixins: [emitter_default.a],
  5013. props: {
  5014. value: {},
  5015. size: String,
  5016. fill: String,
  5017. textColor: String,
  5018. disabled: Boolean
  5019. },
  5020. computed: {
  5021. _elFormItemSize: function _elFormItemSize() {
  5022. return (this.elFormItem || {}).elFormItemSize;
  5023. },
  5024. radioGroupSize: function radioGroupSize() {
  5025. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5026. }
  5027. },
  5028. created: function created() {
  5029. var _this = this;
  5030. this.$on('handleChange', function (value) {
  5031. _this.$emit('change', value);
  5032. });
  5033. },
  5034. mounted: function mounted() {
  5035. // 当radioGroup没有默认选项时,第一个可以选中Tab导航
  5036. var radios = this.$el.querySelectorAll('[type=radio]');
  5037. var firstLabel = this.$el.querySelectorAll('[role=radio]')[0];
  5038. if (![].some.call(radios, function (radio) {
  5039. return radio.checked;
  5040. }) && firstLabel) {
  5041. firstLabel.tabIndex = 0;
  5042. }
  5043. },
  5044. methods: {
  5045. handleKeydown: function handleKeydown(e) {
  5046. // 左右上下按键 可以在radio组内切换不同选项
  5047. var target = e.target;
  5048. var className = target.nodeName === 'INPUT' ? '[type=radio]' : '[role=radio]';
  5049. var radios = this.$el.querySelectorAll(className);
  5050. var length = radios.length;
  5051. var index = [].indexOf.call(radios, target);
  5052. var roleRadios = this.$el.querySelectorAll('[role=radio]');
  5053. switch (e.keyCode) {
  5054. case keyCode.LEFT:
  5055. case keyCode.UP:
  5056. e.stopPropagation();
  5057. e.preventDefault();
  5058. if (index === 0) {
  5059. roleRadios[length - 1].click();
  5060. roleRadios[length - 1].focus();
  5061. } else {
  5062. roleRadios[index - 1].click();
  5063. roleRadios[index - 1].focus();
  5064. }
  5065. break;
  5066. case keyCode.RIGHT:
  5067. case keyCode.DOWN:
  5068. if (index === length - 1) {
  5069. e.stopPropagation();
  5070. e.preventDefault();
  5071. roleRadios[0].click();
  5072. roleRadios[0].focus();
  5073. } else {
  5074. roleRadios[index + 1].click();
  5075. roleRadios[index + 1].focus();
  5076. }
  5077. break;
  5078. default:
  5079. break;
  5080. }
  5081. }
  5082. },
  5083. watch: {
  5084. value: function value(_value) {
  5085. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  5086. }
  5087. }
  5088. });
  5089. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=script&lang=js&
  5090. /* harmony default export */ var src_radio_groupvue_type_script_lang_js_ = (radio_groupvue_type_script_lang_js_);
  5091. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue
  5092. /* normalize component */
  5093. var radio_group_component = normalizeComponent(
  5094. src_radio_groupvue_type_script_lang_js_,
  5095. radio_groupvue_type_template_id_818a704c_render,
  5096. radio_groupvue_type_template_id_818a704c_staticRenderFns,
  5097. false,
  5098. null,
  5099. null,
  5100. null
  5101. )
  5102. /* hot reload */
  5103. if (false) { var radio_group_api; }
  5104. radio_group_component.options.__file = "packages/radio/src/radio-group.vue"
  5105. /* harmony default export */ var radio_group = (radio_group_component.exports);
  5106. // CONCATENATED MODULE: ./packages/radio-group/index.js
  5107. /* istanbul ignore next */
  5108. radio_group.install = function (Vue) {
  5109. Vue.component(radio_group.name, radio_group);
  5110. };
  5111. /* harmony default export */ var packages_radio_group = (radio_group);
  5112. // 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&
  5113. var radio_buttonvue_type_template_id_18a77a32_render = function() {
  5114. var _vm = this
  5115. var _h = _vm.$createElement
  5116. var _c = _vm._self._c || _h
  5117. return _c(
  5118. "label",
  5119. {
  5120. staticClass: "el-radio-button",
  5121. class: [
  5122. _vm.size ? "el-radio-button--" + _vm.size : "",
  5123. { "is-active": _vm.value === _vm.label },
  5124. { "is-disabled": _vm.isDisabled },
  5125. { "is-focus": _vm.focus }
  5126. ],
  5127. attrs: {
  5128. role: "radio",
  5129. "aria-checked": _vm.value === _vm.label,
  5130. "aria-disabled": _vm.isDisabled,
  5131. tabindex: _vm.tabIndex
  5132. },
  5133. on: {
  5134. keydown: function($event) {
  5135. if (
  5136. !("button" in $event) &&
  5137. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  5138. ) {
  5139. return null
  5140. }
  5141. $event.stopPropagation()
  5142. $event.preventDefault()
  5143. _vm.value = _vm.isDisabled ? _vm.value : _vm.label
  5144. }
  5145. }
  5146. },
  5147. [
  5148. _c("input", {
  5149. directives: [
  5150. {
  5151. name: "model",
  5152. rawName: "v-model",
  5153. value: _vm.value,
  5154. expression: "value"
  5155. }
  5156. ],
  5157. staticClass: "el-radio-button__orig-radio",
  5158. attrs: {
  5159. type: "radio",
  5160. name: _vm.name,
  5161. disabled: _vm.isDisabled,
  5162. tabindex: "-1"
  5163. },
  5164. domProps: { value: _vm.label, checked: _vm._q(_vm.value, _vm.label) },
  5165. on: {
  5166. change: [
  5167. function($event) {
  5168. _vm.value = _vm.label
  5169. },
  5170. _vm.handleChange
  5171. ],
  5172. focus: function($event) {
  5173. _vm.focus = true
  5174. },
  5175. blur: function($event) {
  5176. _vm.focus = false
  5177. }
  5178. }
  5179. }),
  5180. _c(
  5181. "span",
  5182. {
  5183. staticClass: "el-radio-button__inner",
  5184. style: _vm.value === _vm.label ? _vm.activeStyle : null,
  5185. on: {
  5186. keydown: function($event) {
  5187. $event.stopPropagation()
  5188. }
  5189. }
  5190. },
  5191. [
  5192. _vm._t("default"),
  5193. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5194. ],
  5195. 2
  5196. )
  5197. ]
  5198. )
  5199. }
  5200. var radio_buttonvue_type_template_id_18a77a32_staticRenderFns = []
  5201. radio_buttonvue_type_template_id_18a77a32_render._withStripped = true
  5202. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=template&id=18a77a32&
  5203. // 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&
  5204. //
  5205. //
  5206. //
  5207. //
  5208. //
  5209. //
  5210. //
  5211. //
  5212. //
  5213. //
  5214. //
  5215. //
  5216. //
  5217. //
  5218. //
  5219. //
  5220. //
  5221. //
  5222. //
  5223. //
  5224. //
  5225. //
  5226. //
  5227. //
  5228. //
  5229. //
  5230. //
  5231. //
  5232. //
  5233. //
  5234. //
  5235. //
  5236. //
  5237. //
  5238. //
  5239. //
  5240. /* harmony default export */ var radio_buttonvue_type_script_lang_js_ = ({
  5241. name: 'ElRadioButton',
  5242. mixins: [emitter_default.a],
  5243. inject: {
  5244. elForm: {
  5245. default: ''
  5246. },
  5247. elFormItem: {
  5248. default: ''
  5249. }
  5250. },
  5251. props: {
  5252. label: {},
  5253. disabled: Boolean,
  5254. name: String
  5255. },
  5256. data: function data() {
  5257. return {
  5258. focus: false
  5259. };
  5260. },
  5261. computed: {
  5262. value: {
  5263. get: function get() {
  5264. return this._radioGroup.value;
  5265. },
  5266. set: function set(value) {
  5267. this._radioGroup.$emit('input', value);
  5268. }
  5269. },
  5270. _radioGroup: function _radioGroup() {
  5271. var parent = this.$parent;
  5272. while (parent) {
  5273. if (parent.$options.componentName !== 'ElRadioGroup') {
  5274. parent = parent.$parent;
  5275. } else {
  5276. return parent;
  5277. }
  5278. }
  5279. return false;
  5280. },
  5281. activeStyle: function activeStyle() {
  5282. return {
  5283. backgroundColor: this._radioGroup.fill || '',
  5284. borderColor: this._radioGroup.fill || '',
  5285. boxShadow: this._radioGroup.fill ? '-1px 0 0 0 ' + this._radioGroup.fill : '',
  5286. color: this._radioGroup.textColor || ''
  5287. };
  5288. },
  5289. _elFormItemSize: function _elFormItemSize() {
  5290. return (this.elFormItem || {}).elFormItemSize;
  5291. },
  5292. size: function size() {
  5293. return this._radioGroup.radioGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5294. },
  5295. isDisabled: function isDisabled() {
  5296. return this.disabled || this._radioGroup.disabled || (this.elForm || {}).disabled;
  5297. },
  5298. tabIndex: function tabIndex() {
  5299. return this.isDisabled || this._radioGroup && this.value !== this.label ? -1 : 0;
  5300. }
  5301. },
  5302. methods: {
  5303. handleChange: function handleChange() {
  5304. var _this = this;
  5305. this.$nextTick(function () {
  5306. _this.dispatch('ElRadioGroup', 'handleChange', _this.value);
  5307. });
  5308. }
  5309. }
  5310. });
  5311. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=script&lang=js&
  5312. /* harmony default export */ var src_radio_buttonvue_type_script_lang_js_ = (radio_buttonvue_type_script_lang_js_);
  5313. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue
  5314. /* normalize component */
  5315. var radio_button_component = normalizeComponent(
  5316. src_radio_buttonvue_type_script_lang_js_,
  5317. radio_buttonvue_type_template_id_18a77a32_render,
  5318. radio_buttonvue_type_template_id_18a77a32_staticRenderFns,
  5319. false,
  5320. null,
  5321. null,
  5322. null
  5323. )
  5324. /* hot reload */
  5325. if (false) { var radio_button_api; }
  5326. radio_button_component.options.__file = "packages/radio/src/radio-button.vue"
  5327. /* harmony default export */ var radio_button = (radio_button_component.exports);
  5328. // CONCATENATED MODULE: ./packages/radio-button/index.js
  5329. /* istanbul ignore next */
  5330. radio_button.install = function (Vue) {
  5331. Vue.component(radio_button.name, radio_button);
  5332. };
  5333. /* harmony default export */ var packages_radio_button = (radio_button);
  5334. // 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&
  5335. var checkboxvue_type_template_id_d0387074_render = function() {
  5336. var _vm = this
  5337. var _h = _vm.$createElement
  5338. var _c = _vm._self._c || _h
  5339. return _c(
  5340. "label",
  5341. {
  5342. staticClass: "el-checkbox",
  5343. class: [
  5344. _vm.border && _vm.checkboxSize
  5345. ? "el-checkbox--" + _vm.checkboxSize
  5346. : "",
  5347. { "is-disabled": _vm.isDisabled },
  5348. { "is-bordered": _vm.border },
  5349. { "is-checked": _vm.isChecked }
  5350. ],
  5351. attrs: {
  5352. role: "checkbox",
  5353. "aria-checked": _vm.indeterminate ? "mixed" : _vm.isChecked,
  5354. "aria-disabled": _vm.isDisabled,
  5355. id: _vm.id
  5356. }
  5357. },
  5358. [
  5359. _c(
  5360. "span",
  5361. {
  5362. staticClass: "el-checkbox__input",
  5363. class: {
  5364. "is-disabled": _vm.isDisabled,
  5365. "is-checked": _vm.isChecked,
  5366. "is-indeterminate": _vm.indeterminate,
  5367. "is-focus": _vm.focus
  5368. },
  5369. attrs: { "aria-checked": "mixed" }
  5370. },
  5371. [
  5372. _c("span", { staticClass: "el-checkbox__inner" }),
  5373. _vm.trueLabel || _vm.falseLabel
  5374. ? _c("input", {
  5375. directives: [
  5376. {
  5377. name: "model",
  5378. rawName: "v-model",
  5379. value: _vm.model,
  5380. expression: "model"
  5381. }
  5382. ],
  5383. staticClass: "el-checkbox__original",
  5384. attrs: {
  5385. type: "checkbox",
  5386. "aria-hidden": "true",
  5387. name: _vm.name,
  5388. disabled: _vm.isDisabled,
  5389. "true-value": _vm.trueLabel,
  5390. "false-value": _vm.falseLabel
  5391. },
  5392. domProps: {
  5393. checked: Array.isArray(_vm.model)
  5394. ? _vm._i(_vm.model, null) > -1
  5395. : _vm._q(_vm.model, _vm.trueLabel)
  5396. },
  5397. on: {
  5398. change: [
  5399. function($event) {
  5400. var $$a = _vm.model,
  5401. $$el = $event.target,
  5402. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5403. if (Array.isArray($$a)) {
  5404. var $$v = null,
  5405. $$i = _vm._i($$a, $$v)
  5406. if ($$el.checked) {
  5407. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5408. } else {
  5409. $$i > -1 &&
  5410. (_vm.model = $$a
  5411. .slice(0, $$i)
  5412. .concat($$a.slice($$i + 1)))
  5413. }
  5414. } else {
  5415. _vm.model = $$c
  5416. }
  5417. },
  5418. _vm.handleChange
  5419. ],
  5420. focus: function($event) {
  5421. _vm.focus = true
  5422. },
  5423. blur: function($event) {
  5424. _vm.focus = false
  5425. }
  5426. }
  5427. })
  5428. : _c("input", {
  5429. directives: [
  5430. {
  5431. name: "model",
  5432. rawName: "v-model",
  5433. value: _vm.model,
  5434. expression: "model"
  5435. }
  5436. ],
  5437. staticClass: "el-checkbox__original",
  5438. attrs: {
  5439. type: "checkbox",
  5440. "aria-hidden": "true",
  5441. disabled: _vm.isDisabled,
  5442. name: _vm.name
  5443. },
  5444. domProps: {
  5445. value: _vm.label,
  5446. checked: Array.isArray(_vm.model)
  5447. ? _vm._i(_vm.model, _vm.label) > -1
  5448. : _vm.model
  5449. },
  5450. on: {
  5451. change: [
  5452. function($event) {
  5453. var $$a = _vm.model,
  5454. $$el = $event.target,
  5455. $$c = $$el.checked ? true : false
  5456. if (Array.isArray($$a)) {
  5457. var $$v = _vm.label,
  5458. $$i = _vm._i($$a, $$v)
  5459. if ($$el.checked) {
  5460. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5461. } else {
  5462. $$i > -1 &&
  5463. (_vm.model = $$a
  5464. .slice(0, $$i)
  5465. .concat($$a.slice($$i + 1)))
  5466. }
  5467. } else {
  5468. _vm.model = $$c
  5469. }
  5470. },
  5471. _vm.handleChange
  5472. ],
  5473. focus: function($event) {
  5474. _vm.focus = true
  5475. },
  5476. blur: function($event) {
  5477. _vm.focus = false
  5478. }
  5479. }
  5480. })
  5481. ]
  5482. ),
  5483. _vm.$slots.default || _vm.label
  5484. ? _c(
  5485. "span",
  5486. { staticClass: "el-checkbox__label" },
  5487. [
  5488. _vm._t("default"),
  5489. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5490. ],
  5491. 2
  5492. )
  5493. : _vm._e()
  5494. ]
  5495. )
  5496. }
  5497. var checkboxvue_type_template_id_d0387074_staticRenderFns = []
  5498. checkboxvue_type_template_id_d0387074_render._withStripped = true
  5499. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=d0387074&
  5500. // 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&
  5501. //
  5502. //
  5503. //
  5504. //
  5505. //
  5506. //
  5507. //
  5508. //
  5509. //
  5510. //
  5511. //
  5512. //
  5513. //
  5514. //
  5515. //
  5516. //
  5517. //
  5518. //
  5519. //
  5520. //
  5521. //
  5522. //
  5523. //
  5524. //
  5525. //
  5526. //
  5527. //
  5528. //
  5529. //
  5530. //
  5531. //
  5532. //
  5533. //
  5534. //
  5535. //
  5536. //
  5537. //
  5538. //
  5539. //
  5540. //
  5541. //
  5542. //
  5543. //
  5544. //
  5545. //
  5546. //
  5547. //
  5548. //
  5549. //
  5550. //
  5551. //
  5552. //
  5553. //
  5554. //
  5555. //
  5556. //
  5557. /* harmony default export */ var checkboxvue_type_script_lang_js_ = ({
  5558. name: 'ElCheckbox',
  5559. mixins: [emitter_default.a],
  5560. inject: {
  5561. elForm: {
  5562. default: ''
  5563. },
  5564. elFormItem: {
  5565. default: ''
  5566. }
  5567. },
  5568. componentName: 'ElCheckbox',
  5569. data: function data() {
  5570. return {
  5571. selfModel: false,
  5572. focus: false,
  5573. isLimitExceeded: false
  5574. };
  5575. },
  5576. computed: {
  5577. model: {
  5578. get: function get() {
  5579. return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  5580. },
  5581. set: function set(val) {
  5582. if (this.isGroup) {
  5583. this.isLimitExceeded = false;
  5584. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  5585. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  5586. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  5587. } else {
  5588. this.$emit('input', val);
  5589. this.selfModel = val;
  5590. }
  5591. }
  5592. },
  5593. isChecked: function isChecked() {
  5594. if ({}.toString.call(this.model) === '[object Boolean]') {
  5595. return this.model;
  5596. } else if (Array.isArray(this.model)) {
  5597. return this.model.indexOf(this.label) > -1;
  5598. } else if (this.model !== null && this.model !== undefined) {
  5599. return this.model === this.trueLabel;
  5600. }
  5601. },
  5602. isGroup: function isGroup() {
  5603. var parent = this.$parent;
  5604. while (parent) {
  5605. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  5606. parent = parent.$parent;
  5607. } else {
  5608. this._checkboxGroup = parent;
  5609. return true;
  5610. }
  5611. }
  5612. return false;
  5613. },
  5614. store: function store() {
  5615. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  5616. },
  5617. isDisabled: function isDisabled() {
  5618. return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
  5619. },
  5620. _elFormItemSize: function _elFormItemSize() {
  5621. return (this.elFormItem || {}).elFormItemSize;
  5622. },
  5623. checkboxSize: function checkboxSize() {
  5624. var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5625. return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
  5626. }
  5627. },
  5628. props: {
  5629. value: {},
  5630. label: {},
  5631. indeterminate: Boolean,
  5632. disabled: Boolean,
  5633. checked: Boolean,
  5634. name: String,
  5635. trueLabel: [String, Number],
  5636. falseLabel: [String, Number],
  5637. id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5638. controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5639. border: Boolean,
  5640. size: String
  5641. },
  5642. methods: {
  5643. addToStore: function addToStore() {
  5644. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  5645. this.model.push(this.label);
  5646. } else {
  5647. this.model = this.trueLabel || true;
  5648. }
  5649. },
  5650. handleChange: function handleChange(ev) {
  5651. var _this = this;
  5652. if (this.isLimitExceeded) return;
  5653. var value = void 0;
  5654. if (ev.target.checked) {
  5655. value = this.trueLabel === undefined ? true : this.trueLabel;
  5656. } else {
  5657. value = this.falseLabel === undefined ? false : this.falseLabel;
  5658. }
  5659. this.$emit('change', value, ev);
  5660. this.$nextTick(function () {
  5661. if (_this.isGroup) {
  5662. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  5663. }
  5664. });
  5665. }
  5666. },
  5667. created: function created() {
  5668. this.checked && this.addToStore();
  5669. },
  5670. mounted: function mounted() {
  5671. // 为indeterminate元素 添加aria-controls 属性
  5672. if (this.indeterminate) {
  5673. this.$el.setAttribute('aria-controls', this.controls);
  5674. }
  5675. },
  5676. watch: {
  5677. value: function value(_value) {
  5678. this.dispatch('ElFormItem', 'el.form.change', _value);
  5679. }
  5680. }
  5681. });
  5682. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js&
  5683. /* harmony default export */ var src_checkboxvue_type_script_lang_js_ = (checkboxvue_type_script_lang_js_);
  5684. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
  5685. /* normalize component */
  5686. var checkbox_component = normalizeComponent(
  5687. src_checkboxvue_type_script_lang_js_,
  5688. checkboxvue_type_template_id_d0387074_render,
  5689. checkboxvue_type_template_id_d0387074_staticRenderFns,
  5690. false,
  5691. null,
  5692. null,
  5693. null
  5694. )
  5695. /* hot reload */
  5696. if (false) { var checkbox_api; }
  5697. checkbox_component.options.__file = "packages/checkbox/src/checkbox.vue"
  5698. /* harmony default export */ var src_checkbox = (checkbox_component.exports);
  5699. // CONCATENATED MODULE: ./packages/checkbox/index.js
  5700. /* istanbul ignore next */
  5701. src_checkbox.install = function (Vue) {
  5702. Vue.component(src_checkbox.name, src_checkbox);
  5703. };
  5704. /* harmony default export */ var packages_checkbox = (src_checkbox);
  5705. // 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&
  5706. var checkbox_buttonvue_type_template_id_478e906e_render = function() {
  5707. var _vm = this
  5708. var _h = _vm.$createElement
  5709. var _c = _vm._self._c || _h
  5710. return _c(
  5711. "label",
  5712. {
  5713. staticClass: "el-checkbox-button",
  5714. class: [
  5715. _vm.size ? "el-checkbox-button--" + _vm.size : "",
  5716. { "is-disabled": _vm.isDisabled },
  5717. { "is-checked": _vm.isChecked },
  5718. { "is-focus": _vm.focus }
  5719. ],
  5720. attrs: {
  5721. role: "checkbox",
  5722. "aria-checked": _vm.isChecked,
  5723. "aria-disabled": _vm.isDisabled
  5724. }
  5725. },
  5726. [
  5727. _vm.trueLabel || _vm.falseLabel
  5728. ? _c("input", {
  5729. directives: [
  5730. {
  5731. name: "model",
  5732. rawName: "v-model",
  5733. value: _vm.model,
  5734. expression: "model"
  5735. }
  5736. ],
  5737. staticClass: "el-checkbox-button__original",
  5738. attrs: {
  5739. type: "checkbox",
  5740. name: _vm.name,
  5741. disabled: _vm.isDisabled,
  5742. "true-value": _vm.trueLabel,
  5743. "false-value": _vm.falseLabel
  5744. },
  5745. domProps: {
  5746. checked: Array.isArray(_vm.model)
  5747. ? _vm._i(_vm.model, null) > -1
  5748. : _vm._q(_vm.model, _vm.trueLabel)
  5749. },
  5750. on: {
  5751. change: [
  5752. function($event) {
  5753. var $$a = _vm.model,
  5754. $$el = $event.target,
  5755. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5756. if (Array.isArray($$a)) {
  5757. var $$v = null,
  5758. $$i = _vm._i($$a, $$v)
  5759. if ($$el.checked) {
  5760. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5761. } else {
  5762. $$i > -1 &&
  5763. (_vm.model = $$a
  5764. .slice(0, $$i)
  5765. .concat($$a.slice($$i + 1)))
  5766. }
  5767. } else {
  5768. _vm.model = $$c
  5769. }
  5770. },
  5771. _vm.handleChange
  5772. ],
  5773. focus: function($event) {
  5774. _vm.focus = true
  5775. },
  5776. blur: function($event) {
  5777. _vm.focus = false
  5778. }
  5779. }
  5780. })
  5781. : _c("input", {
  5782. directives: [
  5783. {
  5784. name: "model",
  5785. rawName: "v-model",
  5786. value: _vm.model,
  5787. expression: "model"
  5788. }
  5789. ],
  5790. staticClass: "el-checkbox-button__original",
  5791. attrs: {
  5792. type: "checkbox",
  5793. name: _vm.name,
  5794. disabled: _vm.isDisabled
  5795. },
  5796. domProps: {
  5797. value: _vm.label,
  5798. checked: Array.isArray(_vm.model)
  5799. ? _vm._i(_vm.model, _vm.label) > -1
  5800. : _vm.model
  5801. },
  5802. on: {
  5803. change: [
  5804. function($event) {
  5805. var $$a = _vm.model,
  5806. $$el = $event.target,
  5807. $$c = $$el.checked ? true : false
  5808. if (Array.isArray($$a)) {
  5809. var $$v = _vm.label,
  5810. $$i = _vm._i($$a, $$v)
  5811. if ($$el.checked) {
  5812. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5813. } else {
  5814. $$i > -1 &&
  5815. (_vm.model = $$a
  5816. .slice(0, $$i)
  5817. .concat($$a.slice($$i + 1)))
  5818. }
  5819. } else {
  5820. _vm.model = $$c
  5821. }
  5822. },
  5823. _vm.handleChange
  5824. ],
  5825. focus: function($event) {
  5826. _vm.focus = true
  5827. },
  5828. blur: function($event) {
  5829. _vm.focus = false
  5830. }
  5831. }
  5832. }),
  5833. _vm.$slots.default || _vm.label
  5834. ? _c(
  5835. "span",
  5836. {
  5837. staticClass: "el-checkbox-button__inner",
  5838. style: _vm.isChecked ? _vm.activeStyle : null
  5839. },
  5840. [_vm._t("default", [_vm._v(_vm._s(_vm.label))])],
  5841. 2
  5842. )
  5843. : _vm._e()
  5844. ]
  5845. )
  5846. }
  5847. var checkbox_buttonvue_type_template_id_478e906e_staticRenderFns = []
  5848. checkbox_buttonvue_type_template_id_478e906e_render._withStripped = true
  5849. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  5850. // 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&
  5851. //
  5852. //
  5853. //
  5854. //
  5855. //
  5856. //
  5857. //
  5858. //
  5859. //
  5860. //
  5861. //
  5862. //
  5863. //
  5864. //
  5865. //
  5866. //
  5867. //
  5868. //
  5869. //
  5870. //
  5871. //
  5872. //
  5873. //
  5874. //
  5875. //
  5876. //
  5877. //
  5878. //
  5879. //
  5880. //
  5881. //
  5882. //
  5883. //
  5884. //
  5885. //
  5886. //
  5887. //
  5888. //
  5889. //
  5890. //
  5891. //
  5892. //
  5893. //
  5894. //
  5895. //
  5896. /* harmony default export */ var checkbox_buttonvue_type_script_lang_js_ = ({
  5897. name: 'ElCheckboxButton',
  5898. mixins: [emitter_default.a],
  5899. inject: {
  5900. elForm: {
  5901. default: ''
  5902. },
  5903. elFormItem: {
  5904. default: ''
  5905. }
  5906. },
  5907. data: function data() {
  5908. return {
  5909. selfModel: false,
  5910. focus: false,
  5911. isLimitExceeded: false
  5912. };
  5913. },
  5914. props: {
  5915. value: {},
  5916. label: {},
  5917. disabled: Boolean,
  5918. checked: Boolean,
  5919. name: String,
  5920. trueLabel: [String, Number],
  5921. falseLabel: [String, Number]
  5922. },
  5923. computed: {
  5924. model: {
  5925. get: function get() {
  5926. return this._checkboxGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  5927. },
  5928. set: function set(val) {
  5929. if (this._checkboxGroup) {
  5930. this.isLimitExceeded = false;
  5931. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  5932. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  5933. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  5934. } else if (this.value !== undefined) {
  5935. this.$emit('input', val);
  5936. } else {
  5937. this.selfModel = val;
  5938. }
  5939. }
  5940. },
  5941. isChecked: function isChecked() {
  5942. if ({}.toString.call(this.model) === '[object Boolean]') {
  5943. return this.model;
  5944. } else if (Array.isArray(this.model)) {
  5945. return this.model.indexOf(this.label) > -1;
  5946. } else if (this.model !== null && this.model !== undefined) {
  5947. return this.model === this.trueLabel;
  5948. }
  5949. },
  5950. _checkboxGroup: function _checkboxGroup() {
  5951. var parent = this.$parent;
  5952. while (parent) {
  5953. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  5954. parent = parent.$parent;
  5955. } else {
  5956. return parent;
  5957. }
  5958. }
  5959. return false;
  5960. },
  5961. store: function store() {
  5962. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  5963. },
  5964. activeStyle: function activeStyle() {
  5965. return {
  5966. backgroundColor: this._checkboxGroup.fill || '',
  5967. borderColor: this._checkboxGroup.fill || '',
  5968. color: this._checkboxGroup.textColor || '',
  5969. 'box-shadow': '-1px 0 0 0 ' + this._checkboxGroup.fill
  5970. };
  5971. },
  5972. _elFormItemSize: function _elFormItemSize() {
  5973. return (this.elFormItem || {}).elFormItemSize;
  5974. },
  5975. size: function size() {
  5976. return this._checkboxGroup.checkboxGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5977. },
  5978. isDisabled: function isDisabled() {
  5979. return this._checkboxGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
  5980. }
  5981. },
  5982. methods: {
  5983. addToStore: function addToStore() {
  5984. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  5985. this.model.push(this.label);
  5986. } else {
  5987. this.model = this.trueLabel || true;
  5988. }
  5989. },
  5990. handleChange: function handleChange(ev) {
  5991. var _this = this;
  5992. if (this.isLimitExceeded) return;
  5993. var value = void 0;
  5994. if (ev.target.checked) {
  5995. value = this.trueLabel === undefined ? true : this.trueLabel;
  5996. } else {
  5997. value = this.falseLabel === undefined ? false : this.falseLabel;
  5998. }
  5999. this.$emit('change', value, ev);
  6000. this.$nextTick(function () {
  6001. if (_this._checkboxGroup) {
  6002. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  6003. }
  6004. });
  6005. }
  6006. },
  6007. created: function created() {
  6008. this.checked && this.addToStore();
  6009. }
  6010. });
  6011. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  6012. /* harmony default export */ var src_checkbox_buttonvue_type_script_lang_js_ = (checkbox_buttonvue_type_script_lang_js_);
  6013. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue
  6014. /* normalize component */
  6015. var checkbox_button_component = normalizeComponent(
  6016. src_checkbox_buttonvue_type_script_lang_js_,
  6017. checkbox_buttonvue_type_template_id_478e906e_render,
  6018. checkbox_buttonvue_type_template_id_478e906e_staticRenderFns,
  6019. false,
  6020. null,
  6021. null,
  6022. null
  6023. )
  6024. /* hot reload */
  6025. if (false) { var checkbox_button_api; }
  6026. checkbox_button_component.options.__file = "packages/checkbox/src/checkbox-button.vue"
  6027. /* harmony default export */ var checkbox_button = (checkbox_button_component.exports);
  6028. // CONCATENATED MODULE: ./packages/checkbox-button/index.js
  6029. /* istanbul ignore next */
  6030. checkbox_button.install = function (Vue) {
  6031. Vue.component(checkbox_button.name, checkbox_button);
  6032. };
  6033. /* harmony default export */ var packages_checkbox_button = (checkbox_button);
  6034. // 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&
  6035. var checkbox_groupvue_type_template_id_7289a290_render = function() {
  6036. var _vm = this
  6037. var _h = _vm.$createElement
  6038. var _c = _vm._self._c || _h
  6039. return _c(
  6040. "div",
  6041. {
  6042. staticClass: "el-checkbox-group",
  6043. attrs: { role: "group", "aria-label": "checkbox-group" }
  6044. },
  6045. [_vm._t("default")],
  6046. 2
  6047. )
  6048. }
  6049. var checkbox_groupvue_type_template_id_7289a290_staticRenderFns = []
  6050. checkbox_groupvue_type_template_id_7289a290_render._withStripped = true
  6051. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=template&id=7289a290&
  6052. // 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&
  6053. /* harmony default export */ var checkbox_groupvue_type_script_lang_js_ = ({
  6054. name: 'ElCheckboxGroup',
  6055. componentName: 'ElCheckboxGroup',
  6056. mixins: [emitter_default.a],
  6057. inject: {
  6058. elFormItem: {
  6059. default: ''
  6060. }
  6061. },
  6062. props: {
  6063. value: {},
  6064. disabled: Boolean,
  6065. min: Number,
  6066. max: Number,
  6067. size: String,
  6068. fill: String,
  6069. textColor: String
  6070. },
  6071. computed: {
  6072. _elFormItemSize: function _elFormItemSize() {
  6073. return (this.elFormItem || {}).elFormItemSize;
  6074. },
  6075. checkboxGroupSize: function checkboxGroupSize() {
  6076. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  6077. }
  6078. },
  6079. watch: {
  6080. value: function value(_value) {
  6081. this.dispatch('ElFormItem', 'el.form.change', [_value]);
  6082. }
  6083. }
  6084. });
  6085. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=script&lang=js&
  6086. /* harmony default export */ var src_checkbox_groupvue_type_script_lang_js_ = (checkbox_groupvue_type_script_lang_js_);
  6087. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue
  6088. /* normalize component */
  6089. var checkbox_group_component = normalizeComponent(
  6090. src_checkbox_groupvue_type_script_lang_js_,
  6091. checkbox_groupvue_type_template_id_7289a290_render,
  6092. checkbox_groupvue_type_template_id_7289a290_staticRenderFns,
  6093. false,
  6094. null,
  6095. null,
  6096. null
  6097. )
  6098. /* hot reload */
  6099. if (false) { var checkbox_group_api; }
  6100. checkbox_group_component.options.__file = "packages/checkbox/src/checkbox-group.vue"
  6101. /* harmony default export */ var checkbox_group = (checkbox_group_component.exports);
  6102. // CONCATENATED MODULE: ./packages/checkbox-group/index.js
  6103. /* istanbul ignore next */
  6104. checkbox_group.install = function (Vue) {
  6105. Vue.component(checkbox_group.name, checkbox_group);
  6106. };
  6107. /* harmony default export */ var packages_checkbox_group = (checkbox_group);
  6108. // 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&
  6109. var componentvue_type_template_id_2dcd8fbb_render = function() {
  6110. var _vm = this
  6111. var _h = _vm.$createElement
  6112. var _c = _vm._self._c || _h
  6113. return _c(
  6114. "div",
  6115. {
  6116. staticClass: "el-switch",
  6117. class: { "is-disabled": _vm.switchDisabled, "is-checked": _vm.checked },
  6118. attrs: {
  6119. role: "switch",
  6120. "aria-checked": _vm.checked,
  6121. "aria-disabled": _vm.switchDisabled
  6122. },
  6123. on: { click: _vm.switchValue }
  6124. },
  6125. [
  6126. _c("input", {
  6127. ref: "input",
  6128. staticClass: "el-switch__input",
  6129. attrs: {
  6130. type: "checkbox",
  6131. id: _vm.id,
  6132. name: _vm.name,
  6133. "true-value": _vm.activeValue,
  6134. "false-value": _vm.inactiveValue,
  6135. disabled: _vm.switchDisabled
  6136. },
  6137. on: {
  6138. change: _vm.handleChange,
  6139. keydown: function($event) {
  6140. if (
  6141. !("button" in $event) &&
  6142. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6143. ) {
  6144. return null
  6145. }
  6146. return _vm.switchValue($event)
  6147. }
  6148. }
  6149. }),
  6150. _vm.inactiveIconClass || _vm.inactiveText
  6151. ? _c(
  6152. "span",
  6153. {
  6154. class: [
  6155. "el-switch__label",
  6156. "el-switch__label--left",
  6157. !_vm.checked ? "is-active" : ""
  6158. ]
  6159. },
  6160. [
  6161. _vm.inactiveIconClass
  6162. ? _c("i", { class: [_vm.inactiveIconClass] })
  6163. : _vm._e(),
  6164. !_vm.inactiveIconClass && _vm.inactiveText
  6165. ? _c("span", { attrs: { "aria-hidden": _vm.checked } }, [
  6166. _vm._v(_vm._s(_vm.inactiveText))
  6167. ])
  6168. : _vm._e()
  6169. ]
  6170. )
  6171. : _vm._e(),
  6172. _c("span", {
  6173. ref: "core",
  6174. staticClass: "el-switch__core",
  6175. style: { width: _vm.coreWidth + "px" }
  6176. }),
  6177. _vm.activeIconClass || _vm.activeText
  6178. ? _c(
  6179. "span",
  6180. {
  6181. class: [
  6182. "el-switch__label",
  6183. "el-switch__label--right",
  6184. _vm.checked ? "is-active" : ""
  6185. ]
  6186. },
  6187. [
  6188. _vm.activeIconClass
  6189. ? _c("i", { class: [_vm.activeIconClass] })
  6190. : _vm._e(),
  6191. !_vm.activeIconClass && _vm.activeText
  6192. ? _c("span", { attrs: { "aria-hidden": !_vm.checked } }, [
  6193. _vm._v(_vm._s(_vm.activeText))
  6194. ])
  6195. : _vm._e()
  6196. ]
  6197. )
  6198. : _vm._e()
  6199. ]
  6200. )
  6201. }
  6202. var componentvue_type_template_id_2dcd8fbb_staticRenderFns = []
  6203. componentvue_type_template_id_2dcd8fbb_render._withStripped = true
  6204. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  6205. // 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&
  6206. //
  6207. //
  6208. //
  6209. //
  6210. //
  6211. //
  6212. //
  6213. //
  6214. //
  6215. //
  6216. //
  6217. //
  6218. //
  6219. //
  6220. //
  6221. //
  6222. //
  6223. //
  6224. //
  6225. //
  6226. //
  6227. //
  6228. //
  6229. //
  6230. //
  6231. //
  6232. //
  6233. //
  6234. //
  6235. //
  6236. //
  6237. //
  6238. //
  6239. //
  6240. //
  6241. //
  6242. //
  6243. /* harmony default export */ var switch_src_componentvue_type_script_lang_js_ = ({
  6244. name: 'ElSwitch',
  6245. mixins: [focus_default()('input'), migrating_default.a, emitter_default.a],
  6246. inject: {
  6247. elForm: {
  6248. default: ''
  6249. }
  6250. },
  6251. props: {
  6252. value: {
  6253. type: [Boolean, String, Number],
  6254. default: false
  6255. },
  6256. disabled: {
  6257. type: Boolean,
  6258. default: false
  6259. },
  6260. width: {
  6261. type: Number,
  6262. default: 40
  6263. },
  6264. activeIconClass: {
  6265. type: String,
  6266. default: ''
  6267. },
  6268. inactiveIconClass: {
  6269. type: String,
  6270. default: ''
  6271. },
  6272. activeText: String,
  6273. inactiveText: String,
  6274. activeColor: {
  6275. type: String,
  6276. default: ''
  6277. },
  6278. inactiveColor: {
  6279. type: String,
  6280. default: ''
  6281. },
  6282. activeValue: {
  6283. type: [Boolean, String, Number],
  6284. default: true
  6285. },
  6286. inactiveValue: {
  6287. type: [Boolean, String, Number],
  6288. default: false
  6289. },
  6290. name: {
  6291. type: String,
  6292. default: ''
  6293. },
  6294. validateEvent: {
  6295. type: Boolean,
  6296. default: true
  6297. },
  6298. id: String
  6299. },
  6300. data: function data() {
  6301. return {
  6302. coreWidth: this.width
  6303. };
  6304. },
  6305. created: function created() {
  6306. if (!~[this.activeValue, this.inactiveValue].indexOf(this.value)) {
  6307. this.$emit('input', this.inactiveValue);
  6308. }
  6309. },
  6310. computed: {
  6311. checked: function checked() {
  6312. return this.value === this.activeValue;
  6313. },
  6314. switchDisabled: function switchDisabled() {
  6315. return this.disabled || (this.elForm || {}).disabled;
  6316. }
  6317. },
  6318. watch: {
  6319. checked: function checked() {
  6320. this.$refs.input.checked = this.checked;
  6321. if (this.activeColor || this.inactiveColor) {
  6322. this.setBackgroundColor();
  6323. }
  6324. if (this.validateEvent) {
  6325. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  6326. }
  6327. }
  6328. },
  6329. methods: {
  6330. handleChange: function handleChange(event) {
  6331. var _this = this;
  6332. var val = this.checked ? this.inactiveValue : this.activeValue;
  6333. this.$emit('input', val);
  6334. this.$emit('change', val);
  6335. this.$nextTick(function () {
  6336. // set input's checked property
  6337. // in case parent refuses to change component's value
  6338. _this.$refs.input.checked = _this.checked;
  6339. });
  6340. },
  6341. setBackgroundColor: function setBackgroundColor() {
  6342. var newColor = this.checked ? this.activeColor : this.inactiveColor;
  6343. this.$refs.core.style.borderColor = newColor;
  6344. this.$refs.core.style.backgroundColor = newColor;
  6345. },
  6346. switchValue: function switchValue() {
  6347. !this.switchDisabled && this.handleChange();
  6348. },
  6349. getMigratingConfig: function getMigratingConfig() {
  6350. return {
  6351. props: {
  6352. 'on-color': 'on-color is renamed to active-color.',
  6353. 'off-color': 'off-color is renamed to inactive-color.',
  6354. 'on-text': 'on-text is renamed to active-text.',
  6355. 'off-text': 'off-text is renamed to inactive-text.',
  6356. 'on-value': 'on-value is renamed to active-value.',
  6357. 'off-value': 'off-value is renamed to inactive-value.',
  6358. 'on-icon-class': 'on-icon-class is renamed to active-icon-class.',
  6359. 'off-icon-class': 'off-icon-class is renamed to inactive-icon-class.'
  6360. }
  6361. };
  6362. }
  6363. },
  6364. mounted: function mounted() {
  6365. /* istanbul ignore if */
  6366. this.coreWidth = this.width || 40;
  6367. if (this.activeColor || this.inactiveColor) {
  6368. this.setBackgroundColor();
  6369. }
  6370. this.$refs.input.checked = this.checked;
  6371. }
  6372. });
  6373. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=script&lang=js&
  6374. /* harmony default export */ var packages_switch_src_componentvue_type_script_lang_js_ = (switch_src_componentvue_type_script_lang_js_);
  6375. // CONCATENATED MODULE: ./packages/switch/src/component.vue
  6376. /* normalize component */
  6377. var src_component_component = normalizeComponent(
  6378. packages_switch_src_componentvue_type_script_lang_js_,
  6379. componentvue_type_template_id_2dcd8fbb_render,
  6380. componentvue_type_template_id_2dcd8fbb_staticRenderFns,
  6381. false,
  6382. null,
  6383. null,
  6384. null
  6385. )
  6386. /* hot reload */
  6387. if (false) { var src_component_api; }
  6388. src_component_component.options.__file = "packages/switch/src/component.vue"
  6389. /* harmony default export */ var switch_src_component = (src_component_component.exports);
  6390. // CONCATENATED MODULE: ./packages/switch/index.js
  6391. /* istanbul ignore next */
  6392. switch_src_component.install = function (Vue) {
  6393. Vue.component(switch_src_component.name, switch_src_component);
  6394. };
  6395. /* harmony default export */ var packages_switch = (switch_src_component);
  6396. // 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&
  6397. var selectvue_type_template_id_0e4aade6_render = function() {
  6398. var _vm = this
  6399. var _h = _vm.$createElement
  6400. var _c = _vm._self._c || _h
  6401. return _c(
  6402. "div",
  6403. {
  6404. directives: [
  6405. {
  6406. name: "clickoutside",
  6407. rawName: "v-clickoutside",
  6408. value: _vm.handleClose,
  6409. expression: "handleClose"
  6410. }
  6411. ],
  6412. staticClass: "el-select",
  6413. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  6414. on: {
  6415. click: function($event) {
  6416. $event.stopPropagation()
  6417. return _vm.toggleMenu($event)
  6418. }
  6419. }
  6420. },
  6421. [
  6422. _vm.multiple
  6423. ? _c(
  6424. "div",
  6425. {
  6426. ref: "tags",
  6427. staticClass: "el-select__tags",
  6428. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  6429. },
  6430. [
  6431. _vm.collapseTags && _vm.selected.length
  6432. ? _c(
  6433. "span",
  6434. [
  6435. _c(
  6436. "el-tag",
  6437. {
  6438. attrs: {
  6439. closable: !_vm.selectDisabled,
  6440. size: _vm.collapseTagSize,
  6441. hit: _vm.selected[0].hitState,
  6442. type: "info",
  6443. "disable-transitions": ""
  6444. },
  6445. on: {
  6446. close: function($event) {
  6447. _vm.deleteTag($event, _vm.selected[0])
  6448. }
  6449. }
  6450. },
  6451. [
  6452. _c("span", { staticClass: "el-select__tags-text" }, [
  6453. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  6454. ])
  6455. ]
  6456. ),
  6457. _vm.selected.length > 1
  6458. ? _c(
  6459. "el-tag",
  6460. {
  6461. attrs: {
  6462. closable: false,
  6463. size: _vm.collapseTagSize,
  6464. type: "info",
  6465. "disable-transitions": ""
  6466. }
  6467. },
  6468. [
  6469. _c(
  6470. "span",
  6471. { staticClass: "el-select__tags-text" },
  6472. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  6473. )
  6474. ]
  6475. )
  6476. : _vm._e()
  6477. ],
  6478. 1
  6479. )
  6480. : _vm._e(),
  6481. !_vm.collapseTags
  6482. ? _c(
  6483. "transition-group",
  6484. { on: { "after-leave": _vm.resetInputHeight } },
  6485. _vm._l(_vm.selected, function(item) {
  6486. return _c(
  6487. "el-tag",
  6488. {
  6489. key: _vm.getValueKey(item),
  6490. attrs: {
  6491. closable: !_vm.selectDisabled,
  6492. size: _vm.collapseTagSize,
  6493. hit: item.hitState,
  6494. type: "info",
  6495. "disable-transitions": ""
  6496. },
  6497. on: {
  6498. close: function($event) {
  6499. _vm.deleteTag($event, item)
  6500. }
  6501. }
  6502. },
  6503. [
  6504. _c("span", { staticClass: "el-select__tags-text" }, [
  6505. _vm._v(_vm._s(item.currentLabel))
  6506. ])
  6507. ]
  6508. )
  6509. }),
  6510. 1
  6511. )
  6512. : _vm._e(),
  6513. _vm.filterable
  6514. ? _c("input", {
  6515. directives: [
  6516. {
  6517. name: "model",
  6518. rawName: "v-model",
  6519. value: _vm.query,
  6520. expression: "query"
  6521. }
  6522. ],
  6523. ref: "input",
  6524. staticClass: "el-select__input",
  6525. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  6526. style: {
  6527. "flex-grow": "1",
  6528. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  6529. "max-width": _vm.inputWidth - 42 + "px"
  6530. },
  6531. attrs: {
  6532. type: "text",
  6533. disabled: _vm.selectDisabled,
  6534. autocomplete: _vm.autoComplete || _vm.autocomplete
  6535. },
  6536. domProps: { value: _vm.query },
  6537. on: {
  6538. focus: _vm.handleFocus,
  6539. blur: function($event) {
  6540. _vm.softFocus = false
  6541. },
  6542. click: function($event) {
  6543. $event.stopPropagation()
  6544. },
  6545. keyup: _vm.managePlaceholder,
  6546. keydown: [
  6547. _vm.resetInputState,
  6548. function($event) {
  6549. if (
  6550. !("button" in $event) &&
  6551. _vm._k($event.keyCode, "down", 40, $event.key, [
  6552. "Down",
  6553. "ArrowDown"
  6554. ])
  6555. ) {
  6556. return null
  6557. }
  6558. $event.preventDefault()
  6559. _vm.navigateOptions("next")
  6560. },
  6561. function($event) {
  6562. if (
  6563. !("button" in $event) &&
  6564. _vm._k($event.keyCode, "up", 38, $event.key, [
  6565. "Up",
  6566. "ArrowUp"
  6567. ])
  6568. ) {
  6569. return null
  6570. }
  6571. $event.preventDefault()
  6572. _vm.navigateOptions("prev")
  6573. },
  6574. function($event) {
  6575. if (
  6576. !("button" in $event) &&
  6577. _vm._k(
  6578. $event.keyCode,
  6579. "enter",
  6580. 13,
  6581. $event.key,
  6582. "Enter"
  6583. )
  6584. ) {
  6585. return null
  6586. }
  6587. $event.preventDefault()
  6588. return _vm.selectOption($event)
  6589. },
  6590. function($event) {
  6591. if (
  6592. !("button" in $event) &&
  6593. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6594. "Esc",
  6595. "Escape"
  6596. ])
  6597. ) {
  6598. return null
  6599. }
  6600. $event.stopPropagation()
  6601. $event.preventDefault()
  6602. _vm.visible = false
  6603. },
  6604. function($event) {
  6605. if (
  6606. !("button" in $event) &&
  6607. _vm._k(
  6608. $event.keyCode,
  6609. "delete",
  6610. [8, 46],
  6611. $event.key,
  6612. ["Backspace", "Delete", "Del"]
  6613. )
  6614. ) {
  6615. return null
  6616. }
  6617. return _vm.deletePrevTag($event)
  6618. }
  6619. ],
  6620. compositionstart: _vm.handleComposition,
  6621. compositionupdate: _vm.handleComposition,
  6622. compositionend: _vm.handleComposition,
  6623. input: [
  6624. function($event) {
  6625. if ($event.target.composing) {
  6626. return
  6627. }
  6628. _vm.query = $event.target.value
  6629. },
  6630. _vm.debouncedQueryChange
  6631. ]
  6632. }
  6633. })
  6634. : _vm._e()
  6635. ],
  6636. 1
  6637. )
  6638. : _vm._e(),
  6639. _c(
  6640. "el-input",
  6641. {
  6642. ref: "reference",
  6643. class: { "is-focus": _vm.visible },
  6644. attrs: {
  6645. type: "text",
  6646. placeholder: _vm.currentPlaceholder,
  6647. name: _vm.name,
  6648. id: _vm.id,
  6649. autocomplete: _vm.autoComplete || _vm.autocomplete,
  6650. size: _vm.selectSize,
  6651. disabled: _vm.selectDisabled,
  6652. readonly: _vm.readonly,
  6653. "validate-event": false
  6654. },
  6655. on: { focus: _vm.handleFocus, blur: _vm.handleBlur },
  6656. nativeOn: {
  6657. keyup: function($event) {
  6658. return _vm.debouncedOnInputChange($event)
  6659. },
  6660. keydown: [
  6661. function($event) {
  6662. if (
  6663. !("button" in $event) &&
  6664. _vm._k($event.keyCode, "down", 40, $event.key, [
  6665. "Down",
  6666. "ArrowDown"
  6667. ])
  6668. ) {
  6669. return null
  6670. }
  6671. $event.stopPropagation()
  6672. $event.preventDefault()
  6673. _vm.navigateOptions("next")
  6674. },
  6675. function($event) {
  6676. if (
  6677. !("button" in $event) &&
  6678. _vm._k($event.keyCode, "up", 38, $event.key, [
  6679. "Up",
  6680. "ArrowUp"
  6681. ])
  6682. ) {
  6683. return null
  6684. }
  6685. $event.stopPropagation()
  6686. $event.preventDefault()
  6687. _vm.navigateOptions("prev")
  6688. },
  6689. function($event) {
  6690. if (
  6691. !("button" in $event) &&
  6692. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6693. ) {
  6694. return null
  6695. }
  6696. $event.preventDefault()
  6697. return _vm.selectOption($event)
  6698. },
  6699. function($event) {
  6700. if (
  6701. !("button" in $event) &&
  6702. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6703. "Esc",
  6704. "Escape"
  6705. ])
  6706. ) {
  6707. return null
  6708. }
  6709. $event.stopPropagation()
  6710. $event.preventDefault()
  6711. _vm.visible = false
  6712. },
  6713. function($event) {
  6714. if (
  6715. !("button" in $event) &&
  6716. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  6717. ) {
  6718. return null
  6719. }
  6720. _vm.visible = false
  6721. }
  6722. ],
  6723. paste: function($event) {
  6724. return _vm.debouncedOnInputChange($event)
  6725. },
  6726. mouseenter: function($event) {
  6727. _vm.inputHovering = true
  6728. },
  6729. mouseleave: function($event) {
  6730. _vm.inputHovering = false
  6731. }
  6732. },
  6733. model: {
  6734. value: _vm.selectedLabel,
  6735. callback: function($$v) {
  6736. _vm.selectedLabel = $$v
  6737. },
  6738. expression: "selectedLabel"
  6739. }
  6740. },
  6741. [
  6742. _vm.$slots.prefix
  6743. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  6744. : _vm._e(),
  6745. _c("template", { slot: "suffix" }, [
  6746. _c("i", {
  6747. directives: [
  6748. {
  6749. name: "show",
  6750. rawName: "v-show",
  6751. value: !_vm.showClose,
  6752. expression: "!showClose"
  6753. }
  6754. ],
  6755. class: [
  6756. "el-select__caret",
  6757. "el-input__icon",
  6758. "el-icon-" + _vm.iconClass
  6759. ]
  6760. }),
  6761. _vm.showClose
  6762. ? _c("i", {
  6763. staticClass:
  6764. "el-select__caret el-input__icon el-icon-circle-close",
  6765. on: { click: _vm.handleClearClick }
  6766. })
  6767. : _vm._e()
  6768. ])
  6769. ],
  6770. 2
  6771. ),
  6772. _c(
  6773. "transition",
  6774. {
  6775. attrs: { name: "el-zoom-in-top" },
  6776. on: {
  6777. "before-enter": _vm.handleMenuEnter,
  6778. "after-leave": _vm.doDestroy
  6779. }
  6780. },
  6781. [
  6782. _c(
  6783. "el-select-menu",
  6784. {
  6785. directives: [
  6786. {
  6787. name: "show",
  6788. rawName: "v-show",
  6789. value: _vm.visible && _vm.emptyText !== false,
  6790. expression: "visible && emptyText !== false"
  6791. }
  6792. ],
  6793. ref: "popper",
  6794. attrs: { "append-to-body": _vm.popperAppendToBody }
  6795. },
  6796. [
  6797. _c(
  6798. "el-scrollbar",
  6799. {
  6800. directives: [
  6801. {
  6802. name: "show",
  6803. rawName: "v-show",
  6804. value: _vm.options.length > 0 && !_vm.loading,
  6805. expression: "options.length > 0 && !loading"
  6806. }
  6807. ],
  6808. ref: "scrollbar",
  6809. class: {
  6810. "is-empty":
  6811. !_vm.allowCreate &&
  6812. _vm.query &&
  6813. _vm.filteredOptionsCount === 0
  6814. },
  6815. attrs: {
  6816. tag: "ul",
  6817. "wrap-class": "el-select-dropdown__wrap",
  6818. "view-class": "el-select-dropdown__list"
  6819. }
  6820. },
  6821. [
  6822. _vm.showNewOption
  6823. ? _c("el-option", {
  6824. attrs: { value: _vm.query, created: "" }
  6825. })
  6826. : _vm._e(),
  6827. _vm._t("default")
  6828. ],
  6829. 2
  6830. ),
  6831. _vm.emptyText &&
  6832. (!_vm.allowCreate ||
  6833. _vm.loading ||
  6834. (_vm.allowCreate && _vm.options.length === 0))
  6835. ? [
  6836. _vm.$slots.empty
  6837. ? _vm._t("empty")
  6838. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  6839. _vm._v(
  6840. "\n " +
  6841. _vm._s(_vm.emptyText) +
  6842. "\n "
  6843. )
  6844. ])
  6845. ]
  6846. : _vm._e()
  6847. ],
  6848. 2
  6849. )
  6850. ],
  6851. 1
  6852. )
  6853. ],
  6854. 1
  6855. )
  6856. }
  6857. var selectvue_type_template_id_0e4aade6_staticRenderFns = []
  6858. selectvue_type_template_id_0e4aade6_render._withStripped = true
  6859. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  6860. // 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&
  6861. var select_dropdownvue_type_template_id_06828748_render = function() {
  6862. var _vm = this
  6863. var _h = _vm.$createElement
  6864. var _c = _vm._self._c || _h
  6865. return _c(
  6866. "div",
  6867. {
  6868. staticClass: "el-select-dropdown el-popper",
  6869. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  6870. style: { minWidth: _vm.minWidth }
  6871. },
  6872. [_vm._t("default")],
  6873. 2
  6874. )
  6875. }
  6876. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  6877. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  6878. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  6879. // 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&
  6880. //
  6881. //
  6882. //
  6883. //
  6884. //
  6885. //
  6886. //
  6887. //
  6888. //
  6889. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  6890. name: 'ElSelectDropdown',
  6891. componentName: 'ElSelectDropdown',
  6892. mixins: [vue_popper_default.a],
  6893. props: {
  6894. placement: {
  6895. default: 'bottom-start'
  6896. },
  6897. boundariesPadding: {
  6898. default: 0
  6899. },
  6900. popperOptions: {
  6901. default: function _default() {
  6902. return {
  6903. gpuAcceleration: false
  6904. };
  6905. }
  6906. },
  6907. visibleArrow: {
  6908. default: true
  6909. },
  6910. appendToBody: {
  6911. type: Boolean,
  6912. default: true
  6913. }
  6914. },
  6915. data: function data() {
  6916. return {
  6917. minWidth: ''
  6918. };
  6919. },
  6920. computed: {
  6921. popperClass: function popperClass() {
  6922. return this.$parent.popperClass;
  6923. }
  6924. },
  6925. watch: {
  6926. '$parent.inputWidth': function $parentInputWidth() {
  6927. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  6928. }
  6929. },
  6930. mounted: function mounted() {
  6931. var _this = this;
  6932. this.referenceElm = this.$parent.$refs.reference.$el;
  6933. this.$parent.popperElm = this.popperElm = this.$el;
  6934. this.$on('updatePopper', function () {
  6935. if (_this.$parent.visible) _this.updatePopper();
  6936. });
  6937. this.$on('destroyPopper', this.destroyPopper);
  6938. }
  6939. });
  6940. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  6941. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  6942. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  6943. /* normalize component */
  6944. var select_dropdown_component = normalizeComponent(
  6945. src_select_dropdownvue_type_script_lang_js_,
  6946. select_dropdownvue_type_template_id_06828748_render,
  6947. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  6948. false,
  6949. null,
  6950. null,
  6951. null
  6952. )
  6953. /* hot reload */
  6954. if (false) { var select_dropdown_api; }
  6955. select_dropdown_component.options.__file = "packages/select/src/select-dropdown.vue"
  6956. /* harmony default export */ var select_dropdown = (select_dropdown_component.exports);
  6957. // 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&
  6958. var optionvue_type_template_id_7a44c642_render = function() {
  6959. var _vm = this
  6960. var _h = _vm.$createElement
  6961. var _c = _vm._self._c || _h
  6962. return _c(
  6963. "li",
  6964. {
  6965. directives: [
  6966. {
  6967. name: "show",
  6968. rawName: "v-show",
  6969. value: _vm.visible,
  6970. expression: "visible"
  6971. }
  6972. ],
  6973. staticClass: "el-select-dropdown__item",
  6974. class: {
  6975. selected: _vm.itemSelected,
  6976. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  6977. hover: _vm.hover
  6978. },
  6979. on: {
  6980. mouseenter: _vm.hoverItem,
  6981. click: function($event) {
  6982. $event.stopPropagation()
  6983. return _vm.selectOptionClick($event)
  6984. }
  6985. }
  6986. },
  6987. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  6988. 2
  6989. )
  6990. }
  6991. var optionvue_type_template_id_7a44c642_staticRenderFns = []
  6992. optionvue_type_template_id_7a44c642_render._withStripped = true
  6993. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  6994. // 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&
  6995. 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; };
  6996. //
  6997. //
  6998. //
  6999. //
  7000. //
  7001. //
  7002. //
  7003. //
  7004. //
  7005. //
  7006. //
  7007. //
  7008. //
  7009. //
  7010. //
  7011. //
  7012. //
  7013. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  7014. mixins: [emitter_default.a],
  7015. name: 'ElOption',
  7016. componentName: 'ElOption',
  7017. inject: ['select'],
  7018. props: {
  7019. value: {
  7020. required: true
  7021. },
  7022. label: [String, Number],
  7023. created: Boolean,
  7024. disabled: {
  7025. type: Boolean,
  7026. default: false
  7027. }
  7028. },
  7029. data: function data() {
  7030. return {
  7031. index: -1,
  7032. groupDisabled: false,
  7033. visible: true,
  7034. hitState: false,
  7035. hover: false
  7036. };
  7037. },
  7038. computed: {
  7039. isObject: function isObject() {
  7040. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  7041. },
  7042. currentLabel: function currentLabel() {
  7043. return this.label || (this.isObject ? '' : this.value);
  7044. },
  7045. currentValue: function currentValue() {
  7046. return this.value || this.label || '';
  7047. },
  7048. itemSelected: function itemSelected() {
  7049. if (!this.select.multiple) {
  7050. return this.isEqual(this.value, this.select.value);
  7051. } else {
  7052. return this.contains(this.select.value, this.value);
  7053. }
  7054. },
  7055. limitReached: function limitReached() {
  7056. if (this.select.multiple) {
  7057. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  7058. } else {
  7059. return false;
  7060. }
  7061. }
  7062. },
  7063. watch: {
  7064. currentLabel: function currentLabel() {
  7065. if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
  7066. },
  7067. value: function value(val, oldVal) {
  7068. var _select = this.select,
  7069. remote = _select.remote,
  7070. valueKey = _select.valueKey;
  7071. if (!this.created && !remote) {
  7072. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  7073. return;
  7074. }
  7075. this.dispatch('ElSelect', 'setSelected');
  7076. }
  7077. }
  7078. },
  7079. methods: {
  7080. isEqual: function isEqual(a, b) {
  7081. if (!this.isObject) {
  7082. return a === b;
  7083. } else {
  7084. var valueKey = this.select.valueKey;
  7085. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  7086. }
  7087. },
  7088. contains: function contains() {
  7089. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7090. var target = arguments[1];
  7091. if (!this.isObject) {
  7092. return arr && arr.indexOf(target) > -1;
  7093. } else {
  7094. var valueKey = this.select.valueKey;
  7095. return arr && arr.some(function (item) {
  7096. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  7097. });
  7098. }
  7099. },
  7100. handleGroupDisabled: function handleGroupDisabled(val) {
  7101. this.groupDisabled = val;
  7102. },
  7103. hoverItem: function hoverItem() {
  7104. if (!this.disabled && !this.groupDisabled) {
  7105. this.select.hoverIndex = this.select.options.indexOf(this);
  7106. }
  7107. },
  7108. selectOptionClick: function selectOptionClick() {
  7109. if (this.disabled !== true && this.groupDisabled !== true) {
  7110. this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
  7111. }
  7112. },
  7113. queryChange: function queryChange(query) {
  7114. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  7115. if (!this.visible) {
  7116. this.select.filteredOptionsCount--;
  7117. }
  7118. }
  7119. },
  7120. created: function created() {
  7121. this.select.options.push(this);
  7122. this.select.cachedOptions.push(this);
  7123. this.select.optionsCount++;
  7124. this.select.filteredOptionsCount++;
  7125. this.$on('queryChange', this.queryChange);
  7126. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  7127. },
  7128. beforeDestroy: function beforeDestroy() {
  7129. this.select.onOptionDestroy(this.select.options.indexOf(this));
  7130. }
  7131. });
  7132. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  7133. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  7134. // CONCATENATED MODULE: ./packages/select/src/option.vue
  7135. /* normalize component */
  7136. var option_component = normalizeComponent(
  7137. src_optionvue_type_script_lang_js_,
  7138. optionvue_type_template_id_7a44c642_render,
  7139. optionvue_type_template_id_7a44c642_staticRenderFns,
  7140. false,
  7141. null,
  7142. null,
  7143. null
  7144. )
  7145. /* hot reload */
  7146. if (false) { var option_api; }
  7147. option_component.options.__file = "packages/select/src/option.vue"
  7148. /* harmony default export */ var src_option = (option_component.exports);
  7149. // EXTERNAL MODULE: external "element-ui/lib/tag"
  7150. var tag_ = __webpack_require__(23);
  7151. var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
  7152. // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
  7153. var resize_event_ = __webpack_require__(13);
  7154. // EXTERNAL MODULE: external "element-ui/lib/locale"
  7155. var lib_locale_ = __webpack_require__(16);
  7156. var lib_locale_default = /*#__PURE__*/__webpack_require__.n(lib_locale_);
  7157. // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
  7158. var scroll_into_view_ = __webpack_require__(24);
  7159. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  7160. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  7161. /* harmony default export */ var navigation_mixin = ({
  7162. data: function data() {
  7163. return {
  7164. hoverOption: -1
  7165. };
  7166. },
  7167. computed: {
  7168. optionsAllDisabled: function optionsAllDisabled() {
  7169. return this.options.filter(function (option) {
  7170. return option.visible;
  7171. }).every(function (option) {
  7172. return option.disabled;
  7173. });
  7174. }
  7175. },
  7176. watch: {
  7177. hoverIndex: function hoverIndex(val) {
  7178. var _this = this;
  7179. if (typeof val === 'number' && val > -1) {
  7180. this.hoverOption = this.options[val] || {};
  7181. }
  7182. this.options.forEach(function (option) {
  7183. option.hover = _this.hoverOption === option;
  7184. });
  7185. }
  7186. },
  7187. methods: {
  7188. navigateOptions: function navigateOptions(direction) {
  7189. var _this2 = this;
  7190. if (!this.visible) {
  7191. this.visible = true;
  7192. return;
  7193. }
  7194. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  7195. if (!this.optionsAllDisabled) {
  7196. if (direction === 'next') {
  7197. this.hoverIndex++;
  7198. if (this.hoverIndex === this.options.length) {
  7199. this.hoverIndex = 0;
  7200. }
  7201. } else if (direction === 'prev') {
  7202. this.hoverIndex--;
  7203. if (this.hoverIndex < 0) {
  7204. this.hoverIndex = this.options.length - 1;
  7205. }
  7206. }
  7207. var option = this.options[this.hoverIndex];
  7208. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  7209. this.navigateOptions(direction);
  7210. }
  7211. this.$nextTick(function () {
  7212. return _this2.scrollToOption(_this2.hoverOption);
  7213. });
  7214. }
  7215. }
  7216. }
  7217. });
  7218. // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
  7219. var shared_ = __webpack_require__(28);
  7220. // 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&
  7221. //
  7222. //
  7223. //
  7224. //
  7225. //
  7226. //
  7227. //
  7228. //
  7229. //
  7230. //
  7231. //
  7232. //
  7233. //
  7234. //
  7235. //
  7236. //
  7237. //
  7238. //
  7239. //
  7240. //
  7241. //
  7242. //
  7243. //
  7244. //
  7245. //
  7246. //
  7247. //
  7248. //
  7249. //
  7250. //
  7251. //
  7252. //
  7253. //
  7254. //
  7255. //
  7256. //
  7257. //
  7258. //
  7259. //
  7260. //
  7261. //
  7262. //
  7263. //
  7264. //
  7265. //
  7266. //
  7267. //
  7268. //
  7269. //
  7270. //
  7271. //
  7272. //
  7273. //
  7274. //
  7275. //
  7276. //
  7277. //
  7278. //
  7279. //
  7280. //
  7281. //
  7282. //
  7283. //
  7284. //
  7285. //
  7286. //
  7287. //
  7288. //
  7289. //
  7290. //
  7291. //
  7292. //
  7293. //
  7294. //
  7295. //
  7296. //
  7297. //
  7298. //
  7299. //
  7300. //
  7301. //
  7302. //
  7303. //
  7304. //
  7305. //
  7306. //
  7307. //
  7308. //
  7309. //
  7310. //
  7311. //
  7312. //
  7313. //
  7314. //
  7315. //
  7316. //
  7317. //
  7318. //
  7319. //
  7320. //
  7321. //
  7322. //
  7323. //
  7324. //
  7325. //
  7326. //
  7327. //
  7328. //
  7329. //
  7330. //
  7331. //
  7332. //
  7333. //
  7334. //
  7335. //
  7336. //
  7337. //
  7338. //
  7339. //
  7340. //
  7341. //
  7342. //
  7343. //
  7344. //
  7345. //
  7346. //
  7347. //
  7348. //
  7349. //
  7350. //
  7351. //
  7352. //
  7353. //
  7354. //
  7355. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  7356. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  7357. name: 'ElSelect',
  7358. componentName: 'ElSelect',
  7359. inject: {
  7360. elForm: {
  7361. default: ''
  7362. },
  7363. elFormItem: {
  7364. default: ''
  7365. }
  7366. },
  7367. provide: function provide() {
  7368. return {
  7369. 'select': this
  7370. };
  7371. },
  7372. computed: {
  7373. _elFormItemSize: function _elFormItemSize() {
  7374. return (this.elFormItem || {}).elFormItemSize;
  7375. },
  7376. readonly: function readonly() {
  7377. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  7378. },
  7379. showClose: function showClose() {
  7380. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  7381. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  7382. return criteria;
  7383. },
  7384. iconClass: function iconClass() {
  7385. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  7386. },
  7387. debounce: function debounce() {
  7388. return this.remote ? 300 : 0;
  7389. },
  7390. emptyText: function emptyText() {
  7391. if (this.loading) {
  7392. return this.loadingText || this.t('el.select.loading');
  7393. } else {
  7394. if (this.remote && this.query === '' && this.options.length === 0) return false;
  7395. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  7396. return this.noMatchText || this.t('el.select.noMatch');
  7397. }
  7398. if (this.options.length === 0) {
  7399. return this.noDataText || this.t('el.select.noData');
  7400. }
  7401. }
  7402. return null;
  7403. },
  7404. showNewOption: function showNewOption() {
  7405. var _this = this;
  7406. var hasExistingOption = this.options.filter(function (option) {
  7407. return !option.created;
  7408. }).some(function (option) {
  7409. return option.currentLabel === _this.query;
  7410. });
  7411. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  7412. },
  7413. selectSize: function selectSize() {
  7414. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  7415. },
  7416. selectDisabled: function selectDisabled() {
  7417. return this.disabled || (this.elForm || {}).disabled;
  7418. },
  7419. collapseTagSize: function collapseTagSize() {
  7420. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  7421. }
  7422. },
  7423. components: {
  7424. ElInput: input_default.a,
  7425. ElSelectMenu: select_dropdown,
  7426. ElOption: src_option,
  7427. ElTag: tag_default.a,
  7428. ElScrollbar: scrollbar_default.a
  7429. },
  7430. directives: { Clickoutside: clickoutside_default.a },
  7431. props: {
  7432. name: String,
  7433. id: String,
  7434. value: {
  7435. required: true
  7436. },
  7437. autocomplete: {
  7438. type: String,
  7439. default: 'off'
  7440. },
  7441. /** @Deprecated in next major version */
  7442. autoComplete: {
  7443. type: String,
  7444. validator: function validator(val) {
  7445. false && false;
  7446. return true;
  7447. }
  7448. },
  7449. automaticDropdown: Boolean,
  7450. size: String,
  7451. disabled: Boolean,
  7452. clearable: Boolean,
  7453. filterable: Boolean,
  7454. allowCreate: Boolean,
  7455. loading: Boolean,
  7456. popperClass: String,
  7457. remote: Boolean,
  7458. loadingText: String,
  7459. noMatchText: String,
  7460. noDataText: String,
  7461. remoteMethod: Function,
  7462. filterMethod: Function,
  7463. multiple: Boolean,
  7464. multipleLimit: {
  7465. type: Number,
  7466. default: 0
  7467. },
  7468. placeholder: {
  7469. type: String,
  7470. default: function _default() {
  7471. return Object(lib_locale_["t"])('el.select.placeholder');
  7472. }
  7473. },
  7474. defaultFirstOption: Boolean,
  7475. reserveKeyword: Boolean,
  7476. valueKey: {
  7477. type: String,
  7478. default: 'value'
  7479. },
  7480. collapseTags: Boolean,
  7481. popperAppendToBody: {
  7482. type: Boolean,
  7483. default: true
  7484. }
  7485. },
  7486. data: function data() {
  7487. return {
  7488. options: [],
  7489. cachedOptions: [],
  7490. createdLabel: null,
  7491. createdSelected: false,
  7492. selected: this.multiple ? [] : {},
  7493. inputLength: 20,
  7494. inputWidth: 0,
  7495. initialInputHeight: 0,
  7496. cachedPlaceHolder: '',
  7497. optionsCount: 0,
  7498. filteredOptionsCount: 0,
  7499. visible: false,
  7500. softFocus: false,
  7501. selectedLabel: '',
  7502. hoverIndex: -1,
  7503. query: '',
  7504. previousQuery: null,
  7505. inputHovering: false,
  7506. currentPlaceholder: '',
  7507. menuVisibleOnFocus: false,
  7508. isOnComposition: false,
  7509. isSilentBlur: false
  7510. };
  7511. },
  7512. watch: {
  7513. selectDisabled: function selectDisabled() {
  7514. var _this2 = this;
  7515. this.$nextTick(function () {
  7516. _this2.resetInputHeight();
  7517. });
  7518. },
  7519. placeholder: function placeholder(val) {
  7520. this.cachedPlaceHolder = this.currentPlaceholder = val;
  7521. },
  7522. value: function value(val, oldVal) {
  7523. if (this.multiple) {
  7524. this.resetInputHeight();
  7525. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  7526. this.currentPlaceholder = '';
  7527. } else {
  7528. this.currentPlaceholder = this.cachedPlaceHolder;
  7529. }
  7530. if (this.filterable && !this.reserveKeyword) {
  7531. this.query = '';
  7532. this.handleQueryChange(this.query);
  7533. }
  7534. }
  7535. this.setSelected();
  7536. if (this.filterable && !this.multiple) {
  7537. this.inputLength = 20;
  7538. }
  7539. if (!Object(util_["valueEquals"])(val, oldVal)) {
  7540. this.dispatch('ElFormItem', 'el.form.change', val);
  7541. }
  7542. },
  7543. visible: function visible(val) {
  7544. var _this3 = this;
  7545. if (!val) {
  7546. this.broadcast('ElSelectDropdown', 'destroyPopper');
  7547. if (this.$refs.input) {
  7548. this.$refs.input.blur();
  7549. }
  7550. this.query = '';
  7551. this.previousQuery = null;
  7552. this.selectedLabel = '';
  7553. this.inputLength = 20;
  7554. this.menuVisibleOnFocus = false;
  7555. this.resetHoverIndex();
  7556. this.$nextTick(function () {
  7557. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  7558. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  7559. }
  7560. });
  7561. if (!this.multiple) {
  7562. if (this.selected) {
  7563. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  7564. this.selectedLabel = this.createdLabel;
  7565. } else {
  7566. this.selectedLabel = this.selected.currentLabel;
  7567. }
  7568. if (this.filterable) this.query = this.selectedLabel;
  7569. }
  7570. if (this.filterable) {
  7571. this.currentPlaceholder = this.cachedPlaceHolder;
  7572. }
  7573. }
  7574. } else {
  7575. this.broadcast('ElSelectDropdown', 'updatePopper');
  7576. if (this.filterable) {
  7577. this.query = this.remote ? '' : this.selectedLabel;
  7578. this.handleQueryChange(this.query);
  7579. if (this.multiple) {
  7580. this.$refs.input.focus();
  7581. } else {
  7582. if (!this.remote) {
  7583. this.broadcast('ElOption', 'queryChange', '');
  7584. this.broadcast('ElOptionGroup', 'queryChange');
  7585. }
  7586. if (this.selectedLabel) {
  7587. this.currentPlaceholder = this.selectedLabel;
  7588. this.selectedLabel = '';
  7589. }
  7590. }
  7591. }
  7592. }
  7593. this.$emit('visible-change', val);
  7594. },
  7595. options: function options() {
  7596. var _this4 = this;
  7597. if (this.$isServer) return;
  7598. this.$nextTick(function () {
  7599. _this4.broadcast('ElSelectDropdown', 'updatePopper');
  7600. });
  7601. if (this.multiple) {
  7602. this.resetInputHeight();
  7603. }
  7604. var inputs = this.$el.querySelectorAll('input');
  7605. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  7606. this.setSelected();
  7607. }
  7608. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7609. this.checkDefaultFirstOption();
  7610. }
  7611. }
  7612. },
  7613. methods: {
  7614. handleComposition: function handleComposition(event) {
  7615. var text = event.target.value;
  7616. if (event.type === 'compositionend') {
  7617. this.isOnComposition = false;
  7618. this.handleQueryChange(text);
  7619. } else {
  7620. var lastCharacter = text[text.length - 1] || '';
  7621. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  7622. }
  7623. },
  7624. handleQueryChange: function handleQueryChange(val) {
  7625. var _this5 = this;
  7626. if (this.previousQuery === val || this.isOnComposition) return;
  7627. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  7628. this.previousQuery = val;
  7629. return;
  7630. }
  7631. this.previousQuery = val;
  7632. this.$nextTick(function () {
  7633. if (_this5.visible) _this5.broadcast('ElSelectDropdown', 'updatePopper');
  7634. });
  7635. this.hoverIndex = -1;
  7636. if (this.multiple && this.filterable) {
  7637. var length = this.$refs.input.value.length * 15 + 20;
  7638. this.inputLength = this.collapseTags ? Math.min(50, length) : length;
  7639. this.managePlaceholder();
  7640. this.resetInputHeight();
  7641. }
  7642. if (this.remote && typeof this.remoteMethod === 'function') {
  7643. this.hoverIndex = -1;
  7644. this.remoteMethod(val);
  7645. } else if (typeof this.filterMethod === 'function') {
  7646. this.filterMethod(val);
  7647. this.broadcast('ElOptionGroup', 'queryChange');
  7648. } else {
  7649. this.filteredOptionsCount = this.optionsCount;
  7650. this.broadcast('ElOption', 'queryChange', val);
  7651. this.broadcast('ElOptionGroup', 'queryChange');
  7652. }
  7653. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7654. this.checkDefaultFirstOption();
  7655. }
  7656. },
  7657. scrollToOption: function scrollToOption(option) {
  7658. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  7659. if (this.$refs.popper && target) {
  7660. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  7661. scroll_into_view_default()(menu, target);
  7662. }
  7663. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  7664. },
  7665. handleMenuEnter: function handleMenuEnter() {
  7666. var _this6 = this;
  7667. this.$nextTick(function () {
  7668. return _this6.scrollToOption(_this6.selected);
  7669. });
  7670. },
  7671. emitChange: function emitChange(val) {
  7672. if (!Object(util_["valueEquals"])(this.value, val)) {
  7673. this.$emit('change', val);
  7674. }
  7675. },
  7676. getOption: function getOption(value) {
  7677. var option = void 0;
  7678. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  7679. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  7680. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  7681. var cachedOption = this.cachedOptions[i];
  7682. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  7683. if (isEqual) {
  7684. option = cachedOption;
  7685. break;
  7686. }
  7687. }
  7688. if (option) return option;
  7689. var label = !isObject && !isNull ? value : '';
  7690. var newOption = {
  7691. value: value,
  7692. currentLabel: label
  7693. };
  7694. if (this.multiple) {
  7695. newOption.hitState = false;
  7696. }
  7697. return newOption;
  7698. },
  7699. setSelected: function setSelected() {
  7700. var _this7 = this;
  7701. if (!this.multiple) {
  7702. var option = this.getOption(this.value);
  7703. if (option.created) {
  7704. this.createdLabel = option.currentLabel;
  7705. this.createdSelected = true;
  7706. } else {
  7707. this.createdSelected = false;
  7708. }
  7709. this.selectedLabel = option.currentLabel;
  7710. this.selected = option;
  7711. if (this.filterable) this.query = this.selectedLabel;
  7712. return;
  7713. }
  7714. var result = [];
  7715. if (Array.isArray(this.value)) {
  7716. this.value.forEach(function (value) {
  7717. result.push(_this7.getOption(value));
  7718. });
  7719. }
  7720. this.selected = result;
  7721. this.$nextTick(function () {
  7722. _this7.resetInputHeight();
  7723. });
  7724. },
  7725. handleFocus: function handleFocus(event) {
  7726. if (!this.softFocus) {
  7727. if (this.automaticDropdown || this.filterable) {
  7728. this.visible = true;
  7729. this.menuVisibleOnFocus = true;
  7730. }
  7731. this.$emit('focus', event);
  7732. } else {
  7733. this.softFocus = false;
  7734. }
  7735. },
  7736. blur: function blur() {
  7737. this.visible = false;
  7738. this.$refs.reference.blur();
  7739. },
  7740. handleBlur: function handleBlur(event) {
  7741. var _this8 = this;
  7742. setTimeout(function () {
  7743. if (_this8.isSilentBlur) {
  7744. _this8.isSilentBlur = false;
  7745. } else {
  7746. _this8.$emit('blur', event);
  7747. }
  7748. }, 50);
  7749. this.softFocus = false;
  7750. },
  7751. handleClearClick: function handleClearClick(event) {
  7752. this.deleteSelected(event);
  7753. },
  7754. doDestroy: function doDestroy() {
  7755. this.$refs.popper && this.$refs.popper.doDestroy();
  7756. },
  7757. handleClose: function handleClose() {
  7758. this.visible = false;
  7759. },
  7760. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  7761. if (!Array.isArray(this.selected)) return;
  7762. var option = this.selected[this.selected.length - 1];
  7763. if (!option) return;
  7764. if (hit === true || hit === false) {
  7765. option.hitState = hit;
  7766. return hit;
  7767. }
  7768. option.hitState = !option.hitState;
  7769. return option.hitState;
  7770. },
  7771. deletePrevTag: function deletePrevTag(e) {
  7772. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  7773. var value = this.value.slice();
  7774. value.pop();
  7775. this.$emit('input', value);
  7776. this.emitChange(value);
  7777. }
  7778. },
  7779. managePlaceholder: function managePlaceholder() {
  7780. if (this.currentPlaceholder !== '') {
  7781. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  7782. }
  7783. },
  7784. resetInputState: function resetInputState(e) {
  7785. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  7786. this.inputLength = this.$refs.input.value.length * 15 + 20;
  7787. this.resetInputHeight();
  7788. },
  7789. resetInputHeight: function resetInputHeight() {
  7790. var _this9 = this;
  7791. if (this.collapseTags && !this.filterable) return;
  7792. this.$nextTick(function () {
  7793. if (!_this9.$refs.reference) return;
  7794. var inputChildNodes = _this9.$refs.reference.$el.childNodes;
  7795. var input = [].filter.call(inputChildNodes, function (item) {
  7796. return item.tagName === 'INPUT';
  7797. })[0];
  7798. var tags = _this9.$refs.tags;
  7799. var sizeInMap = _this9.initialInputHeight || 40;
  7800. input.style.height = _this9.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  7801. if (_this9.visible && _this9.emptyText !== false) {
  7802. _this9.broadcast('ElSelectDropdown', 'updatePopper');
  7803. }
  7804. });
  7805. },
  7806. resetHoverIndex: function resetHoverIndex() {
  7807. var _this10 = this;
  7808. setTimeout(function () {
  7809. if (!_this10.multiple) {
  7810. _this10.hoverIndex = _this10.options.indexOf(_this10.selected);
  7811. } else {
  7812. if (_this10.selected.length > 0) {
  7813. _this10.hoverIndex = Math.min.apply(null, _this10.selected.map(function (item) {
  7814. return _this10.options.indexOf(item);
  7815. }));
  7816. } else {
  7817. _this10.hoverIndex = -1;
  7818. }
  7819. }
  7820. }, 300);
  7821. },
  7822. handleOptionSelect: function handleOptionSelect(option, byClick) {
  7823. var _this11 = this;
  7824. if (this.multiple) {
  7825. var value = (this.value || []).slice();
  7826. var optionIndex = this.getValueIndex(value, option.value);
  7827. if (optionIndex > -1) {
  7828. value.splice(optionIndex, 1);
  7829. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  7830. value.push(option.value);
  7831. }
  7832. this.$emit('input', value);
  7833. this.emitChange(value);
  7834. if (option.created) {
  7835. this.query = '';
  7836. this.handleQueryChange('');
  7837. this.inputLength = 20;
  7838. }
  7839. if (this.filterable) this.$refs.input.focus();
  7840. } else {
  7841. this.$emit('input', option.value);
  7842. this.emitChange(option.value);
  7843. this.visible = false;
  7844. }
  7845. this.isSilentBlur = byClick;
  7846. this.setSoftFocus();
  7847. if (this.visible) return;
  7848. this.$nextTick(function () {
  7849. _this11.scrollToOption(option);
  7850. });
  7851. },
  7852. setSoftFocus: function setSoftFocus() {
  7853. this.softFocus = true;
  7854. var input = this.$refs.input || this.$refs.reference;
  7855. if (input) {
  7856. input.focus();
  7857. }
  7858. },
  7859. getValueIndex: function getValueIndex() {
  7860. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7861. var value = arguments[1];
  7862. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  7863. if (!isObject) {
  7864. return arr.indexOf(value);
  7865. } else {
  7866. var valueKey = this.valueKey;
  7867. var index = -1;
  7868. arr.some(function (item, i) {
  7869. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  7870. index = i;
  7871. return true;
  7872. }
  7873. return false;
  7874. });
  7875. return index;
  7876. }
  7877. },
  7878. toggleMenu: function toggleMenu() {
  7879. if (!this.selectDisabled) {
  7880. if (this.menuVisibleOnFocus) {
  7881. this.menuVisibleOnFocus = false;
  7882. } else {
  7883. this.visible = !this.visible;
  7884. }
  7885. if (this.visible) {
  7886. (this.$refs.input || this.$refs.reference).focus();
  7887. }
  7888. }
  7889. },
  7890. selectOption: function selectOption() {
  7891. if (!this.visible) {
  7892. this.toggleMenu();
  7893. } else {
  7894. if (this.options[this.hoverIndex]) {
  7895. this.handleOptionSelect(this.options[this.hoverIndex]);
  7896. }
  7897. }
  7898. },
  7899. deleteSelected: function deleteSelected(event) {
  7900. event.stopPropagation();
  7901. var value = this.multiple ? [] : null;
  7902. this.$emit('input', value);
  7903. this.emitChange(value);
  7904. this.visible = false;
  7905. this.$emit('clear');
  7906. },
  7907. deleteTag: function deleteTag(event, tag) {
  7908. var index = this.selected.indexOf(tag);
  7909. if (index > -1 && !this.selectDisabled) {
  7910. var value = this.value.slice();
  7911. value.splice(index, 1);
  7912. this.$emit('input', value);
  7913. this.emitChange(value);
  7914. this.$emit('remove-tag', tag.value);
  7915. }
  7916. event.stopPropagation();
  7917. },
  7918. onInputChange: function onInputChange() {
  7919. if (this.filterable && this.query !== this.selectedLabel) {
  7920. this.query = this.selectedLabel;
  7921. this.handleQueryChange(this.query);
  7922. }
  7923. },
  7924. onOptionDestroy: function onOptionDestroy(index) {
  7925. if (index > -1) {
  7926. this.optionsCount--;
  7927. this.filteredOptionsCount--;
  7928. this.options.splice(index, 1);
  7929. }
  7930. },
  7931. resetInputWidth: function resetInputWidth() {
  7932. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  7933. },
  7934. handleResize: function handleResize() {
  7935. this.resetInputWidth();
  7936. if (this.multiple) this.resetInputHeight();
  7937. },
  7938. checkDefaultFirstOption: function checkDefaultFirstOption() {
  7939. this.hoverIndex = -1;
  7940. // highlight the created option
  7941. var hasCreated = false;
  7942. for (var i = this.options.length - 1; i >= 0; i--) {
  7943. if (this.options[i].created) {
  7944. hasCreated = true;
  7945. this.hoverIndex = i;
  7946. break;
  7947. }
  7948. }
  7949. if (hasCreated) return;
  7950. for (var _i = 0; _i !== this.options.length; ++_i) {
  7951. var option = this.options[_i];
  7952. if (this.query) {
  7953. // highlight first options that passes the filter
  7954. if (!option.disabled && !option.groupDisabled && option.visible) {
  7955. this.hoverIndex = _i;
  7956. break;
  7957. }
  7958. } else {
  7959. // highlight currently selected option
  7960. if (option.itemSelected) {
  7961. this.hoverIndex = _i;
  7962. break;
  7963. }
  7964. }
  7965. }
  7966. },
  7967. getValueKey: function getValueKey(item) {
  7968. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  7969. return item.value;
  7970. } else {
  7971. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  7972. }
  7973. }
  7974. },
  7975. created: function created() {
  7976. var _this12 = this;
  7977. this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
  7978. if (this.multiple && !Array.isArray(this.value)) {
  7979. this.$emit('input', []);
  7980. }
  7981. if (!this.multiple && Array.isArray(this.value)) {
  7982. this.$emit('input', '');
  7983. }
  7984. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  7985. _this12.onInputChange();
  7986. });
  7987. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  7988. _this12.handleQueryChange(e.target.value);
  7989. });
  7990. this.$on('handleOptionClick', this.handleOptionSelect);
  7991. this.$on('setSelected', this.setSelected);
  7992. },
  7993. mounted: function mounted() {
  7994. var _this13 = this;
  7995. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  7996. this.currentPlaceholder = '';
  7997. }
  7998. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  7999. var reference = this.$refs.reference;
  8000. if (reference && reference.$el) {
  8001. var sizeMap = {
  8002. medium: 36,
  8003. small: 32,
  8004. mini: 28
  8005. };
  8006. this.initialInputHeight = reference.$el.getBoundingClientRect().height || sizeMap[this.selectSize];
  8007. }
  8008. if (this.remote && this.multiple) {
  8009. this.resetInputHeight();
  8010. }
  8011. this.$nextTick(function () {
  8012. if (reference && reference.$el) {
  8013. _this13.inputWidth = reference.$el.getBoundingClientRect().width;
  8014. }
  8015. });
  8016. this.setSelected();
  8017. },
  8018. beforeDestroy: function beforeDestroy() {
  8019. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  8020. }
  8021. });
  8022. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  8023. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  8024. // CONCATENATED MODULE: ./packages/select/src/select.vue
  8025. /* normalize component */
  8026. var select_component = normalizeComponent(
  8027. src_selectvue_type_script_lang_js_,
  8028. selectvue_type_template_id_0e4aade6_render,
  8029. selectvue_type_template_id_0e4aade6_staticRenderFns,
  8030. false,
  8031. null,
  8032. null,
  8033. null
  8034. )
  8035. /* hot reload */
  8036. if (false) { var select_api; }
  8037. select_component.options.__file = "packages/select/src/select.vue"
  8038. /* harmony default export */ var src_select = (select_component.exports);
  8039. // CONCATENATED MODULE: ./packages/select/index.js
  8040. /* istanbul ignore next */
  8041. src_select.install = function (Vue) {
  8042. Vue.component(src_select.name, src_select);
  8043. };
  8044. /* harmony default export */ var packages_select = (src_select);
  8045. // CONCATENATED MODULE: ./packages/option/index.js
  8046. /* istanbul ignore next */
  8047. src_option.install = function (Vue) {
  8048. Vue.component(src_option.name, src_option);
  8049. };
  8050. /* harmony default export */ var packages_option = (src_option);
  8051. // 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&
  8052. var option_groupvue_type_template_id_6685e5de_render = function() {
  8053. var _vm = this
  8054. var _h = _vm.$createElement
  8055. var _c = _vm._self._c || _h
  8056. return _c(
  8057. "ul",
  8058. {
  8059. directives: [
  8060. {
  8061. name: "show",
  8062. rawName: "v-show",
  8063. value: _vm.visible,
  8064. expression: "visible"
  8065. }
  8066. ],
  8067. staticClass: "el-select-group__wrap"
  8068. },
  8069. [
  8070. _c("li", { staticClass: "el-select-group__title" }, [
  8071. _vm._v(_vm._s(_vm.label))
  8072. ]),
  8073. _c("li", [
  8074. _c("ul", { staticClass: "el-select-group" }, [_vm._t("default")], 2)
  8075. ])
  8076. ]
  8077. )
  8078. }
  8079. var option_groupvue_type_template_id_6685e5de_staticRenderFns = []
  8080. option_groupvue_type_template_id_6685e5de_render._withStripped = true
  8081. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=template&id=6685e5de&
  8082. // 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&
  8083. //
  8084. //
  8085. //
  8086. //
  8087. //
  8088. //
  8089. //
  8090. //
  8091. //
  8092. //
  8093. //
  8094. /* harmony default export */ var option_groupvue_type_script_lang_js_ = ({
  8095. mixins: [emitter_default.a],
  8096. name: 'ElOptionGroup',
  8097. componentName: 'ElOptionGroup',
  8098. props: {
  8099. label: String,
  8100. disabled: {
  8101. type: Boolean,
  8102. default: false
  8103. }
  8104. },
  8105. data: function data() {
  8106. return {
  8107. visible: true
  8108. };
  8109. },
  8110. watch: {
  8111. disabled: function disabled(val) {
  8112. this.broadcast('ElOption', 'handleGroupDisabled', val);
  8113. }
  8114. },
  8115. methods: {
  8116. queryChange: function queryChange() {
  8117. this.visible = this.$children && Array.isArray(this.$children) && this.$children.some(function (option) {
  8118. return option.visible === true;
  8119. });
  8120. }
  8121. },
  8122. created: function created() {
  8123. this.$on('queryChange', this.queryChange);
  8124. },
  8125. mounted: function mounted() {
  8126. if (this.disabled) {
  8127. this.broadcast('ElOption', 'handleGroupDisabled', this.disabled);
  8128. }
  8129. }
  8130. });
  8131. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=script&lang=js&
  8132. /* harmony default export */ var src_option_groupvue_type_script_lang_js_ = (option_groupvue_type_script_lang_js_);
  8133. // CONCATENATED MODULE: ./packages/select/src/option-group.vue
  8134. /* normalize component */
  8135. var option_group_component = normalizeComponent(
  8136. src_option_groupvue_type_script_lang_js_,
  8137. option_groupvue_type_template_id_6685e5de_render,
  8138. option_groupvue_type_template_id_6685e5de_staticRenderFns,
  8139. false,
  8140. null,
  8141. null,
  8142. null
  8143. )
  8144. /* hot reload */
  8145. if (false) { var option_group_api; }
  8146. option_group_component.options.__file = "packages/select/src/option-group.vue"
  8147. /* harmony default export */ var option_group = (option_group_component.exports);
  8148. // CONCATENATED MODULE: ./packages/option-group/index.js
  8149. /* istanbul ignore next */
  8150. option_group.install = function (Vue) {
  8151. Vue.component(option_group.name, option_group);
  8152. };
  8153. /* harmony default export */ var packages_option_group = (option_group);
  8154. // 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&
  8155. var buttonvue_type_template_id_ca859fb4_render = function() {
  8156. var _vm = this
  8157. var _h = _vm.$createElement
  8158. var _c = _vm._self._c || _h
  8159. return _c(
  8160. "button",
  8161. {
  8162. staticClass: "el-button",
  8163. class: [
  8164. _vm.type ? "el-button--" + _vm.type : "",
  8165. _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
  8166. {
  8167. "is-disabled": _vm.buttonDisabled,
  8168. "is-loading": _vm.loading,
  8169. "is-plain": _vm.plain,
  8170. "is-round": _vm.round,
  8171. "is-circle": _vm.circle
  8172. }
  8173. ],
  8174. attrs: {
  8175. disabled: _vm.buttonDisabled || _vm.loading,
  8176. autofocus: _vm.autofocus,
  8177. type: _vm.nativeType
  8178. },
  8179. on: { click: _vm.handleClick }
  8180. },
  8181. [
  8182. _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
  8183. _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
  8184. _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e()
  8185. ]
  8186. )
  8187. }
  8188. var buttonvue_type_template_id_ca859fb4_staticRenderFns = []
  8189. buttonvue_type_template_id_ca859fb4_render._withStripped = true
  8190. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  8191. // 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&
  8192. //
  8193. //
  8194. //
  8195. //
  8196. //
  8197. //
  8198. //
  8199. //
  8200. //
  8201. //
  8202. //
  8203. //
  8204. //
  8205. //
  8206. //
  8207. //
  8208. //
  8209. //
  8210. //
  8211. //
  8212. //
  8213. //
  8214. //
  8215. //
  8216. /* harmony default export */ var buttonvue_type_script_lang_js_ = ({
  8217. name: 'ElButton',
  8218. inject: {
  8219. elForm: {
  8220. default: ''
  8221. },
  8222. elFormItem: {
  8223. default: ''
  8224. }
  8225. },
  8226. props: {
  8227. type: {
  8228. type: String,
  8229. default: 'default'
  8230. },
  8231. size: String,
  8232. icon: {
  8233. type: String,
  8234. default: ''
  8235. },
  8236. nativeType: {
  8237. type: String,
  8238. default: 'button'
  8239. },
  8240. loading: Boolean,
  8241. disabled: Boolean,
  8242. plain: Boolean,
  8243. autofocus: Boolean,
  8244. round: Boolean,
  8245. circle: Boolean
  8246. },
  8247. computed: {
  8248. _elFormItemSize: function _elFormItemSize() {
  8249. return (this.elFormItem || {}).elFormItemSize;
  8250. },
  8251. buttonSize: function buttonSize() {
  8252. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  8253. },
  8254. buttonDisabled: function buttonDisabled() {
  8255. return this.disabled || (this.elForm || {}).disabled;
  8256. }
  8257. },
  8258. methods: {
  8259. handleClick: function handleClick(evt) {
  8260. this.$emit('click', evt);
  8261. }
  8262. }
  8263. });
  8264. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
  8265. /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
  8266. // CONCATENATED MODULE: ./packages/button/src/button.vue
  8267. /* normalize component */
  8268. var button_component = normalizeComponent(
  8269. src_buttonvue_type_script_lang_js_,
  8270. buttonvue_type_template_id_ca859fb4_render,
  8271. buttonvue_type_template_id_ca859fb4_staticRenderFns,
  8272. false,
  8273. null,
  8274. null,
  8275. null
  8276. )
  8277. /* hot reload */
  8278. if (false) { var button_api; }
  8279. button_component.options.__file = "packages/button/src/button.vue"
  8280. /* harmony default export */ var src_button = (button_component.exports);
  8281. // CONCATENATED MODULE: ./packages/button/index.js
  8282. /* istanbul ignore next */
  8283. src_button.install = function (Vue) {
  8284. Vue.component(src_button.name, src_button);
  8285. };
  8286. /* harmony default export */ var packages_button = (src_button);
  8287. // 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&
  8288. var button_groupvue_type_template_id_3d8661d0_render = function() {
  8289. var _vm = this
  8290. var _h = _vm.$createElement
  8291. var _c = _vm._self._c || _h
  8292. return _c("div", { staticClass: "el-button-group" }, [_vm._t("default")], 2)
  8293. }
  8294. var button_groupvue_type_template_id_3d8661d0_staticRenderFns = []
  8295. button_groupvue_type_template_id_3d8661d0_render._withStripped = true
  8296. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=template&id=3d8661d0&
  8297. // 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&
  8298. //
  8299. //
  8300. //
  8301. //
  8302. //
  8303. /* harmony default export */ var button_groupvue_type_script_lang_js_ = ({
  8304. name: 'ElButtonGroup'
  8305. });
  8306. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=script&lang=js&
  8307. /* harmony default export */ var src_button_groupvue_type_script_lang_js_ = (button_groupvue_type_script_lang_js_);
  8308. // CONCATENATED MODULE: ./packages/button/src/button-group.vue
  8309. /* normalize component */
  8310. var button_group_component = normalizeComponent(
  8311. src_button_groupvue_type_script_lang_js_,
  8312. button_groupvue_type_template_id_3d8661d0_render,
  8313. button_groupvue_type_template_id_3d8661d0_staticRenderFns,
  8314. false,
  8315. null,
  8316. null,
  8317. null
  8318. )
  8319. /* hot reload */
  8320. if (false) { var button_group_api; }
  8321. button_group_component.options.__file = "packages/button/src/button-group.vue"
  8322. /* harmony default export */ var button_group = (button_group_component.exports);
  8323. // CONCATENATED MODULE: ./packages/button-group/index.js
  8324. /* istanbul ignore next */
  8325. button_group.install = function (Vue) {
  8326. Vue.component(button_group.name, button_group);
  8327. };
  8328. /* harmony default export */ var packages_button_group = (button_group);
  8329. // 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&
  8330. var tablevue_type_template_id_493fe34e_render = function() {
  8331. var _vm = this
  8332. var _h = _vm.$createElement
  8333. var _c = _vm._self._c || _h
  8334. return _c(
  8335. "div",
  8336. {
  8337. staticClass: "el-table",
  8338. class: [
  8339. {
  8340. "el-table--fit": _vm.fit,
  8341. "el-table--striped": _vm.stripe,
  8342. "el-table--border": _vm.border || _vm.isGroup,
  8343. "el-table--hidden": _vm.isHidden,
  8344. "el-table--group": _vm.isGroup,
  8345. "el-table--fluid-height": _vm.maxHeight,
  8346. "el-table--scrollable-x": _vm.layout.scrollX,
  8347. "el-table--scrollable-y": _vm.layout.scrollY,
  8348. "el-table--enable-row-hover": !_vm.store.states.isComplex,
  8349. "el-table--enable-row-transition":
  8350. (_vm.store.states.data || []).length !== 0 &&
  8351. (_vm.store.states.data || []).length < 100
  8352. },
  8353. _vm.tableSize ? "el-table--" + _vm.tableSize : ""
  8354. ],
  8355. on: {
  8356. mouseleave: function($event) {
  8357. _vm.handleMouseLeave($event)
  8358. }
  8359. }
  8360. },
  8361. [
  8362. _c(
  8363. "div",
  8364. { ref: "hiddenColumns", staticClass: "hidden-columns" },
  8365. [_vm._t("default")],
  8366. 2
  8367. ),
  8368. _vm.showHeader
  8369. ? _c(
  8370. "div",
  8371. {
  8372. directives: [
  8373. {
  8374. name: "mousewheel",
  8375. rawName: "v-mousewheel",
  8376. value: _vm.handleHeaderFooterMousewheel,
  8377. expression: "handleHeaderFooterMousewheel"
  8378. }
  8379. ],
  8380. ref: "headerWrapper",
  8381. staticClass: "el-table__header-wrapper"
  8382. },
  8383. [
  8384. _c("table-header", {
  8385. ref: "tableHeader",
  8386. style: {
  8387. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8388. },
  8389. attrs: {
  8390. store: _vm.store,
  8391. border: _vm.border,
  8392. "default-sort": _vm.defaultSort
  8393. }
  8394. })
  8395. ],
  8396. 1
  8397. )
  8398. : _vm._e(),
  8399. _c(
  8400. "div",
  8401. {
  8402. ref: "bodyWrapper",
  8403. staticClass: "el-table__body-wrapper",
  8404. class: [
  8405. _vm.layout.scrollX
  8406. ? "is-scrolling-" + _vm.scrollPosition
  8407. : "is-scrolling-none"
  8408. ],
  8409. style: [_vm.bodyHeight]
  8410. },
  8411. [
  8412. _c("table-body", {
  8413. style: {
  8414. width: _vm.bodyWidth
  8415. },
  8416. attrs: {
  8417. context: _vm.context,
  8418. store: _vm.store,
  8419. stripe: _vm.stripe,
  8420. "row-class-name": _vm.rowClassName,
  8421. "row-style": _vm.rowStyle,
  8422. highlight: _vm.highlightCurrentRow
  8423. }
  8424. }),
  8425. !_vm.data || _vm.data.length === 0
  8426. ? _c(
  8427. "div",
  8428. {
  8429. ref: "emptyBlock",
  8430. staticClass: "el-table__empty-block",
  8431. style: {
  8432. width: _vm.bodyWidth
  8433. }
  8434. },
  8435. [
  8436. _c(
  8437. "span",
  8438. { staticClass: "el-table__empty-text" },
  8439. [
  8440. _vm._t("empty", [
  8441. _vm._v(
  8442. _vm._s(_vm.emptyText || _vm.t("el.table.emptyText"))
  8443. )
  8444. ])
  8445. ],
  8446. 2
  8447. )
  8448. ]
  8449. )
  8450. : _vm._e(),
  8451. _vm.$slots.append
  8452. ? _c(
  8453. "div",
  8454. {
  8455. ref: "appendWrapper",
  8456. staticClass: "el-table__append-wrapper"
  8457. },
  8458. [_vm._t("append")],
  8459. 2
  8460. )
  8461. : _vm._e()
  8462. ],
  8463. 1
  8464. ),
  8465. _vm.showSummary
  8466. ? _c(
  8467. "div",
  8468. {
  8469. directives: [
  8470. {
  8471. name: "show",
  8472. rawName: "v-show",
  8473. value: _vm.data && _vm.data.length > 0,
  8474. expression: "data && data.length > 0"
  8475. },
  8476. {
  8477. name: "mousewheel",
  8478. rawName: "v-mousewheel",
  8479. value: _vm.handleHeaderFooterMousewheel,
  8480. expression: "handleHeaderFooterMousewheel"
  8481. }
  8482. ],
  8483. ref: "footerWrapper",
  8484. staticClass: "el-table__footer-wrapper"
  8485. },
  8486. [
  8487. _c("table-footer", {
  8488. style: {
  8489. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8490. },
  8491. attrs: {
  8492. store: _vm.store,
  8493. border: _vm.border,
  8494. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8495. "summary-method": _vm.summaryMethod,
  8496. "default-sort": _vm.defaultSort
  8497. }
  8498. })
  8499. ],
  8500. 1
  8501. )
  8502. : _vm._e(),
  8503. _vm.fixedColumns.length > 0
  8504. ? _c(
  8505. "div",
  8506. {
  8507. directives: [
  8508. {
  8509. name: "mousewheel",
  8510. rawName: "v-mousewheel",
  8511. value: _vm.handleFixedMousewheel,
  8512. expression: "handleFixedMousewheel"
  8513. }
  8514. ],
  8515. ref: "fixedWrapper",
  8516. staticClass: "el-table__fixed",
  8517. style: [
  8518. {
  8519. width: _vm.layout.fixedWidth
  8520. ? _vm.layout.fixedWidth + "px"
  8521. : ""
  8522. },
  8523. _vm.fixedHeight
  8524. ]
  8525. },
  8526. [
  8527. _vm.showHeader
  8528. ? _c(
  8529. "div",
  8530. {
  8531. ref: "fixedHeaderWrapper",
  8532. staticClass: "el-table__fixed-header-wrapper"
  8533. },
  8534. [
  8535. _c("table-header", {
  8536. ref: "fixedTableHeader",
  8537. style: {
  8538. width: _vm.bodyWidth
  8539. },
  8540. attrs: {
  8541. fixed: "left",
  8542. border: _vm.border,
  8543. store: _vm.store
  8544. }
  8545. })
  8546. ],
  8547. 1
  8548. )
  8549. : _vm._e(),
  8550. _c(
  8551. "div",
  8552. {
  8553. ref: "fixedBodyWrapper",
  8554. staticClass: "el-table__fixed-body-wrapper",
  8555. style: [
  8556. {
  8557. top: _vm.layout.headerHeight + "px"
  8558. },
  8559. _vm.fixedBodyHeight
  8560. ]
  8561. },
  8562. [
  8563. _c("table-body", {
  8564. style: {
  8565. width: _vm.bodyWidth
  8566. },
  8567. attrs: {
  8568. fixed: "left",
  8569. store: _vm.store,
  8570. stripe: _vm.stripe,
  8571. highlight: _vm.highlightCurrentRow,
  8572. "row-class-name": _vm.rowClassName,
  8573. "row-style": _vm.rowStyle
  8574. }
  8575. }),
  8576. _vm.$slots.append
  8577. ? _c("div", {
  8578. staticClass: "el-table__append-gutter",
  8579. style: {
  8580. height: _vm.layout.appendHeight + "px"
  8581. }
  8582. })
  8583. : _vm._e()
  8584. ],
  8585. 1
  8586. ),
  8587. _vm.showSummary
  8588. ? _c(
  8589. "div",
  8590. {
  8591. directives: [
  8592. {
  8593. name: "show",
  8594. rawName: "v-show",
  8595. value: _vm.data && _vm.data.length > 0,
  8596. expression: "data && data.length > 0"
  8597. }
  8598. ],
  8599. ref: "fixedFooterWrapper",
  8600. staticClass: "el-table__fixed-footer-wrapper"
  8601. },
  8602. [
  8603. _c("table-footer", {
  8604. style: {
  8605. width: _vm.bodyWidth
  8606. },
  8607. attrs: {
  8608. fixed: "left",
  8609. border: _vm.border,
  8610. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8611. "summary-method": _vm.summaryMethod,
  8612. store: _vm.store
  8613. }
  8614. })
  8615. ],
  8616. 1
  8617. )
  8618. : _vm._e()
  8619. ]
  8620. )
  8621. : _vm._e(),
  8622. _vm.rightFixedColumns.length > 0
  8623. ? _c(
  8624. "div",
  8625. {
  8626. directives: [
  8627. {
  8628. name: "mousewheel",
  8629. rawName: "v-mousewheel",
  8630. value: _vm.handleFixedMousewheel,
  8631. expression: "handleFixedMousewheel"
  8632. }
  8633. ],
  8634. ref: "rightFixedWrapper",
  8635. staticClass: "el-table__fixed-right",
  8636. style: [
  8637. {
  8638. width: _vm.layout.rightFixedWidth
  8639. ? _vm.layout.rightFixedWidth + "px"
  8640. : "",
  8641. right: _vm.layout.scrollY
  8642. ? (_vm.border
  8643. ? _vm.layout.gutterWidth
  8644. : _vm.layout.gutterWidth || 0) + "px"
  8645. : ""
  8646. },
  8647. _vm.fixedHeight
  8648. ]
  8649. },
  8650. [
  8651. _vm.showHeader
  8652. ? _c(
  8653. "div",
  8654. {
  8655. ref: "rightFixedHeaderWrapper",
  8656. staticClass: "el-table__fixed-header-wrapper"
  8657. },
  8658. [
  8659. _c("table-header", {
  8660. ref: "rightFixedTableHeader",
  8661. style: {
  8662. width: _vm.bodyWidth
  8663. },
  8664. attrs: {
  8665. fixed: "right",
  8666. border: _vm.border,
  8667. store: _vm.store
  8668. }
  8669. })
  8670. ],
  8671. 1
  8672. )
  8673. : _vm._e(),
  8674. _c(
  8675. "div",
  8676. {
  8677. ref: "rightFixedBodyWrapper",
  8678. staticClass: "el-table__fixed-body-wrapper",
  8679. style: [
  8680. {
  8681. top: _vm.layout.headerHeight + "px"
  8682. },
  8683. _vm.fixedBodyHeight
  8684. ]
  8685. },
  8686. [
  8687. _c("table-body", {
  8688. style: {
  8689. width: _vm.bodyWidth
  8690. },
  8691. attrs: {
  8692. fixed: "right",
  8693. store: _vm.store,
  8694. stripe: _vm.stripe,
  8695. "row-class-name": _vm.rowClassName,
  8696. "row-style": _vm.rowStyle,
  8697. highlight: _vm.highlightCurrentRow
  8698. }
  8699. })
  8700. ],
  8701. 1
  8702. ),
  8703. _vm.showSummary
  8704. ? _c(
  8705. "div",
  8706. {
  8707. directives: [
  8708. {
  8709. name: "show",
  8710. rawName: "v-show",
  8711. value: _vm.data && _vm.data.length > 0,
  8712. expression: "data && data.length > 0"
  8713. }
  8714. ],
  8715. ref: "rightFixedFooterWrapper",
  8716. staticClass: "el-table__fixed-footer-wrapper"
  8717. },
  8718. [
  8719. _c("table-footer", {
  8720. style: {
  8721. width: _vm.bodyWidth
  8722. },
  8723. attrs: {
  8724. fixed: "right",
  8725. border: _vm.border,
  8726. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8727. "summary-method": _vm.summaryMethod,
  8728. store: _vm.store
  8729. }
  8730. })
  8731. ],
  8732. 1
  8733. )
  8734. : _vm._e()
  8735. ]
  8736. )
  8737. : _vm._e(),
  8738. _vm.rightFixedColumns.length > 0
  8739. ? _c("div", {
  8740. ref: "rightFixedPatch",
  8741. staticClass: "el-table__fixed-right-patch",
  8742. style: {
  8743. width: _vm.layout.scrollY ? _vm.layout.gutterWidth + "px" : "0",
  8744. height: _vm.layout.headerHeight + "px"
  8745. }
  8746. })
  8747. : _vm._e(),
  8748. _c("div", {
  8749. directives: [
  8750. {
  8751. name: "show",
  8752. rawName: "v-show",
  8753. value: _vm.resizeProxyVisible,
  8754. expression: "resizeProxyVisible"
  8755. }
  8756. ],
  8757. ref: "resizeProxy",
  8758. staticClass: "el-table__column-resize-proxy"
  8759. })
  8760. ]
  8761. )
  8762. }
  8763. var tablevue_type_template_id_493fe34e_staticRenderFns = []
  8764. tablevue_type_template_id_493fe34e_render._withStripped = true
  8765. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=493fe34e&
  8766. // EXTERNAL MODULE: external "element-ui/lib/checkbox"
  8767. var checkbox_ = __webpack_require__(15);
  8768. var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
  8769. // EXTERNAL MODULE: external "normalize-wheel"
  8770. var external_normalize_wheel_ = __webpack_require__(36);
  8771. var external_normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(external_normalize_wheel_);
  8772. // CONCATENATED MODULE: ./src/directives/mousewheel.js
  8773. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  8774. var mousewheel_mousewheel = function mousewheel(element, callback) {
  8775. if (element && element.addEventListener) {
  8776. element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function (event) {
  8777. var normalized = external_normalize_wheel_default()(event);
  8778. callback && callback.apply(this, [event, normalized]);
  8779. });
  8780. }
  8781. };
  8782. /* harmony default export */ var directives_mousewheel = ({
  8783. bind: function bind(el, binding) {
  8784. mousewheel_mousewheel(el, binding.value);
  8785. }
  8786. });
  8787. // EXTERNAL MODULE: external "vue"
  8788. var external_vue_ = __webpack_require__(4);
  8789. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  8790. // CONCATENATED MODULE: ./packages/table/src/util.js
  8791. 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; };
  8792. var getCell = function getCell(event) {
  8793. var cell = event.target;
  8794. while (cell && cell.tagName.toUpperCase() !== 'HTML') {
  8795. if (cell.tagName.toUpperCase() === 'TD') {
  8796. return cell;
  8797. }
  8798. cell = cell.parentNode;
  8799. }
  8800. return null;
  8801. };
  8802. var util_isObject = function isObject(obj) {
  8803. return obj !== null && (typeof obj === 'undefined' ? 'undefined' : util_typeof(obj)) === 'object';
  8804. };
  8805. var util_orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
  8806. if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
  8807. return array;
  8808. }
  8809. if (typeof reverse === 'string') {
  8810. reverse = reverse === 'descending' ? -1 : 1;
  8811. } else {
  8812. reverse = reverse && reverse < 0 ? -1 : 1;
  8813. }
  8814. var getKey = sortMethod ? null : function (value, index) {
  8815. if (sortBy) {
  8816. if (!Array.isArray(sortBy)) {
  8817. sortBy = [sortBy];
  8818. }
  8819. return sortBy.map(function (by) {
  8820. if (typeof by === 'string') {
  8821. return Object(util_["getValueByPath"])(value, by);
  8822. } else {
  8823. return by(value, index, array);
  8824. }
  8825. });
  8826. }
  8827. if (sortKey !== '$key') {
  8828. if (util_isObject(value) && '$value' in value) value = value.$value;
  8829. }
  8830. return [util_isObject(value) ? Object(util_["getValueByPath"])(value, sortKey) : value];
  8831. };
  8832. var compare = function compare(a, b) {
  8833. if (sortMethod) {
  8834. return sortMethod(a.value, b.value);
  8835. }
  8836. for (var i = 0, len = a.key.length; i < len; i++) {
  8837. if (a.key[i] < b.key[i]) {
  8838. return -1;
  8839. }
  8840. if (a.key[i] > b.key[i]) {
  8841. return 1;
  8842. }
  8843. }
  8844. return 0;
  8845. };
  8846. return array.map(function (value, index) {
  8847. return {
  8848. value: value,
  8849. index: index,
  8850. key: getKey ? getKey(value, index) : null
  8851. };
  8852. }).sort(function (a, b) {
  8853. var order = compare(a, b);
  8854. if (!order) {
  8855. // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
  8856. order = a.index - b.index;
  8857. }
  8858. return order * reverse;
  8859. }).map(function (item) {
  8860. return item.value;
  8861. });
  8862. };
  8863. var getColumnById = function getColumnById(table, columnId) {
  8864. var column = null;
  8865. table.columns.forEach(function (item) {
  8866. if (item.id === columnId) {
  8867. column = item;
  8868. }
  8869. });
  8870. return column;
  8871. };
  8872. var getColumnByKey = function getColumnByKey(table, columnKey) {
  8873. var column = null;
  8874. for (var i = 0; i < table.columns.length; i++) {
  8875. var item = table.columns[i];
  8876. if (item.columnKey === columnKey) {
  8877. column = item;
  8878. break;
  8879. }
  8880. }
  8881. return column;
  8882. };
  8883. var getColumnByCell = function getColumnByCell(table, cell) {
  8884. var matches = (cell.className || '').match(/el-table_[^\s]+/gm);
  8885. if (matches) {
  8886. return getColumnById(table, matches[0]);
  8887. }
  8888. return null;
  8889. };
  8890. var getRowIdentity = function getRowIdentity(row, rowKey) {
  8891. if (!row) throw new Error('row is required when get row identity');
  8892. if (typeof rowKey === 'string') {
  8893. if (rowKey.indexOf('.') < 0) {
  8894. return row[rowKey];
  8895. }
  8896. var key = rowKey.split('.');
  8897. var current = row;
  8898. for (var i = 0; i < key.length; i++) {
  8899. current = current[key[i]];
  8900. }
  8901. return current;
  8902. } else if (typeof rowKey === 'function') {
  8903. return rowKey.call(null, row);
  8904. }
  8905. };
  8906. // CONCATENATED MODULE: ./packages/table/src/table-store.js
  8907. var table_store_sortData = function sortData(data, states) {
  8908. var sortingColumn = states.sortingColumn;
  8909. if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
  8910. return data;
  8911. }
  8912. if (Object.keys(states.treeData).length === 0) {
  8913. return util_orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  8914. }
  8915. // 存在嵌套类型的数据
  8916. var rowKey = states.rowKey;
  8917. var filteredData = [];
  8918. var treeDataMap = {};
  8919. var index = 0;
  8920. while (index < data.length) {
  8921. var cur = data[index];
  8922. var key = cur[rowKey];
  8923. var treeNode = states.treeData[key];
  8924. filteredData.push(cur);
  8925. index++;
  8926. if (!treeNode) {
  8927. continue;
  8928. }
  8929. treeDataMap[key] = [];
  8930. while (index < data.length) {
  8931. cur = data[index];
  8932. treeNode = states.treeData[cur[rowKey]];
  8933. index++;
  8934. if (treeNode && treeNode.level !== 0) {
  8935. treeDataMap[key].push(cur);
  8936. } else {
  8937. filteredData.push(cur);
  8938. break;
  8939. }
  8940. }
  8941. }
  8942. var sortedData = util_orderBy(filteredData, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  8943. return sortedData.reduce(function (prev, current) {
  8944. var treeNodes = treeDataMap[current[rowKey]] || [];
  8945. return prev.concat(current, treeNodes);
  8946. }, []);
  8947. };
  8948. var table_store_getKeysMap = function getKeysMap(array, rowKey) {
  8949. var arrayMap = {};
  8950. (array || []).forEach(function (row, index) {
  8951. arrayMap[getRowIdentity(row, rowKey)] = { row: row, index: index };
  8952. });
  8953. return arrayMap;
  8954. };
  8955. var toggleRowSelection = function toggleRowSelection(states, row, selected) {
  8956. var changed = false;
  8957. var selection = states.selection;
  8958. var index = selection.indexOf(row);
  8959. if (typeof selected === 'undefined') {
  8960. if (index === -1) {
  8961. selection.push(row);
  8962. changed = true;
  8963. } else {
  8964. selection.splice(index, 1);
  8965. changed = true;
  8966. }
  8967. } else {
  8968. if (selected && index === -1) {
  8969. selection.push(row);
  8970. changed = true;
  8971. } else if (!selected && index > -1) {
  8972. selection.splice(index, 1);
  8973. changed = true;
  8974. }
  8975. }
  8976. return changed;
  8977. };
  8978. var toggleRowExpansion = function toggleRowExpansion(states, row, expanded) {
  8979. var changed = false;
  8980. var expandRows = states.expandRows;
  8981. if (typeof expanded !== 'undefined') {
  8982. var index = expandRows.indexOf(row);
  8983. if (expanded) {
  8984. if (index === -1) {
  8985. expandRows.push(row);
  8986. changed = true;
  8987. }
  8988. } else {
  8989. if (index !== -1) {
  8990. expandRows.splice(index, 1);
  8991. changed = true;
  8992. }
  8993. }
  8994. } else {
  8995. var _index = expandRows.indexOf(row);
  8996. if (_index === -1) {
  8997. expandRows.push(row);
  8998. changed = true;
  8999. } else {
  9000. expandRows.splice(_index, 1);
  9001. changed = true;
  9002. }
  9003. }
  9004. return changed;
  9005. };
  9006. var table_store_TableStore = function TableStore(table) {
  9007. var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9008. if (!table) {
  9009. throw new Error('Table is required.');
  9010. }
  9011. this.table = table;
  9012. this.states = {
  9013. rowKey: null,
  9014. _columns: [],
  9015. originColumns: [],
  9016. columns: [],
  9017. fixedColumns: [],
  9018. rightFixedColumns: [],
  9019. leafColumns: [],
  9020. fixedLeafColumns: [],
  9021. rightFixedLeafColumns: [],
  9022. leafColumnsLength: 0,
  9023. fixedLeafColumnsLength: 0,
  9024. rightFixedLeafColumnsLength: 0,
  9025. isComplex: false,
  9026. filteredData: null,
  9027. data: null,
  9028. sortingColumn: null,
  9029. sortProp: null,
  9030. sortOrder: null,
  9031. isAllSelected: false,
  9032. selection: [],
  9033. reserveSelection: false,
  9034. selectable: null,
  9035. currentRow: null,
  9036. hoverRow: null,
  9037. filters: {},
  9038. expandRows: [],
  9039. defaultExpandAll: false,
  9040. selectOnIndeterminate: false,
  9041. treeData: {},
  9042. indent: 16,
  9043. lazy: false,
  9044. lazyTreeNodeMap: {}
  9045. };
  9046. this._toggleAllSelection = debounce_default()(10, function (states) {
  9047. var data = states.data || [];
  9048. if (data.length === 0) return;
  9049. var selection = this.states.selection;
  9050. // when only some rows are selected (but not all), select or deselect all of them
  9051. // depending on the value of selectOnIndeterminate
  9052. var value = states.selectOnIndeterminate ? !states.isAllSelected : !(states.isAllSelected || selection.length);
  9053. var selectionChanged = false;
  9054. data.forEach(function (item, index) {
  9055. if (states.selectable) {
  9056. if (states.selectable.call(null, item, index) && toggleRowSelection(states, item, value)) {
  9057. selectionChanged = true;
  9058. }
  9059. } else {
  9060. if (toggleRowSelection(states, item, value)) {
  9061. selectionChanged = true;
  9062. }
  9063. }
  9064. });
  9065. var table = this.table;
  9066. if (selectionChanged) {
  9067. table.$emit('selection-change', selection ? selection.slice() : []);
  9068. }
  9069. table.$emit('select-all', selection);
  9070. states.isAllSelected = value;
  9071. });
  9072. for (var prop in initialState) {
  9073. if (initialState.hasOwnProperty(prop) && this.states.hasOwnProperty(prop)) {
  9074. this.states[prop] = initialState[prop];
  9075. }
  9076. }
  9077. };
  9078. table_store_TableStore.prototype.mutations = {
  9079. setData: function setData(states, data) {
  9080. var _this = this;
  9081. var dataInstanceChanged = states._data !== data;
  9082. states._data = data;
  9083. Object.keys(states.filters).forEach(function (columnId) {
  9084. var values = states.filters[columnId];
  9085. if (!values || values.length === 0) return;
  9086. var column = getColumnById(_this.states, columnId);
  9087. if (column && column.filterMethod) {
  9088. data = data.filter(function (row) {
  9089. return values.some(function (value) {
  9090. return column.filterMethod.call(null, value, row, column);
  9091. });
  9092. });
  9093. }
  9094. });
  9095. states.filteredData = data;
  9096. states.data = table_store_sortData(data || [], states);
  9097. this.updateCurrentRow();
  9098. var rowKey = states.rowKey;
  9099. if (!states.reserveSelection) {
  9100. if (dataInstanceChanged) {
  9101. this.clearSelection();
  9102. } else {
  9103. this.cleanSelection();
  9104. }
  9105. this.updateAllSelected();
  9106. } else {
  9107. if (rowKey) {
  9108. var selection = states.selection;
  9109. var selectedMap = table_store_getKeysMap(selection, rowKey);
  9110. states.data.forEach(function (row) {
  9111. var rowId = getRowIdentity(row, rowKey);
  9112. var rowInfo = selectedMap[rowId];
  9113. if (rowInfo) {
  9114. selection[rowInfo.index] = row;
  9115. }
  9116. });
  9117. this.updateAllSelected();
  9118. } else {
  9119. console.warn('WARN: rowKey is required when reserve-selection is enabled.');
  9120. }
  9121. }
  9122. var defaultExpandAll = states.defaultExpandAll;
  9123. if (defaultExpandAll) {
  9124. this.states.expandRows = (states.data || []).slice(0);
  9125. } else if (rowKey) {
  9126. // update expandRows to new rows according to rowKey
  9127. var ids = table_store_getKeysMap(this.states.expandRows, rowKey);
  9128. var expandRows = [];
  9129. for (var _iterator = states.data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9130. var _ref;
  9131. if (_isArray) {
  9132. if (_i >= _iterator.length) break;
  9133. _ref = _iterator[_i++];
  9134. } else {
  9135. _i = _iterator.next();
  9136. if (_i.done) break;
  9137. _ref = _i.value;
  9138. }
  9139. var row = _ref;
  9140. var rowId = getRowIdentity(row, rowKey);
  9141. if (ids[rowId]) {
  9142. expandRows.push(row);
  9143. }
  9144. }
  9145. this.states.expandRows = expandRows;
  9146. } else {
  9147. // clear the old rows
  9148. this.states.expandRows = [];
  9149. }
  9150. external_vue_default.a.nextTick(function () {
  9151. return _this.table.updateScrollY();
  9152. });
  9153. },
  9154. changeSortCondition: function changeSortCondition(states, options) {
  9155. var _this2 = this;
  9156. states.data = table_store_sortData(states.filteredData || states._data || [], states);
  9157. if (!options || !(options.silent || options.init)) {
  9158. this.table.$emit('sort-change', {
  9159. column: this.states.sortingColumn,
  9160. prop: this.states.sortProp,
  9161. order: this.states.sortOrder
  9162. });
  9163. }
  9164. external_vue_default.a.nextTick(function () {
  9165. return _this2.table.updateScrollY();
  9166. });
  9167. },
  9168. sort: function sort(states, options) {
  9169. var _this3 = this;
  9170. var prop = options.prop,
  9171. order = options.order,
  9172. init = options.init;
  9173. if (prop) {
  9174. states.sortProp = prop;
  9175. states.sortOrder = order || 'ascending';
  9176. external_vue_default.a.nextTick(function () {
  9177. for (var i = 0, length = states.columns.length; i < length; i++) {
  9178. var column = states.columns[i];
  9179. if (column.property === states.sortProp) {
  9180. column.order = states.sortOrder;
  9181. states.sortingColumn = column;
  9182. break;
  9183. }
  9184. }
  9185. if (states.sortingColumn) {
  9186. _this3.commit('changeSortCondition', {
  9187. init: init
  9188. });
  9189. }
  9190. });
  9191. }
  9192. },
  9193. filterChange: function filterChange(states, options) {
  9194. var _this4 = this;
  9195. var column = options.column,
  9196. values = options.values,
  9197. silent = options.silent,
  9198. multi = options.multi;
  9199. if (values && !Array.isArray(values)) {
  9200. values = [values];
  9201. }
  9202. var filters = {};
  9203. if (multi) {
  9204. column.forEach(function (col) {
  9205. states.filters[col.id] = values;
  9206. filters[col.columnKey || col.id] = values;
  9207. });
  9208. } else {
  9209. var prop = column.property;
  9210. if (prop) {
  9211. states.filters[column.id] = values;
  9212. filters[column.columnKey || column.id] = values;
  9213. }
  9214. }
  9215. var data = states._data;
  9216. Object.keys(states.filters).forEach(function (columnId) {
  9217. var values = states.filters[columnId];
  9218. if (!values || values.length === 0) return;
  9219. var column = getColumnById(_this4.states, columnId);
  9220. if (column && column.filterMethod) {
  9221. data = data.filter(function (row) {
  9222. return values.some(function (value) {
  9223. return column.filterMethod.call(null, value, row, column);
  9224. });
  9225. });
  9226. }
  9227. });
  9228. states.filteredData = data;
  9229. states.data = table_store_sortData(data, states);
  9230. if (!silent) {
  9231. this.table.$emit('filter-change', filters);
  9232. }
  9233. external_vue_default.a.nextTick(function () {
  9234. return _this4.table.updateScrollY();
  9235. });
  9236. },
  9237. insertColumn: function insertColumn(states, column, index, parent) {
  9238. var array = states._columns;
  9239. if (parent) {
  9240. array = parent.children;
  9241. if (!array) array = parent.children = [];
  9242. }
  9243. if (typeof index !== 'undefined') {
  9244. array.splice(index, 0, column);
  9245. } else {
  9246. array.push(column);
  9247. }
  9248. if (column.type === 'selection') {
  9249. states.selectable = column.selectable;
  9250. states.reserveSelection = column.reserveSelection;
  9251. }
  9252. if (this.table.$ready) {
  9253. this.updateColumns(); // hack for dynamics insert column
  9254. this.scheduleLayout();
  9255. }
  9256. },
  9257. removeColumn: function removeColumn(states, column, parent) {
  9258. var array = states._columns;
  9259. if (parent) {
  9260. array = parent.children;
  9261. if (!array) array = parent.children = [];
  9262. }
  9263. if (array) {
  9264. array.splice(array.indexOf(column), 1);
  9265. }
  9266. if (this.table.$ready) {
  9267. this.updateColumns(); // hack for dynamics remove column
  9268. this.scheduleLayout();
  9269. }
  9270. },
  9271. setHoverRow: function setHoverRow(states, row) {
  9272. states.hoverRow = row;
  9273. },
  9274. setCurrentRow: function setCurrentRow(states, row) {
  9275. var oldCurrentRow = states.currentRow;
  9276. states.currentRow = row;
  9277. if (oldCurrentRow !== row) {
  9278. this.table.$emit('current-change', row, oldCurrentRow);
  9279. }
  9280. },
  9281. rowSelectedChanged: function rowSelectedChanged(states, row) {
  9282. var changed = toggleRowSelection(states, row);
  9283. var selection = states.selection;
  9284. if (changed) {
  9285. var table = this.table;
  9286. table.$emit('selection-change', selection ? selection.slice() : []);
  9287. table.$emit('select', selection, row);
  9288. }
  9289. this.updateAllSelected();
  9290. },
  9291. toggleAllSelection: function toggleAllSelection(state) {
  9292. this._toggleAllSelection(state);
  9293. }
  9294. };
  9295. var doFlattenColumns = function doFlattenColumns(columns) {
  9296. var result = [];
  9297. columns.forEach(function (column) {
  9298. if (column.children) {
  9299. result.push.apply(result, doFlattenColumns(column.children));
  9300. } else {
  9301. result.push(column);
  9302. }
  9303. });
  9304. return result;
  9305. };
  9306. table_store_TableStore.prototype.updateColumns = function () {
  9307. var states = this.states;
  9308. var _columns = states._columns || [];
  9309. states.fixedColumns = _columns.filter(function (column) {
  9310. return column.fixed === true || column.fixed === 'left';
  9311. });
  9312. states.rightFixedColumns = _columns.filter(function (column) {
  9313. return column.fixed === 'right';
  9314. });
  9315. if (states.fixedColumns.length > 0 && _columns[0] && _columns[0].type === 'selection' && !_columns[0].fixed) {
  9316. _columns[0].fixed = true;
  9317. states.fixedColumns.unshift(_columns[0]);
  9318. }
  9319. var notFixedColumns = _columns.filter(function (column) {
  9320. return !column.fixed;
  9321. });
  9322. states.originColumns = [].concat(states.fixedColumns).concat(notFixedColumns).concat(states.rightFixedColumns);
  9323. var leafColumns = doFlattenColumns(notFixedColumns);
  9324. var fixedLeafColumns = doFlattenColumns(states.fixedColumns);
  9325. var rightFixedLeafColumns = doFlattenColumns(states.rightFixedColumns);
  9326. states.leafColumnsLength = leafColumns.length;
  9327. states.fixedLeafColumnsLength = fixedLeafColumns.length;
  9328. states.rightFixedLeafColumnsLength = rightFixedLeafColumns.length;
  9329. states.columns = [].concat(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  9330. states.isComplex = states.fixedColumns.length > 0 || states.rightFixedColumns.length > 0;
  9331. };
  9332. table_store_TableStore.prototype.isSelected = function (row) {
  9333. return (this.states.selection || []).indexOf(row) > -1;
  9334. };
  9335. table_store_TableStore.prototype.clearSelection = function () {
  9336. var states = this.states;
  9337. states.isAllSelected = false;
  9338. var oldSelection = states.selection;
  9339. if (states.selection.length) {
  9340. states.selection = [];
  9341. }
  9342. if (oldSelection.length > 0) {
  9343. this.table.$emit('selection-change', states.selection ? states.selection.slice() : []);
  9344. }
  9345. };
  9346. table_store_TableStore.prototype.setExpandRowKeys = function (rowKeys) {
  9347. var expandRows = [];
  9348. var data = this.states.data;
  9349. var rowKey = this.states.rowKey;
  9350. if (!rowKey) throw new Error('[Table] prop row-key should not be empty.');
  9351. var keysMap = table_store_getKeysMap(data, rowKey);
  9352. rowKeys.forEach(function (key) {
  9353. var info = keysMap[key];
  9354. if (info) {
  9355. expandRows.push(info.row);
  9356. }
  9357. });
  9358. this.states.expandRows = expandRows;
  9359. };
  9360. table_store_TableStore.prototype.toggleRowSelection = function (row, selected) {
  9361. var changed = toggleRowSelection(this.states, row, selected);
  9362. if (changed) {
  9363. this.table.$emit('selection-change', this.states.selection ? this.states.selection.slice() : []);
  9364. }
  9365. };
  9366. table_store_TableStore.prototype.toggleRowExpansion = function (row, expanded) {
  9367. var changed = toggleRowExpansion(this.states, row, expanded);
  9368. if (changed) {
  9369. this.table.$emit('expand-change', row, this.states.expandRows);
  9370. this.scheduleLayout();
  9371. }
  9372. };
  9373. table_store_TableStore.prototype.isRowExpanded = function (row) {
  9374. var _states = this.states,
  9375. _states$expandRows = _states.expandRows,
  9376. expandRows = _states$expandRows === undefined ? [] : _states$expandRows,
  9377. rowKey = _states.rowKey;
  9378. if (rowKey) {
  9379. var expandMap = table_store_getKeysMap(expandRows, rowKey);
  9380. return !!expandMap[getRowIdentity(row, rowKey)];
  9381. }
  9382. return expandRows.indexOf(row) !== -1;
  9383. };
  9384. table_store_TableStore.prototype.cleanSelection = function () {
  9385. var selection = this.states.selection || [];
  9386. var data = this.states.data;
  9387. var rowKey = this.states.rowKey;
  9388. var deleted = void 0;
  9389. if (rowKey) {
  9390. deleted = [];
  9391. var selectedMap = table_store_getKeysMap(selection, rowKey);
  9392. var dataMap = table_store_getKeysMap(data, rowKey);
  9393. for (var key in selectedMap) {
  9394. if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
  9395. deleted.push(selectedMap[key].row);
  9396. }
  9397. }
  9398. } else {
  9399. deleted = selection.filter(function (item) {
  9400. return data.indexOf(item) === -1;
  9401. });
  9402. }
  9403. deleted.forEach(function (deletedItem) {
  9404. selection.splice(selection.indexOf(deletedItem), 1);
  9405. });
  9406. if (deleted.length) {
  9407. this.table.$emit('selection-change', selection ? selection.slice() : []);
  9408. }
  9409. };
  9410. table_store_TableStore.prototype.clearFilter = function (columnKeys) {
  9411. var states = this.states;
  9412. var _table$$refs = this.table.$refs,
  9413. tableHeader = _table$$refs.tableHeader,
  9414. fixedTableHeader = _table$$refs.fixedTableHeader,
  9415. rightFixedTableHeader = _table$$refs.rightFixedTableHeader;
  9416. var panels = {};
  9417. if (tableHeader) panels = merge_default()(panels, tableHeader.filterPanels);
  9418. if (fixedTableHeader) panels = merge_default()(panels, fixedTableHeader.filterPanels);
  9419. if (rightFixedTableHeader) panels = merge_default()(panels, rightFixedTableHeader.filterPanels);
  9420. var keys = Object.keys(panels);
  9421. if (!keys.length) return;
  9422. if (typeof columnKeys === 'string') {
  9423. columnKeys = [columnKeys];
  9424. }
  9425. if (Array.isArray(columnKeys)) {
  9426. var columns = columnKeys.map(function (key) {
  9427. return getColumnByKey(states, key);
  9428. });
  9429. keys.forEach(function (key) {
  9430. var column = columns.find(function (col) {
  9431. return col.id === key;
  9432. });
  9433. if (column) {
  9434. panels[key].filteredValue = [];
  9435. }
  9436. });
  9437. this.commit('filterChange', {
  9438. column: columns,
  9439. value: [],
  9440. silent: true,
  9441. multi: true
  9442. });
  9443. } else {
  9444. keys.forEach(function (key) {
  9445. panels[key].filteredValue = [];
  9446. });
  9447. states.filters = {};
  9448. this.commit('filterChange', {
  9449. column: {},
  9450. values: [],
  9451. silent: true
  9452. });
  9453. }
  9454. };
  9455. table_store_TableStore.prototype.clearSort = function () {
  9456. var states = this.states;
  9457. if (!states.sortingColumn) return;
  9458. states.sortingColumn.order = null;
  9459. states.sortProp = null;
  9460. states.sortOrder = null;
  9461. this.commit('changeSortCondition', {
  9462. silent: true
  9463. });
  9464. };
  9465. table_store_TableStore.prototype.updateAllSelected = function () {
  9466. var states = this.states;
  9467. var selection = states.selection,
  9468. rowKey = states.rowKey,
  9469. selectable = states.selectable,
  9470. data = states.data;
  9471. if (!data || data.length === 0) {
  9472. states.isAllSelected = false;
  9473. return;
  9474. }
  9475. var selectedMap = void 0;
  9476. if (rowKey) {
  9477. selectedMap = table_store_getKeysMap(states.selection, rowKey);
  9478. }
  9479. var isSelected = function isSelected(row) {
  9480. if (selectedMap) {
  9481. return !!selectedMap[getRowIdentity(row, rowKey)];
  9482. } else {
  9483. return selection.indexOf(row) !== -1;
  9484. }
  9485. };
  9486. var isAllSelected = true;
  9487. var selectedCount = 0;
  9488. for (var i = 0, j = data.length; i < j; i++) {
  9489. var item = data[i];
  9490. var isRowSelectable = selectable && selectable.call(null, item, i);
  9491. if (!isSelected(item)) {
  9492. if (!selectable || isRowSelectable) {
  9493. isAllSelected = false;
  9494. break;
  9495. }
  9496. } else {
  9497. selectedCount++;
  9498. }
  9499. }
  9500. if (selectedCount === 0) isAllSelected = false;
  9501. states.isAllSelected = isAllSelected;
  9502. };
  9503. table_store_TableStore.prototype.scheduleLayout = function (updateColumns) {
  9504. if (updateColumns) {
  9505. this.updateColumns();
  9506. }
  9507. this.table.debouncedUpdateLayout();
  9508. };
  9509. table_store_TableStore.prototype.setCurrentRowKey = function (key) {
  9510. var states = this.states;
  9511. var rowKey = states.rowKey;
  9512. if (!rowKey) throw new Error('[Table] row-key should not be empty.');
  9513. var data = states.data || [];
  9514. var keysMap = table_store_getKeysMap(data, rowKey);
  9515. var info = keysMap[key];
  9516. states.currentRow = info ? info.row : null;
  9517. };
  9518. table_store_TableStore.prototype.updateCurrentRow = function () {
  9519. var states = this.states;
  9520. var table = this.table;
  9521. var data = states.data || [];
  9522. var oldCurrentRow = states.currentRow;
  9523. if (data.indexOf(oldCurrentRow) === -1) {
  9524. if (states.rowKey && oldCurrentRow) {
  9525. var newCurrentRow = null;
  9526. for (var i = 0; i < data.length; i++) {
  9527. var item = data[i];
  9528. if (item && item[states.rowKey] === oldCurrentRow[states.rowKey]) {
  9529. newCurrentRow = item;
  9530. break;
  9531. }
  9532. }
  9533. if (newCurrentRow) {
  9534. states.currentRow = newCurrentRow;
  9535. return;
  9536. }
  9537. }
  9538. states.currentRow = null;
  9539. if (states.currentRow !== oldCurrentRow) {
  9540. table.$emit('current-change', null, oldCurrentRow);
  9541. }
  9542. }
  9543. };
  9544. table_store_TableStore.prototype.commit = function (name) {
  9545. var mutations = this.mutations;
  9546. if (mutations[name]) {
  9547. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  9548. args[_key - 1] = arguments[_key];
  9549. }
  9550. mutations[name].apply(this, [this.states].concat(args));
  9551. } else {
  9552. throw new Error('Action not found: ' + name);
  9553. }
  9554. };
  9555. table_store_TableStore.prototype.toggleTreeExpansion = function (rowKey) {
  9556. var treeData = this.states.treeData;
  9557. var node = treeData[rowKey];
  9558. if (!node) return;
  9559. if (typeof node.expanded !== 'boolean') {
  9560. throw new Error('a leaf must have expanded property');
  9561. }
  9562. node.expanded = !node.expanded;
  9563. var _traverse = null;
  9564. if (node.expanded) {
  9565. _traverse = function traverse(children, parent) {
  9566. if (children && parent.expanded) {
  9567. children.forEach(function (key) {
  9568. treeData[key].display = true;
  9569. _traverse(treeData[key].children, treeData[key]);
  9570. });
  9571. }
  9572. };
  9573. node.children.forEach(function (key) {
  9574. treeData[key].display = true;
  9575. _traverse(treeData[key].children, treeData[key]);
  9576. });
  9577. } else {
  9578. var traverse = function traverse(children) {
  9579. if (!children) return;
  9580. children.forEach(function (key) {
  9581. treeData[key].display = false;
  9582. traverse(treeData[key].children);
  9583. });
  9584. };
  9585. traverse(node.children);
  9586. }
  9587. };
  9588. table_store_TableStore.prototype.loadData = function (row, treeNode) {
  9589. var _this5 = this;
  9590. var table = this.table;
  9591. var parentRowKey = treeNode.rowKey;
  9592. if (table.lazy && table.load) {
  9593. table.load(row, treeNode, function (data) {
  9594. if (!Array.isArray(data)) {
  9595. throw new Error('data must be an array');
  9596. }
  9597. var treeData = _this5.states.treeData;
  9598. data.forEach(function (item) {
  9599. var rowKey = table.getRowKey(item);
  9600. var parent = treeData[parentRowKey];
  9601. parent.loaded = true;
  9602. parent.children.push(rowKey);
  9603. var child = {
  9604. display: true,
  9605. level: parent.level + 1
  9606. };
  9607. if (item.hasChildren) {
  9608. child.expanded = false;
  9609. child.hasChildren = true;
  9610. child.children = [];
  9611. }
  9612. external_vue_default.a.set(treeData, rowKey, child);
  9613. external_vue_default.a.set(_this5.states.lazyTreeNodeMap, rowKey, item);
  9614. });
  9615. _this5.toggleTreeExpansion(parentRowKey);
  9616. });
  9617. }
  9618. };
  9619. /* harmony default export */ var table_store = (table_store_TableStore);
  9620. // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
  9621. var scrollbar_width_ = __webpack_require__(29);
  9622. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  9623. // CONCATENATED MODULE: ./packages/table/src/table-layout.js
  9624. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9625. var table_layout_TableLayout = function () {
  9626. function TableLayout(options) {
  9627. _classCallCheck(this, TableLayout);
  9628. this.observers = [];
  9629. this.table = null;
  9630. this.store = null;
  9631. this.columns = null;
  9632. this.fit = true;
  9633. this.showHeader = true;
  9634. this.height = null;
  9635. this.scrollX = false;
  9636. this.scrollY = false;
  9637. this.bodyWidth = null;
  9638. this.fixedWidth = null;
  9639. this.rightFixedWidth = null;
  9640. this.tableHeight = null;
  9641. this.headerHeight = 44; // Table Header Height
  9642. this.appendHeight = 0; // Append Slot Height
  9643. this.footerHeight = 44; // Table Footer Height
  9644. this.viewportHeight = null; // Table Height - Scroll Bar Height
  9645. this.bodyHeight = null; // Table Height - Table Header Height
  9646. this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
  9647. this.gutterWidth = scrollbar_width_default()();
  9648. for (var name in options) {
  9649. if (options.hasOwnProperty(name)) {
  9650. this[name] = options[name];
  9651. }
  9652. }
  9653. if (!this.table) {
  9654. throw new Error('table is required for Table Layout');
  9655. }
  9656. if (!this.store) {
  9657. throw new Error('store is required for Table Layout');
  9658. }
  9659. }
  9660. TableLayout.prototype.updateScrollY = function updateScrollY() {
  9661. var height = this.height;
  9662. if (typeof height !== 'string' && typeof height !== 'number') return;
  9663. var bodyWrapper = this.table.bodyWrapper;
  9664. if (this.table.$el && bodyWrapper) {
  9665. var body = bodyWrapper.querySelector('.el-table__body');
  9666. this.scrollY = body.offsetHeight > this.bodyHeight;
  9667. }
  9668. };
  9669. TableLayout.prototype.setHeight = function setHeight(value) {
  9670. var _this = this;
  9671. var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'height';
  9672. if (external_vue_default.a.prototype.$isServer) return;
  9673. var el = this.table.$el;
  9674. if (typeof value === 'string' && /^\d+$/.test(value)) {
  9675. value = Number(value);
  9676. }
  9677. this.height = value;
  9678. if (!el && (value || value === 0)) return external_vue_default.a.nextTick(function () {
  9679. return _this.setHeight(value, prop);
  9680. });
  9681. if (typeof value === 'number') {
  9682. el.style[prop] = value + 'px';
  9683. this.updateElsHeight();
  9684. } else if (typeof value === 'string') {
  9685. el.style[prop] = value;
  9686. this.updateElsHeight();
  9687. }
  9688. };
  9689. TableLayout.prototype.setMaxHeight = function setMaxHeight(value) {
  9690. return this.setHeight(value, 'max-height');
  9691. };
  9692. TableLayout.prototype.updateElsHeight = function updateElsHeight() {
  9693. var _this2 = this;
  9694. if (!this.table.$ready) return external_vue_default.a.nextTick(function () {
  9695. return _this2.updateElsHeight();
  9696. });
  9697. var _table$$refs = this.table.$refs,
  9698. headerWrapper = _table$$refs.headerWrapper,
  9699. appendWrapper = _table$$refs.appendWrapper,
  9700. footerWrapper = _table$$refs.footerWrapper;
  9701. this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0;
  9702. if (this.showHeader && !headerWrapper) return;
  9703. var headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
  9704. if (this.showHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
  9705. return external_vue_default.a.nextTick(function () {
  9706. return _this2.updateElsHeight();
  9707. });
  9708. }
  9709. var tableHeight = this.tableHeight = this.table.$el.clientHeight;
  9710. if (this.height !== null && (!isNaN(this.height) || typeof this.height === 'string')) {
  9711. var footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0;
  9712. this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
  9713. }
  9714. this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight;
  9715. var noData = !this.table.data || this.table.data.length === 0;
  9716. this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
  9717. this.updateScrollY();
  9718. this.notifyObservers('scrollable');
  9719. };
  9720. TableLayout.prototype.getFlattenColumns = function getFlattenColumns() {
  9721. var flattenColumns = [];
  9722. var columns = this.table.columns;
  9723. columns.forEach(function (column) {
  9724. if (column.isColumnGroup) {
  9725. flattenColumns.push.apply(flattenColumns, column.columns);
  9726. } else {
  9727. flattenColumns.push(column);
  9728. }
  9729. });
  9730. return flattenColumns;
  9731. };
  9732. TableLayout.prototype.updateColumnsWidth = function updateColumnsWidth() {
  9733. if (external_vue_default.a.prototype.$isServer) return;
  9734. var fit = this.fit;
  9735. var bodyWidth = this.table.$el.clientWidth;
  9736. var bodyMinWidth = 0;
  9737. var flattenColumns = this.getFlattenColumns();
  9738. var flexColumns = flattenColumns.filter(function (column) {
  9739. return typeof column.width !== 'number';
  9740. });
  9741. flattenColumns.forEach(function (column) {
  9742. // Clean those columns whose width changed from flex to unflex
  9743. if (typeof column.width === 'number' && column.realWidth) column.realWidth = null;
  9744. });
  9745. if (flexColumns.length > 0 && fit) {
  9746. flattenColumns.forEach(function (column) {
  9747. bodyMinWidth += column.width || column.minWidth || 80;
  9748. });
  9749. var scrollYWidth = this.scrollY ? this.gutterWidth : 0;
  9750. if (bodyMinWidth <= bodyWidth - scrollYWidth) {
  9751. // DON'T HAVE SCROLL BAR
  9752. this.scrollX = false;
  9753. var totalFlexWidth = bodyWidth - scrollYWidth - bodyMinWidth;
  9754. if (flexColumns.length === 1) {
  9755. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth;
  9756. } else {
  9757. var allColumnsWidth = flexColumns.reduce(function (prev, column) {
  9758. return prev + (column.minWidth || 80);
  9759. }, 0);
  9760. var flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
  9761. var noneFirstWidth = 0;
  9762. flexColumns.forEach(function (column, index) {
  9763. if (index === 0) return;
  9764. var flexWidth = Math.floor((column.minWidth || 80) * flexWidthPerPixel);
  9765. noneFirstWidth += flexWidth;
  9766. column.realWidth = (column.minWidth || 80) + flexWidth;
  9767. });
  9768. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  9769. }
  9770. } else {
  9771. // HAVE HORIZONTAL SCROLL BAR
  9772. this.scrollX = true;
  9773. flexColumns.forEach(function (column) {
  9774. column.realWidth = column.minWidth;
  9775. });
  9776. }
  9777. this.bodyWidth = Math.max(bodyMinWidth, bodyWidth);
  9778. this.table.resizeState.width = this.bodyWidth;
  9779. } else {
  9780. flattenColumns.forEach(function (column) {
  9781. if (!column.width && !column.minWidth) {
  9782. column.realWidth = 80;
  9783. } else {
  9784. column.realWidth = column.width || column.minWidth;
  9785. }
  9786. bodyMinWidth += column.realWidth;
  9787. });
  9788. this.scrollX = bodyMinWidth > bodyWidth;
  9789. this.bodyWidth = bodyMinWidth;
  9790. }
  9791. var fixedColumns = this.store.states.fixedColumns;
  9792. if (fixedColumns.length > 0) {
  9793. var fixedWidth = 0;
  9794. fixedColumns.forEach(function (column) {
  9795. fixedWidth += column.realWidth || column.width;
  9796. });
  9797. this.fixedWidth = fixedWidth;
  9798. }
  9799. var rightFixedColumns = this.store.states.rightFixedColumns;
  9800. if (rightFixedColumns.length > 0) {
  9801. var rightFixedWidth = 0;
  9802. rightFixedColumns.forEach(function (column) {
  9803. rightFixedWidth += column.realWidth || column.width;
  9804. });
  9805. this.rightFixedWidth = rightFixedWidth;
  9806. }
  9807. this.notifyObservers('columns');
  9808. };
  9809. TableLayout.prototype.addObserver = function addObserver(observer) {
  9810. this.observers.push(observer);
  9811. };
  9812. TableLayout.prototype.removeObserver = function removeObserver(observer) {
  9813. var index = this.observers.indexOf(observer);
  9814. if (index !== -1) {
  9815. this.observers.splice(index, 1);
  9816. }
  9817. };
  9818. TableLayout.prototype.notifyObservers = function notifyObservers(event) {
  9819. var _this3 = this;
  9820. var observers = this.observers;
  9821. observers.forEach(function (observer) {
  9822. switch (event) {
  9823. case 'columns':
  9824. observer.onColumnsChange(_this3);
  9825. break;
  9826. case 'scrollable':
  9827. observer.onScrollableChange(_this3);
  9828. break;
  9829. default:
  9830. throw new Error('Table Layout don\'t have event ' + event + '.');
  9831. }
  9832. });
  9833. };
  9834. return TableLayout;
  9835. }();
  9836. /* harmony default export */ var table_layout = (table_layout_TableLayout);
  9837. // CONCATENATED MODULE: ./packages/table/src/layout-observer.js
  9838. /* harmony default export */ var layout_observer = ({
  9839. created: function created() {
  9840. this.tableLayout.addObserver(this);
  9841. },
  9842. destroyed: function destroyed() {
  9843. this.tableLayout.removeObserver(this);
  9844. },
  9845. computed: {
  9846. tableLayout: function tableLayout() {
  9847. var layout = this.layout;
  9848. if (!layout && this.table) {
  9849. layout = this.table.layout;
  9850. }
  9851. if (!layout) {
  9852. throw new Error('Can not find table layout.');
  9853. }
  9854. return layout;
  9855. }
  9856. },
  9857. mounted: function mounted() {
  9858. this.onColumnsChange(this.tableLayout);
  9859. this.onScrollableChange(this.tableLayout);
  9860. },
  9861. updated: function updated() {
  9862. if (this.__updated__) return;
  9863. this.onColumnsChange(this.tableLayout);
  9864. this.onScrollableChange(this.tableLayout);
  9865. this.__updated__ = true;
  9866. },
  9867. methods: {
  9868. onColumnsChange: function onColumnsChange() {
  9869. var cols = this.$el.querySelectorAll('colgroup > col');
  9870. if (!cols.length) return;
  9871. var flattenColumns = this.tableLayout.getFlattenColumns();
  9872. var columnsMap = {};
  9873. flattenColumns.forEach(function (column) {
  9874. columnsMap[column.id] = column;
  9875. });
  9876. for (var i = 0, j = cols.length; i < j; i++) {
  9877. var col = cols[i];
  9878. var name = col.getAttribute('name');
  9879. var column = columnsMap[name];
  9880. if (column) {
  9881. col.setAttribute('width', column.realWidth || column.width);
  9882. }
  9883. }
  9884. },
  9885. onScrollableChange: function onScrollableChange(layout) {
  9886. var cols = this.$el.querySelectorAll('colgroup > col[name=gutter]');
  9887. for (var i = 0, j = cols.length; i < j; i++) {
  9888. var col = cols[i];
  9889. col.setAttribute('width', layout.scrollY ? layout.gutterWidth : '0');
  9890. }
  9891. var ths = this.$el.querySelectorAll('th.gutter');
  9892. for (var _i = 0, _j = ths.length; _i < _j; _i++) {
  9893. var th = ths[_i];
  9894. th.style.width = layout.scrollY ? layout.gutterWidth + 'px' : '0';
  9895. th.style.display = layout.scrollY ? '' : 'none';
  9896. }
  9897. }
  9898. }
  9899. });
  9900. // CONCATENATED MODULE: ./packages/table/src/table-body.js
  9901. 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; };
  9902. 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; };
  9903. /* harmony default export */ var table_body = ({
  9904. name: 'ElTableBody',
  9905. mixins: [layout_observer],
  9906. components: {
  9907. ElCheckbox: checkbox_default.a,
  9908. ElTooltip: tooltip_default.a
  9909. },
  9910. props: {
  9911. store: {
  9912. required: true
  9913. },
  9914. stripe: Boolean,
  9915. context: {},
  9916. rowClassName: [String, Function],
  9917. rowStyle: [Object, Function],
  9918. fixed: String,
  9919. highlight: Boolean
  9920. },
  9921. render: function render(h) {
  9922. var _this = this;
  9923. var columnsHidden = this.columns.map(function (column, index) {
  9924. return _this.isColumnHidden(index);
  9925. });
  9926. var rows = this.data;
  9927. if (this.store.states.lazy && Object.keys(this.store.states.lazyTreeNodeMap).length) {
  9928. rows = rows.reduce(function (prev, item) {
  9929. prev.push(item);
  9930. var rowKey = _this.store.table.getRowKey(item);
  9931. var parent = _this.store.states.treeData[rowKey];
  9932. if (parent && parent.children && parent.hasChildren) {
  9933. var tmp = [];
  9934. var traverse = function traverse(children) {
  9935. if (!children) return;
  9936. children.forEach(function (key) {
  9937. tmp.push(_this.store.states.lazyTreeNodeMap[key]);
  9938. if (_this.store.states.treeData[key]) {
  9939. traverse(_this.store.states.treeData[key].children);
  9940. }
  9941. });
  9942. };
  9943. traverse(parent.children);
  9944. prev = prev.concat(tmp);
  9945. }
  9946. return prev;
  9947. }, []);
  9948. }
  9949. return h(
  9950. 'table',
  9951. {
  9952. 'class': 'el-table__body',
  9953. attrs: { cellspacing: '0',
  9954. cellpadding: '0',
  9955. border: '0' }
  9956. },
  9957. [h('colgroup', [this._l(this.columns, function (column) {
  9958. return h('col', {
  9959. attrs: { name: column.id }
  9960. });
  9961. })]), h('tbody', [this._l(rows, function (row, $index) {
  9962. var rowKey = _this.table.rowKey ? _this.getKeyOfRow(row, $index) : $index;
  9963. var treeNode = _this.treeData[rowKey];
  9964. var rowClasses = _this.getRowClass(row, $index);
  9965. if (treeNode) {
  9966. rowClasses.push('el-table__row--level-' + treeNode.level);
  9967. }
  9968. var tr = h(
  9969. 'tr',
  9970. {
  9971. directives: [{
  9972. name: 'show',
  9973. value: treeNode ? treeNode.display : true
  9974. }],
  9975. style: _this.rowStyle ? _this.getRowStyle(row, $index) : null,
  9976. key: rowKey,
  9977. on: {
  9978. 'dblclick': function dblclick($event) {
  9979. return _this.handleDoubleClick($event, row);
  9980. },
  9981. 'click': function click($event) {
  9982. return _this.handleClick($event, row);
  9983. },
  9984. 'contextmenu': function contextmenu($event) {
  9985. return _this.handleContextMenu($event, row);
  9986. },
  9987. 'mouseenter': function mouseenter(_) {
  9988. return _this.handleMouseEnter($index);
  9989. },
  9990. 'mouseleave': function mouseleave(_) {
  9991. return _this.handleMouseLeave();
  9992. }
  9993. },
  9994. 'class': rowClasses },
  9995. [_this._l(_this.columns, function (column, cellIndex) {
  9996. var _getSpan = _this.getSpan(row, column, $index, cellIndex),
  9997. rowspan = _getSpan.rowspan,
  9998. colspan = _getSpan.colspan;
  9999. if (!rowspan || !colspan) {
  10000. return '';
  10001. } else {
  10002. var columnData = _extends({}, column);
  10003. if (colspan !== 1) {
  10004. columnData.realWidth = columnData.realWidth * colspan;
  10005. }
  10006. var data = {
  10007. store: _this.store,
  10008. _self: _this.context || _this.table.$vnode.context,
  10009. column: columnData,
  10010. row: row,
  10011. $index: $index
  10012. };
  10013. if (cellIndex === _this.firstDefaultColumnIndex && treeNode) {
  10014. data.treeNode = {
  10015. hasChildren: treeNode.hasChildren || treeNode.children && treeNode.children.length,
  10016. expanded: treeNode.expanded,
  10017. indent: treeNode.level * _this.treeIndent,
  10018. level: treeNode.level,
  10019. loaded: treeNode.loaded,
  10020. rowKey: rowKey
  10021. };
  10022. }
  10023. return h(
  10024. 'td',
  10025. {
  10026. style: _this.getCellStyle($index, cellIndex, row, column),
  10027. 'class': _this.getCellClass($index, cellIndex, row, column),
  10028. attrs: { rowspan: rowspan,
  10029. colspan: colspan
  10030. },
  10031. on: {
  10032. 'mouseenter': function mouseenter($event) {
  10033. return _this.handleCellMouseEnter($event, row);
  10034. },
  10035. 'mouseleave': _this.handleCellMouseLeave
  10036. }
  10037. },
  10038. [column.renderCell.call(_this._renderProxy, h, data, columnsHidden[cellIndex])]
  10039. );
  10040. }
  10041. })]
  10042. );
  10043. if (_this.hasExpandColumn && _this.store.isRowExpanded(row)) {
  10044. return [tr, h('tr', [h(
  10045. 'td',
  10046. {
  10047. attrs: { colspan: _this.columns.length },
  10048. 'class': 'el-table__expanded-cell' },
  10049. [_this.table.renderExpanded ? _this.table.renderExpanded(h, { row: row, $index: $index, store: _this.store }) : '']
  10050. )])];
  10051. } else {
  10052. return tr;
  10053. }
  10054. }).concat(h('el-tooltip', {
  10055. attrs: { effect: this.table.tooltipEffect, placement: 'top', content: this.tooltipContent },
  10056. ref: 'tooltip' }))])]
  10057. );
  10058. },
  10059. computed: {
  10060. table: function table() {
  10061. return this.$parent;
  10062. },
  10063. data: function data() {
  10064. return this.store.states.data;
  10065. },
  10066. treeData: function treeData() {
  10067. return this.store.states.treeData;
  10068. },
  10069. columnsCount: function columnsCount() {
  10070. return this.store.states.columns.length;
  10071. },
  10072. leftFixedLeafCount: function leftFixedLeafCount() {
  10073. return this.store.states.fixedLeafColumnsLength;
  10074. },
  10075. rightFixedLeafCount: function rightFixedLeafCount() {
  10076. return this.store.states.rightFixedLeafColumnsLength;
  10077. },
  10078. leftFixedCount: function leftFixedCount() {
  10079. return this.store.states.fixedColumns.length;
  10080. },
  10081. rightFixedCount: function rightFixedCount() {
  10082. return this.store.states.rightFixedColumns.length;
  10083. },
  10084. columns: function columns() {
  10085. return this.store.states.columns;
  10086. },
  10087. hasExpandColumn: function hasExpandColumn() {
  10088. return this.columns.some(function (_ref) {
  10089. var type = _ref.type;
  10090. return type === 'expand';
  10091. });
  10092. },
  10093. firstDefaultColumnIndex: function firstDefaultColumnIndex() {
  10094. for (var index = 0; index < this.columns.length; index++) {
  10095. if (this.columns[index].type === 'default') {
  10096. return index;
  10097. }
  10098. }
  10099. return 0;
  10100. },
  10101. treeIndent: function treeIndent() {
  10102. return this.store.states.indent;
  10103. }
  10104. },
  10105. watch: {
  10106. // don't trigger getter of currentRow in getCellClass. see https://jsfiddle.net/oe2b4hqt/
  10107. // update DOM manually. see https://github.com/ElemeFE/element/pull/13954/files#diff-9b450c00d0a9dec0ffad5a3176972e40
  10108. 'store.states.hoverRow': function storeStatesHoverRow(newVal, oldVal) {
  10109. if (!this.store.states.isComplex) return;
  10110. var rows = this.$el.querySelectorAll('.el-table__row');
  10111. var oldRow = rows[oldVal];
  10112. var newRow = rows[newVal];
  10113. if (oldRow) {
  10114. Object(dom_["removeClass"])(oldRow, 'hover-row');
  10115. }
  10116. if (newRow) {
  10117. Object(dom_["addClass"])(newRow, 'hover-row');
  10118. }
  10119. }
  10120. },
  10121. data: function data() {
  10122. return {
  10123. tooltipContent: ''
  10124. };
  10125. },
  10126. created: function created() {
  10127. this.activateTooltip = debounce_default()(50, function (tooltip) {
  10128. return tooltip.handleShowPopper();
  10129. });
  10130. },
  10131. methods: {
  10132. getKeyOfRow: function getKeyOfRow(row, index) {
  10133. var rowKey = this.table.rowKey;
  10134. if (rowKey) {
  10135. return getRowIdentity(row, rowKey);
  10136. }
  10137. return index;
  10138. },
  10139. isColumnHidden: function isColumnHidden(index) {
  10140. if (this.fixed === true || this.fixed === 'left') {
  10141. return index >= this.leftFixedLeafCount;
  10142. } else if (this.fixed === 'right') {
  10143. return index < this.columnsCount - this.rightFixedLeafCount;
  10144. } else {
  10145. return index < this.leftFixedLeafCount || index >= this.columnsCount - this.rightFixedLeafCount;
  10146. }
  10147. },
  10148. getSpan: function getSpan(row, column, rowIndex, columnIndex) {
  10149. var rowspan = 1;
  10150. var colspan = 1;
  10151. var fn = this.table.spanMethod;
  10152. if (typeof fn === 'function') {
  10153. var result = fn({
  10154. row: row,
  10155. column: column,
  10156. rowIndex: rowIndex,
  10157. columnIndex: columnIndex
  10158. });
  10159. if (Array.isArray(result)) {
  10160. rowspan = result[0];
  10161. colspan = result[1];
  10162. } else if ((typeof result === 'undefined' ? 'undefined' : table_body_typeof(result)) === 'object') {
  10163. rowspan = result.rowspan;
  10164. colspan = result.colspan;
  10165. }
  10166. }
  10167. return {
  10168. rowspan: rowspan,
  10169. colspan: colspan
  10170. };
  10171. },
  10172. getRowStyle: function getRowStyle(row, rowIndex) {
  10173. var rowStyle = this.table.rowStyle;
  10174. if (typeof rowStyle === 'function') {
  10175. return rowStyle.call(null, {
  10176. row: row,
  10177. rowIndex: rowIndex
  10178. });
  10179. }
  10180. return rowStyle;
  10181. },
  10182. getRowClass: function getRowClass(row, rowIndex) {
  10183. var classes = ['el-table__row'];
  10184. if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
  10185. classes.push('current-row');
  10186. }
  10187. if (this.stripe && rowIndex % 2 === 1) {
  10188. classes.push('el-table__row--striped');
  10189. }
  10190. var rowClassName = this.table.rowClassName;
  10191. if (typeof rowClassName === 'string') {
  10192. classes.push(rowClassName);
  10193. } else if (typeof rowClassName === 'function') {
  10194. classes.push(rowClassName.call(null, {
  10195. row: row,
  10196. rowIndex: rowIndex
  10197. }));
  10198. }
  10199. if (this.store.states.expandRows.indexOf(row) > -1) {
  10200. classes.push('expanded');
  10201. }
  10202. return classes;
  10203. },
  10204. getCellStyle: function getCellStyle(rowIndex, columnIndex, row, column) {
  10205. var cellStyle = this.table.cellStyle;
  10206. if (typeof cellStyle === 'function') {
  10207. return cellStyle.call(null, {
  10208. rowIndex: rowIndex,
  10209. columnIndex: columnIndex,
  10210. row: row,
  10211. column: column
  10212. });
  10213. }
  10214. return cellStyle;
  10215. },
  10216. getCellClass: function getCellClass(rowIndex, columnIndex, row, column) {
  10217. var classes = [column.id, column.align, column.className];
  10218. if (this.isColumnHidden(columnIndex)) {
  10219. classes.push('is-hidden');
  10220. }
  10221. var cellClassName = this.table.cellClassName;
  10222. if (typeof cellClassName === 'string') {
  10223. classes.push(cellClassName);
  10224. } else if (typeof cellClassName === 'function') {
  10225. classes.push(cellClassName.call(null, {
  10226. rowIndex: rowIndex,
  10227. columnIndex: columnIndex,
  10228. row: row,
  10229. column: column
  10230. }));
  10231. }
  10232. return classes.join(' ');
  10233. },
  10234. handleCellMouseEnter: function handleCellMouseEnter(event, row) {
  10235. var table = this.table;
  10236. var cell = getCell(event);
  10237. if (cell) {
  10238. var column = getColumnByCell(table, cell);
  10239. var hoverState = table.hoverState = { cell: cell, column: column, row: row };
  10240. table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
  10241. }
  10242. // 判断是否text-overflow, 如果是就显示tooltip
  10243. var cellChild = event.target.querySelector('.cell');
  10244. if (!(Object(dom_["hasClass"])(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
  10245. return;
  10246. }
  10247. // use range width instead of scrollWidth to determine whether the text is overflowing
  10248. // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
  10249. var range = document.createRange();
  10250. range.setStart(cellChild, 0);
  10251. range.setEnd(cellChild, cellChild.childNodes.length);
  10252. var rangeWidth = range.getBoundingClientRect().width;
  10253. var padding = (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingLeft'), 10) || 0) + (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingRight'), 10) || 0);
  10254. if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
  10255. var tooltip = this.$refs.tooltip;
  10256. // TODO 会引起整个 Table 的重新渲染,需要优化
  10257. this.tooltipContent = cell.innerText || cell.textContent;
  10258. tooltip.referenceElm = cell;
  10259. tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
  10260. tooltip.doDestroy();
  10261. tooltip.setExpectedState(true);
  10262. this.activateTooltip(tooltip);
  10263. }
  10264. },
  10265. handleCellMouseLeave: function handleCellMouseLeave(event) {
  10266. var tooltip = this.$refs.tooltip;
  10267. if (tooltip) {
  10268. tooltip.setExpectedState(false);
  10269. tooltip.handleClosePopper();
  10270. }
  10271. var cell = getCell(event);
  10272. if (!cell) return;
  10273. var oldHoverState = this.table.hoverState || {};
  10274. this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
  10275. },
  10276. handleMouseEnter: function handleMouseEnter(index) {
  10277. this.store.commit('setHoverRow', index);
  10278. },
  10279. handleMouseLeave: function handleMouseLeave() {
  10280. this.store.commit('setHoverRow', null);
  10281. },
  10282. handleContextMenu: function handleContextMenu(event, row) {
  10283. this.handleEvent(event, row, 'contextmenu');
  10284. },
  10285. handleDoubleClick: function handleDoubleClick(event, row) {
  10286. this.handleEvent(event, row, 'dblclick');
  10287. },
  10288. handleClick: function handleClick(event, row) {
  10289. this.store.commit('setCurrentRow', row);
  10290. this.handleEvent(event, row, 'click');
  10291. },
  10292. handleEvent: function handleEvent(event, row, name) {
  10293. var table = this.table;
  10294. var cell = getCell(event);
  10295. var column = void 0;
  10296. if (cell) {
  10297. column = getColumnByCell(table, cell);
  10298. if (column) {
  10299. table.$emit('cell-' + name, row, column, cell, event);
  10300. }
  10301. }
  10302. table.$emit('row-' + name, row, column, event);
  10303. },
  10304. handleExpandClick: function handleExpandClick(row, e) {
  10305. e.stopPropagation();
  10306. this.store.toggleRowExpansion(row);
  10307. }
  10308. }
  10309. });
  10310. // 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&
  10311. var filter_panelvue_type_template_id_7f2c919f_render = function() {
  10312. var _vm = this
  10313. var _h = _vm.$createElement
  10314. var _c = _vm._self._c || _h
  10315. return _c("transition", { attrs: { name: "el-zoom-in-top" } }, [
  10316. _vm.multiple
  10317. ? _c(
  10318. "div",
  10319. {
  10320. directives: [
  10321. {
  10322. name: "clickoutside",
  10323. rawName: "v-clickoutside",
  10324. value: _vm.handleOutsideClick,
  10325. expression: "handleOutsideClick"
  10326. },
  10327. {
  10328. name: "show",
  10329. rawName: "v-show",
  10330. value: _vm.showPopper,
  10331. expression: "showPopper"
  10332. }
  10333. ],
  10334. staticClass: "el-table-filter"
  10335. },
  10336. [
  10337. _c(
  10338. "div",
  10339. { staticClass: "el-table-filter__content" },
  10340. [
  10341. _c(
  10342. "el-scrollbar",
  10343. { attrs: { "wrap-class": "el-table-filter__wrap" } },
  10344. [
  10345. _c(
  10346. "el-checkbox-group",
  10347. {
  10348. staticClass: "el-table-filter__checkbox-group",
  10349. model: {
  10350. value: _vm.filteredValue,
  10351. callback: function($$v) {
  10352. _vm.filteredValue = $$v
  10353. },
  10354. expression: "filteredValue"
  10355. }
  10356. },
  10357. _vm._l(_vm.filters, function(filter) {
  10358. return _c(
  10359. "el-checkbox",
  10360. { key: filter.value, attrs: { label: filter.value } },
  10361. [_vm._v(_vm._s(filter.text))]
  10362. )
  10363. }),
  10364. 1
  10365. )
  10366. ],
  10367. 1
  10368. )
  10369. ],
  10370. 1
  10371. ),
  10372. _c("div", { staticClass: "el-table-filter__bottom" }, [
  10373. _c(
  10374. "button",
  10375. {
  10376. class: { "is-disabled": _vm.filteredValue.length === 0 },
  10377. attrs: { disabled: _vm.filteredValue.length === 0 },
  10378. on: { click: _vm.handleConfirm }
  10379. },
  10380. [_vm._v(_vm._s(_vm.t("el.table.confirmFilter")))]
  10381. ),
  10382. _c("button", { on: { click: _vm.handleReset } }, [
  10383. _vm._v(_vm._s(_vm.t("el.table.resetFilter")))
  10384. ])
  10385. ])
  10386. ]
  10387. )
  10388. : _c(
  10389. "div",
  10390. {
  10391. directives: [
  10392. {
  10393. name: "clickoutside",
  10394. rawName: "v-clickoutside",
  10395. value: _vm.handleOutsideClick,
  10396. expression: "handleOutsideClick"
  10397. },
  10398. {
  10399. name: "show",
  10400. rawName: "v-show",
  10401. value: _vm.showPopper,
  10402. expression: "showPopper"
  10403. }
  10404. ],
  10405. staticClass: "el-table-filter"
  10406. },
  10407. [
  10408. _c(
  10409. "ul",
  10410. { staticClass: "el-table-filter__list" },
  10411. [
  10412. _c(
  10413. "li",
  10414. {
  10415. staticClass: "el-table-filter__list-item",
  10416. class: {
  10417. "is-active":
  10418. _vm.filterValue === undefined ||
  10419. _vm.filterValue === null
  10420. },
  10421. on: {
  10422. click: function($event) {
  10423. _vm.handleSelect(null)
  10424. }
  10425. }
  10426. },
  10427. [_vm._v(_vm._s(_vm.t("el.table.clearFilter")))]
  10428. ),
  10429. _vm._l(_vm.filters, function(filter) {
  10430. return _c(
  10431. "li",
  10432. {
  10433. key: filter.value,
  10434. staticClass: "el-table-filter__list-item",
  10435. class: { "is-active": _vm.isActive(filter) },
  10436. attrs: { label: filter.value },
  10437. on: {
  10438. click: function($event) {
  10439. _vm.handleSelect(filter.value)
  10440. }
  10441. }
  10442. },
  10443. [_vm._v(_vm._s(filter.text))]
  10444. )
  10445. })
  10446. ],
  10447. 2
  10448. )
  10449. ]
  10450. )
  10451. ])
  10452. }
  10453. var filter_panelvue_type_template_id_7f2c919f_staticRenderFns = []
  10454. filter_panelvue_type_template_id_7f2c919f_render._withStripped = true
  10455. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=template&id=7f2c919f&
  10456. // CONCATENATED MODULE: ./packages/table/src/dropdown.js
  10457. var dropdowns = [];
  10458. !external_vue_default.a.prototype.$isServer && document.addEventListener('click', function (event) {
  10459. dropdowns.forEach(function (dropdown) {
  10460. var target = event.target;
  10461. if (!dropdown || !dropdown.$el) return;
  10462. if (target === dropdown.$el || dropdown.$el.contains(target)) {
  10463. return;
  10464. }
  10465. dropdown.handleOutsideClick && dropdown.handleOutsideClick(event);
  10466. });
  10467. });
  10468. /* harmony default export */ var src_dropdown = ({
  10469. open: function open(instance) {
  10470. if (instance) {
  10471. dropdowns.push(instance);
  10472. }
  10473. },
  10474. close: function close(instance) {
  10475. var index = dropdowns.indexOf(instance);
  10476. if (index !== -1) {
  10477. dropdowns.splice(instance, 1);
  10478. }
  10479. }
  10480. });
  10481. // EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
  10482. var checkbox_group_ = __webpack_require__(30);
  10483. var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
  10484. // 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&
  10485. //
  10486. //
  10487. //
  10488. //
  10489. //
  10490. //
  10491. //
  10492. //
  10493. //
  10494. //
  10495. //
  10496. //
  10497. //
  10498. //
  10499. //
  10500. //
  10501. //
  10502. //
  10503. //
  10504. //
  10505. //
  10506. //
  10507. //
  10508. //
  10509. //
  10510. //
  10511. //
  10512. //
  10513. //
  10514. //
  10515. //
  10516. //
  10517. //
  10518. //
  10519. //
  10520. //
  10521. //
  10522. //
  10523. //
  10524. //
  10525. //
  10526. //
  10527. //
  10528. //
  10529. /* harmony default export */ var filter_panelvue_type_script_lang_js_ = ({
  10530. name: 'ElTableFilterPanel',
  10531. mixins: [vue_popper_default.a, locale_default.a],
  10532. directives: {
  10533. Clickoutside: clickoutside_default.a
  10534. },
  10535. components: {
  10536. ElCheckbox: checkbox_default.a,
  10537. ElCheckboxGroup: checkbox_group_default.a
  10538. },
  10539. props: {
  10540. placement: {
  10541. type: String,
  10542. default: 'bottom-end'
  10543. }
  10544. },
  10545. customRender: function customRender(h) {
  10546. return h(
  10547. 'div',
  10548. { 'class': 'el-table-filter' },
  10549. [h('div', { 'class': 'el-table-filter__content' }), h(
  10550. 'div',
  10551. { 'class': 'el-table-filter__bottom' },
  10552. [h(
  10553. 'button',
  10554. {
  10555. on: {
  10556. 'click': this.handleConfirm
  10557. }
  10558. },
  10559. [this.t('el.table.confirmFilter')]
  10560. ), h(
  10561. 'button',
  10562. {
  10563. on: {
  10564. 'click': this.handleReset
  10565. }
  10566. },
  10567. [this.t('el.table.resetFilter')]
  10568. )]
  10569. )]
  10570. );
  10571. },
  10572. methods: {
  10573. isActive: function isActive(filter) {
  10574. return filter.value === this.filterValue;
  10575. },
  10576. handleOutsideClick: function handleOutsideClick() {
  10577. var _this = this;
  10578. setTimeout(function () {
  10579. _this.showPopper = false;
  10580. }, 16);
  10581. },
  10582. handleConfirm: function handleConfirm() {
  10583. this.confirmFilter(this.filteredValue);
  10584. this.handleOutsideClick();
  10585. },
  10586. handleReset: function handleReset() {
  10587. this.filteredValue = [];
  10588. this.confirmFilter(this.filteredValue);
  10589. this.handleOutsideClick();
  10590. },
  10591. handleSelect: function handleSelect(filterValue) {
  10592. this.filterValue = filterValue;
  10593. if (typeof filterValue !== 'undefined' && filterValue !== null) {
  10594. this.confirmFilter(this.filteredValue);
  10595. } else {
  10596. this.confirmFilter([]);
  10597. }
  10598. this.handleOutsideClick();
  10599. },
  10600. confirmFilter: function confirmFilter(filteredValue) {
  10601. this.table.store.commit('filterChange', {
  10602. column: this.column,
  10603. values: filteredValue
  10604. });
  10605. this.table.store.updateAllSelected();
  10606. }
  10607. },
  10608. data: function data() {
  10609. return {
  10610. table: null,
  10611. cell: null,
  10612. column: null
  10613. };
  10614. },
  10615. computed: {
  10616. filters: function filters() {
  10617. return this.column && this.column.filters;
  10618. },
  10619. filterValue: {
  10620. get: function get() {
  10621. return (this.column.filteredValue || [])[0];
  10622. },
  10623. set: function set(value) {
  10624. if (this.filteredValue) {
  10625. if (typeof value !== 'undefined' && value !== null) {
  10626. this.filteredValue.splice(0, 1, value);
  10627. } else {
  10628. this.filteredValue.splice(0, 1);
  10629. }
  10630. }
  10631. }
  10632. },
  10633. filteredValue: {
  10634. get: function get() {
  10635. if (this.column) {
  10636. return this.column.filteredValue || [];
  10637. }
  10638. return [];
  10639. },
  10640. set: function set(value) {
  10641. if (this.column) {
  10642. this.column.filteredValue = value;
  10643. }
  10644. }
  10645. },
  10646. multiple: function multiple() {
  10647. if (this.column) {
  10648. return this.column.filterMultiple;
  10649. }
  10650. return true;
  10651. }
  10652. },
  10653. mounted: function mounted() {
  10654. var _this2 = this;
  10655. this.popperElm = this.$el;
  10656. this.referenceElm = this.cell;
  10657. this.table.bodyWrapper.addEventListener('scroll', function () {
  10658. _this2.updatePopper();
  10659. });
  10660. this.$watch('showPopper', function (value) {
  10661. if (_this2.column) _this2.column.filterOpened = value;
  10662. if (value) {
  10663. src_dropdown.open(_this2);
  10664. } else {
  10665. src_dropdown.close(_this2);
  10666. }
  10667. });
  10668. },
  10669. watch: {
  10670. showPopper: function showPopper(val) {
  10671. if (val === true && parseInt(this.popperJS._popper.style.zIndex, 10) < popup_["PopupManager"].zIndex) {
  10672. this.popperJS._popper.style.zIndex = popup_["PopupManager"].nextZIndex();
  10673. }
  10674. }
  10675. }
  10676. });
  10677. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=script&lang=js&
  10678. /* harmony default export */ var src_filter_panelvue_type_script_lang_js_ = (filter_panelvue_type_script_lang_js_);
  10679. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue
  10680. /* normalize component */
  10681. var filter_panel_component = normalizeComponent(
  10682. src_filter_panelvue_type_script_lang_js_,
  10683. filter_panelvue_type_template_id_7f2c919f_render,
  10684. filter_panelvue_type_template_id_7f2c919f_staticRenderFns,
  10685. false,
  10686. null,
  10687. null,
  10688. null
  10689. )
  10690. /* hot reload */
  10691. if (false) { var filter_panel_api; }
  10692. filter_panel_component.options.__file = "packages/table/src/filter-panel.vue"
  10693. /* harmony default export */ var filter_panel = (filter_panel_component.exports);
  10694. // CONCATENATED MODULE: ./packages/table/src/table-header.js
  10695. var getAllColumns = function getAllColumns(columns) {
  10696. var result = [];
  10697. columns.forEach(function (column) {
  10698. if (column.children) {
  10699. result.push(column);
  10700. result.push.apply(result, getAllColumns(column.children));
  10701. } else {
  10702. result.push(column);
  10703. }
  10704. });
  10705. return result;
  10706. };
  10707. var convertToRows = function convertToRows(originColumns) {
  10708. var maxLevel = 1;
  10709. var traverse = function traverse(column, parent) {
  10710. if (parent) {
  10711. column.level = parent.level + 1;
  10712. if (maxLevel < column.level) {
  10713. maxLevel = column.level;
  10714. }
  10715. }
  10716. if (column.children) {
  10717. var colSpan = 0;
  10718. column.children.forEach(function (subColumn) {
  10719. traverse(subColumn, column);
  10720. colSpan += subColumn.colSpan;
  10721. });
  10722. column.colSpan = colSpan;
  10723. } else {
  10724. column.colSpan = 1;
  10725. }
  10726. };
  10727. originColumns.forEach(function (column) {
  10728. column.level = 1;
  10729. traverse(column);
  10730. });
  10731. var rows = [];
  10732. for (var i = 0; i < maxLevel; i++) {
  10733. rows.push([]);
  10734. }
  10735. var allColumns = getAllColumns(originColumns);
  10736. allColumns.forEach(function (column) {
  10737. if (!column.children) {
  10738. column.rowSpan = maxLevel - column.level + 1;
  10739. } else {
  10740. column.rowSpan = 1;
  10741. }
  10742. rows[column.level - 1].push(column);
  10743. });
  10744. return rows;
  10745. };
  10746. /* harmony default export */ var table_header = ({
  10747. name: 'ElTableHeader',
  10748. mixins: [layout_observer],
  10749. render: function render(h) {
  10750. var _this = this;
  10751. var originColumns = this.store.states.originColumns;
  10752. var columnRows = convertToRows(originColumns, this.columns);
  10753. // 是否拥有多级表头
  10754. var isGroup = columnRows.length > 1;
  10755. if (isGroup) this.$parent.isGroup = true;
  10756. return h(
  10757. 'table',
  10758. {
  10759. 'class': 'el-table__header',
  10760. attrs: { cellspacing: '0',
  10761. cellpadding: '0',
  10762. border: '0' }
  10763. },
  10764. [h('colgroup', [this._l(this.columns, function (column) {
  10765. return h('col', {
  10766. attrs: { name: column.id }
  10767. });
  10768. }), this.hasGutter ? h('col', {
  10769. attrs: { name: 'gutter' }
  10770. }) : '']), h(
  10771. 'thead',
  10772. { 'class': [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] },
  10773. [this._l(columnRows, function (columns, rowIndex) {
  10774. return h(
  10775. 'tr',
  10776. {
  10777. style: _this.getHeaderRowStyle(rowIndex),
  10778. 'class': _this.getHeaderRowClass(rowIndex)
  10779. },
  10780. [_this._l(columns, function (column, cellIndex) {
  10781. return h(
  10782. 'th',
  10783. {
  10784. attrs: {
  10785. colspan: column.colSpan,
  10786. rowspan: column.rowSpan
  10787. },
  10788. on: {
  10789. 'mousemove': function mousemove($event) {
  10790. return _this.handleMouseMove($event, column);
  10791. },
  10792. 'mouseout': _this.handleMouseOut,
  10793. 'mousedown': function mousedown($event) {
  10794. return _this.handleMouseDown($event, column);
  10795. },
  10796. 'click': function click($event) {
  10797. return _this.handleHeaderClick($event, column);
  10798. },
  10799. 'contextmenu': function contextmenu($event) {
  10800. return _this.handleHeaderContextMenu($event, column);
  10801. }
  10802. },
  10803. style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
  10804. 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
  10805. key: column.id },
  10806. [h(
  10807. 'div',
  10808. { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
  10809. [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(
  10810. 'span',
  10811. { 'class': 'caret-wrapper', on: {
  10812. 'click': function click($event) {
  10813. return _this.handleSortClick($event, column);
  10814. }
  10815. }
  10816. },
  10817. [h('i', { 'class': 'sort-caret ascending', on: {
  10818. 'click': function click($event) {
  10819. return _this.handleSortClick($event, column, 'ascending');
  10820. }
  10821. }
  10822. }), h('i', { 'class': 'sort-caret descending', on: {
  10823. 'click': function click($event) {
  10824. return _this.handleSortClick($event, column, 'descending');
  10825. }
  10826. }
  10827. })]
  10828. ) : '', column.filterable ? h(
  10829. 'span',
  10830. { 'class': 'el-table__column-filter-trigger', on: {
  10831. 'click': function click($event) {
  10832. return _this.handleFilterClick($event, column);
  10833. }
  10834. }
  10835. },
  10836. [h('i', { 'class': ['el-icon-arrow-down', column.filterOpened ? 'el-icon-arrow-up' : ''] })]
  10837. ) : '']
  10838. )]
  10839. );
  10840. }), _this.hasGutter ? h('th', { 'class': 'gutter' }) : '']
  10841. );
  10842. })]
  10843. )]
  10844. );
  10845. },
  10846. props: {
  10847. fixed: String,
  10848. store: {
  10849. required: true
  10850. },
  10851. border: Boolean,
  10852. defaultSort: {
  10853. type: Object,
  10854. default: function _default() {
  10855. return {
  10856. prop: '',
  10857. order: ''
  10858. };
  10859. }
  10860. }
  10861. },
  10862. components: {
  10863. ElCheckbox: checkbox_default.a,
  10864. ElTag: tag_default.a
  10865. },
  10866. computed: {
  10867. table: function table() {
  10868. return this.$parent;
  10869. },
  10870. isAllSelected: function isAllSelected() {
  10871. return this.store.states.isAllSelected;
  10872. },
  10873. columnsCount: function columnsCount() {
  10874. return this.store.states.columns.length;
  10875. },
  10876. leftFixedCount: function leftFixedCount() {
  10877. return this.store.states.fixedColumns.length;
  10878. },
  10879. rightFixedCount: function rightFixedCount() {
  10880. return this.store.states.rightFixedColumns.length;
  10881. },
  10882. leftFixedLeafCount: function leftFixedLeafCount() {
  10883. return this.store.states.fixedLeafColumnsLength;
  10884. },
  10885. rightFixedLeafCount: function rightFixedLeafCount() {
  10886. return this.store.states.rightFixedLeafColumnsLength;
  10887. },
  10888. columns: function columns() {
  10889. return this.store.states.columns;
  10890. },
  10891. hasGutter: function hasGutter() {
  10892. return !this.fixed && this.tableLayout.gutterWidth;
  10893. }
  10894. },
  10895. created: function created() {
  10896. this.filterPanels = {};
  10897. },
  10898. mounted: function mounted() {
  10899. var _defaultSort = this.defaultSort,
  10900. prop = _defaultSort.prop,
  10901. order = _defaultSort.order;
  10902. var init = true;
  10903. this.store.commit('sort', { prop: prop, order: order, init: init });
  10904. },
  10905. beforeDestroy: function beforeDestroy() {
  10906. var panels = this.filterPanels;
  10907. for (var prop in panels) {
  10908. if (panels.hasOwnProperty(prop) && panels[prop]) {
  10909. panels[prop].$destroy(true);
  10910. }
  10911. }
  10912. },
  10913. methods: {
  10914. isCellHidden: function isCellHidden(index, columns) {
  10915. var start = 0;
  10916. for (var i = 0; i < index; i++) {
  10917. start += columns[i].colSpan;
  10918. }
  10919. var after = start + columns[index].colSpan - 1;
  10920. if (this.fixed === true || this.fixed === 'left') {
  10921. return after >= this.leftFixedLeafCount;
  10922. } else if (this.fixed === 'right') {
  10923. return start < this.columnsCount - this.rightFixedLeafCount;
  10924. } else {
  10925. return after < this.leftFixedLeafCount || start >= this.columnsCount - this.rightFixedLeafCount;
  10926. }
  10927. },
  10928. getHeaderRowStyle: function getHeaderRowStyle(rowIndex) {
  10929. var headerRowStyle = this.table.headerRowStyle;
  10930. if (typeof headerRowStyle === 'function') {
  10931. return headerRowStyle.call(null, { rowIndex: rowIndex });
  10932. }
  10933. return headerRowStyle;
  10934. },
  10935. getHeaderRowClass: function getHeaderRowClass(rowIndex) {
  10936. var classes = [];
  10937. var headerRowClassName = this.table.headerRowClassName;
  10938. if (typeof headerRowClassName === 'string') {
  10939. classes.push(headerRowClassName);
  10940. } else if (typeof headerRowClassName === 'function') {
  10941. classes.push(headerRowClassName.call(null, { rowIndex: rowIndex }));
  10942. }
  10943. return classes.join(' ');
  10944. },
  10945. getHeaderCellStyle: function getHeaderCellStyle(rowIndex, columnIndex, row, column) {
  10946. var headerCellStyle = this.table.headerCellStyle;
  10947. if (typeof headerCellStyle === 'function') {
  10948. return headerCellStyle.call(null, {
  10949. rowIndex: rowIndex,
  10950. columnIndex: columnIndex,
  10951. row: row,
  10952. column: column
  10953. });
  10954. }
  10955. return headerCellStyle;
  10956. },
  10957. getHeaderCellClass: function getHeaderCellClass(rowIndex, columnIndex, row, column) {
  10958. var classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];
  10959. if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
  10960. classes.push('is-hidden');
  10961. }
  10962. if (!column.children) {
  10963. classes.push('is-leaf');
  10964. }
  10965. if (column.sortable) {
  10966. classes.push('is-sortable');
  10967. }
  10968. var headerCellClassName = this.table.headerCellClassName;
  10969. if (typeof headerCellClassName === 'string') {
  10970. classes.push(headerCellClassName);
  10971. } else if (typeof headerCellClassName === 'function') {
  10972. classes.push(headerCellClassName.call(null, {
  10973. rowIndex: rowIndex,
  10974. columnIndex: columnIndex,
  10975. row: row,
  10976. column: column
  10977. }));
  10978. }
  10979. return classes.join(' ');
  10980. },
  10981. toggleAllSelection: function toggleAllSelection(event) {
  10982. event.stopPropagation();
  10983. this.store.commit('toggleAllSelection');
  10984. },
  10985. handleFilterClick: function handleFilterClick(event, column) {
  10986. event.stopPropagation();
  10987. var target = event.target;
  10988. var cell = target.tagName === 'TH' ? target : target.parentNode;
  10989. cell = cell.querySelector('.el-table__column-filter-trigger') || cell;
  10990. var table = this.$parent;
  10991. var filterPanel = this.filterPanels[column.id];
  10992. if (filterPanel && column.filterOpened) {
  10993. filterPanel.showPopper = false;
  10994. return;
  10995. }
  10996. if (!filterPanel) {
  10997. filterPanel = new external_vue_default.a(filter_panel);
  10998. this.filterPanels[column.id] = filterPanel;
  10999. if (column.filterPlacement) {
  11000. filterPanel.placement = column.filterPlacement;
  11001. }
  11002. filterPanel.table = table;
  11003. filterPanel.cell = cell;
  11004. filterPanel.column = column;
  11005. !this.$isServer && filterPanel.$mount(document.createElement('div'));
  11006. }
  11007. setTimeout(function () {
  11008. filterPanel.showPopper = true;
  11009. }, 16);
  11010. },
  11011. handleHeaderClick: function handleHeaderClick(event, column) {
  11012. if (!column.filters && column.sortable) {
  11013. this.handleSortClick(event, column);
  11014. } else if (column.filterable && !column.sortable) {
  11015. this.handleFilterClick(event, column);
  11016. }
  11017. this.$parent.$emit('header-click', column, event);
  11018. },
  11019. handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
  11020. this.$parent.$emit('header-contextmenu', column, event);
  11021. },
  11022. handleMouseDown: function handleMouseDown(event, column) {
  11023. var _this2 = this;
  11024. if (this.$isServer) return;
  11025. if (column.children && column.children.length > 0) return;
  11026. /* istanbul ignore if */
  11027. if (this.draggingColumn && this.border) {
  11028. this.dragging = true;
  11029. this.$parent.resizeProxyVisible = true;
  11030. var table = this.$parent;
  11031. var tableEl = table.$el;
  11032. var tableLeft = tableEl.getBoundingClientRect().left;
  11033. var columnEl = this.$el.querySelector('th.' + column.id);
  11034. var columnRect = columnEl.getBoundingClientRect();
  11035. var minLeft = columnRect.left - tableLeft + 30;
  11036. Object(dom_["addClass"])(columnEl, 'noclick');
  11037. this.dragState = {
  11038. startMouseLeft: event.clientX,
  11039. startLeft: columnRect.right - tableLeft,
  11040. startColumnLeft: columnRect.left - tableLeft,
  11041. tableLeft: tableLeft
  11042. };
  11043. var resizeProxy = table.$refs.resizeProxy;
  11044. resizeProxy.style.left = this.dragState.startLeft + 'px';
  11045. document.onselectstart = function () {
  11046. return false;
  11047. };
  11048. document.ondragstart = function () {
  11049. return false;
  11050. };
  11051. var handleMouseMove = function handleMouseMove(event) {
  11052. var deltaLeft = event.clientX - _this2.dragState.startMouseLeft;
  11053. var proxyLeft = _this2.dragState.startLeft + deltaLeft;
  11054. resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
  11055. };
  11056. var handleMouseUp = function handleMouseUp() {
  11057. if (_this2.dragging) {
  11058. var _dragState = _this2.dragState,
  11059. startColumnLeft = _dragState.startColumnLeft,
  11060. startLeft = _dragState.startLeft;
  11061. var finalLeft = parseInt(resizeProxy.style.left, 10);
  11062. var columnWidth = finalLeft - startColumnLeft;
  11063. column.width = column.realWidth = columnWidth;
  11064. table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
  11065. _this2.store.scheduleLayout();
  11066. document.body.style.cursor = '';
  11067. _this2.dragging = false;
  11068. _this2.draggingColumn = null;
  11069. _this2.dragState = {};
  11070. table.resizeProxyVisible = false;
  11071. }
  11072. document.removeEventListener('mousemove', handleMouseMove);
  11073. document.removeEventListener('mouseup', handleMouseUp);
  11074. document.onselectstart = null;
  11075. document.ondragstart = null;
  11076. setTimeout(function () {
  11077. Object(dom_["removeClass"])(columnEl, 'noclick');
  11078. }, 0);
  11079. };
  11080. document.addEventListener('mousemove', handleMouseMove);
  11081. document.addEventListener('mouseup', handleMouseUp);
  11082. }
  11083. },
  11084. handleMouseMove: function handleMouseMove(event, column) {
  11085. if (column.children && column.children.length > 0) return;
  11086. var target = event.target;
  11087. while (target && target.tagName !== 'TH') {
  11088. target = target.parentNode;
  11089. }
  11090. if (!column || !column.resizable) return;
  11091. if (!this.dragging && this.border) {
  11092. var rect = target.getBoundingClientRect();
  11093. var bodyStyle = document.body.style;
  11094. if (rect.width > 12 && rect.right - event.pageX < 8) {
  11095. bodyStyle.cursor = 'col-resize';
  11096. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11097. target.style.cursor = 'col-resize';
  11098. }
  11099. this.draggingColumn = column;
  11100. } else if (!this.dragging) {
  11101. bodyStyle.cursor = '';
  11102. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11103. target.style.cursor = 'pointer';
  11104. }
  11105. this.draggingColumn = null;
  11106. }
  11107. }
  11108. },
  11109. handleMouseOut: function handleMouseOut() {
  11110. if (this.$isServer) return;
  11111. document.body.style.cursor = '';
  11112. },
  11113. toggleOrder: function toggleOrder(_ref) {
  11114. var order = _ref.order,
  11115. sortOrders = _ref.sortOrders;
  11116. if (order === '') return sortOrders[0];
  11117. var index = sortOrders.indexOf(order || null);
  11118. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  11119. },
  11120. handleSortClick: function handleSortClick(event, column, givenOrder) {
  11121. event.stopPropagation();
  11122. var order = column.order === givenOrder ? null : givenOrder || this.toggleOrder(column);
  11123. var target = event.target;
  11124. while (target && target.tagName !== 'TH') {
  11125. target = target.parentNode;
  11126. }
  11127. if (target && target.tagName === 'TH') {
  11128. if (Object(dom_["hasClass"])(target, 'noclick')) {
  11129. Object(dom_["removeClass"])(target, 'noclick');
  11130. return;
  11131. }
  11132. }
  11133. if (!column.sortable) return;
  11134. var states = this.store.states;
  11135. var sortProp = states.sortProp;
  11136. var sortOrder = void 0;
  11137. var sortingColumn = states.sortingColumn;
  11138. if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
  11139. if (sortingColumn) {
  11140. sortingColumn.order = null;
  11141. }
  11142. states.sortingColumn = column;
  11143. sortProp = column.property;
  11144. }
  11145. if (!order) {
  11146. sortOrder = column.order = null;
  11147. states.sortingColumn = null;
  11148. sortProp = null;
  11149. } else {
  11150. sortOrder = column.order = order;
  11151. }
  11152. states.sortProp = sortProp;
  11153. states.sortOrder = sortOrder;
  11154. this.store.commit('changeSortCondition');
  11155. }
  11156. },
  11157. data: function data() {
  11158. return {
  11159. draggingColumn: null,
  11160. dragging: false,
  11161. dragState: {}
  11162. };
  11163. }
  11164. });
  11165. // CONCATENATED MODULE: ./packages/table/src/table-footer.js
  11166. /* harmony default export */ var table_footer = ({
  11167. name: 'ElTableFooter',
  11168. mixins: [layout_observer],
  11169. render: function render(h) {
  11170. var _this = this;
  11171. var sums = [];
  11172. if (this.summaryMethod) {
  11173. sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
  11174. } else {
  11175. this.columns.forEach(function (column, index) {
  11176. if (index === 0) {
  11177. sums[index] = _this.sumText;
  11178. return;
  11179. }
  11180. var values = _this.store.states.data.map(function (item) {
  11181. return Number(item[column.property]);
  11182. });
  11183. var precisions = [];
  11184. var notNumber = true;
  11185. values.forEach(function (value) {
  11186. if (!isNaN(value)) {
  11187. notNumber = false;
  11188. var decimal = ('' + value).split('.')[1];
  11189. precisions.push(decimal ? decimal.length : 0);
  11190. }
  11191. });
  11192. var precision = Math.max.apply(null, precisions);
  11193. if (!notNumber) {
  11194. sums[index] = values.reduce(function (prev, curr) {
  11195. var value = Number(curr);
  11196. if (!isNaN(value)) {
  11197. return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  11198. } else {
  11199. return prev;
  11200. }
  11201. }, 0);
  11202. } else {
  11203. sums[index] = '';
  11204. }
  11205. });
  11206. }
  11207. return h(
  11208. 'table',
  11209. {
  11210. 'class': 'el-table__footer',
  11211. attrs: { cellspacing: '0',
  11212. cellpadding: '0',
  11213. border: '0' }
  11214. },
  11215. [h('colgroup', [this._l(this.columns, function (column) {
  11216. return h('col', {
  11217. attrs: { name: column.id }
  11218. });
  11219. }), this.hasGutter ? h('col', {
  11220. attrs: { name: 'gutter' }
  11221. }) : '']), h(
  11222. 'tbody',
  11223. { 'class': [{ 'has-gutter': this.hasGutter }] },
  11224. [h('tr', [this._l(this.columns, function (column, cellIndex) {
  11225. return h(
  11226. 'td',
  11227. {
  11228. attrs: {
  11229. colspan: column.colSpan,
  11230. rowspan: column.rowSpan
  11231. },
  11232. 'class': _this.getRowClasses(column, cellIndex) },
  11233. [h(
  11234. 'div',
  11235. { 'class': ['cell', column.labelClassName] },
  11236. [sums[cellIndex]]
  11237. )]
  11238. );
  11239. }), this.hasGutter ? h('th', { 'class': 'gutter' }) : ''])]
  11240. )]
  11241. );
  11242. },
  11243. props: {
  11244. fixed: String,
  11245. store: {
  11246. required: true
  11247. },
  11248. summaryMethod: Function,
  11249. sumText: String,
  11250. border: Boolean,
  11251. defaultSort: {
  11252. type: Object,
  11253. default: function _default() {
  11254. return {
  11255. prop: '',
  11256. order: ''
  11257. };
  11258. }
  11259. }
  11260. },
  11261. computed: {
  11262. table: function table() {
  11263. return this.$parent;
  11264. },
  11265. isAllSelected: function isAllSelected() {
  11266. return this.store.states.isAllSelected;
  11267. },
  11268. columnsCount: function columnsCount() {
  11269. return this.store.states.columns.length;
  11270. },
  11271. leftFixedCount: function leftFixedCount() {
  11272. return this.store.states.fixedColumns.length;
  11273. },
  11274. leftFixedLeafCount: function leftFixedLeafCount() {
  11275. return this.store.states.fixedLeafColumnsLength;
  11276. },
  11277. rightFixedLeafCount: function rightFixedLeafCount() {
  11278. return this.store.states.rightFixedLeafColumnsLength;
  11279. },
  11280. rightFixedCount: function rightFixedCount() {
  11281. return this.store.states.rightFixedColumns.length;
  11282. },
  11283. columns: function columns() {
  11284. return this.store.states.columns;
  11285. },
  11286. hasGutter: function hasGutter() {
  11287. return !this.fixed && this.tableLayout.gutterWidth;
  11288. }
  11289. },
  11290. methods: {
  11291. isCellHidden: function isCellHidden(index, columns, column) {
  11292. if (this.fixed === true || this.fixed === 'left') {
  11293. return index >= this.leftFixedLeafCount;
  11294. } else if (this.fixed === 'right') {
  11295. var before = 0;
  11296. for (var i = 0; i < index; i++) {
  11297. before += columns[i].colSpan;
  11298. }
  11299. return before < this.columnsCount - this.rightFixedLeafCount;
  11300. } else if (!this.fixed && column.fixed) {
  11301. // hide cell when footer instance is not fixed and column is fixed
  11302. return true;
  11303. } else {
  11304. return index < this.leftFixedCount || index >= this.columnsCount - this.rightFixedCount;
  11305. }
  11306. },
  11307. getRowClasses: function getRowClasses(column, cellIndex) {
  11308. var classes = [column.id, column.align, column.labelClassName];
  11309. if (column.className) {
  11310. classes.push(column.className);
  11311. }
  11312. if (this.isCellHidden(cellIndex, this.columns, column)) {
  11313. classes.push('is-hidden');
  11314. }
  11315. if (!column.children) {
  11316. classes.push('is-leaf');
  11317. }
  11318. return classes;
  11319. }
  11320. }
  11321. });
  11322. // 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&
  11323. //
  11324. //
  11325. //
  11326. //
  11327. //
  11328. //
  11329. //
  11330. //
  11331. //
  11332. //
  11333. //
  11334. //
  11335. //
  11336. //
  11337. //
  11338. //
  11339. //
  11340. //
  11341. //
  11342. //
  11343. //
  11344. //
  11345. //
  11346. //
  11347. //
  11348. //
  11349. //
  11350. //
  11351. //
  11352. //
  11353. //
  11354. //
  11355. //
  11356. //
  11357. //
  11358. //
  11359. //
  11360. //
  11361. //
  11362. //
  11363. //
  11364. //
  11365. //
  11366. //
  11367. //
  11368. //
  11369. //
  11370. //
  11371. //
  11372. //
  11373. //
  11374. //
  11375. //
  11376. //
  11377. //
  11378. //
  11379. //
  11380. //
  11381. //
  11382. //
  11383. //
  11384. //
  11385. //
  11386. //
  11387. //
  11388. //
  11389. //
  11390. //
  11391. //
  11392. //
  11393. //
  11394. //
  11395. //
  11396. //
  11397. //
  11398. //
  11399. //
  11400. //
  11401. //
  11402. //
  11403. //
  11404. //
  11405. //
  11406. //
  11407. //
  11408. //
  11409. //
  11410. //
  11411. //
  11412. //
  11413. //
  11414. //
  11415. //
  11416. //
  11417. //
  11418. //
  11419. //
  11420. //
  11421. //
  11422. //
  11423. //
  11424. //
  11425. //
  11426. //
  11427. //
  11428. //
  11429. //
  11430. //
  11431. //
  11432. //
  11433. //
  11434. //
  11435. //
  11436. //
  11437. //
  11438. //
  11439. //
  11440. //
  11441. //
  11442. //
  11443. //
  11444. //
  11445. //
  11446. //
  11447. //
  11448. //
  11449. //
  11450. //
  11451. //
  11452. //
  11453. //
  11454. //
  11455. //
  11456. //
  11457. //
  11458. //
  11459. //
  11460. //
  11461. //
  11462. //
  11463. //
  11464. //
  11465. //
  11466. //
  11467. //
  11468. //
  11469. //
  11470. //
  11471. //
  11472. //
  11473. //
  11474. //
  11475. //
  11476. //
  11477. //
  11478. //
  11479. //
  11480. //
  11481. //
  11482. //
  11483. //
  11484. //
  11485. //
  11486. //
  11487. //
  11488. //
  11489. //
  11490. //
  11491. //
  11492. //
  11493. //
  11494. //
  11495. //
  11496. //
  11497. //
  11498. //
  11499. //
  11500. //
  11501. //
  11502. //
  11503. //
  11504. //
  11505. //
  11506. //
  11507. //
  11508. //
  11509. //
  11510. //
  11511. //
  11512. //
  11513. //
  11514. //
  11515. //
  11516. //
  11517. //
  11518. //
  11519. //
  11520. //
  11521. //
  11522. //
  11523. //
  11524. //
  11525. //
  11526. //
  11527. //
  11528. //
  11529. //
  11530. //
  11531. //
  11532. //
  11533. //
  11534. //
  11535. //
  11536. //
  11537. var flattenData = function flattenData(data) {
  11538. if (!data) return data;
  11539. var newData = [];
  11540. var flatten = function flatten(arr) {
  11541. arr.forEach(function (item) {
  11542. newData.push(item);
  11543. if (Array.isArray(item.children)) {
  11544. flatten(item.children);
  11545. }
  11546. });
  11547. };
  11548. flatten(data);
  11549. if (data.length === newData.length) {
  11550. return data;
  11551. } else {
  11552. return newData;
  11553. }
  11554. };
  11555. var tableIdSeed = 1;
  11556. /* harmony default export */ var tablevue_type_script_lang_js_ = ({
  11557. name: 'ElTable',
  11558. mixins: [locale_default.a, migrating_default.a],
  11559. directives: {
  11560. Mousewheel: directives_mousewheel
  11561. },
  11562. props: {
  11563. data: {
  11564. type: Array,
  11565. default: function _default() {
  11566. return [];
  11567. }
  11568. },
  11569. size: String,
  11570. width: [String, Number],
  11571. height: [String, Number],
  11572. maxHeight: [String, Number],
  11573. fit: {
  11574. type: Boolean,
  11575. default: true
  11576. },
  11577. stripe: Boolean,
  11578. border: Boolean,
  11579. rowKey: [String, Function],
  11580. context: {},
  11581. showHeader: {
  11582. type: Boolean,
  11583. default: true
  11584. },
  11585. showSummary: Boolean,
  11586. sumText: String,
  11587. summaryMethod: Function,
  11588. rowClassName: [String, Function],
  11589. rowStyle: [Object, Function],
  11590. cellClassName: [String, Function],
  11591. cellStyle: [Object, Function],
  11592. headerRowClassName: [String, Function],
  11593. headerRowStyle: [Object, Function],
  11594. headerCellClassName: [String, Function],
  11595. headerCellStyle: [Object, Function],
  11596. highlightCurrentRow: Boolean,
  11597. currentRowKey: [String, Number],
  11598. emptyText: String,
  11599. expandRowKeys: Array,
  11600. defaultExpandAll: Boolean,
  11601. defaultSort: Object,
  11602. tooltipEffect: String,
  11603. spanMethod: Function,
  11604. selectOnIndeterminate: {
  11605. type: Boolean,
  11606. default: true
  11607. },
  11608. indent: {
  11609. type: Number,
  11610. default: 16
  11611. },
  11612. lazy: Boolean,
  11613. load: Function
  11614. },
  11615. components: {
  11616. TableHeader: table_header,
  11617. TableFooter: table_footer,
  11618. TableBody: table_body,
  11619. ElCheckbox: checkbox_default.a
  11620. },
  11621. methods: {
  11622. getMigratingConfig: function getMigratingConfig() {
  11623. return {
  11624. events: {
  11625. expand: 'expand is renamed to expand-change'
  11626. }
  11627. };
  11628. },
  11629. setCurrentRow: function setCurrentRow(row) {
  11630. this.store.commit('setCurrentRow', row);
  11631. },
  11632. toggleRowSelection: function toggleRowSelection(row, selected) {
  11633. this.store.toggleRowSelection(row, selected);
  11634. this.store.updateAllSelected();
  11635. },
  11636. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  11637. this.store.toggleRowExpansion(row, expanded);
  11638. },
  11639. clearSelection: function clearSelection() {
  11640. this.store.clearSelection();
  11641. },
  11642. clearFilter: function clearFilter(columnKeys) {
  11643. this.store.clearFilter(columnKeys);
  11644. },
  11645. clearSort: function clearSort() {
  11646. this.store.clearSort();
  11647. },
  11648. handleMouseLeave: function handleMouseLeave() {
  11649. this.store.commit('setHoverRow', null);
  11650. if (this.hoverState) this.hoverState = null;
  11651. },
  11652. updateScrollY: function updateScrollY() {
  11653. this.layout.updateScrollY();
  11654. this.layout.updateColumnsWidth();
  11655. },
  11656. handleFixedMousewheel: function handleFixedMousewheel(event, data) {
  11657. var bodyWrapper = this.bodyWrapper;
  11658. if (Math.abs(data.spinY) > 0) {
  11659. var currentScrollTop = bodyWrapper.scrollTop;
  11660. if (data.pixelY < 0 && currentScrollTop !== 0) {
  11661. event.preventDefault();
  11662. }
  11663. if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
  11664. event.preventDefault();
  11665. }
  11666. bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
  11667. } else {
  11668. bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
  11669. }
  11670. },
  11671. handleHeaderFooterMousewheel: function handleHeaderFooterMousewheel(event, data) {
  11672. var pixelX = data.pixelX,
  11673. pixelY = data.pixelY;
  11674. if (Math.abs(pixelX) >= Math.abs(pixelY)) {
  11675. event.preventDefault();
  11676. this.bodyWrapper.scrollLeft += data.pixelX / 5;
  11677. }
  11678. },
  11679. bindEvents: function bindEvents() {
  11680. var _$refs = this.$refs,
  11681. headerWrapper = _$refs.headerWrapper,
  11682. footerWrapper = _$refs.footerWrapper;
  11683. var refs = this.$refs;
  11684. var self = this;
  11685. this.bodyWrapper.addEventListener('scroll', function () {
  11686. if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
  11687. if (footerWrapper) footerWrapper.scrollLeft = this.scrollLeft;
  11688. if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
  11689. if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
  11690. var maxScrollLeftPosition = this.scrollWidth - this.offsetWidth - 1;
  11691. var scrollLeft = this.scrollLeft;
  11692. if (scrollLeft >= maxScrollLeftPosition) {
  11693. self.scrollPosition = 'right';
  11694. } else if (scrollLeft === 0) {
  11695. self.scrollPosition = 'left';
  11696. } else {
  11697. self.scrollPosition = 'middle';
  11698. }
  11699. });
  11700. if (this.fit) {
  11701. Object(resize_event_["addResizeListener"])(this.$el, this.resizeListener);
  11702. }
  11703. },
  11704. resizeListener: function resizeListener() {
  11705. if (!this.$ready) return;
  11706. var shouldUpdateLayout = false;
  11707. var el = this.$el;
  11708. var _resizeState = this.resizeState,
  11709. oldWidth = _resizeState.width,
  11710. oldHeight = _resizeState.height;
  11711. var width = el.offsetWidth;
  11712. if (oldWidth !== width) {
  11713. shouldUpdateLayout = true;
  11714. }
  11715. var height = el.offsetHeight;
  11716. if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
  11717. shouldUpdateLayout = true;
  11718. }
  11719. if (shouldUpdateLayout) {
  11720. this.resizeState.width = width;
  11721. this.resizeState.height = height;
  11722. this.doLayout();
  11723. }
  11724. },
  11725. doLayout: function doLayout() {
  11726. this.layout.updateColumnsWidth();
  11727. if (this.shouldUpdateHeight) {
  11728. this.layout.updateElsHeight();
  11729. }
  11730. },
  11731. sort: function sort(prop, order) {
  11732. this.store.commit('sort', { prop: prop, order: order });
  11733. },
  11734. toggleAllSelection: function toggleAllSelection() {
  11735. this.store.commit('toggleAllSelection');
  11736. },
  11737. getRowKey: function getRowKey(row) {
  11738. var rowKey = getRowIdentity(row, this.store.states.rowKey);
  11739. if (!rowKey) {
  11740. throw new Error('if there\'s nested data, rowKey is required.');
  11741. }
  11742. return rowKey;
  11743. },
  11744. getTableTreeData: function getTableTreeData(data) {
  11745. var _this = this;
  11746. var treeData = {};
  11747. var traverse = function traverse(children, parentData, level) {
  11748. children.forEach(function (item) {
  11749. var rowKey = _this.getRowKey(item);
  11750. treeData[rowKey] = {
  11751. display: false,
  11752. level: level
  11753. };
  11754. parentData.children.push(rowKey);
  11755. if (Array.isArray(item.children) && item.children.length) {
  11756. treeData[rowKey].children = [];
  11757. treeData[rowKey].expanded = false;
  11758. traverse(item.children, treeData[rowKey], level + 1);
  11759. }
  11760. });
  11761. };
  11762. if (data) {
  11763. data.forEach(function (item) {
  11764. var containChildren = Array.isArray(item.children) && item.children.length;
  11765. if (!(containChildren || item.hasChildren)) return;
  11766. var rowKey = _this.getRowKey(item);
  11767. var treeNode = {
  11768. level: 0,
  11769. expanded: false,
  11770. display: true,
  11771. children: []
  11772. };
  11773. if (containChildren) {
  11774. treeData[rowKey] = treeNode;
  11775. traverse(item.children, treeData[rowKey], 1);
  11776. } else if (item.hasChildren && _this.lazy) {
  11777. treeNode.hasChildren = true;
  11778. treeNode.loaded = false;
  11779. treeData[rowKey] = treeNode;
  11780. }
  11781. });
  11782. }
  11783. return treeData;
  11784. }
  11785. },
  11786. created: function created() {
  11787. var _this2 = this;
  11788. this.tableId = 'el-table_' + tableIdSeed++;
  11789. this.debouncedUpdateLayout = debounce_default()(50, function () {
  11790. return _this2.doLayout();
  11791. });
  11792. },
  11793. computed: {
  11794. tableSize: function tableSize() {
  11795. return this.size || (this.$ELEMENT || {}).size;
  11796. },
  11797. bodyWrapper: function bodyWrapper() {
  11798. return this.$refs.bodyWrapper;
  11799. },
  11800. shouldUpdateHeight: function shouldUpdateHeight() {
  11801. return this.height || this.maxHeight || this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0;
  11802. },
  11803. selection: function selection() {
  11804. return this.store.states.selection;
  11805. },
  11806. columns: function columns() {
  11807. return this.store.states.columns;
  11808. },
  11809. tableData: function tableData() {
  11810. return this.store.states.data;
  11811. },
  11812. fixedColumns: function fixedColumns() {
  11813. return this.store.states.fixedColumns;
  11814. },
  11815. rightFixedColumns: function rightFixedColumns() {
  11816. return this.store.states.rightFixedColumns;
  11817. },
  11818. bodyWidth: function bodyWidth() {
  11819. var _layout = this.layout,
  11820. bodyWidth = _layout.bodyWidth,
  11821. scrollY = _layout.scrollY,
  11822. gutterWidth = _layout.gutterWidth;
  11823. return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
  11824. },
  11825. bodyHeight: function bodyHeight() {
  11826. if (this.height) {
  11827. return {
  11828. height: this.layout.bodyHeight ? this.layout.bodyHeight + 'px' : ''
  11829. };
  11830. } else if (this.maxHeight) {
  11831. return {
  11832. 'max-height': this.layout.bodyHeight ? this.layout.bodyHeight + 'px' : ''
  11833. };
  11834. }
  11835. return {};
  11836. },
  11837. fixedBodyHeight: function fixedBodyHeight() {
  11838. if (this.height) {
  11839. return {
  11840. height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
  11841. };
  11842. } else if (this.maxHeight) {
  11843. var maxHeight = this.layout.scrollX ? this.maxHeight - this.layout.gutterWidth : this.maxHeight;
  11844. if (this.showHeader) {
  11845. maxHeight -= this.layout.headerHeight;
  11846. }
  11847. maxHeight -= this.layout.footerHeight;
  11848. return {
  11849. 'max-height': maxHeight + 'px'
  11850. };
  11851. }
  11852. return {};
  11853. },
  11854. fixedHeight: function fixedHeight() {
  11855. if (this.maxHeight) {
  11856. if (this.showSummary) {
  11857. return {
  11858. bottom: 0
  11859. };
  11860. }
  11861. return {
  11862. bottom: this.layout.scrollX && this.data.length ? this.layout.gutterWidth + 'px' : ''
  11863. };
  11864. } else {
  11865. if (this.showSummary) {
  11866. return {
  11867. height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
  11868. };
  11869. }
  11870. return {
  11871. height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
  11872. };
  11873. }
  11874. }
  11875. },
  11876. watch: {
  11877. height: {
  11878. immediate: true,
  11879. handler: function handler(value) {
  11880. this.layout.setHeight(value);
  11881. }
  11882. },
  11883. maxHeight: {
  11884. immediate: true,
  11885. handler: function handler(value) {
  11886. this.layout.setMaxHeight(value);
  11887. }
  11888. },
  11889. currentRowKey: function currentRowKey(newVal) {
  11890. this.store.setCurrentRowKey(newVal);
  11891. },
  11892. data: {
  11893. immediate: true,
  11894. handler: function handler(value) {
  11895. var _this3 = this;
  11896. this.store.states.treeData = this.getTableTreeData(value);
  11897. value = flattenData(value);
  11898. this.store.commit('setData', value);
  11899. if (this.$ready) {
  11900. this.$nextTick(function () {
  11901. _this3.doLayout();
  11902. });
  11903. }
  11904. }
  11905. },
  11906. expandRowKeys: {
  11907. immediate: true,
  11908. handler: function handler(newVal) {
  11909. if (newVal) {
  11910. this.store.setExpandRowKeys(newVal);
  11911. }
  11912. }
  11913. }
  11914. },
  11915. destroyed: function destroyed() {
  11916. if (this.resizeListener) Object(resize_event_["removeResizeListener"])(this.$el, this.resizeListener);
  11917. },
  11918. mounted: function mounted() {
  11919. var _this4 = this;
  11920. this.bindEvents();
  11921. this.store.updateColumns();
  11922. this.doLayout();
  11923. this.resizeState = {
  11924. width: this.$el.offsetWidth,
  11925. height: this.$el.offsetHeight
  11926. };
  11927. // init filters
  11928. this.store.states.columns.forEach(function (column) {
  11929. if (column.filteredValue && column.filteredValue.length) {
  11930. _this4.store.commit('filterChange', {
  11931. column: column,
  11932. values: column.filteredValue,
  11933. silent: true
  11934. });
  11935. }
  11936. });
  11937. this.$ready = true;
  11938. },
  11939. data: function data() {
  11940. var store = new table_store(this, {
  11941. rowKey: this.rowKey,
  11942. defaultExpandAll: this.defaultExpandAll,
  11943. selectOnIndeterminate: this.selectOnIndeterminate,
  11944. indent: this.indent,
  11945. lazy: this.lazy
  11946. });
  11947. var layout = new table_layout({
  11948. store: store,
  11949. table: this,
  11950. fit: this.fit,
  11951. showHeader: this.showHeader
  11952. });
  11953. return {
  11954. layout: layout,
  11955. store: store,
  11956. isHidden: false,
  11957. renderExpanded: null,
  11958. resizeProxyVisible: false,
  11959. resizeState: {
  11960. width: null,
  11961. height: null
  11962. },
  11963. // 是否拥有多级表头
  11964. isGroup: false,
  11965. scrollPosition: 'left'
  11966. };
  11967. }
  11968. });
  11969. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=script&lang=js&
  11970. /* harmony default export */ var src_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_);
  11971. // CONCATENATED MODULE: ./packages/table/src/table.vue
  11972. /* normalize component */
  11973. var table_component = normalizeComponent(
  11974. src_tablevue_type_script_lang_js_,
  11975. tablevue_type_template_id_493fe34e_render,
  11976. tablevue_type_template_id_493fe34e_staticRenderFns,
  11977. false,
  11978. null,
  11979. null,
  11980. null
  11981. )
  11982. /* hot reload */
  11983. if (false) { var table_api; }
  11984. table_component.options.__file = "packages/table/src/table.vue"
  11985. /* harmony default export */ var src_table = (table_component.exports);
  11986. // CONCATENATED MODULE: ./packages/table/index.js
  11987. /* istanbul ignore next */
  11988. src_table.install = function (Vue) {
  11989. Vue.component(src_table.name, src_table);
  11990. };
  11991. /* harmony default export */ var packages_table = (src_table);
  11992. // CONCATENATED MODULE: ./packages/table/src/table-column.js
  11993. var columnIdSeed = 1;
  11994. var defaults = {
  11995. default: {
  11996. order: ''
  11997. },
  11998. selection: {
  11999. width: 48,
  12000. minWidth: 48,
  12001. realWidth: 48,
  12002. order: '',
  12003. className: 'el-table-column--selection'
  12004. },
  12005. expand: {
  12006. width: 48,
  12007. minWidth: 48,
  12008. realWidth: 48,
  12009. order: ''
  12010. },
  12011. index: {
  12012. width: 48,
  12013. minWidth: 48,
  12014. realWidth: 48,
  12015. order: ''
  12016. }
  12017. };
  12018. var forced = {
  12019. selection: {
  12020. renderHeader: function renderHeader(h, _ref) {
  12021. var store = _ref.store;
  12022. return h('el-checkbox', {
  12023. attrs: {
  12024. disabled: store.states.data && store.states.data.length === 0,
  12025. indeterminate: store.states.selection.length > 0 && !this.isAllSelected,
  12026. value: this.isAllSelected },
  12027. nativeOn: {
  12028. 'click': this.toggleAllSelection
  12029. }
  12030. });
  12031. },
  12032. renderCell: function renderCell(h, _ref2) {
  12033. var row = _ref2.row,
  12034. column = _ref2.column,
  12035. store = _ref2.store,
  12036. $index = _ref2.$index;
  12037. return h('el-checkbox', {
  12038. nativeOn: {
  12039. 'click': function click(event) {
  12040. return event.stopPropagation();
  12041. }
  12042. },
  12043. attrs: {
  12044. value: store.isSelected(row),
  12045. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false
  12046. },
  12047. on: {
  12048. 'input': function input() {
  12049. store.commit('rowSelectedChanged', row);
  12050. }
  12051. }
  12052. });
  12053. },
  12054. sortable: false,
  12055. resizable: false
  12056. },
  12057. index: {
  12058. renderHeader: function renderHeader(h, _ref3) {
  12059. var column = _ref3.column;
  12060. return column.label || '#';
  12061. },
  12062. renderCell: function renderCell(h, _ref4) {
  12063. var $index = _ref4.$index,
  12064. column = _ref4.column;
  12065. var i = $index + 1;
  12066. var index = column.index;
  12067. if (typeof index === 'number') {
  12068. i = $index + index;
  12069. } else if (typeof index === 'function') {
  12070. i = index($index);
  12071. }
  12072. return h('div', [i]);
  12073. },
  12074. sortable: false
  12075. },
  12076. expand: {
  12077. renderHeader: function renderHeader(h, _ref5) {
  12078. var column = _ref5.column;
  12079. return column.label || '';
  12080. },
  12081. renderCell: function renderCell(h, _ref6, proxy) {
  12082. var row = _ref6.row,
  12083. store = _ref6.store;
  12084. var expanded = store.states.expandRows.indexOf(row) > -1;
  12085. return h(
  12086. 'div',
  12087. { 'class': 'el-table__expand-icon ' + (expanded ? 'el-table__expand-icon--expanded' : ''),
  12088. on: {
  12089. 'click': function click(e) {
  12090. return proxy.handleExpandClick(row, e);
  12091. }
  12092. }
  12093. },
  12094. [h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  12095. );
  12096. },
  12097. sortable: false,
  12098. resizable: false,
  12099. className: 'el-table__expand-column'
  12100. }
  12101. };
  12102. var table_column_getDefaultColumn = function getDefaultColumn(type, options) {
  12103. var column = {};
  12104. merge_default()(column, defaults[type || 'default']);
  12105. for (var name in options) {
  12106. if (options.hasOwnProperty(name)) {
  12107. var value = options[name];
  12108. if (typeof value !== 'undefined') {
  12109. column[name] = value;
  12110. }
  12111. }
  12112. }
  12113. if (!column.minWidth) {
  12114. column.minWidth = 80;
  12115. }
  12116. column.realWidth = column.width === undefined ? column.minWidth : column.width;
  12117. return column;
  12118. };
  12119. var table_column_DEFAULT_RENDER_CELL = function DEFAULT_RENDER_CELL(h, _ref7) {
  12120. var row = _ref7.row,
  12121. column = _ref7.column,
  12122. $index = _ref7.$index;
  12123. var property = column.property;
  12124. var value = property && Object(util_["getPropByPath"])(row, property).v;
  12125. if (column && column.formatter) {
  12126. return column.formatter(row, column, value, $index);
  12127. }
  12128. return value;
  12129. };
  12130. var parseWidth = function parseWidth(width) {
  12131. if (width !== undefined) {
  12132. width = parseInt(width, 10);
  12133. if (isNaN(width)) {
  12134. width = null;
  12135. }
  12136. }
  12137. return width;
  12138. };
  12139. var parseMinWidth = function parseMinWidth(minWidth) {
  12140. if (minWidth !== undefined) {
  12141. minWidth = parseInt(minWidth, 10);
  12142. if (isNaN(minWidth)) {
  12143. minWidth = 80;
  12144. }
  12145. }
  12146. return minWidth;
  12147. };
  12148. /* harmony default export */ var table_column = ({
  12149. name: 'ElTableColumn',
  12150. props: {
  12151. type: {
  12152. type: String,
  12153. default: 'default'
  12154. },
  12155. label: String,
  12156. className: String,
  12157. labelClassName: String,
  12158. property: String,
  12159. prop: String,
  12160. width: {},
  12161. minWidth: {},
  12162. renderHeader: Function,
  12163. sortable: {
  12164. type: [String, Boolean],
  12165. default: false
  12166. },
  12167. sortMethod: Function,
  12168. sortBy: [String, Function, Array],
  12169. resizable: {
  12170. type: Boolean,
  12171. default: true
  12172. },
  12173. context: {},
  12174. columnKey: String,
  12175. align: String,
  12176. headerAlign: String,
  12177. showTooltipWhenOverflow: Boolean,
  12178. showOverflowTooltip: Boolean,
  12179. fixed: [Boolean, String],
  12180. formatter: Function,
  12181. selectable: Function,
  12182. reserveSelection: Boolean,
  12183. filterMethod: Function,
  12184. filteredValue: Array,
  12185. filters: Array,
  12186. filterPlacement: String,
  12187. filterMultiple: {
  12188. type: Boolean,
  12189. default: true
  12190. },
  12191. index: [Number, Function],
  12192. sortOrders: {
  12193. type: Array,
  12194. default: function _default() {
  12195. return ['ascending', 'descending', null];
  12196. },
  12197. validator: function validator(val) {
  12198. return val.every(function (order) {
  12199. return ['ascending', 'descending', null].indexOf(order) > -1;
  12200. });
  12201. }
  12202. }
  12203. },
  12204. data: function data() {
  12205. return {
  12206. isSubColumn: false,
  12207. columns: []
  12208. };
  12209. },
  12210. beforeCreate: function beforeCreate() {
  12211. this.row = {};
  12212. this.column = {};
  12213. this.$index = 0;
  12214. },
  12215. components: {
  12216. ElCheckbox: checkbox_default.a,
  12217. ElTag: tag_default.a
  12218. },
  12219. computed: {
  12220. owner: function owner() {
  12221. var parent = this.$parent;
  12222. while (parent && !parent.tableId) {
  12223. parent = parent.$parent;
  12224. }
  12225. return parent;
  12226. },
  12227. columnOrTableParent: function columnOrTableParent() {
  12228. var parent = this.$parent;
  12229. while (parent && !parent.tableId && !parent.columnId) {
  12230. parent = parent.$parent;
  12231. }
  12232. return parent;
  12233. }
  12234. },
  12235. created: function created() {
  12236. var _this = this;
  12237. var h = this.$createElement;
  12238. this.customRender = this.$options.render;
  12239. this.$options.render = function (h) {
  12240. return h('div', _this.$slots.default);
  12241. };
  12242. var parent = this.columnOrTableParent;
  12243. var owner = this.owner;
  12244. this.isSubColumn = owner !== parent;
  12245. this.columnId = (parent.tableId || parent.columnId) + '_column_' + columnIdSeed++;
  12246. var type = this.type;
  12247. var width = parseWidth(this.width);
  12248. var minWidth = parseMinWidth(this.minWidth);
  12249. var isColumnGroup = false;
  12250. var column = table_column_getDefaultColumn(type, {
  12251. id: this.columnId,
  12252. columnKey: this.columnKey,
  12253. label: this.label,
  12254. className: this.className,
  12255. labelClassName: this.labelClassName,
  12256. property: this.prop || this.property,
  12257. type: type,
  12258. renderCell: null,
  12259. renderHeader: this.renderHeader,
  12260. minWidth: minWidth,
  12261. width: width,
  12262. isColumnGroup: isColumnGroup,
  12263. context: this.context,
  12264. align: this.align ? 'is-' + this.align : null,
  12265. headerAlign: this.headerAlign ? 'is-' + this.headerAlign : this.align ? 'is-' + this.align : null,
  12266. sortable: this.sortable === '' ? true : this.sortable,
  12267. sortMethod: this.sortMethod,
  12268. sortBy: this.sortBy,
  12269. resizable: this.resizable,
  12270. showOverflowTooltip: this.showOverflowTooltip || this.showTooltipWhenOverflow,
  12271. formatter: this.formatter,
  12272. selectable: this.selectable,
  12273. reserveSelection: this.reserveSelection,
  12274. fixed: this.fixed === '' ? true : this.fixed,
  12275. filterMethod: this.filterMethod,
  12276. filters: this.filters,
  12277. filterable: this.filters || this.filterMethod,
  12278. filterMultiple: this.filterMultiple,
  12279. filterOpened: false,
  12280. filteredValue: this.filteredValue || [],
  12281. filterPlacement: this.filterPlacement || '',
  12282. index: this.index,
  12283. sortOrders: this.sortOrders
  12284. });
  12285. var source = forced[type] || {};
  12286. Object.keys(source).forEach(function (prop) {
  12287. var value = source[prop];
  12288. if (value !== undefined) {
  12289. if (prop === 'renderHeader') {
  12290. if (type === 'selection' && column[prop]) {
  12291. console.warn('[Element Warn][TableColumn]Selection column doesn\'t allow to set render-header function.');
  12292. } else {
  12293. value = column[prop] || value;
  12294. }
  12295. }
  12296. column[prop] = prop === 'className' ? column[prop] + ' ' + value : value;
  12297. }
  12298. });
  12299. // Deprecation warning for renderHeader property
  12300. if (this.renderHeader) {
  12301. console.warn('[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.');
  12302. }
  12303. this.columnConfig = column;
  12304. var renderCell = column.renderCell;
  12305. var _self = this;
  12306. if (type === 'expand') {
  12307. owner.renderExpanded = function (h, data) {
  12308. return _self.$scopedSlots.default ? _self.$scopedSlots.default(data) : _self.$slots.default;
  12309. };
  12310. column.renderCell = function (h, data) {
  12311. return h(
  12312. 'div',
  12313. { 'class': 'cell' },
  12314. [renderCell(h, data, this._renderProxy)]
  12315. );
  12316. };
  12317. return;
  12318. }
  12319. column.renderCell = function (h, data) {
  12320. if (_self.$scopedSlots.default) {
  12321. renderCell = function renderCell() {
  12322. return _self.$scopedSlots.default(data);
  12323. };
  12324. }
  12325. if (!renderCell) {
  12326. renderCell = table_column_DEFAULT_RENDER_CELL;
  12327. }
  12328. var children = [_self.renderTreeCell(data), renderCell(h, data)];
  12329. return _self.showOverflowTooltip || _self.showTooltipWhenOverflow ? h(
  12330. 'div',
  12331. { 'class': 'cell el-tooltip', style: { width: (data.column.realWidth || data.column.width) - 1 + 'px' } },
  12332. [children]
  12333. ) : h(
  12334. 'div',
  12335. { 'class': 'cell' },
  12336. [children]
  12337. );
  12338. };
  12339. },
  12340. destroyed: function destroyed() {
  12341. if (!this.$parent) return;
  12342. var parent = this.$parent;
  12343. this.owner.store.commit('removeColumn', this.columnConfig, this.isSubColumn ? parent.columnConfig : null);
  12344. },
  12345. watch: {
  12346. label: function label(newVal) {
  12347. if (this.columnConfig) {
  12348. this.columnConfig.label = newVal;
  12349. }
  12350. },
  12351. prop: function prop(newVal) {
  12352. if (this.columnConfig) {
  12353. this.columnConfig.property = newVal;
  12354. }
  12355. },
  12356. property: function property(newVal) {
  12357. if (this.columnConfig) {
  12358. this.columnConfig.property = newVal;
  12359. }
  12360. },
  12361. filters: function filters(newVal) {
  12362. if (this.columnConfig) {
  12363. this.columnConfig.filters = newVal;
  12364. }
  12365. },
  12366. filterMultiple: function filterMultiple(newVal) {
  12367. if (this.columnConfig) {
  12368. this.columnConfig.filterMultiple = newVal;
  12369. }
  12370. },
  12371. align: function align(newVal) {
  12372. if (this.columnConfig) {
  12373. this.columnConfig.align = newVal ? 'is-' + newVal : null;
  12374. if (!this.headerAlign) {
  12375. this.columnConfig.headerAlign = newVal ? 'is-' + newVal : null;
  12376. }
  12377. }
  12378. },
  12379. headerAlign: function headerAlign(newVal) {
  12380. if (this.columnConfig) {
  12381. this.columnConfig.headerAlign = 'is-' + (newVal ? newVal : this.align);
  12382. }
  12383. },
  12384. width: function width(newVal) {
  12385. if (this.columnConfig) {
  12386. this.columnConfig.width = parseWidth(newVal);
  12387. this.owner.store.scheduleLayout();
  12388. }
  12389. },
  12390. minWidth: function minWidth(newVal) {
  12391. if (this.columnConfig) {
  12392. this.columnConfig.minWidth = parseMinWidth(newVal);
  12393. this.owner.store.scheduleLayout();
  12394. }
  12395. },
  12396. fixed: function fixed(newVal) {
  12397. if (this.columnConfig) {
  12398. this.columnConfig.fixed = newVal;
  12399. this.owner.store.scheduleLayout(true);
  12400. }
  12401. },
  12402. sortable: function sortable(newVal) {
  12403. if (this.columnConfig) {
  12404. this.columnConfig.sortable = newVal;
  12405. }
  12406. },
  12407. index: function index(newVal) {
  12408. if (this.columnConfig) {
  12409. this.columnConfig.index = newVal;
  12410. }
  12411. },
  12412. formatter: function formatter(newVal) {
  12413. if (this.columnConfig) {
  12414. this.columnConfig.formatter = newVal;
  12415. }
  12416. },
  12417. className: function className(newVal) {
  12418. if (this.columnConfig) {
  12419. this.columnConfig.className = newVal;
  12420. }
  12421. },
  12422. labelClassName: function labelClassName(newVal) {
  12423. if (this.columnConfig) {
  12424. this.columnConfig.labelClassName = newVal;
  12425. }
  12426. }
  12427. },
  12428. methods: {
  12429. renderTreeCell: function renderTreeCell(data) {
  12430. var h = this.$createElement;
  12431. if (!data.treeNode) return null;
  12432. var ele = [];
  12433. ele.push(h('span', { 'class': 'el-table__indent', style: { 'padding-left': data.treeNode.indent + 'px' } }));
  12434. if (data.treeNode.hasChildren) {
  12435. ele.push(h(
  12436. 'div',
  12437. { 'class': ['el-table__expand-icon', data.treeNode.expanded ? 'el-table__expand-icon--expanded' : ''],
  12438. on: {
  12439. 'click': this.handleTreeExpandIconClick.bind(this, data)
  12440. }
  12441. },
  12442. [h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  12443. ));
  12444. } else {
  12445. ele.push(h('span', { 'class': 'el-table__placeholder' }));
  12446. }
  12447. return ele;
  12448. },
  12449. handleTreeExpandIconClick: function handleTreeExpandIconClick(data, e) {
  12450. e.stopPropagation();
  12451. if (data.store.states.lazy && !data.treeNode.loaded) {
  12452. data.store.loadData(data.row, data.treeNode);
  12453. } else {
  12454. data.store.toggleTreeExpansion(data.treeNode.rowKey);
  12455. }
  12456. }
  12457. },
  12458. mounted: function mounted() {
  12459. var _this2 = this;
  12460. var owner = this.owner;
  12461. var parent = this.columnOrTableParent;
  12462. var columnIndex = void 0;
  12463. if (!this.isSubColumn) {
  12464. columnIndex = [].indexOf.call(parent.$refs.hiddenColumns.children, this.$el);
  12465. } else {
  12466. columnIndex = [].indexOf.call(parent.$el.children, this.$el);
  12467. }
  12468. if (this.$scopedSlots.header) {
  12469. if (this.type === 'selection') {
  12470. console.warn('[Element Warn][TableColumn]Selection column doesn\'t allow to set scoped-slot header.');
  12471. } else {
  12472. this.columnConfig.renderHeader = function (h, scope) {
  12473. return _this2.$scopedSlots.header(scope);
  12474. };
  12475. }
  12476. }
  12477. owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
  12478. }
  12479. });
  12480. // CONCATENATED MODULE: ./packages/table-column/index.js
  12481. /* istanbul ignore next */
  12482. table_column.install = function (Vue) {
  12483. Vue.component(table_column.name, table_column);
  12484. };
  12485. /* harmony default export */ var packages_table_column = (table_column);
  12486. // 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&
  12487. var pickervue_type_template_id_79ae069f_render = function() {
  12488. var _vm = this
  12489. var _h = _vm.$createElement
  12490. var _c = _vm._self._c || _h
  12491. return !_vm.ranged
  12492. ? _c(
  12493. "el-input",
  12494. _vm._b(
  12495. {
  12496. directives: [
  12497. {
  12498. name: "clickoutside",
  12499. rawName: "v-clickoutside",
  12500. value: _vm.handleClose,
  12501. expression: "handleClose"
  12502. }
  12503. ],
  12504. ref: "reference",
  12505. staticClass: "el-date-editor",
  12506. class: "el-date-editor--" + _vm.type,
  12507. attrs: {
  12508. readonly:
  12509. !_vm.editable ||
  12510. _vm.readonly ||
  12511. _vm.type === "dates" ||
  12512. _vm.type === "week",
  12513. disabled: _vm.pickerDisabled,
  12514. size: _vm.pickerSize,
  12515. name: _vm.name,
  12516. placeholder: _vm.placeholder,
  12517. value: _vm.displayValue,
  12518. validateEvent: false
  12519. },
  12520. on: {
  12521. focus: _vm.handleFocus,
  12522. input: function(value) {
  12523. return (_vm.userInput = value)
  12524. },
  12525. change: _vm.handleChange
  12526. },
  12527. nativeOn: {
  12528. keydown: function($event) {
  12529. return _vm.handleKeydown($event)
  12530. },
  12531. mouseenter: function($event) {
  12532. return _vm.handleMouseEnter($event)
  12533. },
  12534. mouseleave: function($event) {
  12535. _vm.showClose = false
  12536. }
  12537. }
  12538. },
  12539. "el-input",
  12540. _vm.firstInputId,
  12541. false
  12542. ),
  12543. [
  12544. _c("i", {
  12545. staticClass: "el-input__icon",
  12546. class: _vm.triggerClass,
  12547. attrs: { slot: "prefix" },
  12548. on: { click: _vm.handleFocus },
  12549. slot: "prefix"
  12550. }),
  12551. _vm.haveTrigger
  12552. ? _c("i", {
  12553. staticClass: "el-input__icon",
  12554. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  12555. attrs: { slot: "suffix" },
  12556. on: { click: _vm.handleClickIcon },
  12557. slot: "suffix"
  12558. })
  12559. : _vm._e()
  12560. ]
  12561. )
  12562. : _c(
  12563. "div",
  12564. {
  12565. directives: [
  12566. {
  12567. name: "clickoutside",
  12568. rawName: "v-clickoutside",
  12569. value: _vm.handleClose,
  12570. expression: "handleClose"
  12571. }
  12572. ],
  12573. ref: "reference",
  12574. staticClass: "el-date-editor el-range-editor el-input__inner",
  12575. class: [
  12576. "el-date-editor--" + _vm.type,
  12577. _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
  12578. _vm.pickerDisabled ? "is-disabled" : "",
  12579. _vm.pickerVisible ? "is-active" : ""
  12580. ],
  12581. on: {
  12582. click: _vm.handleRangeClick,
  12583. mouseenter: _vm.handleMouseEnter,
  12584. mouseleave: function($event) {
  12585. _vm.showClose = false
  12586. },
  12587. keydown: _vm.handleKeydown
  12588. }
  12589. },
  12590. [
  12591. _c("i", {
  12592. class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
  12593. }),
  12594. _c(
  12595. "input",
  12596. _vm._b(
  12597. {
  12598. staticClass: "el-range-input",
  12599. attrs: {
  12600. autocomplete: "off",
  12601. placeholder: _vm.startPlaceholder,
  12602. disabled: _vm.pickerDisabled,
  12603. readonly: !_vm.editable || _vm.readonly,
  12604. name: _vm.name && _vm.name[0]
  12605. },
  12606. domProps: { value: _vm.displayValue && _vm.displayValue[0] },
  12607. on: {
  12608. input: _vm.handleStartInput,
  12609. change: _vm.handleStartChange,
  12610. focus: _vm.handleFocus
  12611. }
  12612. },
  12613. "input",
  12614. _vm.firstInputId,
  12615. false
  12616. )
  12617. ),
  12618. _vm._t("range-separator", [
  12619. _c("span", { staticClass: "el-range-separator" }, [
  12620. _vm._v(_vm._s(_vm.rangeSeparator))
  12621. ])
  12622. ]),
  12623. _c(
  12624. "input",
  12625. _vm._b(
  12626. {
  12627. staticClass: "el-range-input",
  12628. attrs: {
  12629. autocomplete: "off",
  12630. placeholder: _vm.endPlaceholder,
  12631. disabled: _vm.pickerDisabled,
  12632. readonly: !_vm.editable || _vm.readonly,
  12633. name: _vm.name && _vm.name[1]
  12634. },
  12635. domProps: { value: _vm.displayValue && _vm.displayValue[1] },
  12636. on: {
  12637. input: _vm.handleEndInput,
  12638. change: _vm.handleEndChange,
  12639. focus: _vm.handleFocus
  12640. }
  12641. },
  12642. "input",
  12643. _vm.secondInputId,
  12644. false
  12645. )
  12646. ),
  12647. _vm.haveTrigger
  12648. ? _c("i", {
  12649. staticClass: "el-input__icon el-range__close-icon",
  12650. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  12651. on: { click: _vm.handleClickIcon }
  12652. })
  12653. : _vm._e()
  12654. ],
  12655. 2
  12656. )
  12657. }
  12658. var pickervue_type_template_id_79ae069f_staticRenderFns = []
  12659. pickervue_type_template_id_79ae069f_render._withStripped = true
  12660. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
  12661. // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
  12662. var date_util_ = __webpack_require__(0);
  12663. // 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&
  12664. //
  12665. //
  12666. //
  12667. //
  12668. //
  12669. //
  12670. //
  12671. //
  12672. //
  12673. //
  12674. //
  12675. //
  12676. //
  12677. //
  12678. //
  12679. //
  12680. //
  12681. //
  12682. //
  12683. //
  12684. //
  12685. //
  12686. //
  12687. //
  12688. //
  12689. //
  12690. //
  12691. //
  12692. //
  12693. //
  12694. //
  12695. //
  12696. //
  12697. //
  12698. //
  12699. //
  12700. //
  12701. //
  12702. //
  12703. //
  12704. //
  12705. //
  12706. //
  12707. //
  12708. //
  12709. //
  12710. //
  12711. //
  12712. //
  12713. //
  12714. //
  12715. //
  12716. //
  12717. //
  12718. //
  12719. //
  12720. //
  12721. //
  12722. //
  12723. //
  12724. //
  12725. //
  12726. //
  12727. //
  12728. //
  12729. //
  12730. //
  12731. //
  12732. //
  12733. //
  12734. //
  12735. //
  12736. //
  12737. //
  12738. //
  12739. //
  12740. //
  12741. //
  12742. //
  12743. //
  12744. //
  12745. //
  12746. //
  12747. //
  12748. //
  12749. var NewPopper = {
  12750. props: {
  12751. appendToBody: vue_popper_default.a.props.appendToBody,
  12752. offset: vue_popper_default.a.props.offset,
  12753. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  12754. arrowOffset: vue_popper_default.a.props.arrowOffset
  12755. },
  12756. methods: vue_popper_default.a.methods,
  12757. data: function data() {
  12758. return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
  12759. },
  12760. beforeDestroy: vue_popper_default.a.beforeDestroy
  12761. };
  12762. var DEFAULT_FORMATS = {
  12763. date: 'yyyy-MM-dd',
  12764. month: 'yyyy-MM',
  12765. datetime: 'yyyy-MM-dd HH:mm:ss',
  12766. time: 'HH:mm:ss',
  12767. week: 'yyyywWW',
  12768. timerange: 'HH:mm:ss',
  12769. daterange: 'yyyy-MM-dd',
  12770. monthrange: 'yyyy-MM',
  12771. datetimerange: 'yyyy-MM-dd HH:mm:ss',
  12772. year: 'yyyy'
  12773. };
  12774. var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates'];
  12775. var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
  12776. if (format === 'timestamp') return value.getTime();
  12777. return Object(date_util_["formatDate"])(value, format);
  12778. };
  12779. var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
  12780. if (format === 'timestamp') return new Date(Number(text));
  12781. return Object(date_util_["parseDate"])(text, format);
  12782. };
  12783. var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
  12784. if (Array.isArray(value) && value.length === 2) {
  12785. var start = value[0];
  12786. var end = value[1];
  12787. if (start && end) {
  12788. return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
  12789. }
  12790. }
  12791. return '';
  12792. };
  12793. var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
  12794. if (!Array.isArray(array)) {
  12795. array = array.split(separator);
  12796. }
  12797. if (array.length === 2) {
  12798. var range1 = array[0];
  12799. var range2 = array[1];
  12800. return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
  12801. }
  12802. return [];
  12803. };
  12804. var TYPE_VALUE_RESOLVER_MAP = {
  12805. default: {
  12806. formatter: function formatter(value) {
  12807. if (!value) return '';
  12808. return '' + value;
  12809. },
  12810. parser: function parser(text) {
  12811. if (text === undefined || text === '') return null;
  12812. return text;
  12813. }
  12814. },
  12815. week: {
  12816. formatter: function formatter(value, format) {
  12817. var week = Object(date_util_["getWeekNumber"])(value);
  12818. var month = value.getMonth();
  12819. var trueDate = new Date(value);
  12820. if (week === 1 && month === 11) {
  12821. trueDate.setHours(0, 0, 0, 0);
  12822. trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
  12823. }
  12824. var date = Object(date_util_["formatDate"])(trueDate, format);
  12825. date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
  12826. return date;
  12827. },
  12828. parser: function parser(text, format) {
  12829. // parse as if a normal date
  12830. return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
  12831. }
  12832. },
  12833. date: {
  12834. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  12835. parser: pickervue_type_script_lang_js_DATE_PARSER
  12836. },
  12837. datetime: {
  12838. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  12839. parser: pickervue_type_script_lang_js_DATE_PARSER
  12840. },
  12841. daterange: {
  12842. formatter: RANGE_FORMATTER,
  12843. parser: RANGE_PARSER
  12844. },
  12845. monthrange: {
  12846. formatter: RANGE_FORMATTER,
  12847. parser: RANGE_PARSER
  12848. },
  12849. datetimerange: {
  12850. formatter: RANGE_FORMATTER,
  12851. parser: RANGE_PARSER
  12852. },
  12853. timerange: {
  12854. formatter: RANGE_FORMATTER,
  12855. parser: RANGE_PARSER
  12856. },
  12857. time: {
  12858. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  12859. parser: pickervue_type_script_lang_js_DATE_PARSER
  12860. },
  12861. month: {
  12862. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  12863. parser: pickervue_type_script_lang_js_DATE_PARSER
  12864. },
  12865. year: {
  12866. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  12867. parser: pickervue_type_script_lang_js_DATE_PARSER
  12868. },
  12869. number: {
  12870. formatter: function formatter(value) {
  12871. if (!value) return '';
  12872. return '' + value;
  12873. },
  12874. parser: function parser(text) {
  12875. var result = Number(text);
  12876. if (!isNaN(text)) {
  12877. return result;
  12878. } else {
  12879. return null;
  12880. }
  12881. }
  12882. },
  12883. dates: {
  12884. formatter: function formatter(value, format) {
  12885. return value.map(function (date) {
  12886. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  12887. });
  12888. },
  12889. parser: function parser(value, format) {
  12890. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  12891. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  12892. });
  12893. }
  12894. }
  12895. };
  12896. var PLACEMENT_MAP = {
  12897. left: 'bottom-start',
  12898. center: 'bottom',
  12899. right: 'bottom-end'
  12900. };
  12901. var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
  12902. var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  12903. if (!value) return null;
  12904. var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
  12905. var format = customFormat || DEFAULT_FORMATS[type];
  12906. return parser(value, format, rangeSeparator);
  12907. };
  12908. var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
  12909. if (!value) return null;
  12910. var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
  12911. var format = customFormat || DEFAULT_FORMATS[type];
  12912. return formatter(value, format);
  12913. };
  12914. /*
  12915. * Considers:
  12916. * 1. Date object
  12917. * 2. date string
  12918. * 3. array of 1 or 2
  12919. */
  12920. var valueEquals = function valueEquals(a, b) {
  12921. // considers Date object and string
  12922. var dateEquals = function dateEquals(a, b) {
  12923. var aIsDate = a instanceof Date;
  12924. var bIsDate = b instanceof Date;
  12925. if (aIsDate && bIsDate) {
  12926. return a.getTime() === b.getTime();
  12927. }
  12928. if (!aIsDate && !bIsDate) {
  12929. return a === b;
  12930. }
  12931. return false;
  12932. };
  12933. var aIsArray = a instanceof Array;
  12934. var bIsArray = b instanceof Array;
  12935. if (aIsArray && bIsArray) {
  12936. if (a.length !== b.length) {
  12937. return false;
  12938. }
  12939. return a.every(function (item, index) {
  12940. return dateEquals(item, b[index]);
  12941. });
  12942. }
  12943. if (!aIsArray && !bIsArray) {
  12944. return dateEquals(a, b);
  12945. }
  12946. return false;
  12947. };
  12948. var isString = function isString(val) {
  12949. return typeof val === 'string' || val instanceof String;
  12950. };
  12951. var pickervue_type_script_lang_js_validator = function validator(val) {
  12952. // either: String, Array of String, null / undefined
  12953. return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
  12954. };
  12955. /* harmony default export */ var pickervue_type_script_lang_js_ = ({
  12956. mixins: [emitter_default.a, NewPopper],
  12957. inject: {
  12958. elForm: {
  12959. default: ''
  12960. },
  12961. elFormItem: {
  12962. default: ''
  12963. }
  12964. },
  12965. props: {
  12966. size: String,
  12967. format: String,
  12968. valueFormat: String,
  12969. readonly: Boolean,
  12970. placeholder: String,
  12971. startPlaceholder: String,
  12972. endPlaceholder: String,
  12973. prefixIcon: String,
  12974. clearIcon: {
  12975. type: String,
  12976. default: 'el-icon-circle-close'
  12977. },
  12978. name: {
  12979. default: '',
  12980. validator: pickervue_type_script_lang_js_validator
  12981. },
  12982. disabled: Boolean,
  12983. clearable: {
  12984. type: Boolean,
  12985. default: true
  12986. },
  12987. id: {
  12988. default: '',
  12989. validator: pickervue_type_script_lang_js_validator
  12990. },
  12991. popperClass: String,
  12992. editable: {
  12993. type: Boolean,
  12994. default: true
  12995. },
  12996. align: {
  12997. type: String,
  12998. default: 'left'
  12999. },
  13000. value: {},
  13001. defaultValue: {},
  13002. defaultTime: {},
  13003. rangeSeparator: {
  13004. default: '-'
  13005. },
  13006. pickerOptions: {},
  13007. unlinkPanels: Boolean,
  13008. validateEvent: {
  13009. type: Boolean,
  13010. default: true
  13011. }
  13012. },
  13013. components: { ElInput: input_default.a },
  13014. directives: { Clickoutside: clickoutside_default.a },
  13015. data: function data() {
  13016. return {
  13017. pickerVisible: false,
  13018. showClose: false,
  13019. userInput: null,
  13020. valueOnOpen: null, // value when picker opens, used to determine whether to emit change
  13021. unwatchPickerOptions: null
  13022. };
  13023. },
  13024. watch: {
  13025. pickerVisible: function pickerVisible(val) {
  13026. if (this.readonly || this.pickerDisabled) return;
  13027. if (val) {
  13028. this.showPicker();
  13029. this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
  13030. } else {
  13031. this.hidePicker();
  13032. this.emitChange(this.value);
  13033. this.userInput = null;
  13034. if (this.validateEvent) {
  13035. this.dispatch('ElFormItem', 'el.form.blur');
  13036. }
  13037. this.$emit('blur', this);
  13038. this.blur();
  13039. }
  13040. },
  13041. parsedValue: {
  13042. immediate: true,
  13043. handler: function handler(val) {
  13044. if (this.picker) {
  13045. this.picker.value = val;
  13046. }
  13047. }
  13048. },
  13049. defaultValue: function defaultValue(val) {
  13050. // NOTE: should eventually move to jsx style picker + panel ?
  13051. if (this.picker) {
  13052. this.picker.defaultValue = val;
  13053. }
  13054. },
  13055. value: function value(val, oldVal) {
  13056. if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
  13057. this.dispatch('ElFormItem', 'el.form.change', val);
  13058. }
  13059. }
  13060. },
  13061. computed: {
  13062. ranged: function ranged() {
  13063. return this.type.indexOf('range') > -1;
  13064. },
  13065. reference: function reference() {
  13066. var reference = this.$refs.reference;
  13067. return reference.$el || reference;
  13068. },
  13069. refInput: function refInput() {
  13070. if (this.reference) {
  13071. return [].slice.call(this.reference.querySelectorAll('input'));
  13072. }
  13073. return [];
  13074. },
  13075. valueIsEmpty: function valueIsEmpty() {
  13076. var val = this.value;
  13077. if (Array.isArray(val)) {
  13078. for (var i = 0, len = val.length; i < len; i++) {
  13079. if (val[i]) {
  13080. return false;
  13081. }
  13082. }
  13083. } else {
  13084. if (val) {
  13085. return false;
  13086. }
  13087. }
  13088. return true;
  13089. },
  13090. triggerClass: function triggerClass() {
  13091. return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
  13092. },
  13093. selectionMode: function selectionMode() {
  13094. if (this.type === 'week') {
  13095. return 'week';
  13096. } else if (this.type === 'month') {
  13097. return 'month';
  13098. } else if (this.type === 'year') {
  13099. return 'year';
  13100. } else if (this.type === 'dates') {
  13101. return 'dates';
  13102. }
  13103. return 'day';
  13104. },
  13105. haveTrigger: function haveTrigger() {
  13106. if (typeof this.showTrigger !== 'undefined') {
  13107. return this.showTrigger;
  13108. }
  13109. return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
  13110. },
  13111. displayValue: function displayValue() {
  13112. var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
  13113. if (Array.isArray(this.userInput)) {
  13114. return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
  13115. } else if (this.userInput !== null) {
  13116. return this.userInput;
  13117. } else if (formattedValue) {
  13118. return this.type === 'dates' ? formattedValue.join(', ') : formattedValue;
  13119. } else {
  13120. return '';
  13121. }
  13122. },
  13123. parsedValue: function parsedValue() {
  13124. if (!this.value) return this.value; // component value is not set
  13125. if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
  13126. var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
  13127. if (valueIsDateObject) {
  13128. return this.value;
  13129. }
  13130. if (this.valueFormat) {
  13131. return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
  13132. }
  13133. // NOTE: deal with common but incorrect usage, should remove in next major version
  13134. // user might provide string / timestamp without value-format, coerce them into date (or array of date)
  13135. return Array.isArray(this.value) ? this.value.map(function (val) {
  13136. return new Date(val);
  13137. }) : new Date(this.value);
  13138. },
  13139. _elFormItemSize: function _elFormItemSize() {
  13140. return (this.elFormItem || {}).elFormItemSize;
  13141. },
  13142. pickerSize: function pickerSize() {
  13143. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  13144. },
  13145. pickerDisabled: function pickerDisabled() {
  13146. return this.disabled || (this.elForm || {}).disabled;
  13147. },
  13148. firstInputId: function firstInputId() {
  13149. var obj = {};
  13150. var id = void 0;
  13151. if (this.ranged) {
  13152. id = this.id && this.id[0];
  13153. } else {
  13154. id = this.id;
  13155. }
  13156. if (id) obj.id = id;
  13157. return obj;
  13158. },
  13159. secondInputId: function secondInputId() {
  13160. var obj = {};
  13161. var id = void 0;
  13162. if (this.ranged) {
  13163. id = this.id && this.id[1];
  13164. }
  13165. if (id) obj.id = id;
  13166. return obj;
  13167. }
  13168. },
  13169. created: function created() {
  13170. // vue-popper
  13171. this.popperOptions = {
  13172. boundariesPadding: 0,
  13173. gpuAcceleration: false
  13174. };
  13175. this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
  13176. this.$on('fieldReset', this.handleFieldReset);
  13177. },
  13178. methods: {
  13179. focus: function focus() {
  13180. if (!this.ranged) {
  13181. this.$refs.reference.focus();
  13182. } else {
  13183. this.handleFocus();
  13184. }
  13185. },
  13186. blur: function blur() {
  13187. this.refInput.forEach(function (input) {
  13188. return input.blur();
  13189. });
  13190. },
  13191. // {parse, formatTo} Value deals maps component value with internal Date
  13192. parseValue: function parseValue(value) {
  13193. var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
  13194. if (this.valueFormat && !isParsed) {
  13195. return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
  13196. } else {
  13197. return value;
  13198. }
  13199. },
  13200. formatToValue: function formatToValue(date) {
  13201. var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
  13202. if (this.valueFormat && isFormattable) {
  13203. return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
  13204. } else {
  13205. return date;
  13206. }
  13207. },
  13208. // {parse, formatTo} String deals with user input
  13209. parseString: function parseString(value) {
  13210. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13211. return parseAsFormatAndType(value, this.format, type);
  13212. },
  13213. formatToString: function formatToString(value) {
  13214. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13215. return formatAsFormatAndType(value, this.format, type);
  13216. },
  13217. handleMouseEnter: function handleMouseEnter() {
  13218. if (this.readonly || this.pickerDisabled) return;
  13219. if (!this.valueIsEmpty && this.clearable) {
  13220. this.showClose = true;
  13221. }
  13222. },
  13223. handleChange: function handleChange() {
  13224. if (this.userInput) {
  13225. var value = this.parseString(this.displayValue);
  13226. if (value) {
  13227. this.picker.value = value;
  13228. if (this.isValidValue(value)) {
  13229. this.emitInput(value);
  13230. this.userInput = null;
  13231. }
  13232. }
  13233. }
  13234. if (this.userInput === '') {
  13235. this.emitInput(null);
  13236. this.emitChange(null);
  13237. this.userInput = null;
  13238. }
  13239. },
  13240. handleStartInput: function handleStartInput(event) {
  13241. if (this.userInput) {
  13242. this.userInput = [event.target.value, this.userInput[1]];
  13243. } else {
  13244. this.userInput = [event.target.value, null];
  13245. }
  13246. },
  13247. handleEndInput: function handleEndInput(event) {
  13248. if (this.userInput) {
  13249. this.userInput = [this.userInput[0], event.target.value];
  13250. } else {
  13251. this.userInput = [null, event.target.value];
  13252. }
  13253. },
  13254. handleStartChange: function handleStartChange(event) {
  13255. var value = this.parseString(this.userInput && this.userInput[0]);
  13256. if (value) {
  13257. this.userInput = [this.formatToString(value), this.displayValue[1]];
  13258. var newValue = [value, this.picker.value && this.picker.value[1]];
  13259. this.picker.value = newValue;
  13260. if (this.isValidValue(newValue)) {
  13261. this.emitInput(newValue);
  13262. this.userInput = null;
  13263. }
  13264. }
  13265. },
  13266. handleEndChange: function handleEndChange(event) {
  13267. var value = this.parseString(this.userInput && this.userInput[1]);
  13268. if (value) {
  13269. this.userInput = [this.displayValue[0], this.formatToString(value)];
  13270. var newValue = [this.picker.value && this.picker.value[0], value];
  13271. this.picker.value = newValue;
  13272. if (this.isValidValue(newValue)) {
  13273. this.emitInput(newValue);
  13274. this.userInput = null;
  13275. }
  13276. }
  13277. },
  13278. handleClickIcon: function handleClickIcon(event) {
  13279. if (this.readonly || this.pickerDisabled) return;
  13280. if (this.showClose) {
  13281. this.valueOnOpen = this.value;
  13282. event.stopPropagation();
  13283. this.emitInput(null);
  13284. this.emitChange(null);
  13285. this.showClose = false;
  13286. if (this.picker && typeof this.picker.handleClear === 'function') {
  13287. this.picker.handleClear();
  13288. }
  13289. } else {
  13290. this.pickerVisible = !this.pickerVisible;
  13291. }
  13292. },
  13293. handleClose: function handleClose() {
  13294. if (!this.pickerVisible) return;
  13295. this.pickerVisible = false;
  13296. if (this.type === 'dates') {
  13297. // restore to former value
  13298. var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
  13299. this.emitInput(oldValue);
  13300. }
  13301. },
  13302. handleFieldReset: function handleFieldReset(initialValue) {
  13303. this.userInput = initialValue === '' ? null : initialValue;
  13304. },
  13305. handleFocus: function handleFocus() {
  13306. var type = this.type;
  13307. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13308. this.pickerVisible = true;
  13309. }
  13310. this.$emit('focus', this);
  13311. },
  13312. handleKeydown: function handleKeydown(event) {
  13313. var _this = this;
  13314. var keyCode = event.keyCode;
  13315. // ESC
  13316. if (keyCode === 27) {
  13317. this.pickerVisible = false;
  13318. event.stopPropagation();
  13319. return;
  13320. }
  13321. // Tab
  13322. if (keyCode === 9) {
  13323. if (!this.ranged) {
  13324. this.handleChange();
  13325. this.pickerVisible = this.picker.visible = false;
  13326. this.blur();
  13327. event.stopPropagation();
  13328. } else {
  13329. // user may change focus between two input
  13330. setTimeout(function () {
  13331. if (_this.refInput.indexOf(document.activeElement) === -1) {
  13332. _this.pickerVisible = false;
  13333. _this.blur();
  13334. event.stopPropagation();
  13335. }
  13336. }, 0);
  13337. }
  13338. return;
  13339. }
  13340. // Enter
  13341. if (keyCode === 13) {
  13342. if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
  13343. this.handleChange();
  13344. this.pickerVisible = this.picker.visible = false;
  13345. this.blur();
  13346. }
  13347. event.stopPropagation();
  13348. return;
  13349. }
  13350. // if user is typing, do not let picker handle key input
  13351. if (this.userInput) {
  13352. event.stopPropagation();
  13353. return;
  13354. }
  13355. // delegate other keys to panel
  13356. if (this.picker && this.picker.handleKeydown) {
  13357. this.picker.handleKeydown(event);
  13358. }
  13359. },
  13360. handleRangeClick: function handleRangeClick() {
  13361. var type = this.type;
  13362. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13363. this.pickerVisible = true;
  13364. }
  13365. this.$emit('focus', this);
  13366. },
  13367. hidePicker: function hidePicker() {
  13368. if (this.picker) {
  13369. this.picker.resetView && this.picker.resetView();
  13370. this.pickerVisible = this.picker.visible = false;
  13371. this.destroyPopper();
  13372. }
  13373. },
  13374. showPicker: function showPicker() {
  13375. var _this2 = this;
  13376. if (this.$isServer) return;
  13377. if (!this.picker) {
  13378. this.mountPicker();
  13379. }
  13380. this.pickerVisible = this.picker.visible = true;
  13381. this.updatePopper();
  13382. this.picker.value = this.parsedValue;
  13383. this.picker.resetView && this.picker.resetView();
  13384. this.$nextTick(function () {
  13385. _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
  13386. });
  13387. },
  13388. mountPicker: function mountPicker() {
  13389. var _this3 = this;
  13390. this.picker = new external_vue_default.a(this.panel).$mount();
  13391. this.picker.defaultValue = this.defaultValue;
  13392. this.picker.defaultTime = this.defaultTime;
  13393. this.picker.popperClass = this.popperClass;
  13394. this.popperElm = this.picker.$el;
  13395. this.picker.width = this.reference.getBoundingClientRect().width;
  13396. this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
  13397. this.picker.selectionMode = this.selectionMode;
  13398. this.picker.unlinkPanels = this.unlinkPanels;
  13399. this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
  13400. this.$watch('format', function (format) {
  13401. _this3.picker.format = format;
  13402. });
  13403. var updateOptions = function updateOptions() {
  13404. var options = _this3.pickerOptions;
  13405. if (options && options.selectableRange) {
  13406. var ranges = options.selectableRange;
  13407. var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
  13408. var format = DEFAULT_FORMATS.timerange;
  13409. ranges = Array.isArray(ranges) ? ranges : [ranges];
  13410. _this3.picker.selectableRange = ranges.map(function (range) {
  13411. return parser(range, format, _this3.rangeSeparator);
  13412. });
  13413. }
  13414. for (var option in options) {
  13415. if (options.hasOwnProperty(option) &&
  13416. // 忽略 time-picker 的该配置项
  13417. option !== 'selectableRange') {
  13418. _this3.picker[option] = options[option];
  13419. }
  13420. }
  13421. // main format must prevail over undocumented pickerOptions.format
  13422. if (_this3.format) {
  13423. _this3.picker.format = _this3.format;
  13424. }
  13425. };
  13426. updateOptions();
  13427. this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
  13428. return updateOptions();
  13429. }, { deep: true });
  13430. this.$el.appendChild(this.picker.$el);
  13431. this.picker.resetView && this.picker.resetView();
  13432. this.picker.$on('dodestroy', this.doDestroy);
  13433. this.picker.$on('pick', function () {
  13434. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  13435. var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13436. _this3.userInput = null;
  13437. _this3.pickerVisible = _this3.picker.visible = visible;
  13438. _this3.emitInput(date);
  13439. _this3.picker.resetView && _this3.picker.resetView();
  13440. });
  13441. this.picker.$on('select-range', function (start, end, pos) {
  13442. if (_this3.refInput.length === 0) return;
  13443. if (!pos || pos === 'min') {
  13444. _this3.refInput[0].setSelectionRange(start, end);
  13445. _this3.refInput[0].focus();
  13446. } else if (pos === 'max') {
  13447. _this3.refInput[1].setSelectionRange(start, end);
  13448. _this3.refInput[1].focus();
  13449. }
  13450. });
  13451. },
  13452. unmountPicker: function unmountPicker() {
  13453. if (this.picker) {
  13454. this.picker.$destroy();
  13455. this.picker.$off();
  13456. if (typeof this.unwatchPickerOptions === 'function') {
  13457. this.unwatchPickerOptions();
  13458. }
  13459. this.picker.$el.parentNode.removeChild(this.picker.$el);
  13460. }
  13461. },
  13462. emitChange: function emitChange(val) {
  13463. // determine user real change only
  13464. if (!valueEquals(val, this.valueOnOpen)) {
  13465. this.$emit('change', val);
  13466. this.valueOnOpen = val;
  13467. if (this.validateEvent) {
  13468. this.dispatch('ElFormItem', 'el.form.change', val);
  13469. }
  13470. }
  13471. },
  13472. emitInput: function emitInput(val) {
  13473. var formatted = this.formatToValue(val);
  13474. if (!valueEquals(this.value, formatted)) {
  13475. this.$emit('input', formatted);
  13476. }
  13477. },
  13478. isValidValue: function isValidValue(value) {
  13479. if (!this.picker) {
  13480. this.mountPicker();
  13481. }
  13482. if (this.picker.isValidValue) {
  13483. return value && this.picker.isValidValue(value);
  13484. } else {
  13485. return true;
  13486. }
  13487. }
  13488. }
  13489. });
  13490. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
  13491. /* harmony default export */ var src_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
  13492. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
  13493. /* normalize component */
  13494. var picker_component = normalizeComponent(
  13495. src_pickervue_type_script_lang_js_,
  13496. pickervue_type_template_id_79ae069f_render,
  13497. pickervue_type_template_id_79ae069f_staticRenderFns,
  13498. false,
  13499. null,
  13500. null,
  13501. null
  13502. )
  13503. /* hot reload */
  13504. if (false) { var picker_api; }
  13505. picker_component.options.__file = "packages/date-picker/src/picker.vue"
  13506. /* harmony default export */ var picker = (picker_component.exports);
  13507. // 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&
  13508. var datevue_type_template_id_2440d4ea_render = function() {
  13509. var _vm = this
  13510. var _h = _vm.$createElement
  13511. var _c = _vm._self._c || _h
  13512. return _c(
  13513. "transition",
  13514. {
  13515. attrs: { name: "el-zoom-in-top" },
  13516. on: { "after-enter": _vm.handleEnter, "after-leave": _vm.handleLeave }
  13517. },
  13518. [
  13519. _c(
  13520. "div",
  13521. {
  13522. directives: [
  13523. {
  13524. name: "show",
  13525. rawName: "v-show",
  13526. value: _vm.visible,
  13527. expression: "visible"
  13528. }
  13529. ],
  13530. staticClass: "el-picker-panel el-date-picker el-popper",
  13531. class: [
  13532. {
  13533. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  13534. "has-time": _vm.showTime
  13535. },
  13536. _vm.popperClass
  13537. ]
  13538. },
  13539. [
  13540. _c(
  13541. "div",
  13542. { staticClass: "el-picker-panel__body-wrapper" },
  13543. [
  13544. _vm._t("sidebar"),
  13545. _vm.shortcuts
  13546. ? _c(
  13547. "div",
  13548. { staticClass: "el-picker-panel__sidebar" },
  13549. _vm._l(_vm.shortcuts, function(shortcut, key) {
  13550. return _c(
  13551. "button",
  13552. {
  13553. key: key,
  13554. staticClass: "el-picker-panel__shortcut",
  13555. attrs: { type: "button" },
  13556. on: {
  13557. click: function($event) {
  13558. _vm.handleShortcutClick(shortcut)
  13559. }
  13560. }
  13561. },
  13562. [_vm._v(_vm._s(shortcut.text))]
  13563. )
  13564. }),
  13565. 0
  13566. )
  13567. : _vm._e(),
  13568. _c("div", { staticClass: "el-picker-panel__body" }, [
  13569. _vm.showTime
  13570. ? _c("div", { staticClass: "el-date-picker__time-header" }, [
  13571. _c(
  13572. "span",
  13573. { staticClass: "el-date-picker__editor-wrap" },
  13574. [
  13575. _c("el-input", {
  13576. attrs: {
  13577. placeholder: _vm.t("el.datepicker.selectDate"),
  13578. value: _vm.visibleDate,
  13579. size: "small"
  13580. },
  13581. on: {
  13582. input: function(val) {
  13583. return (_vm.userInputDate = val)
  13584. },
  13585. change: _vm.handleVisibleDateChange
  13586. }
  13587. })
  13588. ],
  13589. 1
  13590. ),
  13591. _c(
  13592. "span",
  13593. {
  13594. directives: [
  13595. {
  13596. name: "clickoutside",
  13597. rawName: "v-clickoutside",
  13598. value: _vm.handleTimePickClose,
  13599. expression: "handleTimePickClose"
  13600. }
  13601. ],
  13602. staticClass: "el-date-picker__editor-wrap"
  13603. },
  13604. [
  13605. _c("el-input", {
  13606. ref: "input",
  13607. attrs: {
  13608. placeholder: _vm.t("el.datepicker.selectTime"),
  13609. value: _vm.visibleTime,
  13610. size: "small"
  13611. },
  13612. on: {
  13613. focus: function($event) {
  13614. _vm.timePickerVisible = true
  13615. },
  13616. input: function(val) {
  13617. return (_vm.userInputTime = val)
  13618. },
  13619. change: _vm.handleVisibleTimeChange
  13620. }
  13621. }),
  13622. _c("time-picker", {
  13623. ref: "timepicker",
  13624. attrs: {
  13625. "time-arrow-control": _vm.arrowControl,
  13626. visible: _vm.timePickerVisible
  13627. },
  13628. on: {
  13629. pick: _vm.handleTimePick,
  13630. mounted: _vm.proxyTimePickerDataProperties
  13631. }
  13632. })
  13633. ],
  13634. 1
  13635. )
  13636. ])
  13637. : _vm._e(),
  13638. _c(
  13639. "div",
  13640. {
  13641. directives: [
  13642. {
  13643. name: "show",
  13644. rawName: "v-show",
  13645. value: _vm.currentView !== "time",
  13646. expression: "currentView !== 'time'"
  13647. }
  13648. ],
  13649. staticClass: "el-date-picker__header",
  13650. class: {
  13651. "el-date-picker__header--bordered":
  13652. _vm.currentView === "year" ||
  13653. _vm.currentView === "month"
  13654. }
  13655. },
  13656. [
  13657. _c("button", {
  13658. staticClass:
  13659. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",
  13660. attrs: {
  13661. type: "button",
  13662. "aria-label": _vm.t("el.datepicker.prevYear")
  13663. },
  13664. on: { click: _vm.prevYear }
  13665. }),
  13666. _c("button", {
  13667. directives: [
  13668. {
  13669. name: "show",
  13670. rawName: "v-show",
  13671. value: _vm.currentView === "date",
  13672. expression: "currentView === 'date'"
  13673. }
  13674. ],
  13675. staticClass:
  13676. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",
  13677. attrs: {
  13678. type: "button",
  13679. "aria-label": _vm.t("el.datepicker.prevMonth")
  13680. },
  13681. on: { click: _vm.prevMonth }
  13682. }),
  13683. _c(
  13684. "span",
  13685. {
  13686. staticClass: "el-date-picker__header-label",
  13687. attrs: { role: "button" },
  13688. on: { click: _vm.showYearPicker }
  13689. },
  13690. [_vm._v(_vm._s(_vm.yearLabel))]
  13691. ),
  13692. _c(
  13693. "span",
  13694. {
  13695. directives: [
  13696. {
  13697. name: "show",
  13698. rawName: "v-show",
  13699. value: _vm.currentView === "date",
  13700. expression: "currentView === 'date'"
  13701. }
  13702. ],
  13703. staticClass: "el-date-picker__header-label",
  13704. class: { active: _vm.currentView === "month" },
  13705. attrs: { role: "button" },
  13706. on: { click: _vm.showMonthPicker }
  13707. },
  13708. [
  13709. _vm._v(
  13710. _vm._s(_vm.t("el.datepicker.month" + (_vm.month + 1)))
  13711. )
  13712. ]
  13713. ),
  13714. _c("button", {
  13715. staticClass:
  13716. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",
  13717. attrs: {
  13718. type: "button",
  13719. "aria-label": _vm.t("el.datepicker.nextYear")
  13720. },
  13721. on: { click: _vm.nextYear }
  13722. }),
  13723. _c("button", {
  13724. directives: [
  13725. {
  13726. name: "show",
  13727. rawName: "v-show",
  13728. value: _vm.currentView === "date",
  13729. expression: "currentView === 'date'"
  13730. }
  13731. ],
  13732. staticClass:
  13733. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",
  13734. attrs: {
  13735. type: "button",
  13736. "aria-label": _vm.t("el.datepicker.nextMonth")
  13737. },
  13738. on: { click: _vm.nextMonth }
  13739. })
  13740. ]
  13741. ),
  13742. _c(
  13743. "div",
  13744. { staticClass: "el-picker-panel__content" },
  13745. [
  13746. _c("date-table", {
  13747. directives: [
  13748. {
  13749. name: "show",
  13750. rawName: "v-show",
  13751. value: _vm.currentView === "date",
  13752. expression: "currentView === 'date'"
  13753. }
  13754. ],
  13755. attrs: {
  13756. "selection-mode": _vm.selectionMode,
  13757. "first-day-of-week": _vm.firstDayOfWeek,
  13758. value: _vm.value,
  13759. "default-value": _vm.defaultValue
  13760. ? new Date(_vm.defaultValue)
  13761. : null,
  13762. date: _vm.date,
  13763. "disabled-date": _vm.disabledDate
  13764. },
  13765. on: { pick: _vm.handleDatePick }
  13766. }),
  13767. _c("year-table", {
  13768. directives: [
  13769. {
  13770. name: "show",
  13771. rawName: "v-show",
  13772. value: _vm.currentView === "year",
  13773. expression: "currentView === 'year'"
  13774. }
  13775. ],
  13776. attrs: {
  13777. value: _vm.value,
  13778. "default-value": _vm.defaultValue
  13779. ? new Date(_vm.defaultValue)
  13780. : null,
  13781. date: _vm.date,
  13782. "disabled-date": _vm.disabledDate
  13783. },
  13784. on: { pick: _vm.handleYearPick }
  13785. }),
  13786. _c("month-table", {
  13787. directives: [
  13788. {
  13789. name: "show",
  13790. rawName: "v-show",
  13791. value: _vm.currentView === "month",
  13792. expression: "currentView === 'month'"
  13793. }
  13794. ],
  13795. attrs: {
  13796. value: _vm.value,
  13797. "default-value": _vm.defaultValue
  13798. ? new Date(_vm.defaultValue)
  13799. : null,
  13800. date: _vm.date,
  13801. "disabled-date": _vm.disabledDate
  13802. },
  13803. on: { pick: _vm.handleMonthPick }
  13804. })
  13805. ],
  13806. 1
  13807. )
  13808. ])
  13809. ],
  13810. 2
  13811. ),
  13812. _c(
  13813. "div",
  13814. {
  13815. directives: [
  13816. {
  13817. name: "show",
  13818. rawName: "v-show",
  13819. value: _vm.footerVisible && _vm.currentView === "date",
  13820. expression: "footerVisible && currentView === 'date'"
  13821. }
  13822. ],
  13823. staticClass: "el-picker-panel__footer"
  13824. },
  13825. [
  13826. _c(
  13827. "el-button",
  13828. {
  13829. directives: [
  13830. {
  13831. name: "show",
  13832. rawName: "v-show",
  13833. value: _vm.selectionMode !== "dates",
  13834. expression: "selectionMode !== 'dates'"
  13835. }
  13836. ],
  13837. staticClass: "el-picker-panel__link-btn",
  13838. attrs: { size: "mini", type: "text" },
  13839. on: { click: _vm.changeToNow }
  13840. },
  13841. [
  13842. _vm._v(
  13843. "\n " +
  13844. _vm._s(_vm.t("el.datepicker.now")) +
  13845. "\n "
  13846. )
  13847. ]
  13848. ),
  13849. _c(
  13850. "el-button",
  13851. {
  13852. staticClass: "el-picker-panel__link-btn",
  13853. attrs: { plain: "", size: "mini" },
  13854. on: { click: _vm.confirm }
  13855. },
  13856. [
  13857. _vm._v(
  13858. "\n " +
  13859. _vm._s(_vm.t("el.datepicker.confirm")) +
  13860. "\n "
  13861. )
  13862. ]
  13863. )
  13864. ],
  13865. 1
  13866. )
  13867. ]
  13868. )
  13869. ]
  13870. )
  13871. }
  13872. var datevue_type_template_id_2440d4ea_staticRenderFns = []
  13873. datevue_type_template_id_2440d4ea_render._withStripped = true
  13874. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=template&id=2440d4ea&
  13875. // 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&
  13876. var timevue_type_template_id_3d939089_render = function() {
  13877. var _vm = this
  13878. var _h = _vm.$createElement
  13879. var _c = _vm._self._c || _h
  13880. return _c(
  13881. "transition",
  13882. {
  13883. attrs: { name: "el-zoom-in-top" },
  13884. on: {
  13885. "after-leave": function($event) {
  13886. _vm.$emit("dodestroy")
  13887. }
  13888. }
  13889. },
  13890. [
  13891. _c(
  13892. "div",
  13893. {
  13894. directives: [
  13895. {
  13896. name: "show",
  13897. rawName: "v-show",
  13898. value: _vm.visible,
  13899. expression: "visible"
  13900. }
  13901. ],
  13902. staticClass: "el-time-panel el-popper",
  13903. class: _vm.popperClass
  13904. },
  13905. [
  13906. _c(
  13907. "div",
  13908. {
  13909. staticClass: "el-time-panel__content",
  13910. class: { "has-seconds": _vm.showSeconds }
  13911. },
  13912. [
  13913. _c("time-spinner", {
  13914. ref: "spinner",
  13915. attrs: {
  13916. "arrow-control": _vm.useArrow,
  13917. "show-seconds": _vm.showSeconds,
  13918. "am-pm-mode": _vm.amPmMode,
  13919. date: _vm.date
  13920. },
  13921. on: {
  13922. change: _vm.handleChange,
  13923. "select-range": _vm.setSelectionRange
  13924. }
  13925. })
  13926. ],
  13927. 1
  13928. ),
  13929. _c("div", { staticClass: "el-time-panel__footer" }, [
  13930. _c(
  13931. "button",
  13932. {
  13933. staticClass: "el-time-panel__btn cancel",
  13934. attrs: { type: "button" },
  13935. on: { click: _vm.handleCancel }
  13936. },
  13937. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  13938. ),
  13939. _c(
  13940. "button",
  13941. {
  13942. staticClass: "el-time-panel__btn",
  13943. class: { confirm: !_vm.disabled },
  13944. attrs: { type: "button" },
  13945. on: {
  13946. click: function($event) {
  13947. _vm.handleConfirm()
  13948. }
  13949. }
  13950. },
  13951. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  13952. )
  13953. ])
  13954. ]
  13955. )
  13956. ]
  13957. )
  13958. }
  13959. var timevue_type_template_id_3d939089_staticRenderFns = []
  13960. timevue_type_template_id_3d939089_render._withStripped = true
  13961. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
  13962. // 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&
  13963. var time_spinnervue_type_template_id_1facadeb_render = function() {
  13964. var _vm = this
  13965. var _h = _vm.$createElement
  13966. var _c = _vm._self._c || _h
  13967. return _c(
  13968. "div",
  13969. {
  13970. staticClass: "el-time-spinner",
  13971. class: { "has-seconds": _vm.showSeconds }
  13972. },
  13973. [
  13974. !_vm.arrowControl
  13975. ? [
  13976. _c(
  13977. "el-scrollbar",
  13978. {
  13979. ref: "hours",
  13980. staticClass: "el-time-spinner__wrapper",
  13981. attrs: {
  13982. "wrap-style": "max-height: inherit;",
  13983. "view-class": "el-time-spinner__list",
  13984. noresize: "",
  13985. tag: "ul"
  13986. },
  13987. nativeOn: {
  13988. mouseenter: function($event) {
  13989. _vm.emitSelectRange("hours")
  13990. },
  13991. mousemove: function($event) {
  13992. _vm.adjustCurrentSpinner("hours")
  13993. }
  13994. }
  13995. },
  13996. _vm._l(_vm.hoursList, function(disabled, hour) {
  13997. return _c(
  13998. "li",
  13999. {
  14000. key: hour,
  14001. staticClass: "el-time-spinner__item",
  14002. class: { active: hour === _vm.hours, disabled: disabled },
  14003. on: {
  14004. click: function($event) {
  14005. _vm.handleClick("hours", {
  14006. value: hour,
  14007. disabled: disabled
  14008. })
  14009. }
  14010. }
  14011. },
  14012. [
  14013. _vm._v(
  14014. _vm._s(
  14015. ("0" + (_vm.amPmMode ? hour % 12 || 12 : hour)).slice(
  14016. -2
  14017. )
  14018. ) + _vm._s(_vm.amPm(hour))
  14019. )
  14020. ]
  14021. )
  14022. }),
  14023. 0
  14024. ),
  14025. _c(
  14026. "el-scrollbar",
  14027. {
  14028. ref: "minutes",
  14029. staticClass: "el-time-spinner__wrapper",
  14030. attrs: {
  14031. "wrap-style": "max-height: inherit;",
  14032. "view-class": "el-time-spinner__list",
  14033. noresize: "",
  14034. tag: "ul"
  14035. },
  14036. nativeOn: {
  14037. mouseenter: function($event) {
  14038. _vm.emitSelectRange("minutes")
  14039. },
  14040. mousemove: function($event) {
  14041. _vm.adjustCurrentSpinner("minutes")
  14042. }
  14043. }
  14044. },
  14045. _vm._l(_vm.minutesList, function(enabled, key) {
  14046. return _c(
  14047. "li",
  14048. {
  14049. key: key,
  14050. staticClass: "el-time-spinner__item",
  14051. class: { active: key === _vm.minutes, disabled: !enabled },
  14052. on: {
  14053. click: function($event) {
  14054. _vm.handleClick("minutes", {
  14055. value: key,
  14056. disabled: false
  14057. })
  14058. }
  14059. }
  14060. },
  14061. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14062. )
  14063. }),
  14064. 0
  14065. ),
  14066. _c(
  14067. "el-scrollbar",
  14068. {
  14069. directives: [
  14070. {
  14071. name: "show",
  14072. rawName: "v-show",
  14073. value: _vm.showSeconds,
  14074. expression: "showSeconds"
  14075. }
  14076. ],
  14077. ref: "seconds",
  14078. staticClass: "el-time-spinner__wrapper",
  14079. attrs: {
  14080. "wrap-style": "max-height: inherit;",
  14081. "view-class": "el-time-spinner__list",
  14082. noresize: "",
  14083. tag: "ul"
  14084. },
  14085. nativeOn: {
  14086. mouseenter: function($event) {
  14087. _vm.emitSelectRange("seconds")
  14088. },
  14089. mousemove: function($event) {
  14090. _vm.adjustCurrentSpinner("seconds")
  14091. }
  14092. }
  14093. },
  14094. _vm._l(60, function(second, key) {
  14095. return _c(
  14096. "li",
  14097. {
  14098. key: key,
  14099. staticClass: "el-time-spinner__item",
  14100. class: { active: key === _vm.seconds },
  14101. on: {
  14102. click: function($event) {
  14103. _vm.handleClick("seconds", {
  14104. value: key,
  14105. disabled: false
  14106. })
  14107. }
  14108. }
  14109. },
  14110. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14111. )
  14112. }),
  14113. 0
  14114. )
  14115. ]
  14116. : _vm._e(),
  14117. _vm.arrowControl
  14118. ? [
  14119. _c(
  14120. "div",
  14121. {
  14122. staticClass: "el-time-spinner__wrapper is-arrow",
  14123. on: {
  14124. mouseenter: function($event) {
  14125. _vm.emitSelectRange("hours")
  14126. }
  14127. }
  14128. },
  14129. [
  14130. _c("i", {
  14131. directives: [
  14132. {
  14133. name: "repeat-click",
  14134. rawName: "v-repeat-click",
  14135. value: _vm.decrease,
  14136. expression: "decrease"
  14137. }
  14138. ],
  14139. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14140. }),
  14141. _c("i", {
  14142. directives: [
  14143. {
  14144. name: "repeat-click",
  14145. rawName: "v-repeat-click",
  14146. value: _vm.increase,
  14147. expression: "increase"
  14148. }
  14149. ],
  14150. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14151. }),
  14152. _c(
  14153. "ul",
  14154. { ref: "hours", staticClass: "el-time-spinner__list" },
  14155. _vm._l(_vm.arrowHourList, function(hour, key) {
  14156. return _c(
  14157. "li",
  14158. {
  14159. key: key,
  14160. staticClass: "el-time-spinner__item",
  14161. class: {
  14162. active: hour === _vm.hours,
  14163. disabled: _vm.hoursList[hour]
  14164. }
  14165. },
  14166. [
  14167. _vm._v(
  14168. _vm._s(
  14169. hour === undefined
  14170. ? ""
  14171. : (
  14172. "0" + (_vm.amPmMode ? hour % 12 || 12 : hour)
  14173. ).slice(-2) + _vm.amPm(hour)
  14174. )
  14175. )
  14176. ]
  14177. )
  14178. }),
  14179. 0
  14180. )
  14181. ]
  14182. ),
  14183. _c(
  14184. "div",
  14185. {
  14186. staticClass: "el-time-spinner__wrapper is-arrow",
  14187. on: {
  14188. mouseenter: function($event) {
  14189. _vm.emitSelectRange("minutes")
  14190. }
  14191. }
  14192. },
  14193. [
  14194. _c("i", {
  14195. directives: [
  14196. {
  14197. name: "repeat-click",
  14198. rawName: "v-repeat-click",
  14199. value: _vm.decrease,
  14200. expression: "decrease"
  14201. }
  14202. ],
  14203. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14204. }),
  14205. _c("i", {
  14206. directives: [
  14207. {
  14208. name: "repeat-click",
  14209. rawName: "v-repeat-click",
  14210. value: _vm.increase,
  14211. expression: "increase"
  14212. }
  14213. ],
  14214. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14215. }),
  14216. _c(
  14217. "ul",
  14218. { ref: "minutes", staticClass: "el-time-spinner__list" },
  14219. _vm._l(_vm.arrowMinuteList, function(minute, key) {
  14220. return _c(
  14221. "li",
  14222. {
  14223. key: key,
  14224. staticClass: "el-time-spinner__item",
  14225. class: { active: minute === _vm.minutes }
  14226. },
  14227. [
  14228. _vm._v(
  14229. "\n " +
  14230. _vm._s(
  14231. minute === undefined
  14232. ? ""
  14233. : ("0" + minute).slice(-2)
  14234. ) +
  14235. "\n "
  14236. )
  14237. ]
  14238. )
  14239. }),
  14240. 0
  14241. )
  14242. ]
  14243. ),
  14244. _vm.showSeconds
  14245. ? _c(
  14246. "div",
  14247. {
  14248. staticClass: "el-time-spinner__wrapper is-arrow",
  14249. on: {
  14250. mouseenter: function($event) {
  14251. _vm.emitSelectRange("seconds")
  14252. }
  14253. }
  14254. },
  14255. [
  14256. _c("i", {
  14257. directives: [
  14258. {
  14259. name: "repeat-click",
  14260. rawName: "v-repeat-click",
  14261. value: _vm.decrease,
  14262. expression: "decrease"
  14263. }
  14264. ],
  14265. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14266. }),
  14267. _c("i", {
  14268. directives: [
  14269. {
  14270. name: "repeat-click",
  14271. rawName: "v-repeat-click",
  14272. value: _vm.increase,
  14273. expression: "increase"
  14274. }
  14275. ],
  14276. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14277. }),
  14278. _c(
  14279. "ul",
  14280. { ref: "seconds", staticClass: "el-time-spinner__list" },
  14281. _vm._l(_vm.arrowSecondList, function(second, key) {
  14282. return _c(
  14283. "li",
  14284. {
  14285. key: key,
  14286. staticClass: "el-time-spinner__item",
  14287. class: { active: second === _vm.seconds }
  14288. },
  14289. [
  14290. _vm._v(
  14291. "\n " +
  14292. _vm._s(
  14293. second === undefined
  14294. ? ""
  14295. : ("0" + second).slice(-2)
  14296. ) +
  14297. "\n "
  14298. )
  14299. ]
  14300. )
  14301. }),
  14302. 0
  14303. )
  14304. ]
  14305. )
  14306. : _vm._e()
  14307. ]
  14308. : _vm._e()
  14309. ],
  14310. 2
  14311. )
  14312. }
  14313. var time_spinnervue_type_template_id_1facadeb_staticRenderFns = []
  14314. time_spinnervue_type_template_id_1facadeb_render._withStripped = true
  14315. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
  14316. // 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&
  14317. //
  14318. //
  14319. //
  14320. //
  14321. //
  14322. //
  14323. //
  14324. //
  14325. //
  14326. //
  14327. //
  14328. //
  14329. //
  14330. //
  14331. //
  14332. //
  14333. //
  14334. //
  14335. //
  14336. //
  14337. //
  14338. //
  14339. //
  14340. //
  14341. //
  14342. //
  14343. //
  14344. //
  14345. //
  14346. //
  14347. //
  14348. //
  14349. //
  14350. //
  14351. //
  14352. //
  14353. //
  14354. //
  14355. //
  14356. //
  14357. //
  14358. //
  14359. //
  14360. //
  14361. //
  14362. //
  14363. //
  14364. //
  14365. //
  14366. //
  14367. //
  14368. //
  14369. //
  14370. //
  14371. //
  14372. //
  14373. //
  14374. //
  14375. //
  14376. //
  14377. //
  14378. //
  14379. //
  14380. //
  14381. //
  14382. //
  14383. //
  14384. //
  14385. //
  14386. //
  14387. //
  14388. //
  14389. //
  14390. //
  14391. //
  14392. //
  14393. //
  14394. //
  14395. //
  14396. //
  14397. //
  14398. //
  14399. //
  14400. //
  14401. //
  14402. //
  14403. //
  14404. //
  14405. //
  14406. //
  14407. //
  14408. //
  14409. //
  14410. //
  14411. //
  14412. //
  14413. //
  14414. //
  14415. //
  14416. //
  14417. //
  14418. //
  14419. /* harmony default export */ var time_spinnervue_type_script_lang_js_ = ({
  14420. components: { ElScrollbar: scrollbar_default.a },
  14421. directives: {
  14422. repeatClick: repeat_click
  14423. },
  14424. props: {
  14425. date: {},
  14426. defaultValue: {}, // reserved for future use
  14427. showSeconds: {
  14428. type: Boolean,
  14429. default: true
  14430. },
  14431. arrowControl: Boolean,
  14432. amPmMode: {
  14433. type: String,
  14434. default: '' // 'a': am/pm; 'A': AM/PM
  14435. }
  14436. },
  14437. computed: {
  14438. hours: function hours() {
  14439. return this.date.getHours();
  14440. },
  14441. minutes: function minutes() {
  14442. return this.date.getMinutes();
  14443. },
  14444. seconds: function seconds() {
  14445. return this.date.getSeconds();
  14446. },
  14447. hoursList: function hoursList() {
  14448. return Object(date_util_["getRangeHours"])(this.selectableRange);
  14449. },
  14450. minutesList: function minutesList() {
  14451. return Object(date_util_["getRangeMinutes"])(this.selectableRange, this.hours);
  14452. },
  14453. arrowHourList: function arrowHourList() {
  14454. var hours = this.hours;
  14455. return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
  14456. },
  14457. arrowMinuteList: function arrowMinuteList() {
  14458. var minutes = this.minutes;
  14459. return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
  14460. },
  14461. arrowSecondList: function arrowSecondList() {
  14462. var seconds = this.seconds;
  14463. return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
  14464. }
  14465. },
  14466. data: function data() {
  14467. return {
  14468. selectableRange: [],
  14469. currentScrollbar: null
  14470. };
  14471. },
  14472. mounted: function mounted() {
  14473. var _this = this;
  14474. this.$nextTick(function () {
  14475. !_this.arrowControl && _this.bindScrollEvent();
  14476. });
  14477. },
  14478. methods: {
  14479. increase: function increase() {
  14480. this.scrollDown(1);
  14481. },
  14482. decrease: function decrease() {
  14483. this.scrollDown(-1);
  14484. },
  14485. modifyDateField: function modifyDateField(type, value) {
  14486. switch (type) {
  14487. case 'hours':
  14488. this.$emit('change', Object(date_util_["modifyTime"])(this.date, value, this.minutes, this.seconds));break;
  14489. case 'minutes':
  14490. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, value, this.seconds));break;
  14491. case 'seconds':
  14492. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, this.minutes, value));break;
  14493. }
  14494. },
  14495. handleClick: function handleClick(type, _ref) {
  14496. var value = _ref.value,
  14497. disabled = _ref.disabled;
  14498. if (!disabled) {
  14499. this.modifyDateField(type, value);
  14500. this.emitSelectRange(type);
  14501. this.adjustSpinner(type, value);
  14502. }
  14503. },
  14504. emitSelectRange: function emitSelectRange(type) {
  14505. if (type === 'hours') {
  14506. this.$emit('select-range', 0, 2);
  14507. } else if (type === 'minutes') {
  14508. this.$emit('select-range', 3, 5);
  14509. } else if (type === 'seconds') {
  14510. this.$emit('select-range', 6, 8);
  14511. }
  14512. this.currentScrollbar = type;
  14513. },
  14514. bindScrollEvent: function bindScrollEvent() {
  14515. var _this2 = this;
  14516. var bindFuntion = function bindFuntion(type) {
  14517. _this2.$refs[type].wrap.onscroll = function (e) {
  14518. // TODO: scroll is emitted when set scrollTop programatically
  14519. // should find better solutions in the future!
  14520. _this2.handleScroll(type, e);
  14521. };
  14522. };
  14523. bindFuntion('hours');
  14524. bindFuntion('minutes');
  14525. bindFuntion('seconds');
  14526. },
  14527. handleScroll: function handleScroll(type) {
  14528. var value = Math.min(Math.floor((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), type === 'hours' ? 23 : 59);
  14529. this.modifyDateField(type, value);
  14530. },
  14531. // NOTE: used by datetime / date-range panel
  14532. // renamed from adjustScrollTop
  14533. // should try to refactory it
  14534. adjustSpinners: function adjustSpinners() {
  14535. this.adjustSpinner('hours', this.hours);
  14536. this.adjustSpinner('minutes', this.minutes);
  14537. this.adjustSpinner('seconds', this.seconds);
  14538. },
  14539. adjustCurrentSpinner: function adjustCurrentSpinner(type) {
  14540. this.adjustSpinner(type, this[type]);
  14541. },
  14542. adjustSpinner: function adjustSpinner(type, value) {
  14543. if (this.arrowControl) return;
  14544. var el = this.$refs[type].wrap;
  14545. if (el) {
  14546. el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
  14547. }
  14548. },
  14549. scrollDown: function scrollDown(step) {
  14550. if (!this.currentScrollbar) {
  14551. this.emitSelectRange('hours');
  14552. }
  14553. var label = this.currentScrollbar;
  14554. var hoursList = this.hoursList;
  14555. var now = this[label];
  14556. if (this.currentScrollbar === 'hours') {
  14557. var total = Math.abs(step);
  14558. step = step > 0 ? 1 : -1;
  14559. var length = hoursList.length;
  14560. while (length-- && total) {
  14561. now = (now + step + hoursList.length) % hoursList.length;
  14562. if (hoursList[now]) {
  14563. continue;
  14564. }
  14565. total--;
  14566. }
  14567. if (hoursList[now]) return;
  14568. } else {
  14569. now = (now + step + 60) % 60;
  14570. }
  14571. this.modifyDateField(label, now);
  14572. this.adjustSpinner(label, now);
  14573. },
  14574. amPm: function amPm(hour) {
  14575. var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
  14576. if (!shouldShowAmPm) return '';
  14577. var isCapital = this.amPmMode === 'A';
  14578. var content = hour < 12 ? ' am' : ' pm';
  14579. if (isCapital) content = content.toUpperCase();
  14580. return content;
  14581. },
  14582. typeItemHeight: function typeItemHeight(type) {
  14583. return this.$refs[type].$el.querySelector('li').offsetHeight;
  14584. },
  14585. scrollBarHeight: function scrollBarHeight(type) {
  14586. return this.$refs[type].$el.offsetHeight;
  14587. }
  14588. }
  14589. });
  14590. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
  14591. /* harmony default export */ var basic_time_spinnervue_type_script_lang_js_ = (time_spinnervue_type_script_lang_js_);
  14592. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue
  14593. /* normalize component */
  14594. var time_spinner_component = normalizeComponent(
  14595. basic_time_spinnervue_type_script_lang_js_,
  14596. time_spinnervue_type_template_id_1facadeb_render,
  14597. time_spinnervue_type_template_id_1facadeb_staticRenderFns,
  14598. false,
  14599. null,
  14600. null,
  14601. null
  14602. )
  14603. /* hot reload */
  14604. if (false) { var time_spinner_api; }
  14605. time_spinner_component.options.__file = "packages/date-picker/src/basic/time-spinner.vue"
  14606. /* harmony default export */ var time_spinner = (time_spinner_component.exports);
  14607. // 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&
  14608. //
  14609. //
  14610. //
  14611. //
  14612. //
  14613. //
  14614. //
  14615. //
  14616. //
  14617. //
  14618. //
  14619. //
  14620. //
  14621. //
  14622. //
  14623. //
  14624. //
  14625. //
  14626. //
  14627. //
  14628. //
  14629. //
  14630. //
  14631. //
  14632. //
  14633. //
  14634. //
  14635. //
  14636. //
  14637. //
  14638. //
  14639. //
  14640. /* harmony default export */ var timevue_type_script_lang_js_ = ({
  14641. mixins: [locale_default.a],
  14642. components: {
  14643. TimeSpinner: time_spinner
  14644. },
  14645. props: {
  14646. visible: Boolean,
  14647. timeArrowControl: Boolean
  14648. },
  14649. watch: {
  14650. visible: function visible(val) {
  14651. var _this = this;
  14652. if (val) {
  14653. this.oldValue = this.value;
  14654. this.$nextTick(function () {
  14655. return _this.$refs.spinner.emitSelectRange('hours');
  14656. });
  14657. } else {
  14658. this.needInitAdjust = true;
  14659. }
  14660. },
  14661. value: function value(newVal) {
  14662. var _this2 = this;
  14663. var date = void 0;
  14664. if (newVal instanceof Date) {
  14665. date = Object(date_util_["limitTimeRange"])(newVal, this.selectableRange, this.format);
  14666. } else if (!newVal) {
  14667. date = this.defaultValue ? new Date(this.defaultValue) : new Date();
  14668. }
  14669. this.date = date;
  14670. if (this.visible && this.needInitAdjust) {
  14671. this.$nextTick(function (_) {
  14672. return _this2.adjustSpinners();
  14673. });
  14674. this.needInitAdjust = false;
  14675. }
  14676. },
  14677. selectableRange: function selectableRange(val) {
  14678. this.$refs.spinner.selectableRange = val;
  14679. },
  14680. defaultValue: function defaultValue(val) {
  14681. if (!Object(date_util_["isDate"])(this.value)) {
  14682. this.date = val ? new Date(val) : new Date();
  14683. }
  14684. }
  14685. },
  14686. data: function data() {
  14687. return {
  14688. popperClass: '',
  14689. format: 'HH:mm:ss',
  14690. value: '',
  14691. defaultValue: null,
  14692. date: new Date(),
  14693. oldValue: new Date(),
  14694. selectableRange: [],
  14695. selectionRange: [0, 2],
  14696. disabled: false,
  14697. arrowControl: false,
  14698. needInitAdjust: true
  14699. };
  14700. },
  14701. computed: {
  14702. showSeconds: function showSeconds() {
  14703. return (this.format || '').indexOf('ss') !== -1;
  14704. },
  14705. useArrow: function useArrow() {
  14706. return this.arrowControl || this.timeArrowControl || false;
  14707. },
  14708. amPmMode: function amPmMode() {
  14709. if ((this.format || '').indexOf('A') !== -1) return 'A';
  14710. if ((this.format || '').indexOf('a') !== -1) return 'a';
  14711. return '';
  14712. }
  14713. },
  14714. methods: {
  14715. handleCancel: function handleCancel() {
  14716. this.$emit('pick', this.oldValue, false);
  14717. },
  14718. handleChange: function handleChange(date) {
  14719. // this.visible avoids edge cases, when use scrolls during panel closing animation
  14720. if (this.visible) {
  14721. this.date = Object(date_util_["clearMilliseconds"])(date);
  14722. // if date is out of range, do not emit
  14723. if (this.isValidValue(this.date)) {
  14724. this.$emit('pick', this.date, true);
  14725. }
  14726. }
  14727. },
  14728. setSelectionRange: function setSelectionRange(start, end) {
  14729. this.$emit('select-range', start, end);
  14730. this.selectionRange = [start, end];
  14731. },
  14732. handleConfirm: function handleConfirm() {
  14733. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  14734. var first = arguments[1];
  14735. if (first) return;
  14736. var date = Object(date_util_["clearMilliseconds"])(Object(date_util_["limitTimeRange"])(this.date, this.selectableRange, this.format));
  14737. this.$emit('pick', date, visible, first);
  14738. },
  14739. handleKeydown: function handleKeydown(event) {
  14740. var keyCode = event.keyCode;
  14741. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  14742. // Left or Right
  14743. if (keyCode === 37 || keyCode === 39) {
  14744. var step = mapping[keyCode];
  14745. this.changeSelectionRange(step);
  14746. event.preventDefault();
  14747. return;
  14748. }
  14749. // Up or Down
  14750. if (keyCode === 38 || keyCode === 40) {
  14751. var _step = mapping[keyCode];
  14752. this.$refs.spinner.scrollDown(_step);
  14753. event.preventDefault();
  14754. return;
  14755. }
  14756. },
  14757. isValidValue: function isValidValue(date) {
  14758. return Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format);
  14759. },
  14760. adjustSpinners: function adjustSpinners() {
  14761. return this.$refs.spinner.adjustSpinners();
  14762. },
  14763. changeSelectionRange: function changeSelectionRange(step) {
  14764. var list = [0, 3].concat(this.showSeconds ? [6] : []);
  14765. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  14766. var index = list.indexOf(this.selectionRange[0]);
  14767. var next = (index + step + list.length) % list.length;
  14768. this.$refs.spinner.emitSelectRange(mapping[next]);
  14769. }
  14770. },
  14771. mounted: function mounted() {
  14772. var _this3 = this;
  14773. this.$nextTick(function () {
  14774. return _this3.handleConfirm(true, true);
  14775. });
  14776. this.$emit('mounted');
  14777. }
  14778. });
  14779. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
  14780. /* harmony default export */ var panel_timevue_type_script_lang_js_ = (timevue_type_script_lang_js_);
  14781. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue
  14782. /* normalize component */
  14783. var time_component = normalizeComponent(
  14784. panel_timevue_type_script_lang_js_,
  14785. timevue_type_template_id_3d939089_render,
  14786. timevue_type_template_id_3d939089_staticRenderFns,
  14787. false,
  14788. null,
  14789. null,
  14790. null
  14791. )
  14792. /* hot reload */
  14793. if (false) { var time_api; }
  14794. time_component.options.__file = "packages/date-picker/src/panel/time.vue"
  14795. /* harmony default export */ var panel_time = (time_component.exports);
  14796. // 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&
  14797. var year_tablevue_type_template_id_c86ab5e0_render = function() {
  14798. var _vm = this
  14799. var _h = _vm.$createElement
  14800. var _c = _vm._self._c || _h
  14801. return _c(
  14802. "table",
  14803. { staticClass: "el-year-table", on: { click: _vm.handleYearTableClick } },
  14804. [
  14805. _c("tbody", [
  14806. _c("tr", [
  14807. _c(
  14808. "td",
  14809. {
  14810. staticClass: "available",
  14811. class: _vm.getCellStyle(_vm.startYear + 0)
  14812. },
  14813. [_c("a", { staticClass: "cell" }, [_vm._v(_vm._s(_vm.startYear))])]
  14814. ),
  14815. _c(
  14816. "td",
  14817. {
  14818. staticClass: "available",
  14819. class: _vm.getCellStyle(_vm.startYear + 1)
  14820. },
  14821. [
  14822. _c("a", { staticClass: "cell" }, [
  14823. _vm._v(_vm._s(_vm.startYear + 1))
  14824. ])
  14825. ]
  14826. ),
  14827. _c(
  14828. "td",
  14829. {
  14830. staticClass: "available",
  14831. class: _vm.getCellStyle(_vm.startYear + 2)
  14832. },
  14833. [
  14834. _c("a", { staticClass: "cell" }, [
  14835. _vm._v(_vm._s(_vm.startYear + 2))
  14836. ])
  14837. ]
  14838. ),
  14839. _c(
  14840. "td",
  14841. {
  14842. staticClass: "available",
  14843. class: _vm.getCellStyle(_vm.startYear + 3)
  14844. },
  14845. [
  14846. _c("a", { staticClass: "cell" }, [
  14847. _vm._v(_vm._s(_vm.startYear + 3))
  14848. ])
  14849. ]
  14850. )
  14851. ]),
  14852. _c("tr", [
  14853. _c(
  14854. "td",
  14855. {
  14856. staticClass: "available",
  14857. class: _vm.getCellStyle(_vm.startYear + 4)
  14858. },
  14859. [
  14860. _c("a", { staticClass: "cell" }, [
  14861. _vm._v(_vm._s(_vm.startYear + 4))
  14862. ])
  14863. ]
  14864. ),
  14865. _c(
  14866. "td",
  14867. {
  14868. staticClass: "available",
  14869. class: _vm.getCellStyle(_vm.startYear + 5)
  14870. },
  14871. [
  14872. _c("a", { staticClass: "cell" }, [
  14873. _vm._v(_vm._s(_vm.startYear + 5))
  14874. ])
  14875. ]
  14876. ),
  14877. _c(
  14878. "td",
  14879. {
  14880. staticClass: "available",
  14881. class: _vm.getCellStyle(_vm.startYear + 6)
  14882. },
  14883. [
  14884. _c("a", { staticClass: "cell" }, [
  14885. _vm._v(_vm._s(_vm.startYear + 6))
  14886. ])
  14887. ]
  14888. ),
  14889. _c(
  14890. "td",
  14891. {
  14892. staticClass: "available",
  14893. class: _vm.getCellStyle(_vm.startYear + 7)
  14894. },
  14895. [
  14896. _c("a", { staticClass: "cell" }, [
  14897. _vm._v(_vm._s(_vm.startYear + 7))
  14898. ])
  14899. ]
  14900. )
  14901. ]),
  14902. _c("tr", [
  14903. _c(
  14904. "td",
  14905. {
  14906. staticClass: "available",
  14907. class: _vm.getCellStyle(_vm.startYear + 8)
  14908. },
  14909. [
  14910. _c("a", { staticClass: "cell" }, [
  14911. _vm._v(_vm._s(_vm.startYear + 8))
  14912. ])
  14913. ]
  14914. ),
  14915. _c(
  14916. "td",
  14917. {
  14918. staticClass: "available",
  14919. class: _vm.getCellStyle(_vm.startYear + 9)
  14920. },
  14921. [
  14922. _c("a", { staticClass: "cell" }, [
  14923. _vm._v(_vm._s(_vm.startYear + 9))
  14924. ])
  14925. ]
  14926. ),
  14927. _c("td"),
  14928. _c("td")
  14929. ])
  14930. ])
  14931. ]
  14932. )
  14933. }
  14934. var year_tablevue_type_template_id_c86ab5e0_staticRenderFns = []
  14935. year_tablevue_type_template_id_c86ab5e0_render._withStripped = true
  14936. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=template&id=c86ab5e0&
  14937. // 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&
  14938. //
  14939. //
  14940. //
  14941. //
  14942. //
  14943. //
  14944. //
  14945. //
  14946. //
  14947. //
  14948. //
  14949. //
  14950. //
  14951. //
  14952. //
  14953. //
  14954. //
  14955. //
  14956. //
  14957. //
  14958. //
  14959. //
  14960. //
  14961. //
  14962. //
  14963. //
  14964. //
  14965. //
  14966. //
  14967. //
  14968. //
  14969. //
  14970. //
  14971. //
  14972. //
  14973. //
  14974. //
  14975. //
  14976. //
  14977. //
  14978. //
  14979. //
  14980. //
  14981. //
  14982. //
  14983. var year_tablevue_type_script_lang_js_datesInYear = function datesInYear(year) {
  14984. var numOfDays = Object(date_util_["getDayCountOfYear"])(year);
  14985. var firstDay = new Date(year, 0, 1);
  14986. return Object(date_util_["range"])(numOfDays).map(function (n) {
  14987. return Object(date_util_["nextDate"])(firstDay, n);
  14988. });
  14989. };
  14990. /* harmony default export */ var year_tablevue_type_script_lang_js_ = ({
  14991. props: {
  14992. disabledDate: {},
  14993. value: {},
  14994. defaultValue: {
  14995. validator: function validator(val) {
  14996. // null or valid Date Object
  14997. return val === null || val instanceof Date && Object(date_util_["isDate"])(val);
  14998. }
  14999. },
  15000. date: {}
  15001. },
  15002. computed: {
  15003. startYear: function startYear() {
  15004. return Math.floor(this.date.getFullYear() / 10) * 10;
  15005. }
  15006. },
  15007. methods: {
  15008. getCellStyle: function getCellStyle(year) {
  15009. var style = {};
  15010. var today = new Date();
  15011. style.disabled = typeof this.disabledDate === 'function' ? year_tablevue_type_script_lang_js_datesInYear(year).every(this.disabledDate) : false;
  15012. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15013. return date.getFullYear() === year;
  15014. }) >= 0;
  15015. style.today = today.getFullYear() === year;
  15016. style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
  15017. return style;
  15018. },
  15019. handleYearTableClick: function handleYearTableClick(event) {
  15020. var target = event.target;
  15021. if (target.tagName === 'A') {
  15022. if (Object(dom_["hasClass"])(target.parentNode, 'disabled')) return;
  15023. var year = target.textContent || target.innerText;
  15024. this.$emit('pick', Number(year));
  15025. }
  15026. }
  15027. }
  15028. });
  15029. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=script&lang=js&
  15030. /* harmony default export */ var basic_year_tablevue_type_script_lang_js_ = (year_tablevue_type_script_lang_js_);
  15031. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue
  15032. /* normalize component */
  15033. var year_table_component = normalizeComponent(
  15034. basic_year_tablevue_type_script_lang_js_,
  15035. year_tablevue_type_template_id_c86ab5e0_render,
  15036. year_tablevue_type_template_id_c86ab5e0_staticRenderFns,
  15037. false,
  15038. null,
  15039. null,
  15040. null
  15041. )
  15042. /* hot reload */
  15043. if (false) { var year_table_api; }
  15044. year_table_component.options.__file = "packages/date-picker/src/basic/year-table.vue"
  15045. /* harmony default export */ var year_table = (year_table_component.exports);
  15046. // 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&
  15047. var month_tablevue_type_template_id_654d4f42_render = function() {
  15048. var _vm = this
  15049. var _h = _vm.$createElement
  15050. var _c = _vm._self._c || _h
  15051. return _c(
  15052. "table",
  15053. {
  15054. staticClass: "el-month-table",
  15055. on: { click: _vm.handleMonthTableClick, mousemove: _vm.handleMouseMove }
  15056. },
  15057. [
  15058. _c(
  15059. "tbody",
  15060. _vm._l(_vm.rows, function(row, key) {
  15061. return _c(
  15062. "tr",
  15063. { key: key },
  15064. _vm._l(row, function(cell, key) {
  15065. return _c("td", { key: key, class: _vm.getCellStyle(cell) }, [
  15066. _c("div", [
  15067. _c("a", { staticClass: "cell" }, [
  15068. _vm._v(
  15069. _vm._s(
  15070. _vm.t("el.datepicker.months." + _vm.months[cell.text])
  15071. )
  15072. )
  15073. ])
  15074. ])
  15075. ])
  15076. }),
  15077. 0
  15078. )
  15079. }),
  15080. 0
  15081. )
  15082. ]
  15083. )
  15084. }
  15085. var month_tablevue_type_template_id_654d4f42_staticRenderFns = []
  15086. month_tablevue_type_template_id_654d4f42_render._withStripped = true
  15087. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=template&id=654d4f42&
  15088. // 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&
  15089. //
  15090. //
  15091. //
  15092. //
  15093. //
  15094. //
  15095. //
  15096. //
  15097. //
  15098. //
  15099. //
  15100. //
  15101. //
  15102. //
  15103. var month_tablevue_type_script_lang_js_datesInMonth = function datesInMonth(year, month) {
  15104. var numOfDays = Object(date_util_["getDayCountOfMonth"])(year, month);
  15105. var firstDay = new Date(year, month, 1);
  15106. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15107. return Object(date_util_["nextDate"])(firstDay, n);
  15108. });
  15109. };
  15110. var clearDate = function clearDate(date) {
  15111. return new Date(date.getFullYear(), date.getMonth());
  15112. };
  15113. var getMonthTimestamp = function getMonthTimestamp(time) {
  15114. if (typeof time === 'number' || typeof time === 'string') {
  15115. return clearDate(new Date(time)).getTime();
  15116. } else if (time instanceof Date) {
  15117. return clearDate(time).getTime();
  15118. } else {
  15119. return NaN;
  15120. }
  15121. };
  15122. /* harmony default export */ var month_tablevue_type_script_lang_js_ = ({
  15123. props: {
  15124. disabledDate: {},
  15125. value: {},
  15126. selectionMode: {
  15127. default: 'month'
  15128. },
  15129. minDate: {},
  15130. maxDate: {},
  15131. defaultValue: {
  15132. validator: function validator(val) {
  15133. // null or valid Date Object
  15134. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  15135. }
  15136. },
  15137. date: {},
  15138. rangeState: {
  15139. default: function _default() {
  15140. return {
  15141. endDate: null,
  15142. selecting: false
  15143. };
  15144. }
  15145. }
  15146. },
  15147. mixins: [locale_default.a],
  15148. watch: {
  15149. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  15150. this.markRange(this.minDate, newVal);
  15151. },
  15152. minDate: function minDate(newVal, oldVal) {
  15153. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15154. this.markRange(this.minDate, this.maxDate);
  15155. }
  15156. },
  15157. maxDate: function maxDate(newVal, oldVal) {
  15158. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15159. this.markRange(this.minDate, this.maxDate);
  15160. }
  15161. }
  15162. },
  15163. data: function data() {
  15164. return {
  15165. months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],
  15166. tableRows: [[], [], []],
  15167. lastRow: null,
  15168. lastColumn: null
  15169. };
  15170. },
  15171. methods: {
  15172. cellMatchesDate: function cellMatchesDate(cell, date) {
  15173. var value = new Date(date);
  15174. return this.date.getFullYear() === value.getFullYear() && Number(cell.text) === value.getMonth();
  15175. },
  15176. getCellStyle: function getCellStyle(cell) {
  15177. var _this = this;
  15178. var style = {};
  15179. var year = this.date.getFullYear();
  15180. var today = new Date();
  15181. var month = cell.text;
  15182. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  15183. style.disabled = typeof this.disabledDate === 'function' ? month_tablevue_type_script_lang_js_datesInMonth(year, month).every(this.disabledDate) : false;
  15184. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15185. return date.getFullYear() === year && date.getMonth() === month;
  15186. }) >= 0;
  15187. style.today = today.getFullYear() === year && today.getMonth() === month;
  15188. style.default = defaultValue.some(function (date) {
  15189. return _this.cellMatchesDate(cell, date);
  15190. });
  15191. if (cell.inRange) {
  15192. style['in-range'] = true;
  15193. if (cell.start) {
  15194. style['start-date'] = true;
  15195. }
  15196. if (cell.end) {
  15197. style['end-date'] = true;
  15198. }
  15199. }
  15200. return style;
  15201. },
  15202. getMonthOfCell: function getMonthOfCell(month) {
  15203. var year = this.date.getFullYear();
  15204. return new Date(year, month, 1);
  15205. },
  15206. markRange: function markRange(minDate, maxDate) {
  15207. minDate = getMonthTimestamp(minDate);
  15208. maxDate = getMonthTimestamp(maxDate) || minDate;
  15209. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  15210. minDate = _ref[0];
  15211. maxDate = _ref[1];
  15212. var rows = this.rows;
  15213. for (var i = 0, k = rows.length; i < k; i++) {
  15214. var row = rows[i];
  15215. for (var j = 0, l = row.length; j < l; j++) {
  15216. var cell = row[j];
  15217. var index = i * 4 + j;
  15218. var time = new Date(this.date.getFullYear(), index).getTime();
  15219. cell.inRange = minDate && time >= minDate && time <= maxDate;
  15220. cell.start = minDate && time === minDate;
  15221. cell.end = maxDate && time === maxDate;
  15222. }
  15223. }
  15224. },
  15225. handleMouseMove: function handleMouseMove(event) {
  15226. if (!this.rangeState.selecting) return;
  15227. var target = event.target;
  15228. if (target.tagName === 'A') {
  15229. target = target.parentNode.parentNode;
  15230. }
  15231. if (target.tagName === 'DIV') {
  15232. target = target.parentNode;
  15233. }
  15234. if (target.tagName !== 'TD') return;
  15235. var row = target.parentNode.rowIndex;
  15236. var column = target.cellIndex;
  15237. // can not select disabled date
  15238. if (this.rows[row][column].disabled) return;
  15239. // only update rangeState when mouse moves to a new cell
  15240. // this avoids frequent Date object creation and improves performance
  15241. if (row !== this.lastRow || column !== this.lastColumn) {
  15242. this.lastRow = row;
  15243. this.lastColumn = column;
  15244. this.$emit('changerange', {
  15245. minDate: this.minDate,
  15246. maxDate: this.maxDate,
  15247. rangeState: {
  15248. selecting: true,
  15249. endDate: this.getMonthOfCell(row * 4 + column)
  15250. }
  15251. });
  15252. }
  15253. },
  15254. handleMonthTableClick: function handleMonthTableClick(event) {
  15255. var target = event.target;
  15256. if (target.tagName === 'A') {
  15257. target = target.parentNode.parentNode;
  15258. }
  15259. if (target.tagName === 'DIV') {
  15260. target = target.parentNode;
  15261. }
  15262. if (target.tagName !== 'TD') return;
  15263. if (Object(dom_["hasClass"])(target, 'disabled')) return;
  15264. var column = target.cellIndex;
  15265. var row = target.parentNode.rowIndex;
  15266. var month = row * 4 + column;
  15267. var newDate = this.getMonthOfCell(month);
  15268. if (this.selectionMode === 'range') {
  15269. if (!this.rangeState.selecting) {
  15270. this.$emit('pick', { minDate: newDate, maxDate: null });
  15271. this.rangeState.selecting = true;
  15272. } else {
  15273. if (newDate >= this.minDate) {
  15274. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  15275. } else {
  15276. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  15277. }
  15278. this.rangeState.selecting = false;
  15279. }
  15280. } else {
  15281. this.$emit('pick', month);
  15282. }
  15283. }
  15284. },
  15285. computed: {
  15286. rows: function rows() {
  15287. var _this2 = this;
  15288. // TODO: refactory rows / getCellClasses
  15289. var rows = this.tableRows;
  15290. var disabledDate = this.disabledDate;
  15291. var selectedDate = [];
  15292. var now = getMonthTimestamp(new Date());
  15293. for (var i = 0; i < 3; i++) {
  15294. var row = rows[i];
  15295. var _loop = function _loop(j) {
  15296. var cell = row[j];
  15297. if (!cell) {
  15298. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  15299. }
  15300. cell.type = 'normal';
  15301. var index = i * 4 + j;
  15302. var time = new Date(_this2.date.getFullYear(), index).getTime();
  15303. cell.inRange = time >= getMonthTimestamp(_this2.minDate) && time <= getMonthTimestamp(_this2.maxDate);
  15304. cell.start = _this2.minDate && time === getMonthTimestamp(_this2.minDate);
  15305. cell.end = _this2.maxDate && time === getMonthTimestamp(_this2.maxDate);
  15306. var isToday = time === now;
  15307. if (isToday) {
  15308. cell.type = 'today';
  15309. }
  15310. cell.text = index;
  15311. var cellDate = new Date(time);
  15312. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  15313. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  15314. return date.getTime() === cellDate.getTime();
  15315. });
  15316. _this2.$set(row, j, cell);
  15317. };
  15318. for (var j = 0; j < 4; j++) {
  15319. _loop(j);
  15320. }
  15321. }
  15322. return rows;
  15323. }
  15324. }
  15325. });
  15326. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=script&lang=js&
  15327. /* harmony default export */ var basic_month_tablevue_type_script_lang_js_ = (month_tablevue_type_script_lang_js_);
  15328. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue
  15329. /* normalize component */
  15330. var month_table_component = normalizeComponent(
  15331. basic_month_tablevue_type_script_lang_js_,
  15332. month_tablevue_type_template_id_654d4f42_render,
  15333. month_tablevue_type_template_id_654d4f42_staticRenderFns,
  15334. false,
  15335. null,
  15336. null,
  15337. null
  15338. )
  15339. /* hot reload */
  15340. if (false) { var month_table_api; }
  15341. month_table_component.options.__file = "packages/date-picker/src/basic/month-table.vue"
  15342. /* harmony default export */ var month_table = (month_table_component.exports);
  15343. // 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&
  15344. var date_tablevue_type_template_id_5d1f3341_render = function() {
  15345. var _vm = this
  15346. var _h = _vm.$createElement
  15347. var _c = _vm._self._c || _h
  15348. return _c(
  15349. "table",
  15350. {
  15351. staticClass: "el-date-table",
  15352. class: { "is-week-mode": _vm.selectionMode === "week" },
  15353. attrs: { cellspacing: "0", cellpadding: "0" },
  15354. on: { click: _vm.handleClick, mousemove: _vm.handleMouseMove }
  15355. },
  15356. [
  15357. _c(
  15358. "tbody",
  15359. [
  15360. _c(
  15361. "tr",
  15362. [
  15363. _vm.showWeekNumber
  15364. ? _c("th", [_vm._v(_vm._s(_vm.t("el.datepicker.week")))])
  15365. : _vm._e(),
  15366. _vm._l(_vm.WEEKS, function(week, key) {
  15367. return _c("th", { key: key }, [
  15368. _vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))
  15369. ])
  15370. })
  15371. ],
  15372. 2
  15373. ),
  15374. _vm._l(_vm.rows, function(row, key) {
  15375. return _c(
  15376. "tr",
  15377. {
  15378. key: key,
  15379. staticClass: "el-date-table__row",
  15380. class: { current: _vm.isWeekActive(row[1]) }
  15381. },
  15382. _vm._l(row, function(cell, key) {
  15383. return _c("td", { key: key, class: _vm.getCellClasses(cell) }, [
  15384. _c("div", [
  15385. _c("span", [
  15386. _vm._v("\n " + _vm._s(cell.text) + "\n ")
  15387. ])
  15388. ])
  15389. ])
  15390. }),
  15391. 0
  15392. )
  15393. })
  15394. ],
  15395. 2
  15396. )
  15397. ]
  15398. )
  15399. }
  15400. var date_tablevue_type_template_id_5d1f3341_staticRenderFns = []
  15401. date_tablevue_type_template_id_5d1f3341_render._withStripped = true
  15402. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=template&id=5d1f3341&
  15403. // 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&
  15404. //
  15405. //
  15406. //
  15407. //
  15408. //
  15409. //
  15410. //
  15411. //
  15412. //
  15413. //
  15414. //
  15415. //
  15416. //
  15417. //
  15418. //
  15419. //
  15420. //
  15421. //
  15422. //
  15423. //
  15424. //
  15425. //
  15426. //
  15427. //
  15428. //
  15429. //
  15430. //
  15431. //
  15432. //
  15433. //
  15434. //
  15435. //
  15436. //
  15437. var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
  15438. var date_tablevue_type_script_lang_js_getDateTimestamp = function getDateTimestamp(time) {
  15439. if (typeof time === 'number' || typeof time === 'string') {
  15440. return Object(date_util_["clearTime"])(new Date(time)).getTime();
  15441. } else if (time instanceof Date) {
  15442. return Object(date_util_["clearTime"])(time).getTime();
  15443. } else {
  15444. return NaN;
  15445. }
  15446. };
  15447. // remove the first element that satisfies `pred` from arr
  15448. // return a new array if modification occurs
  15449. // return the original array otherwise
  15450. var date_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  15451. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  15452. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  15453. };
  15454. /* harmony default export */ var date_tablevue_type_script_lang_js_ = ({
  15455. mixins: [locale_default.a],
  15456. props: {
  15457. firstDayOfWeek: {
  15458. default: 7,
  15459. type: Number,
  15460. validator: function validator(val) {
  15461. return val >= 1 && val <= 7;
  15462. }
  15463. },
  15464. value: {},
  15465. defaultValue: {
  15466. validator: function validator(val) {
  15467. // either: null, valid Date object, Array of valid Date objects
  15468. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  15469. }
  15470. },
  15471. date: {},
  15472. selectionMode: {
  15473. default: 'day'
  15474. },
  15475. showWeekNumber: {
  15476. type: Boolean,
  15477. default: false
  15478. },
  15479. disabledDate: {},
  15480. minDate: {},
  15481. maxDate: {},
  15482. rangeState: {
  15483. default: function _default() {
  15484. return {
  15485. endDate: null,
  15486. selecting: false
  15487. };
  15488. }
  15489. }
  15490. },
  15491. computed: {
  15492. offsetDay: function offsetDay() {
  15493. var week = this.firstDayOfWeek;
  15494. // 周日为界限,左右偏移的天数,3217654 例如周一就是 -1,目的是调整前两行日期的位置
  15495. return week > 3 ? 7 - week : -week;
  15496. },
  15497. WEEKS: function WEEKS() {
  15498. var week = this.firstDayOfWeek;
  15499. return _WEEKS.concat(_WEEKS).slice(week, week + 7);
  15500. },
  15501. year: function year() {
  15502. return this.date.getFullYear();
  15503. },
  15504. month: function month() {
  15505. return this.date.getMonth();
  15506. },
  15507. startDate: function startDate() {
  15508. return Object(date_util_["getStartDateOfMonth"])(this.year, this.month);
  15509. },
  15510. rows: function rows() {
  15511. var _this = this;
  15512. // TODO: refactory rows / getCellClasses
  15513. var date = new Date(this.year, this.month, 1);
  15514. var day = Object(date_util_["getFirstDayOfMonth"])(date); // day of first day
  15515. var dateCountOfMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth());
  15516. var dateCountOfLastMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
  15517. day = day === 0 ? 7 : day;
  15518. var offset = this.offsetDay;
  15519. var rows = this.tableRows;
  15520. var count = 1;
  15521. var startDate = this.startDate;
  15522. var disabledDate = this.disabledDate;
  15523. var selectedDate = this.selectionMode === 'dates' ? Object(util_["coerceTruthyValueToArray"])(this.value) : [];
  15524. var now = date_tablevue_type_script_lang_js_getDateTimestamp(new Date());
  15525. for (var i = 0; i < 6; i++) {
  15526. var row = rows[i];
  15527. if (this.showWeekNumber) {
  15528. if (!row[0]) {
  15529. row[0] = { type: 'week', text: Object(date_util_["getWeekNumber"])(Object(date_util_["nextDate"])(startDate, i * 7 + 1)) };
  15530. }
  15531. }
  15532. var _loop = function _loop(j) {
  15533. var cell = row[_this.showWeekNumber ? j + 1 : j];
  15534. if (!cell) {
  15535. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  15536. }
  15537. cell.type = 'normal';
  15538. var index = i * 7 + j;
  15539. var time = Object(date_util_["nextDate"])(startDate, index - offset).getTime();
  15540. cell.inRange = time >= date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate) && time <= date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  15541. cell.start = _this.minDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate);
  15542. cell.end = _this.maxDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  15543. var isToday = time === now;
  15544. if (isToday) {
  15545. cell.type = 'today';
  15546. }
  15547. if (i >= 0 && i <= 1) {
  15548. var numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
  15549. if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
  15550. cell.text = count++;
  15551. } else {
  15552. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
  15553. cell.type = 'prev-month';
  15554. }
  15555. } else {
  15556. if (count <= dateCountOfMonth) {
  15557. cell.text = count++;
  15558. } else {
  15559. cell.text = count++ - dateCountOfMonth;
  15560. cell.type = 'next-month';
  15561. }
  15562. }
  15563. var cellDate = new Date(time);
  15564. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  15565. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  15566. return date.getTime() === cellDate.getTime();
  15567. });
  15568. _this.$set(row, _this.showWeekNumber ? j + 1 : j, cell);
  15569. };
  15570. for (var j = 0; j < 7; j++) {
  15571. _loop(j);
  15572. }
  15573. if (this.selectionMode === 'week') {
  15574. var start = this.showWeekNumber ? 1 : 0;
  15575. var end = this.showWeekNumber ? 7 : 6;
  15576. var isWeekActive = this.isWeekActive(row[start + 1]);
  15577. row[start].inRange = isWeekActive;
  15578. row[start].start = isWeekActive;
  15579. row[end].inRange = isWeekActive;
  15580. row[end].end = isWeekActive;
  15581. }
  15582. }
  15583. return rows;
  15584. }
  15585. },
  15586. watch: {
  15587. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  15588. this.markRange(this.minDate, newVal);
  15589. },
  15590. minDate: function minDate(newVal, oldVal) {
  15591. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  15592. this.markRange(this.minDate, this.maxDate);
  15593. }
  15594. },
  15595. maxDate: function maxDate(newVal, oldVal) {
  15596. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  15597. this.markRange(this.minDate, this.maxDate);
  15598. }
  15599. }
  15600. },
  15601. data: function data() {
  15602. return {
  15603. tableRows: [[], [], [], [], [], []],
  15604. lastRow: null,
  15605. lastColumn: null
  15606. };
  15607. },
  15608. methods: {
  15609. cellMatchesDate: function cellMatchesDate(cell, date) {
  15610. var value = new Date(date);
  15611. return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
  15612. },
  15613. getCellClasses: function getCellClasses(cell) {
  15614. var _this2 = this;
  15615. var selectionMode = this.selectionMode;
  15616. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  15617. var classes = [];
  15618. if ((cell.type === 'normal' || cell.type === 'today') && !cell.disabled) {
  15619. classes.push('available');
  15620. if (cell.type === 'today') {
  15621. classes.push('today');
  15622. }
  15623. } else {
  15624. classes.push(cell.type);
  15625. }
  15626. if (cell.type === 'normal' && defaultValue.some(function (date) {
  15627. return _this2.cellMatchesDate(cell, date);
  15628. })) {
  15629. classes.push('default');
  15630. }
  15631. if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) {
  15632. classes.push('current');
  15633. }
  15634. if (cell.inRange && (cell.type === 'normal' || cell.type === 'today' || this.selectionMode === 'week')) {
  15635. classes.push('in-range');
  15636. if (cell.start) {
  15637. classes.push('start-date');
  15638. }
  15639. if (cell.end) {
  15640. classes.push('end-date');
  15641. }
  15642. }
  15643. if (cell.disabled) {
  15644. classes.push('disabled');
  15645. }
  15646. if (cell.selected) {
  15647. classes.push('selected');
  15648. }
  15649. return classes.join(' ');
  15650. },
  15651. getDateOfCell: function getDateOfCell(row, column) {
  15652. var offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
  15653. return Object(date_util_["nextDate"])(this.startDate, offsetFromStart);
  15654. },
  15655. isWeekActive: function isWeekActive(cell) {
  15656. if (this.selectionMode !== 'week') return false;
  15657. var newDate = new Date(this.year, this.month, 1);
  15658. var year = newDate.getFullYear();
  15659. var month = newDate.getMonth();
  15660. if (cell.type === 'prev-month') {
  15661. newDate.setMonth(month === 0 ? 11 : month - 1);
  15662. newDate.setFullYear(month === 0 ? year - 1 : year);
  15663. }
  15664. if (cell.type === 'next-month') {
  15665. newDate.setMonth(month === 11 ? 0 : month + 1);
  15666. newDate.setFullYear(month === 11 ? year + 1 : year);
  15667. }
  15668. newDate.setDate(parseInt(cell.text, 10));
  15669. if (Object(date_util_["isDate"])(this.value)) {
  15670. var dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
  15671. var weekDate = Object(date_util_["prevDate"])(this.value, dayOffset);
  15672. return weekDate.getTime() === newDate.getTime();
  15673. }
  15674. return false;
  15675. },
  15676. markRange: function markRange(minDate, maxDate) {
  15677. minDate = date_tablevue_type_script_lang_js_getDateTimestamp(minDate);
  15678. maxDate = date_tablevue_type_script_lang_js_getDateTimestamp(maxDate) || minDate;
  15679. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  15680. minDate = _ref[0];
  15681. maxDate = _ref[1];
  15682. var startDate = this.startDate;
  15683. var rows = this.rows;
  15684. for (var i = 0, k = rows.length; i < k; i++) {
  15685. var row = rows[i];
  15686. for (var j = 0, l = row.length; j < l; j++) {
  15687. if (this.showWeekNumber && j === 0) continue;
  15688. var _cell = row[j];
  15689. var index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
  15690. var time = Object(date_util_["nextDate"])(startDate, index - this.offsetDay).getTime();
  15691. _cell.inRange = minDate && time >= minDate && time <= maxDate;
  15692. _cell.start = minDate && time === minDate;
  15693. _cell.end = maxDate && time === maxDate;
  15694. }
  15695. }
  15696. },
  15697. handleMouseMove: function handleMouseMove(event) {
  15698. if (!this.rangeState.selecting) return;
  15699. var target = event.target;
  15700. if (target.tagName === 'SPAN') {
  15701. target = target.parentNode.parentNode;
  15702. }
  15703. if (target.tagName === 'DIV') {
  15704. target = target.parentNode;
  15705. }
  15706. if (target.tagName !== 'TD') return;
  15707. var row = target.parentNode.rowIndex - 1;
  15708. var column = target.cellIndex;
  15709. // can not select disabled date
  15710. if (this.rows[row][column].disabled) return;
  15711. // only update rangeState when mouse moves to a new cell
  15712. // this avoids frequent Date object creation and improves performance
  15713. if (row !== this.lastRow || column !== this.lastColumn) {
  15714. this.lastRow = row;
  15715. this.lastColumn = column;
  15716. this.$emit('changerange', {
  15717. minDate: this.minDate,
  15718. maxDate: this.maxDate,
  15719. rangeState: {
  15720. selecting: true,
  15721. endDate: this.getDateOfCell(row, column)
  15722. }
  15723. });
  15724. }
  15725. },
  15726. handleClick: function handleClick(event) {
  15727. var target = event.target;
  15728. if (target.tagName === 'SPAN') {
  15729. target = target.parentNode.parentNode;
  15730. }
  15731. if (target.tagName === 'DIV') {
  15732. target = target.parentNode;
  15733. }
  15734. if (target.tagName !== 'TD') return;
  15735. var row = target.parentNode.rowIndex - 1;
  15736. var column = this.selectionMode === 'week' ? 1 : target.cellIndex;
  15737. var cell = this.rows[row][column];
  15738. if (cell.disabled || cell.type === 'week') return;
  15739. var newDate = this.getDateOfCell(row, column);
  15740. if (this.selectionMode === 'range') {
  15741. if (!this.rangeState.selecting) {
  15742. this.$emit('pick', { minDate: newDate, maxDate: null });
  15743. this.rangeState.selecting = true;
  15744. } else {
  15745. if (newDate >= this.minDate) {
  15746. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  15747. } else {
  15748. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  15749. }
  15750. this.rangeState.selecting = false;
  15751. }
  15752. } else if (this.selectionMode === 'day') {
  15753. this.$emit('pick', newDate);
  15754. } else if (this.selectionMode === 'week') {
  15755. var weekNumber = Object(date_util_["getWeekNumber"])(newDate);
  15756. var value = newDate.getFullYear() + 'w' + weekNumber;
  15757. this.$emit('pick', {
  15758. year: newDate.getFullYear(),
  15759. week: weekNumber,
  15760. value: value,
  15761. date: newDate
  15762. });
  15763. } else if (this.selectionMode === 'dates') {
  15764. var _value = this.value || [];
  15765. var newValue = cell.selected ? date_tablevue_type_script_lang_js_removeFromArray(_value, function (date) {
  15766. return date.getTime() === newDate.getTime();
  15767. }) : [].concat(_value, [newDate]);
  15768. this.$emit('pick', newValue);
  15769. }
  15770. }
  15771. }
  15772. });
  15773. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=script&lang=js&
  15774. /* harmony default export */ var basic_date_tablevue_type_script_lang_js_ = (date_tablevue_type_script_lang_js_);
  15775. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue
  15776. /* normalize component */
  15777. var date_table_component = normalizeComponent(
  15778. basic_date_tablevue_type_script_lang_js_,
  15779. date_tablevue_type_template_id_5d1f3341_render,
  15780. date_tablevue_type_template_id_5d1f3341_staticRenderFns,
  15781. false,
  15782. null,
  15783. null,
  15784. null
  15785. )
  15786. /* hot reload */
  15787. if (false) { var date_table_api; }
  15788. date_table_component.options.__file = "packages/date-picker/src/basic/date-table.vue"
  15789. /* harmony default export */ var date_table = (date_table_component.exports);
  15790. // 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&
  15791. //
  15792. //
  15793. //
  15794. //
  15795. //
  15796. //
  15797. //
  15798. //
  15799. //
  15800. //
  15801. //
  15802. //
  15803. //
  15804. //
  15805. //
  15806. //
  15807. //
  15808. //
  15809. //
  15810. //
  15811. //
  15812. //
  15813. //
  15814. //
  15815. //
  15816. //
  15817. //
  15818. //
  15819. //
  15820. //
  15821. //
  15822. //
  15823. //
  15824. //
  15825. //
  15826. //
  15827. //
  15828. //
  15829. //
  15830. //
  15831. //
  15832. //
  15833. //
  15834. //
  15835. //
  15836. //
  15837. //
  15838. //
  15839. //
  15840. //
  15841. //
  15842. //
  15843. //
  15844. //
  15845. //
  15846. //
  15847. //
  15848. //
  15849. //
  15850. //
  15851. //
  15852. //
  15853. //
  15854. //
  15855. //
  15856. //
  15857. //
  15858. //
  15859. //
  15860. //
  15861. //
  15862. //
  15863. //
  15864. //
  15865. //
  15866. //
  15867. //
  15868. //
  15869. //
  15870. //
  15871. //
  15872. //
  15873. //
  15874. //
  15875. //
  15876. //
  15877. //
  15878. //
  15879. //
  15880. //
  15881. //
  15882. //
  15883. //
  15884. //
  15885. //
  15886. //
  15887. //
  15888. //
  15889. //
  15890. //
  15891. //
  15892. //
  15893. //
  15894. //
  15895. //
  15896. //
  15897. //
  15898. //
  15899. //
  15900. //
  15901. //
  15902. //
  15903. //
  15904. //
  15905. //
  15906. //
  15907. //
  15908. //
  15909. //
  15910. //
  15911. //
  15912. //
  15913. //
  15914. //
  15915. //
  15916. //
  15917. //
  15918. //
  15919. //
  15920. //
  15921. //
  15922. //
  15923. //
  15924. //
  15925. //
  15926. //
  15927. //
  15928. //
  15929. //
  15930. //
  15931. //
  15932. //
  15933. //
  15934. /* harmony default export */ var datevue_type_script_lang_js_ = ({
  15935. mixins: [locale_default.a],
  15936. directives: { Clickoutside: clickoutside_default.a },
  15937. watch: {
  15938. showTime: function showTime(val) {
  15939. var _this = this;
  15940. /* istanbul ignore if */
  15941. if (!val) return;
  15942. this.$nextTick(function (_) {
  15943. var inputElm = _this.$refs.input.$el;
  15944. if (inputElm) {
  15945. _this.pickerWidth = inputElm.getBoundingClientRect().width + 10;
  15946. }
  15947. });
  15948. },
  15949. value: function value(val) {
  15950. if (this.selectionMode === 'dates' && this.value) return;
  15951. if (Object(date_util_["isDate"])(val)) {
  15952. this.date = new Date(val);
  15953. } else {
  15954. this.date = this.getDefaultValue();
  15955. }
  15956. },
  15957. defaultValue: function defaultValue(val) {
  15958. if (!Object(date_util_["isDate"])(this.value)) {
  15959. this.date = val ? new Date(val) : new Date();
  15960. }
  15961. },
  15962. timePickerVisible: function timePickerVisible(val) {
  15963. var _this2 = this;
  15964. if (val) this.$nextTick(function () {
  15965. return _this2.$refs.timepicker.adjustSpinners();
  15966. });
  15967. },
  15968. selectionMode: function selectionMode(newVal) {
  15969. if (newVal === 'month') {
  15970. /* istanbul ignore next */
  15971. if (this.currentView !== 'year' || this.currentView !== 'month') {
  15972. this.currentView = 'month';
  15973. }
  15974. } else if (newVal === 'dates') {
  15975. this.currentView = 'date';
  15976. }
  15977. }
  15978. },
  15979. methods: {
  15980. proxyTimePickerDataProperties: function proxyTimePickerDataProperties() {
  15981. var _this3 = this;
  15982. var format = function format(timeFormat) {
  15983. _this3.$refs.timepicker.format = timeFormat;
  15984. };
  15985. var value = function value(_value) {
  15986. _this3.$refs.timepicker.value = _value;
  15987. };
  15988. var date = function date(_date) {
  15989. _this3.$refs.timepicker.date = _date;
  15990. };
  15991. var selectableRange = function selectableRange(_selectableRange) {
  15992. _this3.$refs.timepicker.selectableRange = _selectableRange;
  15993. };
  15994. this.$watch('value', value);
  15995. this.$watch('date', date);
  15996. this.$watch('selectableRange', selectableRange);
  15997. format(this.timeFormat);
  15998. value(this.value);
  15999. date(this.date);
  16000. selectableRange(this.selectableRange);
  16001. },
  16002. handleClear: function handleClear() {
  16003. this.date = this.getDefaultValue();
  16004. this.$emit('pick', null);
  16005. },
  16006. emit: function emit(value) {
  16007. var _this4 = this;
  16008. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  16009. args[_key - 1] = arguments[_key];
  16010. }
  16011. if (!value) {
  16012. this.$emit.apply(this, ['pick', value].concat(args));
  16013. } else if (Array.isArray(value)) {
  16014. var dates = value.map(function (date) {
  16015. return _this4.showTime ? Object(date_util_["clearMilliseconds"])(date) : Object(date_util_["clearTime"])(date);
  16016. });
  16017. this.$emit.apply(this, ['pick', dates].concat(args));
  16018. } else {
  16019. this.$emit.apply(this, ['pick', this.showTime ? Object(date_util_["clearMilliseconds"])(value) : Object(date_util_["clearTime"])(value)].concat(args));
  16020. }
  16021. this.userInputDate = null;
  16022. this.userInputTime = null;
  16023. },
  16024. // resetDate() {
  16025. // this.date = new Date(this.date);
  16026. // },
  16027. showMonthPicker: function showMonthPicker() {
  16028. this.currentView = 'month';
  16029. },
  16030. showYearPicker: function showYearPicker() {
  16031. this.currentView = 'year';
  16032. },
  16033. // XXX: 没用到
  16034. // handleLabelClick() {
  16035. // if (this.currentView === 'date') {
  16036. // this.showMonthPicker();
  16037. // } else if (this.currentView === 'month') {
  16038. // this.showYearPicker();
  16039. // }
  16040. // },
  16041. prevMonth: function prevMonth() {
  16042. this.date = Object(date_util_["prevMonth"])(this.date);
  16043. },
  16044. nextMonth: function nextMonth() {
  16045. this.date = Object(date_util_["nextMonth"])(this.date);
  16046. },
  16047. prevYear: function prevYear() {
  16048. if (this.currentView === 'year') {
  16049. this.date = Object(date_util_["prevYear"])(this.date, 10);
  16050. } else {
  16051. this.date = Object(date_util_["prevYear"])(this.date);
  16052. }
  16053. },
  16054. nextYear: function nextYear() {
  16055. if (this.currentView === 'year') {
  16056. this.date = Object(date_util_["nextYear"])(this.date, 10);
  16057. } else {
  16058. this.date = Object(date_util_["nextYear"])(this.date);
  16059. }
  16060. },
  16061. handleShortcutClick: function handleShortcutClick(shortcut) {
  16062. if (shortcut.onClick) {
  16063. shortcut.onClick(this);
  16064. }
  16065. },
  16066. handleTimePick: function handleTimePick(value, visible, first) {
  16067. if (Object(date_util_["isDate"])(value)) {
  16068. var newDate = this.value ? Object(date_util_["modifyTime"])(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16069. this.date = newDate;
  16070. this.emit(this.date, true);
  16071. } else {
  16072. this.emit(value, true);
  16073. }
  16074. if (!first) {
  16075. this.timePickerVisible = visible;
  16076. }
  16077. },
  16078. handleTimePickClose: function handleTimePickClose() {
  16079. this.timePickerVisible = false;
  16080. },
  16081. handleMonthPick: function handleMonthPick(month) {
  16082. if (this.selectionMode === 'month') {
  16083. this.date = Object(date_util_["modifyDate"])(this.date, this.year, month, 1);
  16084. this.emit(this.date);
  16085. } else {
  16086. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, this.year, month);
  16087. // TODO: should emit intermediate value ??
  16088. // this.emit(this.date);
  16089. this.currentView = 'date';
  16090. }
  16091. },
  16092. handleDatePick: function handleDatePick(value) {
  16093. if (this.selectionMode === 'day') {
  16094. var newDate = this.value ? Object(date_util_["modifyDate"])(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : Object(date_util_["modifyWithTimeString"])(value, this.defaultTime);
  16095. // change default time while out of selectableRange
  16096. if (!this.checkDateWithinRange(newDate)) {
  16097. newDate = Object(date_util_["modifyDate"])(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
  16098. }
  16099. this.date = newDate;
  16100. this.emit(this.date, this.showTime);
  16101. } else if (this.selectionMode === 'week') {
  16102. this.emit(value.date);
  16103. } else if (this.selectionMode === 'dates') {
  16104. this.emit(value, true); // set false to keep panel open
  16105. }
  16106. },
  16107. handleYearPick: function handleYearPick(year) {
  16108. if (this.selectionMode === 'year') {
  16109. this.date = Object(date_util_["modifyDate"])(this.date, year, 0, 1);
  16110. this.emit(this.date);
  16111. } else {
  16112. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, year, this.month);
  16113. // TODO: should emit intermediate value ??
  16114. // this.emit(this.date, true);
  16115. this.currentView = 'month';
  16116. }
  16117. },
  16118. changeToNow: function changeToNow() {
  16119. // NOTE: not a permanent solution
  16120. // consider disable "now" button in the future
  16121. if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
  16122. this.date = new Date();
  16123. this.emit(this.date);
  16124. }
  16125. },
  16126. confirm: function confirm() {
  16127. if (this.selectionMode === 'dates') {
  16128. this.emit(this.value);
  16129. } else {
  16130. // value were emitted in handle{Date,Time}Pick, nothing to update here
  16131. // deal with the scenario where: user opens the picker, then confirm without doing anything
  16132. var value = this.value ? this.value : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16133. this.date = new Date(value); // refresh date
  16134. this.emit(value);
  16135. }
  16136. },
  16137. resetView: function resetView() {
  16138. if (this.selectionMode === 'month') {
  16139. this.currentView = 'month';
  16140. } else if (this.selectionMode === 'year') {
  16141. this.currentView = 'year';
  16142. } else {
  16143. this.currentView = 'date';
  16144. }
  16145. },
  16146. handleEnter: function handleEnter() {
  16147. document.body.addEventListener('keydown', this.handleKeydown);
  16148. },
  16149. handleLeave: function handleLeave() {
  16150. this.$emit('dodestroy');
  16151. document.body.removeEventListener('keydown', this.handleKeydown);
  16152. },
  16153. handleKeydown: function handleKeydown(event) {
  16154. var keyCode = event.keyCode;
  16155. var list = [38, 40, 37, 39];
  16156. if (this.visible && !this.timePickerVisible) {
  16157. if (list.indexOf(keyCode) !== -1) {
  16158. this.handleKeyControl(keyCode);
  16159. event.stopPropagation();
  16160. event.preventDefault();
  16161. }
  16162. if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) {
  16163. // Enter
  16164. this.emit(this.date, false);
  16165. }
  16166. }
  16167. },
  16168. handleKeyControl: function handleKeyControl(keyCode) {
  16169. var mapping = {
  16170. 'year': {
  16171. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16172. return date.setFullYear(date.getFullYear() + step);
  16173. }
  16174. },
  16175. 'month': {
  16176. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16177. return date.setMonth(date.getMonth() + step);
  16178. }
  16179. },
  16180. 'week': {
  16181. 38: -1, 40: 1, 37: -1, 39: 1, offset: function offset(date, step) {
  16182. return date.setDate(date.getDate() + step * 7);
  16183. }
  16184. },
  16185. 'day': {
  16186. 38: -7, 40: 7, 37: -1, 39: 1, offset: function offset(date, step) {
  16187. return date.setDate(date.getDate() + step);
  16188. }
  16189. }
  16190. };
  16191. var mode = this.selectionMode;
  16192. var year = 3.1536e10;
  16193. var now = this.date.getTime();
  16194. var newDate = new Date(this.date.getTime());
  16195. while (Math.abs(now - newDate.getTime()) <= year) {
  16196. var map = mapping[mode];
  16197. map.offset(newDate, map[keyCode]);
  16198. if (typeof this.disabledDate === 'function' && this.disabledDate(newDate)) {
  16199. continue;
  16200. }
  16201. this.date = newDate;
  16202. this.$emit('pick', newDate, true);
  16203. break;
  16204. }
  16205. },
  16206. handleVisibleTimeChange: function handleVisibleTimeChange(value) {
  16207. var time = Object(date_util_["parseDate"])(value, this.timeFormat);
  16208. if (time && this.checkDateWithinRange(time)) {
  16209. this.date = Object(date_util_["modifyDate"])(time, this.year, this.month, this.monthDate);
  16210. this.userInputTime = null;
  16211. this.$refs.timepicker.value = this.date;
  16212. this.timePickerVisible = false;
  16213. this.emit(this.date, true);
  16214. }
  16215. },
  16216. handleVisibleDateChange: function handleVisibleDateChange(value) {
  16217. var date = Object(date_util_["parseDate"])(value, this.dateFormat);
  16218. if (date) {
  16219. if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
  16220. return;
  16221. }
  16222. this.date = Object(date_util_["modifyTime"])(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
  16223. this.userInputDate = null;
  16224. this.resetView();
  16225. this.emit(this.date, true);
  16226. }
  16227. },
  16228. isValidValue: function isValidValue(value) {
  16229. return value && !isNaN(value) && (typeof this.disabledDate === 'function' ? !this.disabledDate(value) : true) && this.checkDateWithinRange(value);
  16230. },
  16231. getDefaultValue: function getDefaultValue() {
  16232. // if default-value is set, return it
  16233. // otherwise, return now (the moment this method gets called)
  16234. return this.defaultValue ? new Date(this.defaultValue) : new Date();
  16235. },
  16236. checkDateWithinRange: function checkDateWithinRange(date) {
  16237. return this.selectableRange.length > 0 ? Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format || 'HH:mm:ss') : true;
  16238. }
  16239. },
  16240. components: {
  16241. TimePicker: panel_time, YearTable: year_table, MonthTable: month_table, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a
  16242. },
  16243. data: function data() {
  16244. return {
  16245. popperClass: '',
  16246. date: new Date(),
  16247. value: '',
  16248. defaultValue: null, // use getDefaultValue() for time computation
  16249. defaultTime: null,
  16250. showTime: false,
  16251. selectionMode: 'day',
  16252. shortcuts: '',
  16253. visible: false,
  16254. currentView: 'date',
  16255. disabledDate: '',
  16256. selectableRange: [],
  16257. firstDayOfWeek: 7,
  16258. showWeekNumber: false,
  16259. timePickerVisible: false,
  16260. format: '',
  16261. arrowControl: false,
  16262. userInputDate: null,
  16263. userInputTime: null
  16264. };
  16265. },
  16266. computed: {
  16267. year: function year() {
  16268. return this.date.getFullYear();
  16269. },
  16270. month: function month() {
  16271. return this.date.getMonth();
  16272. },
  16273. week: function week() {
  16274. return Object(date_util_["getWeekNumber"])(this.date);
  16275. },
  16276. monthDate: function monthDate() {
  16277. return this.date.getDate();
  16278. },
  16279. footerVisible: function footerVisible() {
  16280. return this.showTime || this.selectionMode === 'dates';
  16281. },
  16282. visibleTime: function visibleTime() {
  16283. if (this.userInputTime !== null) {
  16284. return this.userInputTime;
  16285. } else {
  16286. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.timeFormat);
  16287. }
  16288. },
  16289. visibleDate: function visibleDate() {
  16290. if (this.userInputDate !== null) {
  16291. return this.userInputDate;
  16292. } else {
  16293. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.dateFormat);
  16294. }
  16295. },
  16296. yearLabel: function yearLabel() {
  16297. var yearTranslation = this.t('el.datepicker.year');
  16298. if (this.currentView === 'year') {
  16299. var startYear = Math.floor(this.year / 10) * 10;
  16300. if (yearTranslation) {
  16301. return startYear + ' ' + yearTranslation + ' - ' + (startYear + 9) + ' ' + yearTranslation;
  16302. }
  16303. return startYear + ' - ' + (startYear + 9);
  16304. }
  16305. return this.year + ' ' + yearTranslation;
  16306. },
  16307. timeFormat: function timeFormat() {
  16308. if (this.format) {
  16309. return Object(date_util_["extractTimeFormat"])(this.format);
  16310. } else {
  16311. return 'HH:mm:ss';
  16312. }
  16313. },
  16314. dateFormat: function dateFormat() {
  16315. if (this.format) {
  16316. return Object(date_util_["extractDateFormat"])(this.format);
  16317. } else {
  16318. return 'yyyy-MM-dd';
  16319. }
  16320. }
  16321. }
  16322. });
  16323. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=script&lang=js&
  16324. /* harmony default export */ var panel_datevue_type_script_lang_js_ = (datevue_type_script_lang_js_);
  16325. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue
  16326. /* normalize component */
  16327. var date_component = normalizeComponent(
  16328. panel_datevue_type_script_lang_js_,
  16329. datevue_type_template_id_2440d4ea_render,
  16330. datevue_type_template_id_2440d4ea_staticRenderFns,
  16331. false,
  16332. null,
  16333. null,
  16334. null
  16335. )
  16336. /* hot reload */
  16337. if (false) { var date_api; }
  16338. date_component.options.__file = "packages/date-picker/src/panel/date.vue"
  16339. /* harmony default export */ var panel_date = (date_component.exports);
  16340. // 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&
  16341. var date_rangevue_type_template_id_2652849a_render = function() {
  16342. var _vm = this
  16343. var _h = _vm.$createElement
  16344. var _c = _vm._self._c || _h
  16345. return _c(
  16346. "transition",
  16347. {
  16348. attrs: { name: "el-zoom-in-top" },
  16349. on: {
  16350. "after-leave": function($event) {
  16351. _vm.$emit("dodestroy")
  16352. }
  16353. }
  16354. },
  16355. [
  16356. _c(
  16357. "div",
  16358. {
  16359. directives: [
  16360. {
  16361. name: "show",
  16362. rawName: "v-show",
  16363. value: _vm.visible,
  16364. expression: "visible"
  16365. }
  16366. ],
  16367. staticClass: "el-picker-panel el-date-range-picker el-popper",
  16368. class: [
  16369. {
  16370. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  16371. "has-time": _vm.showTime
  16372. },
  16373. _vm.popperClass
  16374. ]
  16375. },
  16376. [
  16377. _c(
  16378. "div",
  16379. { staticClass: "el-picker-panel__body-wrapper" },
  16380. [
  16381. _vm._t("sidebar"),
  16382. _vm.shortcuts
  16383. ? _c(
  16384. "div",
  16385. { staticClass: "el-picker-panel__sidebar" },
  16386. _vm._l(_vm.shortcuts, function(shortcut, key) {
  16387. return _c(
  16388. "button",
  16389. {
  16390. key: key,
  16391. staticClass: "el-picker-panel__shortcut",
  16392. attrs: { type: "button" },
  16393. on: {
  16394. click: function($event) {
  16395. _vm.handleShortcutClick(shortcut)
  16396. }
  16397. }
  16398. },
  16399. [_vm._v(_vm._s(shortcut.text))]
  16400. )
  16401. }),
  16402. 0
  16403. )
  16404. : _vm._e(),
  16405. _c("div", { staticClass: "el-picker-panel__body" }, [
  16406. _vm.showTime
  16407. ? _c(
  16408. "div",
  16409. { staticClass: "el-date-range-picker__time-header" },
  16410. [
  16411. _c(
  16412. "span",
  16413. { staticClass: "el-date-range-picker__editors-wrap" },
  16414. [
  16415. _c(
  16416. "span",
  16417. {
  16418. staticClass:
  16419. "el-date-range-picker__time-picker-wrap"
  16420. },
  16421. [
  16422. _c("el-input", {
  16423. ref: "minInput",
  16424. staticClass: "el-date-range-picker__editor",
  16425. attrs: {
  16426. size: "small",
  16427. disabled: _vm.rangeState.selecting,
  16428. placeholder: _vm.t(
  16429. "el.datepicker.startDate"
  16430. ),
  16431. value: _vm.minVisibleDate
  16432. },
  16433. on: {
  16434. input: function(val) {
  16435. return _vm.handleDateInput(val, "min")
  16436. },
  16437. change: function(val) {
  16438. return _vm.handleDateChange(val, "min")
  16439. }
  16440. }
  16441. })
  16442. ],
  16443. 1
  16444. ),
  16445. _c(
  16446. "span",
  16447. {
  16448. directives: [
  16449. {
  16450. name: "clickoutside",
  16451. rawName: "v-clickoutside",
  16452. value: _vm.handleMinTimeClose,
  16453. expression: "handleMinTimeClose"
  16454. }
  16455. ],
  16456. staticClass:
  16457. "el-date-range-picker__time-picker-wrap"
  16458. },
  16459. [
  16460. _c("el-input", {
  16461. staticClass: "el-date-range-picker__editor",
  16462. attrs: {
  16463. size: "small",
  16464. disabled: _vm.rangeState.selecting,
  16465. placeholder: _vm.t(
  16466. "el.datepicker.startTime"
  16467. ),
  16468. value: _vm.minVisibleTime
  16469. },
  16470. on: {
  16471. focus: function($event) {
  16472. _vm.minTimePickerVisible = true
  16473. },
  16474. input: function(val) {
  16475. return _vm.handleTimeInput(val, "min")
  16476. },
  16477. change: function(val) {
  16478. return _vm.handleTimeChange(val, "min")
  16479. }
  16480. }
  16481. }),
  16482. _c("time-picker", {
  16483. ref: "minTimePicker",
  16484. attrs: {
  16485. "time-arrow-control": _vm.arrowControl,
  16486. visible: _vm.minTimePickerVisible
  16487. },
  16488. on: {
  16489. pick: _vm.handleMinTimePick,
  16490. mounted: function($event) {
  16491. _vm.$refs.minTimePicker.format =
  16492. _vm.timeFormat
  16493. }
  16494. }
  16495. })
  16496. ],
  16497. 1
  16498. )
  16499. ]
  16500. ),
  16501. _c("span", { staticClass: "el-icon-arrow-right" }),
  16502. _c(
  16503. "span",
  16504. {
  16505. staticClass:
  16506. "el-date-range-picker__editors-wrap is-right"
  16507. },
  16508. [
  16509. _c(
  16510. "span",
  16511. {
  16512. staticClass:
  16513. "el-date-range-picker__time-picker-wrap"
  16514. },
  16515. [
  16516. _c("el-input", {
  16517. staticClass: "el-date-range-picker__editor",
  16518. attrs: {
  16519. size: "small",
  16520. disabled: _vm.rangeState.selecting,
  16521. placeholder: _vm.t("el.datepicker.endDate"),
  16522. value: _vm.maxVisibleDate,
  16523. readonly: !_vm.minDate
  16524. },
  16525. on: {
  16526. input: function(val) {
  16527. return _vm.handleDateInput(val, "max")
  16528. },
  16529. change: function(val) {
  16530. return _vm.handleDateChange(val, "max")
  16531. }
  16532. }
  16533. })
  16534. ],
  16535. 1
  16536. ),
  16537. _c(
  16538. "span",
  16539. {
  16540. directives: [
  16541. {
  16542. name: "clickoutside",
  16543. rawName: "v-clickoutside",
  16544. value: _vm.handleMaxTimeClose,
  16545. expression: "handleMaxTimeClose"
  16546. }
  16547. ],
  16548. staticClass:
  16549. "el-date-range-picker__time-picker-wrap"
  16550. },
  16551. [
  16552. _c("el-input", {
  16553. staticClass: "el-date-range-picker__editor",
  16554. attrs: {
  16555. size: "small",
  16556. disabled: _vm.rangeState.selecting,
  16557. placeholder: _vm.t("el.datepicker.endTime"),
  16558. value: _vm.maxVisibleTime,
  16559. readonly: !_vm.minDate
  16560. },
  16561. on: {
  16562. focus: function($event) {
  16563. _vm.minDate &&
  16564. (_vm.maxTimePickerVisible = true)
  16565. },
  16566. input: function(val) {
  16567. return _vm.handleTimeInput(val, "max")
  16568. },
  16569. change: function(val) {
  16570. return _vm.handleTimeChange(val, "max")
  16571. }
  16572. }
  16573. }),
  16574. _c("time-picker", {
  16575. ref: "maxTimePicker",
  16576. attrs: {
  16577. "time-arrow-control": _vm.arrowControl,
  16578. visible: _vm.maxTimePickerVisible
  16579. },
  16580. on: {
  16581. pick: _vm.handleMaxTimePick,
  16582. mounted: function($event) {
  16583. _vm.$refs.maxTimePicker.format =
  16584. _vm.timeFormat
  16585. }
  16586. }
  16587. })
  16588. ],
  16589. 1
  16590. )
  16591. ]
  16592. )
  16593. ]
  16594. )
  16595. : _vm._e(),
  16596. _c(
  16597. "div",
  16598. {
  16599. staticClass:
  16600. "el-picker-panel__content el-date-range-picker__content is-left"
  16601. },
  16602. [
  16603. _c("div", { staticClass: "el-date-range-picker__header" }, [
  16604. _c("button", {
  16605. staticClass:
  16606. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  16607. attrs: { type: "button" },
  16608. on: { click: _vm.leftPrevYear }
  16609. }),
  16610. _c("button", {
  16611. staticClass:
  16612. "el-picker-panel__icon-btn el-icon-arrow-left",
  16613. attrs: { type: "button" },
  16614. on: { click: _vm.leftPrevMonth }
  16615. }),
  16616. _vm.unlinkPanels
  16617. ? _c("button", {
  16618. staticClass:
  16619. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  16620. class: { "is-disabled": !_vm.enableYearArrow },
  16621. attrs: {
  16622. type: "button",
  16623. disabled: !_vm.enableYearArrow
  16624. },
  16625. on: { click: _vm.leftNextYear }
  16626. })
  16627. : _vm._e(),
  16628. _vm.unlinkPanels
  16629. ? _c("button", {
  16630. staticClass:
  16631. "el-picker-panel__icon-btn el-icon-arrow-right",
  16632. class: { "is-disabled": !_vm.enableMonthArrow },
  16633. attrs: {
  16634. type: "button",
  16635. disabled: !_vm.enableMonthArrow
  16636. },
  16637. on: { click: _vm.leftNextMonth }
  16638. })
  16639. : _vm._e(),
  16640. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  16641. ]),
  16642. _c("date-table", {
  16643. attrs: {
  16644. "selection-mode": "range",
  16645. date: _vm.leftDate,
  16646. "default-value": _vm.defaultValue,
  16647. "min-date": _vm.minDate,
  16648. "max-date": _vm.maxDate,
  16649. "range-state": _vm.rangeState,
  16650. "disabled-date": _vm.disabledDate,
  16651. "first-day-of-week": _vm.firstDayOfWeek
  16652. },
  16653. on: {
  16654. changerange: _vm.handleChangeRange,
  16655. pick: _vm.handleRangePick
  16656. }
  16657. })
  16658. ],
  16659. 1
  16660. ),
  16661. _c(
  16662. "div",
  16663. {
  16664. staticClass:
  16665. "el-picker-panel__content el-date-range-picker__content is-right"
  16666. },
  16667. [
  16668. _c("div", { staticClass: "el-date-range-picker__header" }, [
  16669. _vm.unlinkPanels
  16670. ? _c("button", {
  16671. staticClass:
  16672. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  16673. class: { "is-disabled": !_vm.enableYearArrow },
  16674. attrs: {
  16675. type: "button",
  16676. disabled: !_vm.enableYearArrow
  16677. },
  16678. on: { click: _vm.rightPrevYear }
  16679. })
  16680. : _vm._e(),
  16681. _vm.unlinkPanels
  16682. ? _c("button", {
  16683. staticClass:
  16684. "el-picker-panel__icon-btn el-icon-arrow-left",
  16685. class: { "is-disabled": !_vm.enableMonthArrow },
  16686. attrs: {
  16687. type: "button",
  16688. disabled: !_vm.enableMonthArrow
  16689. },
  16690. on: { click: _vm.rightPrevMonth }
  16691. })
  16692. : _vm._e(),
  16693. _c("button", {
  16694. staticClass:
  16695. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  16696. attrs: { type: "button" },
  16697. on: { click: _vm.rightNextYear }
  16698. }),
  16699. _c("button", {
  16700. staticClass:
  16701. "el-picker-panel__icon-btn el-icon-arrow-right",
  16702. attrs: { type: "button" },
  16703. on: { click: _vm.rightNextMonth }
  16704. }),
  16705. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  16706. ]),
  16707. _c("date-table", {
  16708. attrs: {
  16709. "selection-mode": "range",
  16710. date: _vm.rightDate,
  16711. "default-value": _vm.defaultValue,
  16712. "min-date": _vm.minDate,
  16713. "max-date": _vm.maxDate,
  16714. "range-state": _vm.rangeState,
  16715. "disabled-date": _vm.disabledDate,
  16716. "first-day-of-week": _vm.firstDayOfWeek
  16717. },
  16718. on: {
  16719. changerange: _vm.handleChangeRange,
  16720. pick: _vm.handleRangePick
  16721. }
  16722. })
  16723. ],
  16724. 1
  16725. )
  16726. ])
  16727. ],
  16728. 2
  16729. ),
  16730. _vm.showTime
  16731. ? _c(
  16732. "div",
  16733. { staticClass: "el-picker-panel__footer" },
  16734. [
  16735. _c(
  16736. "el-button",
  16737. {
  16738. staticClass: "el-picker-panel__link-btn",
  16739. attrs: { size: "mini", type: "text" },
  16740. on: { click: _vm.handleClear }
  16741. },
  16742. [
  16743. _vm._v(
  16744. "\n " +
  16745. _vm._s(_vm.t("el.datepicker.clear")) +
  16746. "\n "
  16747. )
  16748. ]
  16749. ),
  16750. _c(
  16751. "el-button",
  16752. {
  16753. staticClass: "el-picker-panel__link-btn",
  16754. attrs: {
  16755. plain: "",
  16756. size: "mini",
  16757. disabled: _vm.btnDisabled
  16758. },
  16759. on: {
  16760. click: function($event) {
  16761. _vm.handleConfirm(false)
  16762. }
  16763. }
  16764. },
  16765. [
  16766. _vm._v(
  16767. "\n " +
  16768. _vm._s(_vm.t("el.datepicker.confirm")) +
  16769. "\n "
  16770. )
  16771. ]
  16772. )
  16773. ],
  16774. 1
  16775. )
  16776. : _vm._e()
  16777. ]
  16778. )
  16779. ]
  16780. )
  16781. }
  16782. var date_rangevue_type_template_id_2652849a_staticRenderFns = []
  16783. date_rangevue_type_template_id_2652849a_render._withStripped = true
  16784. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=template&id=2652849a&
  16785. // 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&
  16786. //
  16787. //
  16788. //
  16789. //
  16790. //
  16791. //
  16792. //
  16793. //
  16794. //
  16795. //
  16796. //
  16797. //
  16798. //
  16799. //
  16800. //
  16801. //
  16802. //
  16803. //
  16804. //
  16805. //
  16806. //
  16807. //
  16808. //
  16809. //
  16810. //
  16811. //
  16812. //
  16813. //
  16814. //
  16815. //
  16816. //
  16817. //
  16818. //
  16819. //
  16820. //
  16821. //
  16822. //
  16823. //
  16824. //
  16825. //
  16826. //
  16827. //
  16828. //
  16829. //
  16830. //
  16831. //
  16832. //
  16833. //
  16834. //
  16835. //
  16836. //
  16837. //
  16838. //
  16839. //
  16840. //
  16841. //
  16842. //
  16843. //
  16844. //
  16845. //
  16846. //
  16847. //
  16848. //
  16849. //
  16850. //
  16851. //
  16852. //
  16853. //
  16854. //
  16855. //
  16856. //
  16857. //
  16858. //
  16859. //
  16860. //
  16861. //
  16862. //
  16863. //
  16864. //
  16865. //
  16866. //
  16867. //
  16868. //
  16869. //
  16870. //
  16871. //
  16872. //
  16873. //
  16874. //
  16875. //
  16876. //
  16877. //
  16878. //
  16879. //
  16880. //
  16881. //
  16882. //
  16883. //
  16884. //
  16885. //
  16886. //
  16887. //
  16888. //
  16889. //
  16890. //
  16891. //
  16892. //
  16893. //
  16894. //
  16895. //
  16896. //
  16897. //
  16898. //
  16899. //
  16900. //
  16901. //
  16902. //
  16903. //
  16904. //
  16905. //
  16906. //
  16907. //
  16908. //
  16909. //
  16910. //
  16911. //
  16912. //
  16913. //
  16914. //
  16915. //
  16916. //
  16917. //
  16918. //
  16919. //
  16920. //
  16921. //
  16922. //
  16923. //
  16924. //
  16925. //
  16926. //
  16927. //
  16928. //
  16929. //
  16930. //
  16931. //
  16932. //
  16933. //
  16934. //
  16935. //
  16936. //
  16937. //
  16938. //
  16939. //
  16940. //
  16941. //
  16942. //
  16943. //
  16944. //
  16945. //
  16946. //
  16947. //
  16948. //
  16949. //
  16950. //
  16951. //
  16952. //
  16953. //
  16954. //
  16955. //
  16956. //
  16957. //
  16958. //
  16959. //
  16960. //
  16961. //
  16962. //
  16963. //
  16964. //
  16965. //
  16966. //
  16967. //
  16968. //
  16969. //
  16970. //
  16971. //
  16972. //
  16973. var date_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  16974. if (Array.isArray(defaultValue)) {
  16975. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  16976. } else if (defaultValue) {
  16977. return [new Date(defaultValue), Object(date_util_["nextDate"])(new Date(defaultValue), 1)];
  16978. } else {
  16979. return [new Date(), Object(date_util_["nextDate"])(new Date(), 1)];
  16980. }
  16981. };
  16982. /* harmony default export */ var date_rangevue_type_script_lang_js_ = ({
  16983. mixins: [locale_default.a],
  16984. directives: { Clickoutside: clickoutside_default.a },
  16985. computed: {
  16986. btnDisabled: function btnDisabled() {
  16987. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  16988. },
  16989. leftLabel: function leftLabel() {
  16990. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.leftDate.getMonth() + 1));
  16991. },
  16992. rightLabel: function rightLabel() {
  16993. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.rightDate.getMonth() + 1));
  16994. },
  16995. leftYear: function leftYear() {
  16996. return this.leftDate.getFullYear();
  16997. },
  16998. leftMonth: function leftMonth() {
  16999. return this.leftDate.getMonth();
  17000. },
  17001. leftMonthDate: function leftMonthDate() {
  17002. return this.leftDate.getDate();
  17003. },
  17004. rightYear: function rightYear() {
  17005. return this.rightDate.getFullYear();
  17006. },
  17007. rightMonth: function rightMonth() {
  17008. return this.rightDate.getMonth();
  17009. },
  17010. rightMonthDate: function rightMonthDate() {
  17011. return this.rightDate.getDate();
  17012. },
  17013. minVisibleDate: function minVisibleDate() {
  17014. if (this.dateUserInput.min !== null) return this.dateUserInput.min;
  17015. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.dateFormat);
  17016. return '';
  17017. },
  17018. maxVisibleDate: function maxVisibleDate() {
  17019. if (this.dateUserInput.max !== null) return this.dateUserInput.max;
  17020. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.dateFormat);
  17021. return '';
  17022. },
  17023. minVisibleTime: function minVisibleTime() {
  17024. if (this.timeUserInput.min !== null) return this.timeUserInput.min;
  17025. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.timeFormat);
  17026. return '';
  17027. },
  17028. maxVisibleTime: function maxVisibleTime() {
  17029. if (this.timeUserInput.max !== null) return this.timeUserInput.max;
  17030. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.timeFormat);
  17031. return '';
  17032. },
  17033. timeFormat: function timeFormat() {
  17034. if (this.format) {
  17035. return Object(date_util_["extractTimeFormat"])(this.format);
  17036. } else {
  17037. return 'HH:mm:ss';
  17038. }
  17039. },
  17040. dateFormat: function dateFormat() {
  17041. if (this.format) {
  17042. return Object(date_util_["extractDateFormat"])(this.format);
  17043. } else {
  17044. return 'yyyy-MM-dd';
  17045. }
  17046. },
  17047. enableMonthArrow: function enableMonthArrow() {
  17048. var nextMonth = (this.leftMonth + 1) % 12;
  17049. var yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
  17050. return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
  17051. },
  17052. enableYearArrow: function enableYearArrow() {
  17053. return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
  17054. }
  17055. },
  17056. data: function data() {
  17057. return {
  17058. popperClass: '',
  17059. value: [],
  17060. defaultValue: null,
  17061. defaultTime: null,
  17062. minDate: '',
  17063. maxDate: '',
  17064. leftDate: new Date(),
  17065. rightDate: Object(date_util_["nextMonth"])(new Date()),
  17066. rangeState: {
  17067. endDate: null,
  17068. selecting: false,
  17069. row: null,
  17070. column: null
  17071. },
  17072. showTime: false,
  17073. shortcuts: '',
  17074. visible: '',
  17075. disabledDate: '',
  17076. firstDayOfWeek: 7,
  17077. minTimePickerVisible: false,
  17078. maxTimePickerVisible: false,
  17079. format: '',
  17080. arrowControl: false,
  17081. unlinkPanels: false,
  17082. dateUserInput: {
  17083. min: null,
  17084. max: null
  17085. },
  17086. timeUserInput: {
  17087. min: null,
  17088. max: null
  17089. }
  17090. };
  17091. },
  17092. watch: {
  17093. minDate: function minDate(val) {
  17094. var _this = this;
  17095. this.dateUserInput.min = null;
  17096. this.timeUserInput.min = null;
  17097. this.$nextTick(function () {
  17098. if (_this.$refs.maxTimePicker && _this.maxDate && _this.maxDate < _this.minDate) {
  17099. var format = 'HH:mm:ss';
  17100. _this.$refs.maxTimePicker.selectableRange = [[Object(date_util_["parseDate"])(Object(date_util_["formatDate"])(_this.minDate, format), format), Object(date_util_["parseDate"])('23:59:59', format)]];
  17101. }
  17102. });
  17103. if (val && this.$refs.minTimePicker) {
  17104. this.$refs.minTimePicker.date = val;
  17105. this.$refs.minTimePicker.value = val;
  17106. }
  17107. },
  17108. maxDate: function maxDate(val) {
  17109. this.dateUserInput.max = null;
  17110. this.timeUserInput.max = null;
  17111. if (val && this.$refs.maxTimePicker) {
  17112. this.$refs.maxTimePicker.date = val;
  17113. this.$refs.maxTimePicker.value = val;
  17114. }
  17115. },
  17116. minTimePickerVisible: function minTimePickerVisible(val) {
  17117. var _this2 = this;
  17118. if (val) {
  17119. this.$nextTick(function () {
  17120. _this2.$refs.minTimePicker.date = _this2.minDate;
  17121. _this2.$refs.minTimePicker.value = _this2.minDate;
  17122. _this2.$refs.minTimePicker.adjustSpinners();
  17123. });
  17124. }
  17125. },
  17126. maxTimePickerVisible: function maxTimePickerVisible(val) {
  17127. var _this3 = this;
  17128. if (val) {
  17129. this.$nextTick(function () {
  17130. _this3.$refs.maxTimePicker.date = _this3.maxDate;
  17131. _this3.$refs.maxTimePicker.value = _this3.maxDate;
  17132. _this3.$refs.maxTimePicker.adjustSpinners();
  17133. });
  17134. }
  17135. },
  17136. value: function value(newVal) {
  17137. if (!newVal) {
  17138. this.minDate = null;
  17139. this.maxDate = null;
  17140. } else if (Array.isArray(newVal)) {
  17141. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  17142. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  17143. if (this.minDate) {
  17144. this.leftDate = this.minDate;
  17145. if (this.unlinkPanels && this.maxDate) {
  17146. var minDateYear = this.minDate.getFullYear();
  17147. var minDateMonth = this.minDate.getMonth();
  17148. var maxDateYear = this.maxDate.getFullYear();
  17149. var maxDateMonth = this.maxDate.getMonth();
  17150. this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? Object(date_util_["nextMonth"])(this.maxDate) : this.maxDate;
  17151. } else {
  17152. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17153. }
  17154. } else {
  17155. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17156. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17157. }
  17158. }
  17159. },
  17160. defaultValue: function defaultValue(val) {
  17161. if (!Array.isArray(this.value)) {
  17162. var _calcDefaultValue = date_rangevue_type_script_lang_js_calcDefaultValue(val),
  17163. left = _calcDefaultValue[0],
  17164. right = _calcDefaultValue[1];
  17165. this.leftDate = left;
  17166. this.rightDate = val && val[1] && this.unlinkPanels ? right : Object(date_util_["nextMonth"])(this.leftDate);
  17167. }
  17168. }
  17169. },
  17170. methods: {
  17171. handleClear: function handleClear() {
  17172. this.minDate = null;
  17173. this.maxDate = null;
  17174. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17175. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17176. this.$emit('pick', null);
  17177. },
  17178. handleChangeRange: function handleChangeRange(val) {
  17179. this.minDate = val.minDate;
  17180. this.maxDate = val.maxDate;
  17181. this.rangeState = val.rangeState;
  17182. },
  17183. handleDateInput: function handleDateInput(value, type) {
  17184. this.dateUserInput[type] = value;
  17185. if (value.length !== this.dateFormat.length) return;
  17186. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17187. if (parsedValue) {
  17188. if (typeof this.disabledDate === 'function' && this.disabledDate(new Date(parsedValue))) {
  17189. return;
  17190. }
  17191. if (type === 'min') {
  17192. this.minDate = Object(date_util_["modifyDate"])(this.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17193. this.leftDate = new Date(parsedValue);
  17194. if (!this.unlinkPanels) {
  17195. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17196. }
  17197. } else {
  17198. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17199. this.rightDate = new Date(parsedValue);
  17200. if (!this.unlinkPanels) {
  17201. this.leftDate = Object(date_util_["prevMonth"])(parsedValue);
  17202. }
  17203. }
  17204. }
  17205. },
  17206. handleDateChange: function handleDateChange(value, type) {
  17207. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17208. if (parsedValue) {
  17209. if (type === 'min') {
  17210. this.minDate = Object(date_util_["modifyDate"])(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17211. if (this.minDate > this.maxDate) {
  17212. this.maxDate = this.minDate;
  17213. }
  17214. } else {
  17215. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17216. if (this.maxDate < this.minDate) {
  17217. this.minDate = this.maxDate;
  17218. }
  17219. }
  17220. }
  17221. },
  17222. handleTimeInput: function handleTimeInput(value, type) {
  17223. var _this4 = this;
  17224. this.timeUserInput[type] = value;
  17225. if (value.length !== this.timeFormat.length) return;
  17226. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17227. if (parsedValue) {
  17228. if (type === 'min') {
  17229. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17230. this.$nextTick(function (_) {
  17231. return _this4.$refs.minTimePicker.adjustSpinners();
  17232. });
  17233. } else {
  17234. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17235. this.$nextTick(function (_) {
  17236. return _this4.$refs.maxTimePicker.adjustSpinners();
  17237. });
  17238. }
  17239. }
  17240. },
  17241. handleTimeChange: function handleTimeChange(value, type) {
  17242. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17243. if (parsedValue) {
  17244. if (type === 'min') {
  17245. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17246. if (this.minDate > this.maxDate) {
  17247. this.maxDate = this.minDate;
  17248. }
  17249. this.$refs.minTimePicker.value = this.minDate;
  17250. this.minTimePickerVisible = false;
  17251. } else {
  17252. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17253. if (this.maxDate < this.minDate) {
  17254. this.minDate = this.maxDate;
  17255. }
  17256. this.$refs.maxTimePicker.value = this.minDate;
  17257. this.maxTimePickerVisible = false;
  17258. }
  17259. }
  17260. },
  17261. handleRangePick: function handleRangePick(val) {
  17262. var _this5 = this;
  17263. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  17264. var defaultTime = this.defaultTime || [];
  17265. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  17266. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  17267. if (this.maxDate === maxDate && this.minDate === minDate) {
  17268. return;
  17269. }
  17270. this.onPick && this.onPick(val);
  17271. this.maxDate = maxDate;
  17272. this.minDate = minDate;
  17273. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  17274. setTimeout(function () {
  17275. _this5.maxDate = maxDate;
  17276. _this5.minDate = minDate;
  17277. }, 10);
  17278. if (!close || this.showTime) return;
  17279. this.handleConfirm();
  17280. },
  17281. handleShortcutClick: function handleShortcutClick(shortcut) {
  17282. if (shortcut.onClick) {
  17283. shortcut.onClick(this);
  17284. }
  17285. },
  17286. handleMinTimePick: function handleMinTimePick(value, visible, first) {
  17287. this.minDate = this.minDate || new Date();
  17288. if (value) {
  17289. this.minDate = Object(date_util_["modifyTime"])(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17290. }
  17291. if (!first) {
  17292. this.minTimePickerVisible = visible;
  17293. }
  17294. if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
  17295. this.maxDate = new Date(this.minDate);
  17296. }
  17297. },
  17298. handleMinTimeClose: function handleMinTimeClose() {
  17299. this.minTimePickerVisible = false;
  17300. },
  17301. handleMaxTimePick: function handleMaxTimePick(value, visible, first) {
  17302. if (this.maxDate && value) {
  17303. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17304. }
  17305. if (!first) {
  17306. this.maxTimePickerVisible = visible;
  17307. }
  17308. if (this.maxDate && this.minDate && this.minDate.getTime() > this.maxDate.getTime()) {
  17309. this.minDate = new Date(this.maxDate);
  17310. }
  17311. },
  17312. handleMaxTimeClose: function handleMaxTimeClose() {
  17313. this.maxTimePickerVisible = false;
  17314. },
  17315. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  17316. leftPrevYear: function leftPrevYear() {
  17317. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  17318. if (!this.unlinkPanels) {
  17319. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17320. }
  17321. },
  17322. leftPrevMonth: function leftPrevMonth() {
  17323. this.leftDate = Object(date_util_["prevMonth"])(this.leftDate);
  17324. if (!this.unlinkPanels) {
  17325. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17326. }
  17327. },
  17328. rightNextYear: function rightNextYear() {
  17329. if (!this.unlinkPanels) {
  17330. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17331. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17332. } else {
  17333. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  17334. }
  17335. },
  17336. rightNextMonth: function rightNextMonth() {
  17337. if (!this.unlinkPanels) {
  17338. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17339. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17340. } else {
  17341. this.rightDate = Object(date_util_["nextMonth"])(this.rightDate);
  17342. }
  17343. },
  17344. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  17345. leftNextYear: function leftNextYear() {
  17346. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17347. },
  17348. leftNextMonth: function leftNextMonth() {
  17349. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17350. },
  17351. rightPrevYear: function rightPrevYear() {
  17352. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  17353. },
  17354. rightPrevMonth: function rightPrevMonth() {
  17355. this.rightDate = Object(date_util_["prevMonth"])(this.rightDate);
  17356. },
  17357. handleConfirm: function handleConfirm() {
  17358. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  17359. if (this.isValidValue([this.minDate, this.maxDate])) {
  17360. this.$emit('pick', [this.minDate, this.maxDate], visible);
  17361. }
  17362. },
  17363. isValidValue: function isValidValue(value) {
  17364. 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);
  17365. },
  17366. resetView: function resetView() {
  17367. // NOTE: this is a hack to reset {min, max}Date on picker open.
  17368. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  17369. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  17370. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  17371. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  17372. }
  17373. },
  17374. components: { TimePicker: panel_time, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a }
  17375. });
  17376. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=script&lang=js&
  17377. /* harmony default export */ var panel_date_rangevue_type_script_lang_js_ = (date_rangevue_type_script_lang_js_);
  17378. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue
  17379. /* normalize component */
  17380. var date_range_component = normalizeComponent(
  17381. panel_date_rangevue_type_script_lang_js_,
  17382. date_rangevue_type_template_id_2652849a_render,
  17383. date_rangevue_type_template_id_2652849a_staticRenderFns,
  17384. false,
  17385. null,
  17386. null,
  17387. null
  17388. )
  17389. /* hot reload */
  17390. if (false) { var date_range_api; }
  17391. date_range_component.options.__file = "packages/date-picker/src/panel/date-range.vue"
  17392. /* harmony default export */ var date_range = (date_range_component.exports);
  17393. // 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&
  17394. var month_rangevue_type_template_id_f2645fb8_render = function() {
  17395. var _vm = this
  17396. var _h = _vm.$createElement
  17397. var _c = _vm._self._c || _h
  17398. return _c(
  17399. "transition",
  17400. {
  17401. attrs: { name: "el-zoom-in-top" },
  17402. on: {
  17403. "after-leave": function($event) {
  17404. _vm.$emit("dodestroy")
  17405. }
  17406. }
  17407. },
  17408. [
  17409. _c(
  17410. "div",
  17411. {
  17412. directives: [
  17413. {
  17414. name: "show",
  17415. rawName: "v-show",
  17416. value: _vm.visible,
  17417. expression: "visible"
  17418. }
  17419. ],
  17420. staticClass: "el-picker-panel el-date-range-picker el-popper",
  17421. class: [
  17422. {
  17423. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts
  17424. },
  17425. _vm.popperClass
  17426. ]
  17427. },
  17428. [
  17429. _c(
  17430. "div",
  17431. { staticClass: "el-picker-panel__body-wrapper" },
  17432. [
  17433. _vm._t("sidebar"),
  17434. _vm.shortcuts
  17435. ? _c(
  17436. "div",
  17437. { staticClass: "el-picker-panel__sidebar" },
  17438. _vm._l(_vm.shortcuts, function(shortcut, key) {
  17439. return _c(
  17440. "button",
  17441. {
  17442. key: key,
  17443. staticClass: "el-picker-panel__shortcut",
  17444. attrs: { type: "button" },
  17445. on: {
  17446. click: function($event) {
  17447. _vm.handleShortcutClick(shortcut)
  17448. }
  17449. }
  17450. },
  17451. [_vm._v(_vm._s(shortcut.text))]
  17452. )
  17453. }),
  17454. 0
  17455. )
  17456. : _vm._e(),
  17457. _c("div", { staticClass: "el-picker-panel__body" }, [
  17458. _c(
  17459. "div",
  17460. {
  17461. staticClass:
  17462. "el-picker-panel__content el-date-range-picker__content is-left"
  17463. },
  17464. [
  17465. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17466. _c("button", {
  17467. staticClass:
  17468. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17469. attrs: { type: "button" },
  17470. on: { click: _vm.leftPrevYear }
  17471. }),
  17472. _vm.unlinkPanels
  17473. ? _c("button", {
  17474. staticClass:
  17475. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17476. class: { "is-disabled": !_vm.enableYearArrow },
  17477. attrs: {
  17478. type: "button",
  17479. disabled: !_vm.enableYearArrow
  17480. },
  17481. on: { click: _vm.leftNextYear }
  17482. })
  17483. : _vm._e(),
  17484. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  17485. ]),
  17486. _c("month-table", {
  17487. attrs: {
  17488. "selection-mode": "range",
  17489. date: _vm.leftDate,
  17490. "default-value": _vm.defaultValue,
  17491. "min-date": _vm.minDate,
  17492. "max-date": _vm.maxDate,
  17493. "range-state": _vm.rangeState,
  17494. "disabled-date": _vm.disabledDate
  17495. },
  17496. on: {
  17497. changerange: _vm.handleChangeRange,
  17498. pick: _vm.handleRangePick
  17499. }
  17500. })
  17501. ],
  17502. 1
  17503. ),
  17504. _c(
  17505. "div",
  17506. {
  17507. staticClass:
  17508. "el-picker-panel__content el-date-range-picker__content is-right"
  17509. },
  17510. [
  17511. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17512. _vm.unlinkPanels
  17513. ? _c("button", {
  17514. staticClass:
  17515. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17516. class: { "is-disabled": !_vm.enableYearArrow },
  17517. attrs: {
  17518. type: "button",
  17519. disabled: !_vm.enableYearArrow
  17520. },
  17521. on: { click: _vm.rightPrevYear }
  17522. })
  17523. : _vm._e(),
  17524. _c("button", {
  17525. staticClass:
  17526. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17527. attrs: { type: "button" },
  17528. on: { click: _vm.rightNextYear }
  17529. }),
  17530. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  17531. ]),
  17532. _c("month-table", {
  17533. attrs: {
  17534. "selection-mode": "range",
  17535. date: _vm.rightDate,
  17536. "default-value": _vm.defaultValue,
  17537. "min-date": _vm.minDate,
  17538. "max-date": _vm.maxDate,
  17539. "range-state": _vm.rangeState,
  17540. "disabled-date": _vm.disabledDate
  17541. },
  17542. on: {
  17543. changerange: _vm.handleChangeRange,
  17544. pick: _vm.handleRangePick
  17545. }
  17546. })
  17547. ],
  17548. 1
  17549. )
  17550. ])
  17551. ],
  17552. 2
  17553. )
  17554. ]
  17555. )
  17556. ]
  17557. )
  17558. }
  17559. var month_rangevue_type_template_id_f2645fb8_staticRenderFns = []
  17560. month_rangevue_type_template_id_f2645fb8_render._withStripped = true
  17561. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=template&id=f2645fb8&
  17562. // 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&
  17563. //
  17564. //
  17565. //
  17566. //
  17567. //
  17568. //
  17569. //
  17570. //
  17571. //
  17572. //
  17573. //
  17574. //
  17575. //
  17576. //
  17577. //
  17578. //
  17579. //
  17580. //
  17581. //
  17582. //
  17583. //
  17584. //
  17585. //
  17586. //
  17587. //
  17588. //
  17589. //
  17590. //
  17591. //
  17592. //
  17593. //
  17594. //
  17595. //
  17596. //
  17597. //
  17598. //
  17599. //
  17600. //
  17601. //
  17602. //
  17603. //
  17604. //
  17605. //
  17606. //
  17607. //
  17608. //
  17609. //
  17610. //
  17611. //
  17612. //
  17613. //
  17614. //
  17615. //
  17616. //
  17617. //
  17618. //
  17619. //
  17620. //
  17621. //
  17622. //
  17623. //
  17624. //
  17625. //
  17626. //
  17627. //
  17628. //
  17629. //
  17630. //
  17631. //
  17632. //
  17633. //
  17634. //
  17635. //
  17636. //
  17637. //
  17638. //
  17639. //
  17640. //
  17641. //
  17642. var month_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  17643. if (Array.isArray(defaultValue)) {
  17644. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  17645. } else if (defaultValue) {
  17646. return [new Date(defaultValue), Object(date_util_["nextMonth"])(new Date(defaultValue))];
  17647. } else {
  17648. return [new Date(), Object(date_util_["nextMonth"])(new Date())];
  17649. }
  17650. };
  17651. /* harmony default export */ var month_rangevue_type_script_lang_js_ = ({
  17652. mixins: [locale_default.a],
  17653. directives: { Clickoutside: clickoutside_default.a },
  17654. computed: {
  17655. btnDisabled: function btnDisabled() {
  17656. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  17657. },
  17658. leftLabel: function leftLabel() {
  17659. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  17660. },
  17661. rightLabel: function rightLabel() {
  17662. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  17663. },
  17664. leftYear: function leftYear() {
  17665. return this.leftDate.getFullYear();
  17666. },
  17667. rightYear: function rightYear() {
  17668. return this.rightDate.getFullYear() === this.leftDate.getFullYear() ? this.leftDate.getFullYear() + 1 : this.rightDate.getFullYear();
  17669. },
  17670. enableYearArrow: function enableYearArrow() {
  17671. return this.unlinkPanels && this.rightYear > this.leftYear + 1;
  17672. }
  17673. },
  17674. data: function data() {
  17675. return {
  17676. popperClass: '',
  17677. value: [],
  17678. defaultValue: null,
  17679. defaultTime: null,
  17680. minDate: '',
  17681. maxDate: '',
  17682. leftDate: new Date(),
  17683. rightDate: Object(date_util_["nextYear"])(new Date()),
  17684. rangeState: {
  17685. endDate: null,
  17686. selecting: false,
  17687. row: null,
  17688. column: null
  17689. },
  17690. shortcuts: '',
  17691. visible: '',
  17692. disabledDate: '',
  17693. format: '',
  17694. arrowControl: false,
  17695. unlinkPanels: false
  17696. };
  17697. },
  17698. watch: {
  17699. value: function value(newVal) {
  17700. if (!newVal) {
  17701. this.minDate = null;
  17702. this.maxDate = null;
  17703. } else if (Array.isArray(newVal)) {
  17704. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  17705. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  17706. if (this.minDate) {
  17707. this.leftDate = this.minDate;
  17708. if (this.unlinkPanels && this.maxDate) {
  17709. var minDateYear = this.minDate.getFullYear();
  17710. var maxDateYear = this.maxDate.getFullYear();
  17711. this.rightDate = minDateYear === maxDateYear ? Object(date_util_["nextYear"])(this.maxDate) : this.maxDate;
  17712. } else {
  17713. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  17714. }
  17715. } else {
  17716. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17717. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  17718. }
  17719. }
  17720. },
  17721. defaultValue: function defaultValue(val) {
  17722. if (!Array.isArray(this.value)) {
  17723. var _calcDefaultValue = month_rangevue_type_script_lang_js_calcDefaultValue(val),
  17724. left = _calcDefaultValue[0],
  17725. right = _calcDefaultValue[1];
  17726. this.leftDate = left;
  17727. this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : Object(date_util_["nextYear"])(this.leftDate);
  17728. }
  17729. }
  17730. },
  17731. methods: {
  17732. handleClear: function handleClear() {
  17733. this.minDate = null;
  17734. this.maxDate = null;
  17735. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17736. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  17737. this.$emit('pick', null);
  17738. },
  17739. handleChangeRange: function handleChangeRange(val) {
  17740. this.minDate = val.minDate;
  17741. this.maxDate = val.maxDate;
  17742. this.rangeState = val.rangeState;
  17743. },
  17744. handleRangePick: function handleRangePick(val) {
  17745. var _this = this;
  17746. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  17747. var defaultTime = this.defaultTime || [];
  17748. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  17749. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  17750. if (this.maxDate === maxDate && this.minDate === minDate) {
  17751. return;
  17752. }
  17753. this.onPick && this.onPick(val);
  17754. this.maxDate = maxDate;
  17755. this.minDate = minDate;
  17756. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  17757. setTimeout(function () {
  17758. _this.maxDate = maxDate;
  17759. _this.minDate = minDate;
  17760. }, 10);
  17761. if (!close) return;
  17762. this.handleConfirm();
  17763. },
  17764. handleShortcutClick: function handleShortcutClick(shortcut) {
  17765. if (shortcut.onClick) {
  17766. shortcut.onClick(this);
  17767. }
  17768. },
  17769. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  17770. leftPrevYear: function leftPrevYear() {
  17771. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  17772. if (!this.unlinkPanels) {
  17773. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  17774. }
  17775. },
  17776. rightNextYear: function rightNextYear() {
  17777. if (!this.unlinkPanels) {
  17778. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17779. }
  17780. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  17781. },
  17782. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  17783. leftNextYear: function leftNextYear() {
  17784. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17785. },
  17786. rightPrevYear: function rightPrevYear() {
  17787. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  17788. },
  17789. handleConfirm: function handleConfirm() {
  17790. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  17791. if (this.isValidValue([this.minDate, this.maxDate])) {
  17792. this.$emit('pick', [this.minDate, this.maxDate], visible);
  17793. }
  17794. },
  17795. isValidValue: function isValidValue(value) {
  17796. 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);
  17797. },
  17798. resetView: function resetView() {
  17799. // NOTE: this is a hack to reset {min, max}Date on picker open.
  17800. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  17801. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  17802. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  17803. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  17804. }
  17805. },
  17806. components: { MonthTable: month_table, ElInput: input_default.a, ElButton: button_default.a }
  17807. });
  17808. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=script&lang=js&
  17809. /* harmony default export */ var panel_month_rangevue_type_script_lang_js_ = (month_rangevue_type_script_lang_js_);
  17810. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue
  17811. /* normalize component */
  17812. var month_range_component = normalizeComponent(
  17813. panel_month_rangevue_type_script_lang_js_,
  17814. month_rangevue_type_template_id_f2645fb8_render,
  17815. month_rangevue_type_template_id_f2645fb8_staticRenderFns,
  17816. false,
  17817. null,
  17818. null,
  17819. null
  17820. )
  17821. /* hot reload */
  17822. if (false) { var month_range_api; }
  17823. month_range_component.options.__file = "packages/date-picker/src/panel/month-range.vue"
  17824. /* harmony default export */ var month_range = (month_range_component.exports);
  17825. // CONCATENATED MODULE: ./packages/date-picker/src/picker/date-picker.js
  17826. var date_picker_getPanel = function getPanel(type) {
  17827. if (type === 'daterange' || type === 'datetimerange') {
  17828. return date_range;
  17829. } else if (type === 'monthrange') {
  17830. return month_range;
  17831. }
  17832. return panel_date;
  17833. };
  17834. /* harmony default export */ var date_picker = ({
  17835. mixins: [picker],
  17836. name: 'ElDatePicker',
  17837. props: {
  17838. type: {
  17839. type: String,
  17840. default: 'date'
  17841. },
  17842. timeArrowControl: Boolean
  17843. },
  17844. watch: {
  17845. type: function type(_type) {
  17846. if (this.picker) {
  17847. this.unmountPicker();
  17848. this.panel = date_picker_getPanel(_type);
  17849. this.mountPicker();
  17850. } else {
  17851. this.panel = date_picker_getPanel(_type);
  17852. }
  17853. }
  17854. },
  17855. created: function created() {
  17856. this.panel = date_picker_getPanel(this.type);
  17857. }
  17858. });
  17859. // CONCATENATED MODULE: ./packages/date-picker/index.js
  17860. /* istanbul ignore next */
  17861. date_picker.install = function install(Vue) {
  17862. Vue.component(date_picker.name, date_picker);
  17863. };
  17864. /* harmony default export */ var packages_date_picker = (date_picker);
  17865. // 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&
  17866. var time_selectvue_type_template_id_51ab9320_render = function() {
  17867. var _vm = this
  17868. var _h = _vm.$createElement
  17869. var _c = _vm._self._c || _h
  17870. return _c(
  17871. "transition",
  17872. {
  17873. attrs: { name: "el-zoom-in-top" },
  17874. on: {
  17875. "before-enter": _vm.handleMenuEnter,
  17876. "after-leave": function($event) {
  17877. _vm.$emit("dodestroy")
  17878. }
  17879. }
  17880. },
  17881. [
  17882. _c(
  17883. "div",
  17884. {
  17885. directives: [
  17886. {
  17887. name: "show",
  17888. rawName: "v-show",
  17889. value: _vm.visible,
  17890. expression: "visible"
  17891. }
  17892. ],
  17893. ref: "popper",
  17894. staticClass: "el-picker-panel time-select el-popper",
  17895. class: _vm.popperClass,
  17896. style: { width: _vm.width + "px" }
  17897. },
  17898. [
  17899. _c(
  17900. "el-scrollbar",
  17901. {
  17902. attrs: { noresize: "", "wrap-class": "el-picker-panel__content" }
  17903. },
  17904. _vm._l(_vm.items, function(item) {
  17905. return _c(
  17906. "div",
  17907. {
  17908. key: item.value,
  17909. staticClass: "time-select-item",
  17910. class: {
  17911. selected: _vm.value === item.value,
  17912. disabled: item.disabled,
  17913. default: item.value === _vm.defaultValue
  17914. },
  17915. attrs: { disabled: item.disabled },
  17916. on: {
  17917. click: function($event) {
  17918. _vm.handleClick(item)
  17919. }
  17920. }
  17921. },
  17922. [_vm._v(_vm._s(item.value))]
  17923. )
  17924. }),
  17925. 0
  17926. )
  17927. ],
  17928. 1
  17929. )
  17930. ]
  17931. )
  17932. }
  17933. var time_selectvue_type_template_id_51ab9320_staticRenderFns = []
  17934. time_selectvue_type_template_id_51ab9320_render._withStripped = true
  17935. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=51ab9320&
  17936. // 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&
  17937. //
  17938. //
  17939. //
  17940. //
  17941. //
  17942. //
  17943. //
  17944. //
  17945. //
  17946. //
  17947. //
  17948. //
  17949. //
  17950. //
  17951. //
  17952. //
  17953. //
  17954. //
  17955. //
  17956. //
  17957. var parseTime = function parseTime(time) {
  17958. var values = (time || '').split(':');
  17959. if (values.length >= 2) {
  17960. var hours = parseInt(values[0], 10);
  17961. var minutes = parseInt(values[1], 10);
  17962. return {
  17963. hours: hours,
  17964. minutes: minutes
  17965. };
  17966. }
  17967. /* istanbul ignore next */
  17968. return null;
  17969. };
  17970. var compareTime = function compareTime(time1, time2) {
  17971. var value1 = parseTime(time1);
  17972. var value2 = parseTime(time2);
  17973. var minutes1 = value1.minutes + value1.hours * 60;
  17974. var minutes2 = value2.minutes + value2.hours * 60;
  17975. if (minutes1 === minutes2) {
  17976. return 0;
  17977. }
  17978. return minutes1 > minutes2 ? 1 : -1;
  17979. };
  17980. var formatTime = function formatTime(time) {
  17981. return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
  17982. };
  17983. var nextTime = function nextTime(time, step) {
  17984. var timeValue = parseTime(time);
  17985. var stepValue = parseTime(step);
  17986. var next = {
  17987. hours: timeValue.hours,
  17988. minutes: timeValue.minutes
  17989. };
  17990. next.minutes += stepValue.minutes;
  17991. next.hours += stepValue.hours;
  17992. next.hours += Math.floor(next.minutes / 60);
  17993. next.minutes = next.minutes % 60;
  17994. return formatTime(next);
  17995. };
  17996. /* harmony default export */ var time_selectvue_type_script_lang_js_ = ({
  17997. components: { ElScrollbar: scrollbar_default.a },
  17998. watch: {
  17999. value: function value(val) {
  18000. var _this = this;
  18001. if (!val) return;
  18002. this.$nextTick(function () {
  18003. return _this.scrollToOption();
  18004. });
  18005. }
  18006. },
  18007. methods: {
  18008. handleClick: function handleClick(item) {
  18009. if (!item.disabled) {
  18010. this.$emit('pick', item.value);
  18011. }
  18012. },
  18013. handleClear: function handleClear() {
  18014. this.$emit('pick', null);
  18015. },
  18016. scrollToOption: function scrollToOption() {
  18017. var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
  18018. var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
  18019. scroll_into_view_default()(menu, menu.querySelector(selector));
  18020. },
  18021. handleMenuEnter: function handleMenuEnter() {
  18022. var _this2 = this;
  18023. var selected = this.items.map(function (item) {
  18024. return item.value;
  18025. }).indexOf(this.value) !== -1;
  18026. var hasDefault = this.items.map(function (item) {
  18027. return item.value;
  18028. }).indexOf(this.defaultValue) !== -1;
  18029. var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
  18030. this.$nextTick(function () {
  18031. return _this2.scrollToOption(option);
  18032. });
  18033. },
  18034. scrollDown: function scrollDown(step) {
  18035. var items = this.items;
  18036. var length = items.length;
  18037. var total = items.length;
  18038. var index = items.map(function (item) {
  18039. return item.value;
  18040. }).indexOf(this.value);
  18041. while (total--) {
  18042. index = (index + step + length) % length;
  18043. if (!items[index].disabled) {
  18044. this.$emit('pick', items[index].value, true);
  18045. return;
  18046. }
  18047. }
  18048. },
  18049. isValidValue: function isValidValue(date) {
  18050. return this.items.filter(function (item) {
  18051. return !item.disabled;
  18052. }).map(function (item) {
  18053. return item.value;
  18054. }).indexOf(date) !== -1;
  18055. },
  18056. handleKeydown: function handleKeydown(event) {
  18057. var keyCode = event.keyCode;
  18058. if (keyCode === 38 || keyCode === 40) {
  18059. var mapping = { 40: 1, 38: -1 };
  18060. var offset = mapping[keyCode.toString()];
  18061. this.scrollDown(offset);
  18062. event.stopPropagation();
  18063. return;
  18064. }
  18065. }
  18066. },
  18067. data: function data() {
  18068. return {
  18069. popperClass: '',
  18070. start: '09:00',
  18071. end: '18:00',
  18072. step: '00:30',
  18073. value: '',
  18074. defaultValue: '',
  18075. visible: false,
  18076. minTime: '',
  18077. maxTime: '',
  18078. width: 0
  18079. };
  18080. },
  18081. computed: {
  18082. items: function items() {
  18083. var start = this.start;
  18084. var end = this.end;
  18085. var step = this.step;
  18086. var result = [];
  18087. if (start && end && step) {
  18088. var current = start;
  18089. while (compareTime(current, end) <= 0) {
  18090. result.push({
  18091. value: current,
  18092. disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
  18093. });
  18094. current = nextTime(current, step);
  18095. }
  18096. }
  18097. return result;
  18098. }
  18099. }
  18100. });
  18101. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js&
  18102. /* harmony default export */ var panel_time_selectvue_type_script_lang_js_ = (time_selectvue_type_script_lang_js_);
  18103. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue
  18104. /* normalize component */
  18105. var time_select_component = normalizeComponent(
  18106. panel_time_selectvue_type_script_lang_js_,
  18107. time_selectvue_type_template_id_51ab9320_render,
  18108. time_selectvue_type_template_id_51ab9320_staticRenderFns,
  18109. false,
  18110. null,
  18111. null,
  18112. null
  18113. )
  18114. /* hot reload */
  18115. if (false) { var time_select_api; }
  18116. time_select_component.options.__file = "packages/date-picker/src/panel/time-select.vue"
  18117. /* harmony default export */ var time_select = (time_select_component.exports);
  18118. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-select.js
  18119. /* harmony default export */ var picker_time_select = ({
  18120. mixins: [picker],
  18121. name: 'ElTimeSelect',
  18122. componentName: 'ElTimeSelect',
  18123. props: {
  18124. type: {
  18125. type: String,
  18126. default: 'time-select'
  18127. }
  18128. },
  18129. beforeCreate: function beforeCreate() {
  18130. this.panel = time_select;
  18131. }
  18132. });
  18133. // CONCATENATED MODULE: ./packages/time-select/index.js
  18134. /* istanbul ignore next */
  18135. picker_time_select.install = function (Vue) {
  18136. Vue.component(picker_time_select.name, picker_time_select);
  18137. };
  18138. /* harmony default export */ var packages_time_select = (picker_time_select);
  18139. // 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&
  18140. var time_rangevue_type_template_id_fb28660e_render = function() {
  18141. var _vm = this
  18142. var _h = _vm.$createElement
  18143. var _c = _vm._self._c || _h
  18144. return _c(
  18145. "transition",
  18146. {
  18147. attrs: { name: "el-zoom-in-top" },
  18148. on: {
  18149. "after-leave": function($event) {
  18150. _vm.$emit("dodestroy")
  18151. }
  18152. }
  18153. },
  18154. [
  18155. _c(
  18156. "div",
  18157. {
  18158. directives: [
  18159. {
  18160. name: "show",
  18161. rawName: "v-show",
  18162. value: _vm.visible,
  18163. expression: "visible"
  18164. }
  18165. ],
  18166. staticClass: "el-time-range-picker el-picker-panel el-popper",
  18167. class: _vm.popperClass
  18168. },
  18169. [
  18170. _c("div", { staticClass: "el-time-range-picker__content" }, [
  18171. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18172. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18173. _vm._v(_vm._s(_vm.t("el.datepicker.startTime")))
  18174. ]),
  18175. _c(
  18176. "div",
  18177. {
  18178. staticClass:
  18179. "el-time-range-picker__body el-time-panel__content",
  18180. class: {
  18181. "has-seconds": _vm.showSeconds,
  18182. "is-arrow": _vm.arrowControl
  18183. }
  18184. },
  18185. [
  18186. _c("time-spinner", {
  18187. ref: "minSpinner",
  18188. attrs: {
  18189. "show-seconds": _vm.showSeconds,
  18190. "am-pm-mode": _vm.amPmMode,
  18191. "arrow-control": _vm.arrowControl,
  18192. date: _vm.minDate
  18193. },
  18194. on: {
  18195. change: _vm.handleMinChange,
  18196. "select-range": _vm.setMinSelectionRange
  18197. }
  18198. })
  18199. ],
  18200. 1
  18201. )
  18202. ]),
  18203. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18204. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18205. _vm._v(_vm._s(_vm.t("el.datepicker.endTime")))
  18206. ]),
  18207. _c(
  18208. "div",
  18209. {
  18210. staticClass:
  18211. "el-time-range-picker__body el-time-panel__content",
  18212. class: {
  18213. "has-seconds": _vm.showSeconds,
  18214. "is-arrow": _vm.arrowControl
  18215. }
  18216. },
  18217. [
  18218. _c("time-spinner", {
  18219. ref: "maxSpinner",
  18220. attrs: {
  18221. "show-seconds": _vm.showSeconds,
  18222. "am-pm-mode": _vm.amPmMode,
  18223. "arrow-control": _vm.arrowControl,
  18224. date: _vm.maxDate
  18225. },
  18226. on: {
  18227. change: _vm.handleMaxChange,
  18228. "select-range": _vm.setMaxSelectionRange
  18229. }
  18230. })
  18231. ],
  18232. 1
  18233. )
  18234. ])
  18235. ]),
  18236. _c("div", { staticClass: "el-time-panel__footer" }, [
  18237. _c(
  18238. "button",
  18239. {
  18240. staticClass: "el-time-panel__btn cancel",
  18241. attrs: { type: "button" },
  18242. on: {
  18243. click: function($event) {
  18244. _vm.handleCancel()
  18245. }
  18246. }
  18247. },
  18248. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  18249. ),
  18250. _c(
  18251. "button",
  18252. {
  18253. staticClass: "el-time-panel__btn confirm",
  18254. attrs: { type: "button", disabled: _vm.btnDisabled },
  18255. on: {
  18256. click: function($event) {
  18257. _vm.handleConfirm()
  18258. }
  18259. }
  18260. },
  18261. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  18262. )
  18263. ])
  18264. ]
  18265. )
  18266. ]
  18267. )
  18268. }
  18269. var time_rangevue_type_template_id_fb28660e_staticRenderFns = []
  18270. time_rangevue_type_template_id_fb28660e_render._withStripped = true
  18271. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
  18272. // 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&
  18273. //
  18274. //
  18275. //
  18276. //
  18277. //
  18278. //
  18279. //
  18280. //
  18281. //
  18282. //
  18283. //
  18284. //
  18285. //
  18286. //
  18287. //
  18288. //
  18289. //
  18290. //
  18291. //
  18292. //
  18293. //
  18294. //
  18295. //
  18296. //
  18297. //
  18298. //
  18299. //
  18300. //
  18301. //
  18302. //
  18303. //
  18304. //
  18305. //
  18306. //
  18307. //
  18308. //
  18309. //
  18310. //
  18311. //
  18312. //
  18313. //
  18314. //
  18315. //
  18316. //
  18317. //
  18318. //
  18319. //
  18320. //
  18321. //
  18322. //
  18323. //
  18324. //
  18325. //
  18326. //
  18327. //
  18328. //
  18329. //
  18330. var MIN_TIME = Object(date_util_["parseDate"])('00:00:00', 'HH:mm:ss');
  18331. var MAX_TIME = Object(date_util_["parseDate"])('23:59:59', 'HH:mm:ss');
  18332. var time_rangevue_type_script_lang_js_minTimeOfDay = function minTimeOfDay(date) {
  18333. return Object(date_util_["modifyDate"])(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18334. };
  18335. var time_rangevue_type_script_lang_js_maxTimeOfDay = function maxTimeOfDay(date) {
  18336. return Object(date_util_["modifyDate"])(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18337. };
  18338. // increase time by amount of milliseconds, but within the range of day
  18339. var advanceTime = function advanceTime(date, amount) {
  18340. return new Date(Math.min(date.getTime() + amount, time_rangevue_type_script_lang_js_maxTimeOfDay(date).getTime()));
  18341. };
  18342. /* harmony default export */ var time_rangevue_type_script_lang_js_ = ({
  18343. mixins: [locale_default.a],
  18344. components: { TimeSpinner: time_spinner },
  18345. computed: {
  18346. showSeconds: function showSeconds() {
  18347. return (this.format || '').indexOf('ss') !== -1;
  18348. },
  18349. offset: function offset() {
  18350. return this.showSeconds ? 11 : 8;
  18351. },
  18352. spinner: function spinner() {
  18353. return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner;
  18354. },
  18355. btnDisabled: function btnDisabled() {
  18356. return this.minDate.getTime() > this.maxDate.getTime();
  18357. },
  18358. amPmMode: function amPmMode() {
  18359. if ((this.format || '').indexOf('A') !== -1) return 'A';
  18360. if ((this.format || '').indexOf('a') !== -1) return 'a';
  18361. return '';
  18362. }
  18363. },
  18364. data: function data() {
  18365. return {
  18366. popperClass: '',
  18367. minDate: new Date(),
  18368. maxDate: new Date(),
  18369. value: [],
  18370. oldValue: [new Date(), new Date()],
  18371. defaultValue: null,
  18372. format: 'HH:mm:ss',
  18373. visible: false,
  18374. selectionRange: [0, 2],
  18375. arrowControl: false
  18376. };
  18377. },
  18378. watch: {
  18379. value: function value(_value) {
  18380. if (Array.isArray(_value)) {
  18381. this.minDate = new Date(_value[0]);
  18382. this.maxDate = new Date(_value[1]);
  18383. } else {
  18384. if (Array.isArray(this.defaultValue)) {
  18385. this.minDate = new Date(this.defaultValue[0]);
  18386. this.maxDate = new Date(this.defaultValue[1]);
  18387. } else if (this.defaultValue) {
  18388. this.minDate = new Date(this.defaultValue);
  18389. this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000);
  18390. } else {
  18391. this.minDate = new Date();
  18392. this.maxDate = advanceTime(new Date(), 60 * 60 * 1000);
  18393. }
  18394. }
  18395. },
  18396. visible: function visible(val) {
  18397. var _this = this;
  18398. if (val) {
  18399. this.oldValue = this.value;
  18400. this.$nextTick(function () {
  18401. return _this.$refs.minSpinner.emitSelectRange('hours');
  18402. });
  18403. }
  18404. }
  18405. },
  18406. methods: {
  18407. handleClear: function handleClear() {
  18408. this.$emit('pick', null);
  18409. },
  18410. handleCancel: function handleCancel() {
  18411. this.$emit('pick', this.oldValue);
  18412. },
  18413. handleMinChange: function handleMinChange(date) {
  18414. this.minDate = Object(date_util_["clearMilliseconds"])(date);
  18415. this.handleChange();
  18416. },
  18417. handleMaxChange: function handleMaxChange(date) {
  18418. this.maxDate = Object(date_util_["clearMilliseconds"])(date);
  18419. this.handleChange();
  18420. },
  18421. handleChange: function handleChange() {
  18422. if (this.isValidValue([this.minDate, this.maxDate])) {
  18423. this.$refs.minSpinner.selectableRange = [[time_rangevue_type_script_lang_js_minTimeOfDay(this.minDate), this.maxDate]];
  18424. this.$refs.maxSpinner.selectableRange = [[this.minDate, time_rangevue_type_script_lang_js_maxTimeOfDay(this.maxDate)]];
  18425. this.$emit('pick', [this.minDate, this.maxDate], true);
  18426. }
  18427. },
  18428. setMinSelectionRange: function setMinSelectionRange(start, end) {
  18429. this.$emit('select-range', start, end, 'min');
  18430. this.selectionRange = [start, end];
  18431. },
  18432. setMaxSelectionRange: function setMaxSelectionRange(start, end) {
  18433. this.$emit('select-range', start, end, 'max');
  18434. this.selectionRange = [start + this.offset, end + this.offset];
  18435. },
  18436. handleConfirm: function handleConfirm() {
  18437. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18438. var minSelectableRange = this.$refs.minSpinner.selectableRange;
  18439. var maxSelectableRange = this.$refs.maxSpinner.selectableRange;
  18440. this.minDate = Object(date_util_["limitTimeRange"])(this.minDate, minSelectableRange, this.format);
  18441. this.maxDate = Object(date_util_["limitTimeRange"])(this.maxDate, maxSelectableRange, this.format);
  18442. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18443. },
  18444. adjustSpinners: function adjustSpinners() {
  18445. this.$refs.minSpinner.adjustSpinners();
  18446. this.$refs.maxSpinner.adjustSpinners();
  18447. },
  18448. changeSelectionRange: function changeSelectionRange(step) {
  18449. var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
  18450. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  18451. var index = list.indexOf(this.selectionRange[0]);
  18452. var next = (index + step + list.length) % list.length;
  18453. var half = list.length / 2;
  18454. if (next < half) {
  18455. this.$refs.minSpinner.emitSelectRange(mapping[next]);
  18456. } else {
  18457. this.$refs.maxSpinner.emitSelectRange(mapping[next - half]);
  18458. }
  18459. },
  18460. isValidValue: function isValidValue(date) {
  18461. return Array.isArray(date) && Object(date_util_["timeWithinRange"])(this.minDate, this.$refs.minSpinner.selectableRange) && Object(date_util_["timeWithinRange"])(this.maxDate, this.$refs.maxSpinner.selectableRange);
  18462. },
  18463. handleKeydown: function handleKeydown(event) {
  18464. var keyCode = event.keyCode;
  18465. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  18466. // Left or Right
  18467. if (keyCode === 37 || keyCode === 39) {
  18468. var step = mapping[keyCode];
  18469. this.changeSelectionRange(step);
  18470. event.preventDefault();
  18471. return;
  18472. }
  18473. // Up or Down
  18474. if (keyCode === 38 || keyCode === 40) {
  18475. var _step = mapping[keyCode];
  18476. this.spinner.scrollDown(_step);
  18477. event.preventDefault();
  18478. return;
  18479. }
  18480. }
  18481. }
  18482. });
  18483. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
  18484. /* harmony default export */ var panel_time_rangevue_type_script_lang_js_ = (time_rangevue_type_script_lang_js_);
  18485. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue
  18486. /* normalize component */
  18487. var time_range_component = normalizeComponent(
  18488. panel_time_rangevue_type_script_lang_js_,
  18489. time_rangevue_type_template_id_fb28660e_render,
  18490. time_rangevue_type_template_id_fb28660e_staticRenderFns,
  18491. false,
  18492. null,
  18493. null,
  18494. null
  18495. )
  18496. /* hot reload */
  18497. if (false) { var time_range_api; }
  18498. time_range_component.options.__file = "packages/date-picker/src/panel/time-range.vue"
  18499. /* harmony default export */ var time_range = (time_range_component.exports);
  18500. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-picker.js
  18501. /* harmony default export */ var time_picker = ({
  18502. mixins: [picker],
  18503. name: 'ElTimePicker',
  18504. props: {
  18505. isRange: Boolean,
  18506. arrowControl: Boolean
  18507. },
  18508. data: function data() {
  18509. return {
  18510. type: ''
  18511. };
  18512. },
  18513. watch: {
  18514. isRange: function isRange(_isRange) {
  18515. if (this.picker) {
  18516. this.unmountPicker();
  18517. this.type = _isRange ? 'timerange' : 'time';
  18518. this.panel = _isRange ? time_range : panel_time;
  18519. this.mountPicker();
  18520. } else {
  18521. this.type = _isRange ? 'timerange' : 'time';
  18522. this.panel = _isRange ? time_range : panel_time;
  18523. }
  18524. }
  18525. },
  18526. created: function created() {
  18527. this.type = this.isRange ? 'timerange' : 'time';
  18528. this.panel = this.isRange ? time_range : panel_time;
  18529. }
  18530. });
  18531. // CONCATENATED MODULE: ./packages/time-picker/index.js
  18532. /* istanbul ignore next */
  18533. time_picker.install = function (Vue) {
  18534. Vue.component(time_picker.name, time_picker);
  18535. };
  18536. /* harmony default export */ var packages_time_picker = (time_picker);
  18537. // 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&
  18538. var mainvue_type_template_id_52060272_render = function() {
  18539. var _vm = this
  18540. var _h = _vm.$createElement
  18541. var _c = _vm._self._c || _h
  18542. return _c(
  18543. "span",
  18544. [
  18545. _c(
  18546. "transition",
  18547. {
  18548. attrs: { name: _vm.transition },
  18549. on: {
  18550. "after-enter": _vm.handleAfterEnter,
  18551. "after-leave": _vm.handleAfterLeave
  18552. }
  18553. },
  18554. [
  18555. _c(
  18556. "div",
  18557. {
  18558. directives: [
  18559. {
  18560. name: "show",
  18561. rawName: "v-show",
  18562. value: !_vm.disabled && _vm.showPopper,
  18563. expression: "!disabled && showPopper"
  18564. }
  18565. ],
  18566. ref: "popper",
  18567. staticClass: "el-popover el-popper",
  18568. class: [_vm.popperClass, _vm.content && "el-popover--plain"],
  18569. style: { width: _vm.width + "px" },
  18570. attrs: {
  18571. role: "tooltip",
  18572. id: _vm.tooltipId,
  18573. "aria-hidden":
  18574. _vm.disabled || !_vm.showPopper ? "true" : "false"
  18575. }
  18576. },
  18577. [
  18578. _vm.title
  18579. ? _c("div", {
  18580. staticClass: "el-popover__title",
  18581. domProps: { textContent: _vm._s(_vm.title) }
  18582. })
  18583. : _vm._e(),
  18584. _vm._t("default", [_vm._v(_vm._s(_vm.content))])
  18585. ],
  18586. 2
  18587. )
  18588. ]
  18589. ),
  18590. _vm._t("reference")
  18591. ],
  18592. 2
  18593. )
  18594. }
  18595. var mainvue_type_template_id_52060272_staticRenderFns = []
  18596. mainvue_type_template_id_52060272_render._withStripped = true
  18597. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=template&id=52060272&
  18598. // 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&
  18599. //
  18600. //
  18601. //
  18602. //
  18603. //
  18604. //
  18605. //
  18606. //
  18607. //
  18608. //
  18609. //
  18610. //
  18611. //
  18612. //
  18613. //
  18614. //
  18615. //
  18616. //
  18617. //
  18618. //
  18619. //
  18620. //
  18621. //
  18622. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  18623. name: 'ElPopover',
  18624. mixins: [vue_popper_default.a],
  18625. props: {
  18626. trigger: {
  18627. type: String,
  18628. default: 'click',
  18629. validator: function validator(value) {
  18630. return ['click', 'focus', 'hover', 'manual'].indexOf(value) > -1;
  18631. }
  18632. },
  18633. openDelay: {
  18634. type: Number,
  18635. default: 0
  18636. },
  18637. title: String,
  18638. disabled: Boolean,
  18639. content: String,
  18640. reference: {},
  18641. popperClass: String,
  18642. width: {},
  18643. visibleArrow: {
  18644. default: true
  18645. },
  18646. arrowOffset: {
  18647. type: Number,
  18648. default: 0
  18649. },
  18650. transition: {
  18651. type: String,
  18652. default: 'fade-in-linear'
  18653. },
  18654. tabindex: {
  18655. type: Number,
  18656. default: 0
  18657. }
  18658. },
  18659. computed: {
  18660. tooltipId: function tooltipId() {
  18661. return 'el-popover-' + Object(util_["generateId"])();
  18662. }
  18663. },
  18664. watch: {
  18665. showPopper: function showPopper(val) {
  18666. if (this.disabled) {
  18667. return;
  18668. }
  18669. val ? this.$emit('show') : this.$emit('hide');
  18670. }
  18671. },
  18672. mounted: function mounted() {
  18673. var _this = this;
  18674. var reference = this.referenceElm = this.reference || this.$refs.reference;
  18675. var popper = this.popper || this.$refs.popper;
  18676. if (!reference && this.$slots.reference && this.$slots.reference[0]) {
  18677. reference = this.referenceElm = this.$slots.reference[0].elm;
  18678. }
  18679. // 可访问性
  18680. if (reference) {
  18681. Object(dom_["addClass"])(reference, 'el-popover__reference');
  18682. reference.setAttribute('aria-describedby', this.tooltipId);
  18683. reference.setAttribute('tabindex', this.tabindex); // tab序列
  18684. popper.setAttribute('tabindex', 0);
  18685. if (this.trigger !== 'click') {
  18686. Object(dom_["on"])(reference, 'focusin', function () {
  18687. _this.handleFocus();
  18688. var instance = reference.__vue__;
  18689. if (instance && typeof instance.focus === 'function') {
  18690. instance.focus();
  18691. }
  18692. });
  18693. Object(dom_["on"])(popper, 'focusin', this.handleFocus);
  18694. Object(dom_["on"])(reference, 'focusout', this.handleBlur);
  18695. Object(dom_["on"])(popper, 'focusout', this.handleBlur);
  18696. }
  18697. Object(dom_["on"])(reference, 'keydown', this.handleKeydown);
  18698. Object(dom_["on"])(reference, 'click', this.handleClick);
  18699. }
  18700. if (this.trigger === 'click') {
  18701. Object(dom_["on"])(reference, 'click', this.doToggle);
  18702. Object(dom_["on"])(document, 'click', this.handleDocumentClick);
  18703. } else if (this.trigger === 'hover') {
  18704. Object(dom_["on"])(reference, 'mouseenter', this.handleMouseEnter);
  18705. Object(dom_["on"])(popper, 'mouseenter', this.handleMouseEnter);
  18706. Object(dom_["on"])(reference, 'mouseleave', this.handleMouseLeave);
  18707. Object(dom_["on"])(popper, 'mouseleave', this.handleMouseLeave);
  18708. } else if (this.trigger === 'focus') {
  18709. if (this.tabindex < 0) {
  18710. console.warn('[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key');
  18711. }
  18712. if (reference.querySelector('input, textarea')) {
  18713. Object(dom_["on"])(reference, 'focusin', this.doShow);
  18714. Object(dom_["on"])(reference, 'focusout', this.doClose);
  18715. } else {
  18716. Object(dom_["on"])(reference, 'mousedown', this.doShow);
  18717. Object(dom_["on"])(reference, 'mouseup', this.doClose);
  18718. }
  18719. }
  18720. },
  18721. beforeDestroy: function beforeDestroy() {
  18722. this.cleanup();
  18723. },
  18724. deactivated: function deactivated() {
  18725. this.cleanup();
  18726. },
  18727. methods: {
  18728. doToggle: function doToggle() {
  18729. this.showPopper = !this.showPopper;
  18730. },
  18731. doShow: function doShow() {
  18732. this.showPopper = true;
  18733. },
  18734. doClose: function doClose() {
  18735. this.showPopper = false;
  18736. },
  18737. handleFocus: function handleFocus() {
  18738. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  18739. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = true;
  18740. },
  18741. handleClick: function handleClick() {
  18742. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  18743. },
  18744. handleBlur: function handleBlur() {
  18745. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  18746. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = false;
  18747. },
  18748. handleMouseEnter: function handleMouseEnter() {
  18749. var _this2 = this;
  18750. clearTimeout(this._timer);
  18751. if (this.openDelay) {
  18752. this._timer = setTimeout(function () {
  18753. _this2.showPopper = true;
  18754. }, this.openDelay);
  18755. } else {
  18756. this.showPopper = true;
  18757. }
  18758. },
  18759. handleKeydown: function handleKeydown(ev) {
  18760. if (ev.keyCode === 27 && this.trigger !== 'manual') {
  18761. // esc
  18762. this.doClose();
  18763. }
  18764. },
  18765. handleMouseLeave: function handleMouseLeave() {
  18766. var _this3 = this;
  18767. clearTimeout(this._timer);
  18768. this._timer = setTimeout(function () {
  18769. _this3.showPopper = false;
  18770. }, 200);
  18771. },
  18772. handleDocumentClick: function handleDocumentClick(e) {
  18773. var reference = this.reference || this.$refs.reference;
  18774. var popper = this.popper || this.$refs.popper;
  18775. if (!reference && this.$slots.reference && this.$slots.reference[0]) {
  18776. reference = this.referenceElm = this.$slots.reference[0].elm;
  18777. }
  18778. if (!this.$el || !reference || this.$el.contains(e.target) || reference.contains(e.target) || !popper || popper.contains(e.target)) return;
  18779. this.showPopper = false;
  18780. },
  18781. handleAfterEnter: function handleAfterEnter() {
  18782. this.$emit('after-enter');
  18783. },
  18784. handleAfterLeave: function handleAfterLeave() {
  18785. this.$emit('after-leave');
  18786. this.doDestroy();
  18787. },
  18788. cleanup: function cleanup() {
  18789. if (this.openDelay) {
  18790. clearTimeout(this._timer);
  18791. }
  18792. }
  18793. },
  18794. destroyed: function destroyed() {
  18795. var reference = this.reference;
  18796. Object(dom_["off"])(reference, 'click', this.doToggle);
  18797. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  18798. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  18799. Object(dom_["off"])(reference, 'focusin', this.doShow);
  18800. Object(dom_["off"])(reference, 'focusout', this.doClose);
  18801. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  18802. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  18803. Object(dom_["off"])(reference, 'mouseleave', this.handleMouseLeave);
  18804. Object(dom_["off"])(reference, 'mouseenter', this.handleMouseEnter);
  18805. Object(dom_["off"])(document, 'click', this.handleDocumentClick);
  18806. }
  18807. });
  18808. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=script&lang=js&
  18809. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  18810. // CONCATENATED MODULE: ./packages/popover/src/main.vue
  18811. /* normalize component */
  18812. var main_component = normalizeComponent(
  18813. src_mainvue_type_script_lang_js_,
  18814. mainvue_type_template_id_52060272_render,
  18815. mainvue_type_template_id_52060272_staticRenderFns,
  18816. false,
  18817. null,
  18818. null,
  18819. null
  18820. )
  18821. /* hot reload */
  18822. if (false) { var main_api; }
  18823. main_component.options.__file = "packages/popover/src/main.vue"
  18824. /* harmony default export */ var main = (main_component.exports);
  18825. // CONCATENATED MODULE: ./packages/popover/src/directive.js
  18826. var getReference = function getReference(el, binding, vnode) {
  18827. var _ref = binding.expression ? binding.value : binding.arg;
  18828. var popper = vnode.context.$refs[_ref];
  18829. if (popper) {
  18830. if (Array.isArray(popper)) {
  18831. popper[0].$refs.reference = el;
  18832. } else {
  18833. popper.$refs.reference = el;
  18834. }
  18835. }
  18836. };
  18837. /* harmony default export */ var directive = ({
  18838. bind: function bind(el, binding, vnode) {
  18839. getReference(el, binding, vnode);
  18840. },
  18841. inserted: function inserted(el, binding, vnode) {
  18842. getReference(el, binding, vnode);
  18843. }
  18844. });
  18845. // CONCATENATED MODULE: ./packages/popover/index.js
  18846. external_vue_default.a.directive('popover', directive);
  18847. /* istanbul ignore next */
  18848. main.install = function (Vue) {
  18849. Vue.directive('popover', directive);
  18850. Vue.component(main.name, main);
  18851. };
  18852. main.directive = directive;
  18853. /* harmony default export */ var popover = (main);
  18854. // CONCATENATED MODULE: ./packages/tooltip/src/main.js
  18855. /* harmony default export */ var src_main = ({
  18856. name: 'ElTooltip',
  18857. mixins: [vue_popper_default.a],
  18858. props: {
  18859. openDelay: {
  18860. type: Number,
  18861. default: 0
  18862. },
  18863. disabled: Boolean,
  18864. manual: Boolean,
  18865. effect: {
  18866. type: String,
  18867. default: 'dark'
  18868. },
  18869. arrowOffset: {
  18870. type: Number,
  18871. default: 0
  18872. },
  18873. popperClass: String,
  18874. content: String,
  18875. visibleArrow: {
  18876. default: true
  18877. },
  18878. transition: {
  18879. type: String,
  18880. default: 'el-fade-in-linear'
  18881. },
  18882. popperOptions: {
  18883. default: function _default() {
  18884. return {
  18885. boundariesPadding: 10,
  18886. gpuAcceleration: false
  18887. };
  18888. }
  18889. },
  18890. enterable: {
  18891. type: Boolean,
  18892. default: true
  18893. },
  18894. hideAfter: {
  18895. type: Number,
  18896. default: 0
  18897. },
  18898. tabindex: {
  18899. type: Number,
  18900. default: 0
  18901. }
  18902. },
  18903. data: function data() {
  18904. return {
  18905. tooltipId: 'el-tooltip-' + Object(util_["generateId"])(),
  18906. timeoutPending: null,
  18907. focusing: false
  18908. };
  18909. },
  18910. beforeCreate: function beforeCreate() {
  18911. var _this = this;
  18912. if (this.$isServer) return;
  18913. this.popperVM = new external_vue_default.a({
  18914. data: { node: '' },
  18915. render: function render(h) {
  18916. return this.node;
  18917. }
  18918. }).$mount();
  18919. this.debounceClose = debounce_default()(200, function () {
  18920. return _this.handleClosePopper();
  18921. });
  18922. },
  18923. render: function render(h) {
  18924. var _this2 = this;
  18925. if (this.popperVM) {
  18926. this.popperVM.node = h(
  18927. 'transition',
  18928. {
  18929. attrs: {
  18930. name: this.transition
  18931. },
  18932. on: {
  18933. 'afterLeave': this.doDestroy
  18934. }
  18935. },
  18936. [h(
  18937. 'div',
  18938. {
  18939. on: {
  18940. 'mouseleave': function mouseleave() {
  18941. _this2.setExpectedState(false);_this2.debounceClose();
  18942. },
  18943. 'mouseenter': function mouseenter() {
  18944. _this2.setExpectedState(true);
  18945. }
  18946. },
  18947. ref: 'popper',
  18948. attrs: { role: 'tooltip',
  18949. id: this.tooltipId,
  18950. 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
  18951. },
  18952. directives: [{
  18953. name: 'show',
  18954. value: !this.disabled && this.showPopper
  18955. }],
  18956. 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
  18957. [this.$slots.content || this.content]
  18958. )]
  18959. );
  18960. }
  18961. var firstElement = this.getFirstElement();
  18962. if (!firstElement) return null;
  18963. var data = firstElement.data = firstElement.data || {};
  18964. data.staticClass = this.addTooltipClass(data.staticClass);
  18965. return firstElement;
  18966. },
  18967. mounted: function mounted() {
  18968. var _this3 = this;
  18969. this.referenceElm = this.$el;
  18970. if (this.$el.nodeType === 1) {
  18971. this.$el.setAttribute('aria-describedby', this.tooltipId);
  18972. this.$el.setAttribute('tabindex', 0);
  18973. Object(dom_["on"])(this.referenceElm, 'mouseenter', this.show);
  18974. Object(dom_["on"])(this.referenceElm, 'mouseleave', this.hide);
  18975. Object(dom_["on"])(this.referenceElm, 'focus', function () {
  18976. if (!_this3.$slots.default || !_this3.$slots.default.length) {
  18977. _this3.handleFocus();
  18978. return;
  18979. }
  18980. var instance = _this3.$slots.default[0].componentInstance;
  18981. if (instance && instance.focus) {
  18982. instance.focus();
  18983. } else {
  18984. _this3.handleFocus();
  18985. }
  18986. });
  18987. Object(dom_["on"])(this.referenceElm, 'blur', this.handleBlur);
  18988. Object(dom_["on"])(this.referenceElm, 'click', this.removeFocusing);
  18989. }
  18990. // fix issue https://github.com/ElemeFE/element/issues/14424
  18991. if (this.value && this.popperVM) {
  18992. this.popperVM.$nextTick(function () {
  18993. if (_this3.value) {
  18994. _this3.updatePopper();
  18995. }
  18996. });
  18997. }
  18998. },
  18999. watch: {
  19000. focusing: function focusing(val) {
  19001. if (val) {
  19002. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19003. } else {
  19004. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19005. }
  19006. }
  19007. },
  19008. methods: {
  19009. show: function show() {
  19010. this.setExpectedState(true);
  19011. this.handleShowPopper();
  19012. },
  19013. hide: function hide() {
  19014. this.setExpectedState(false);
  19015. this.debounceClose();
  19016. },
  19017. handleFocus: function handleFocus() {
  19018. this.focusing = true;
  19019. this.show();
  19020. },
  19021. handleBlur: function handleBlur() {
  19022. this.focusing = false;
  19023. this.hide();
  19024. },
  19025. removeFocusing: function removeFocusing() {
  19026. this.focusing = false;
  19027. },
  19028. addTooltipClass: function addTooltipClass(prev) {
  19029. if (!prev) {
  19030. return 'el-tooltip';
  19031. } else {
  19032. return 'el-tooltip ' + prev.replace('el-tooltip', '');
  19033. }
  19034. },
  19035. handleShowPopper: function handleShowPopper() {
  19036. var _this4 = this;
  19037. if (!this.expectedState || this.manual) return;
  19038. clearTimeout(this.timeout);
  19039. this.timeout = setTimeout(function () {
  19040. _this4.showPopper = true;
  19041. }, this.openDelay);
  19042. if (this.hideAfter > 0) {
  19043. this.timeoutPending = setTimeout(function () {
  19044. _this4.showPopper = false;
  19045. }, this.hideAfter);
  19046. }
  19047. },
  19048. handleClosePopper: function handleClosePopper() {
  19049. if (this.enterable && this.expectedState || this.manual) return;
  19050. clearTimeout(this.timeout);
  19051. if (this.timeoutPending) {
  19052. clearTimeout(this.timeoutPending);
  19053. }
  19054. this.showPopper = false;
  19055. if (this.disabled) {
  19056. this.doDestroy();
  19057. }
  19058. },
  19059. setExpectedState: function setExpectedState(expectedState) {
  19060. if (expectedState === false) {
  19061. clearTimeout(this.timeoutPending);
  19062. }
  19063. this.expectedState = expectedState;
  19064. },
  19065. getFirstElement: function getFirstElement() {
  19066. var slots = this.$slots.default;
  19067. if (!Array.isArray(slots)) return null;
  19068. var element = null;
  19069. for (var index = 0; index < slots.length; index++) {
  19070. if (slots[index] && slots[index].tag) {
  19071. element = slots[index];
  19072. };
  19073. }
  19074. return element;
  19075. }
  19076. },
  19077. beforeDestroy: function beforeDestroy() {
  19078. this.popperVM && this.popperVM.$destroy();
  19079. },
  19080. destroyed: function destroyed() {
  19081. var reference = this.referenceElm;
  19082. if (reference.nodeType === 1) {
  19083. Object(dom_["off"])(reference, 'mouseenter', this.show);
  19084. Object(dom_["off"])(reference, 'mouseleave', this.hide);
  19085. Object(dom_["off"])(reference, 'focus', this.handleFocus);
  19086. Object(dom_["off"])(reference, 'blur', this.handleBlur);
  19087. Object(dom_["off"])(reference, 'click', this.removeFocusing);
  19088. }
  19089. }
  19090. });
  19091. // CONCATENATED MODULE: ./packages/tooltip/index.js
  19092. /* istanbul ignore next */
  19093. src_main.install = function (Vue) {
  19094. Vue.component(src_main.name, src_main);
  19095. };
  19096. /* harmony default export */ var packages_tooltip = (src_main);
  19097. // 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&
  19098. var mainvue_type_template_id_6b29b012_render = function() {
  19099. var _vm = this
  19100. var _h = _vm.$createElement
  19101. var _c = _vm._self._c || _h
  19102. return _c("transition", { attrs: { name: "msgbox-fade" } }, [
  19103. _c(
  19104. "div",
  19105. {
  19106. directives: [
  19107. {
  19108. name: "show",
  19109. rawName: "v-show",
  19110. value: _vm.visible,
  19111. expression: "visible"
  19112. }
  19113. ],
  19114. staticClass: "el-message-box__wrapper",
  19115. attrs: {
  19116. tabindex: "-1",
  19117. role: "dialog",
  19118. "aria-modal": "true",
  19119. "aria-label": _vm.title || "dialog"
  19120. },
  19121. on: {
  19122. click: function($event) {
  19123. if ($event.target !== $event.currentTarget) {
  19124. return null
  19125. }
  19126. return _vm.handleWrapperClick($event)
  19127. }
  19128. }
  19129. },
  19130. [
  19131. _c(
  19132. "div",
  19133. {
  19134. staticClass: "el-message-box",
  19135. class: [_vm.customClass, _vm.center && "el-message-box--center"]
  19136. },
  19137. [
  19138. _vm.title !== null
  19139. ? _c("div", { staticClass: "el-message-box__header" }, [
  19140. _c("div", { staticClass: "el-message-box__title" }, [
  19141. _vm.icon && _vm.center
  19142. ? _c("div", {
  19143. class: ["el-message-box__status", _vm.icon]
  19144. })
  19145. : _vm._e(),
  19146. _c("span", [_vm._v(_vm._s(_vm.title))])
  19147. ]),
  19148. _vm.showClose
  19149. ? _c(
  19150. "button",
  19151. {
  19152. staticClass: "el-message-box__headerbtn",
  19153. attrs: { type: "button", "aria-label": "Close" },
  19154. on: {
  19155. click: function($event) {
  19156. _vm.handleAction(
  19157. _vm.distinguishCancelAndClose
  19158. ? "close"
  19159. : "cancel"
  19160. )
  19161. },
  19162. keydown: function($event) {
  19163. if (
  19164. !("button" in $event) &&
  19165. _vm._k(
  19166. $event.keyCode,
  19167. "enter",
  19168. 13,
  19169. $event.key,
  19170. "Enter"
  19171. )
  19172. ) {
  19173. return null
  19174. }
  19175. _vm.handleAction(
  19176. _vm.distinguishCancelAndClose
  19177. ? "close"
  19178. : "cancel"
  19179. )
  19180. }
  19181. }
  19182. },
  19183. [
  19184. _c("i", {
  19185. staticClass: "el-message-box__close el-icon-close"
  19186. })
  19187. ]
  19188. )
  19189. : _vm._e()
  19190. ])
  19191. : _vm._e(),
  19192. _c("div", { staticClass: "el-message-box__content" }, [
  19193. _vm.icon && !_vm.center && _vm.message !== ""
  19194. ? _c("div", { class: ["el-message-box__status", _vm.icon] })
  19195. : _vm._e(),
  19196. _vm.message !== ""
  19197. ? _c(
  19198. "div",
  19199. { staticClass: "el-message-box__message" },
  19200. [
  19201. _vm._t("default", [
  19202. !_vm.dangerouslyUseHTMLString
  19203. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  19204. : _c("p", {
  19205. domProps: { innerHTML: _vm._s(_vm.message) }
  19206. })
  19207. ])
  19208. ],
  19209. 2
  19210. )
  19211. : _vm._e(),
  19212. _c(
  19213. "div",
  19214. {
  19215. directives: [
  19216. {
  19217. name: "show",
  19218. rawName: "v-show",
  19219. value: _vm.showInput,
  19220. expression: "showInput"
  19221. }
  19222. ],
  19223. staticClass: "el-message-box__input"
  19224. },
  19225. [
  19226. _c("el-input", {
  19227. ref: "input",
  19228. attrs: {
  19229. type: _vm.inputType,
  19230. placeholder: _vm.inputPlaceholder
  19231. },
  19232. nativeOn: {
  19233. keydown: function($event) {
  19234. if (
  19235. !("button" in $event) &&
  19236. _vm._k(
  19237. $event.keyCode,
  19238. "enter",
  19239. 13,
  19240. $event.key,
  19241. "Enter"
  19242. )
  19243. ) {
  19244. return null
  19245. }
  19246. return _vm.handleInputEnter($event)
  19247. }
  19248. },
  19249. model: {
  19250. value: _vm.inputValue,
  19251. callback: function($$v) {
  19252. _vm.inputValue = $$v
  19253. },
  19254. expression: "inputValue"
  19255. }
  19256. }),
  19257. _c(
  19258. "div",
  19259. {
  19260. staticClass: "el-message-box__errormsg",
  19261. style: {
  19262. visibility: !!_vm.editorErrorMessage
  19263. ? "visible"
  19264. : "hidden"
  19265. }
  19266. },
  19267. [_vm._v(_vm._s(_vm.editorErrorMessage))]
  19268. )
  19269. ],
  19270. 1
  19271. )
  19272. ]),
  19273. _c(
  19274. "div",
  19275. { staticClass: "el-message-box__btns" },
  19276. [
  19277. _vm.showCancelButton
  19278. ? _c(
  19279. "el-button",
  19280. {
  19281. class: [_vm.cancelButtonClasses],
  19282. attrs: {
  19283. loading: _vm.cancelButtonLoading,
  19284. round: _vm.roundButton,
  19285. size: "small"
  19286. },
  19287. on: {
  19288. keydown: function($event) {
  19289. if (
  19290. !("button" in $event) &&
  19291. _vm._k(
  19292. $event.keyCode,
  19293. "enter",
  19294. 13,
  19295. $event.key,
  19296. "Enter"
  19297. )
  19298. ) {
  19299. return null
  19300. }
  19301. _vm.handleAction("cancel")
  19302. }
  19303. },
  19304. nativeOn: {
  19305. click: function($event) {
  19306. _vm.handleAction("cancel")
  19307. }
  19308. }
  19309. },
  19310. [
  19311. _vm._v(
  19312. "\n " +
  19313. _vm._s(
  19314. _vm.cancelButtonText ||
  19315. _vm.t("el.messagebox.cancel")
  19316. ) +
  19317. "\n "
  19318. )
  19319. ]
  19320. )
  19321. : _vm._e(),
  19322. _c(
  19323. "el-button",
  19324. {
  19325. directives: [
  19326. {
  19327. name: "show",
  19328. rawName: "v-show",
  19329. value: _vm.showConfirmButton,
  19330. expression: "showConfirmButton"
  19331. }
  19332. ],
  19333. ref: "confirm",
  19334. class: [_vm.confirmButtonClasses],
  19335. attrs: {
  19336. loading: _vm.confirmButtonLoading,
  19337. round: _vm.roundButton,
  19338. size: "small"
  19339. },
  19340. on: {
  19341. keydown: function($event) {
  19342. if (
  19343. !("button" in $event) &&
  19344. _vm._k(
  19345. $event.keyCode,
  19346. "enter",
  19347. 13,
  19348. $event.key,
  19349. "Enter"
  19350. )
  19351. ) {
  19352. return null
  19353. }
  19354. _vm.handleAction("confirm")
  19355. }
  19356. },
  19357. nativeOn: {
  19358. click: function($event) {
  19359. _vm.handleAction("confirm")
  19360. }
  19361. }
  19362. },
  19363. [
  19364. _vm._v(
  19365. "\n " +
  19366. _vm._s(
  19367. _vm.confirmButtonText ||
  19368. _vm.t("el.messagebox.confirm")
  19369. ) +
  19370. "\n "
  19371. )
  19372. ]
  19373. )
  19374. ],
  19375. 1
  19376. )
  19377. ]
  19378. )
  19379. ]
  19380. )
  19381. ])
  19382. }
  19383. var mainvue_type_template_id_6b29b012_staticRenderFns = []
  19384. mainvue_type_template_id_6b29b012_render._withStripped = true
  19385. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  19386. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-dialog"
  19387. var aria_dialog_ = __webpack_require__(37);
  19388. var aria_dialog_default = /*#__PURE__*/__webpack_require__.n(aria_dialog_);
  19389. // 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&
  19390. //
  19391. //
  19392. //
  19393. //
  19394. //
  19395. //
  19396. //
  19397. //
  19398. //
  19399. //
  19400. //
  19401. //
  19402. //
  19403. //
  19404. //
  19405. //
  19406. //
  19407. //
  19408. //
  19409. //
  19410. //
  19411. //
  19412. //
  19413. //
  19414. //
  19415. //
  19416. //
  19417. //
  19418. //
  19419. //
  19420. //
  19421. //
  19422. //
  19423. //
  19424. //
  19425. //
  19426. //
  19427. //
  19428. //
  19429. //
  19430. //
  19431. //
  19432. //
  19433. //
  19434. //
  19435. //
  19436. //
  19437. //
  19438. //
  19439. //
  19440. //
  19441. //
  19442. //
  19443. //
  19444. //
  19445. //
  19446. //
  19447. //
  19448. //
  19449. //
  19450. //
  19451. //
  19452. //
  19453. //
  19454. //
  19455. //
  19456. //
  19457. //
  19458. //
  19459. //
  19460. //
  19461. //
  19462. //
  19463. //
  19464. //
  19465. //
  19466. //
  19467. //
  19468. var messageBox = void 0;
  19469. var typeMap = {
  19470. success: 'success',
  19471. info: 'info',
  19472. warning: 'warning',
  19473. error: 'error'
  19474. };
  19475. /* harmony default export */ var message_box_src_mainvue_type_script_lang_js_ = ({
  19476. mixins: [popup_default.a, locale_default.a],
  19477. props: {
  19478. modal: {
  19479. default: true
  19480. },
  19481. lockScroll: {
  19482. default: true
  19483. },
  19484. showClose: {
  19485. type: Boolean,
  19486. default: true
  19487. },
  19488. closeOnClickModal: {
  19489. default: true
  19490. },
  19491. closeOnPressEscape: {
  19492. default: true
  19493. },
  19494. closeOnHashChange: {
  19495. default: true
  19496. },
  19497. center: {
  19498. default: false,
  19499. type: Boolean
  19500. },
  19501. roundButton: {
  19502. default: false,
  19503. type: Boolean
  19504. }
  19505. },
  19506. components: {
  19507. ElInput: input_default.a,
  19508. ElButton: button_default.a
  19509. },
  19510. computed: {
  19511. icon: function icon() {
  19512. var type = this.type,
  19513. iconClass = this.iconClass;
  19514. return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
  19515. },
  19516. confirmButtonClasses: function confirmButtonClasses() {
  19517. return 'el-button--primary ' + this.confirmButtonClass;
  19518. },
  19519. cancelButtonClasses: function cancelButtonClasses() {
  19520. return '' + this.cancelButtonClass;
  19521. }
  19522. },
  19523. methods: {
  19524. getSafeClose: function getSafeClose() {
  19525. var _this = this;
  19526. var currentId = this.uid;
  19527. return function () {
  19528. _this.$nextTick(function () {
  19529. if (currentId === _this.uid) _this.doClose();
  19530. });
  19531. };
  19532. },
  19533. doClose: function doClose() {
  19534. var _this2 = this;
  19535. if (!this.visible) return;
  19536. this.visible = false;
  19537. this._closing = true;
  19538. this.onClose && this.onClose();
  19539. messageBox.closeDialog(); // 解绑
  19540. if (this.lockScroll) {
  19541. setTimeout(this.restoreBodyStyle, 200);
  19542. }
  19543. this.opened = false;
  19544. this.doAfterClose();
  19545. setTimeout(function () {
  19546. if (_this2.action) _this2.callback(_this2.action, _this2);
  19547. });
  19548. },
  19549. handleWrapperClick: function handleWrapperClick() {
  19550. if (this.closeOnClickModal) {
  19551. this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
  19552. }
  19553. },
  19554. handleInputEnter: function handleInputEnter() {
  19555. if (this.inputType !== 'textarea') {
  19556. return this.handleAction('confirm');
  19557. }
  19558. },
  19559. handleAction: function handleAction(action) {
  19560. if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
  19561. return;
  19562. }
  19563. this.action = action;
  19564. if (typeof this.beforeClose === 'function') {
  19565. this.close = this.getSafeClose();
  19566. this.beforeClose(action, this, this.close);
  19567. } else {
  19568. this.doClose();
  19569. }
  19570. },
  19571. validate: function validate() {
  19572. if (this.$type === 'prompt') {
  19573. var inputPattern = this.inputPattern;
  19574. if (inputPattern && !inputPattern.test(this.inputValue || '')) {
  19575. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  19576. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  19577. return false;
  19578. }
  19579. var inputValidator = this.inputValidator;
  19580. if (typeof inputValidator === 'function') {
  19581. var validateResult = inputValidator(this.inputValue);
  19582. if (validateResult === false) {
  19583. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  19584. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  19585. return false;
  19586. }
  19587. if (typeof validateResult === 'string') {
  19588. this.editorErrorMessage = validateResult;
  19589. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  19590. return false;
  19591. }
  19592. }
  19593. }
  19594. this.editorErrorMessage = '';
  19595. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  19596. return true;
  19597. },
  19598. getFirstFocus: function getFirstFocus() {
  19599. var btn = this.$el.querySelector('.el-message-box__btns .el-button');
  19600. var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
  19601. return btn || title;
  19602. },
  19603. getInputElement: function getInputElement() {
  19604. var inputRefs = this.$refs.input.$refs;
  19605. return inputRefs.input || inputRefs.textarea;
  19606. }
  19607. },
  19608. watch: {
  19609. inputValue: {
  19610. immediate: true,
  19611. handler: function handler(val) {
  19612. var _this3 = this;
  19613. this.$nextTick(function (_) {
  19614. if (_this3.$type === 'prompt' && val !== null) {
  19615. _this3.validate();
  19616. }
  19617. });
  19618. }
  19619. },
  19620. visible: function visible(val) {
  19621. var _this4 = this;
  19622. if (val) {
  19623. this.uid++;
  19624. if (this.$type === 'alert' || this.$type === 'confirm') {
  19625. this.$nextTick(function () {
  19626. _this4.$refs.confirm.$el.focus();
  19627. });
  19628. }
  19629. this.focusAfterClosed = document.activeElement;
  19630. messageBox = new aria_dialog_default.a(this.$el, this.focusAfterClosed, this.getFirstFocus());
  19631. }
  19632. // prompt
  19633. if (this.$type !== 'prompt') return;
  19634. if (val) {
  19635. setTimeout(function () {
  19636. if (_this4.$refs.input && _this4.$refs.input.$el) {
  19637. _this4.getInputElement().focus();
  19638. }
  19639. }, 500);
  19640. } else {
  19641. this.editorErrorMessage = '';
  19642. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  19643. }
  19644. }
  19645. },
  19646. mounted: function mounted() {
  19647. var _this5 = this;
  19648. this.$nextTick(function () {
  19649. if (_this5.closeOnHashChange) {
  19650. window.addEventListener('hashchange', _this5.close);
  19651. }
  19652. });
  19653. },
  19654. beforeDestroy: function beforeDestroy() {
  19655. if (this.closeOnHashChange) {
  19656. window.removeEventListener('hashchange', this.close);
  19657. }
  19658. setTimeout(function () {
  19659. messageBox.closeDialog();
  19660. });
  19661. },
  19662. data: function data() {
  19663. return {
  19664. uid: 1,
  19665. title: undefined,
  19666. message: '',
  19667. type: '',
  19668. iconClass: '',
  19669. customClass: '',
  19670. showInput: false,
  19671. inputValue: null,
  19672. inputPlaceholder: '',
  19673. inputType: 'text',
  19674. inputPattern: null,
  19675. inputValidator: null,
  19676. inputErrorMessage: '',
  19677. showConfirmButton: true,
  19678. showCancelButton: false,
  19679. action: '',
  19680. confirmButtonText: '',
  19681. cancelButtonText: '',
  19682. confirmButtonLoading: false,
  19683. cancelButtonLoading: false,
  19684. confirmButtonClass: '',
  19685. confirmButtonDisabled: false,
  19686. cancelButtonClass: '',
  19687. editorErrorMessage: null,
  19688. callback: null,
  19689. dangerouslyUseHTMLString: false,
  19690. focusAfterClosed: null,
  19691. isOnComposition: false,
  19692. distinguishCancelAndClose: false
  19693. };
  19694. }
  19695. });
  19696. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=script&lang=js&
  19697. /* harmony default export */ var packages_message_box_src_mainvue_type_script_lang_js_ = (message_box_src_mainvue_type_script_lang_js_);
  19698. // CONCATENATED MODULE: ./packages/message-box/src/main.vue
  19699. /* normalize component */
  19700. var src_main_component = normalizeComponent(
  19701. packages_message_box_src_mainvue_type_script_lang_js_,
  19702. mainvue_type_template_id_6b29b012_render,
  19703. mainvue_type_template_id_6b29b012_staticRenderFns,
  19704. false,
  19705. null,
  19706. null,
  19707. null
  19708. )
  19709. /* hot reload */
  19710. if (false) { var src_main_api; }
  19711. src_main_component.options.__file = "packages/message-box/src/main.vue"
  19712. /* harmony default export */ var message_box_src_main = (src_main_component.exports);
  19713. // EXTERNAL MODULE: external "element-ui/lib/utils/vdom"
  19714. var vdom_ = __webpack_require__(21);
  19715. // CONCATENATED MODULE: ./packages/message-box/src/main.js
  19716. 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; };
  19717. var main_defaults = {
  19718. title: null,
  19719. message: '',
  19720. type: '',
  19721. iconClass: '',
  19722. showInput: false,
  19723. showClose: true,
  19724. modalFade: true,
  19725. lockScroll: true,
  19726. closeOnClickModal: true,
  19727. closeOnPressEscape: true,
  19728. closeOnHashChange: true,
  19729. inputValue: null,
  19730. inputPlaceholder: '',
  19731. inputType: 'text',
  19732. inputPattern: null,
  19733. inputValidator: null,
  19734. inputErrorMessage: '',
  19735. showConfirmButton: true,
  19736. showCancelButton: false,
  19737. confirmButtonPosition: 'right',
  19738. confirmButtonHighlight: false,
  19739. cancelButtonHighlight: false,
  19740. confirmButtonText: '',
  19741. cancelButtonText: '',
  19742. confirmButtonClass: '',
  19743. cancelButtonClass: '',
  19744. customClass: '',
  19745. beforeClose: null,
  19746. dangerouslyUseHTMLString: false,
  19747. center: false,
  19748. roundButton: false,
  19749. distinguishCancelAndClose: false
  19750. };
  19751. var MessageBoxConstructor = external_vue_default.a.extend(message_box_src_main);
  19752. var currentMsg = void 0,
  19753. main_instance = void 0;
  19754. var msgQueue = [];
  19755. var defaultCallback = function defaultCallback(action) {
  19756. if (currentMsg) {
  19757. var callback = currentMsg.callback;
  19758. if (typeof callback === 'function') {
  19759. if (main_instance.showInput) {
  19760. callback(main_instance.inputValue, action);
  19761. } else {
  19762. callback(action);
  19763. }
  19764. }
  19765. if (currentMsg.resolve) {
  19766. if (action === 'confirm') {
  19767. if (main_instance.showInput) {
  19768. currentMsg.resolve({ value: main_instance.inputValue, action: action });
  19769. } else {
  19770. currentMsg.resolve(action);
  19771. }
  19772. } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
  19773. currentMsg.reject(action);
  19774. }
  19775. }
  19776. }
  19777. };
  19778. var initInstance = function initInstance() {
  19779. main_instance = new MessageBoxConstructor({
  19780. el: document.createElement('div')
  19781. });
  19782. main_instance.callback = defaultCallback;
  19783. };
  19784. var main_showNextMsg = function showNextMsg() {
  19785. if (!main_instance) {
  19786. initInstance();
  19787. }
  19788. main_instance.action = '';
  19789. if (!main_instance.visible || main_instance.closeTimer) {
  19790. if (msgQueue.length > 0) {
  19791. currentMsg = msgQueue.shift();
  19792. var options = currentMsg.options;
  19793. for (var prop in options) {
  19794. if (options.hasOwnProperty(prop)) {
  19795. main_instance[prop] = options[prop];
  19796. }
  19797. }
  19798. if (options.callback === undefined) {
  19799. main_instance.callback = defaultCallback;
  19800. }
  19801. var oldCb = main_instance.callback;
  19802. main_instance.callback = function (action, instance) {
  19803. oldCb(action, instance);
  19804. showNextMsg();
  19805. };
  19806. if (Object(vdom_["isVNode"])(main_instance.message)) {
  19807. main_instance.$slots.default = [main_instance.message];
  19808. main_instance.message = null;
  19809. } else {
  19810. delete main_instance.$slots.default;
  19811. }
  19812. ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
  19813. if (main_instance[prop] === undefined) {
  19814. main_instance[prop] = true;
  19815. }
  19816. });
  19817. document.body.appendChild(main_instance.$el);
  19818. external_vue_default.a.nextTick(function () {
  19819. main_instance.visible = true;
  19820. });
  19821. }
  19822. }
  19823. };
  19824. var main_MessageBox = function MessageBox(options, callback) {
  19825. if (external_vue_default.a.prototype.$isServer) return;
  19826. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  19827. options = {
  19828. message: options
  19829. };
  19830. if (typeof arguments[1] === 'string') {
  19831. options.title = arguments[1];
  19832. }
  19833. } else if (options.callback && !callback) {
  19834. callback = options.callback;
  19835. }
  19836. if (typeof Promise !== 'undefined') {
  19837. return new Promise(function (resolve, reject) {
  19838. // eslint-disable-line
  19839. msgQueue.push({
  19840. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  19841. callback: callback,
  19842. resolve: resolve,
  19843. reject: reject
  19844. });
  19845. main_showNextMsg();
  19846. });
  19847. } else {
  19848. msgQueue.push({
  19849. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  19850. callback: callback
  19851. });
  19852. main_showNextMsg();
  19853. }
  19854. };
  19855. main_MessageBox.setDefaults = function (defaults) {
  19856. main_MessageBox.defaults = defaults;
  19857. };
  19858. main_MessageBox.alert = function (message, title, options) {
  19859. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  19860. options = title;
  19861. title = '';
  19862. } else if (title === undefined) {
  19863. title = '';
  19864. }
  19865. return main_MessageBox(merge_default()({
  19866. title: title,
  19867. message: message,
  19868. $type: 'alert',
  19869. closeOnPressEscape: false,
  19870. closeOnClickModal: false
  19871. }, options));
  19872. };
  19873. main_MessageBox.confirm = function (message, title, options) {
  19874. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  19875. options = title;
  19876. title = '';
  19877. } else if (title === undefined) {
  19878. title = '';
  19879. }
  19880. return main_MessageBox(merge_default()({
  19881. title: title,
  19882. message: message,
  19883. $type: 'confirm',
  19884. showCancelButton: true
  19885. }, options));
  19886. };
  19887. main_MessageBox.prompt = function (message, title, options) {
  19888. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  19889. options = title;
  19890. title = '';
  19891. } else if (title === undefined) {
  19892. title = '';
  19893. }
  19894. return main_MessageBox(merge_default()({
  19895. title: title,
  19896. message: message,
  19897. showCancelButton: true,
  19898. showInput: true,
  19899. $type: 'prompt'
  19900. }, options));
  19901. };
  19902. main_MessageBox.close = function () {
  19903. main_instance.doClose();
  19904. main_instance.visible = false;
  19905. msgQueue = [];
  19906. currentMsg = null;
  19907. };
  19908. /* harmony default export */ var packages_message_box_src_main = (main_MessageBox);
  19909. // CONCATENATED MODULE: ./packages/message-box/index.js
  19910. /* harmony default export */ var message_box = (packages_message_box_src_main);
  19911. // 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&
  19912. var breadcrumbvue_type_template_id_4b464c06_render = function() {
  19913. var _vm = this
  19914. var _h = _vm.$createElement
  19915. var _c = _vm._self._c || _h
  19916. return _c(
  19917. "div",
  19918. {
  19919. staticClass: "el-breadcrumb",
  19920. attrs: { "aria-label": "Breadcrumb", role: "navigation" }
  19921. },
  19922. [_vm._t("default")],
  19923. 2
  19924. )
  19925. }
  19926. var breadcrumbvue_type_template_id_4b464c06_staticRenderFns = []
  19927. breadcrumbvue_type_template_id_4b464c06_render._withStripped = true
  19928. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=template&id=4b464c06&
  19929. // 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&
  19930. //
  19931. //
  19932. //
  19933. //
  19934. //
  19935. /* harmony default export */ var breadcrumbvue_type_script_lang_js_ = ({
  19936. name: 'ElBreadcrumb',
  19937. props: {
  19938. separator: {
  19939. type: String,
  19940. default: '/'
  19941. },
  19942. separatorClass: {
  19943. type: String,
  19944. default: ''
  19945. }
  19946. },
  19947. provide: function provide() {
  19948. return {
  19949. elBreadcrumb: this
  19950. };
  19951. },
  19952. mounted: function mounted() {
  19953. var items = this.$el.querySelectorAll('.el-breadcrumb__item');
  19954. if (items.length) {
  19955. items[items.length - 1].setAttribute('aria-current', 'page');
  19956. }
  19957. }
  19958. });
  19959. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=script&lang=js&
  19960. /* harmony default export */ var src_breadcrumbvue_type_script_lang_js_ = (breadcrumbvue_type_script_lang_js_);
  19961. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue
  19962. /* normalize component */
  19963. var breadcrumb_component = normalizeComponent(
  19964. src_breadcrumbvue_type_script_lang_js_,
  19965. breadcrumbvue_type_template_id_4b464c06_render,
  19966. breadcrumbvue_type_template_id_4b464c06_staticRenderFns,
  19967. false,
  19968. null,
  19969. null,
  19970. null
  19971. )
  19972. /* hot reload */
  19973. if (false) { var breadcrumb_api; }
  19974. breadcrumb_component.options.__file = "packages/breadcrumb/src/breadcrumb.vue"
  19975. /* harmony default export */ var breadcrumb = (breadcrumb_component.exports);
  19976. // CONCATENATED MODULE: ./packages/breadcrumb/index.js
  19977. /* istanbul ignore next */
  19978. breadcrumb.install = function (Vue) {
  19979. Vue.component(breadcrumb.name, breadcrumb);
  19980. };
  19981. /* harmony default export */ var packages_breadcrumb = (breadcrumb);
  19982. // 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&
  19983. var breadcrumb_itemvue_type_template_id_fcf9eaac_render = function() {
  19984. var _vm = this
  19985. var _h = _vm.$createElement
  19986. var _c = _vm._self._c || _h
  19987. return _c("span", { staticClass: "el-breadcrumb__item" }, [
  19988. _c(
  19989. "span",
  19990. {
  19991. ref: "link",
  19992. class: ["el-breadcrumb__inner", _vm.to ? "is-link" : ""],
  19993. attrs: { role: "link" }
  19994. },
  19995. [_vm._t("default")],
  19996. 2
  19997. ),
  19998. _vm.separatorClass
  19999. ? _c("i", {
  20000. staticClass: "el-breadcrumb__separator",
  20001. class: _vm.separatorClass
  20002. })
  20003. : _c(
  20004. "span",
  20005. {
  20006. staticClass: "el-breadcrumb__separator",
  20007. attrs: { role: "presentation" }
  20008. },
  20009. [_vm._v(_vm._s(_vm.separator))]
  20010. )
  20011. ])
  20012. }
  20013. var breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns = []
  20014. breadcrumb_itemvue_type_template_id_fcf9eaac_render._withStripped = true
  20015. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=template&id=fcf9eaac&
  20016. // 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&
  20017. //
  20018. //
  20019. //
  20020. //
  20021. //
  20022. //
  20023. //
  20024. //
  20025. //
  20026. //
  20027. //
  20028. //
  20029. /* harmony default export */ var breadcrumb_itemvue_type_script_lang_js_ = ({
  20030. name: 'ElBreadcrumbItem',
  20031. props: {
  20032. to: {},
  20033. replace: Boolean
  20034. },
  20035. data: function data() {
  20036. return {
  20037. separator: '',
  20038. separatorClass: ''
  20039. };
  20040. },
  20041. inject: ['elBreadcrumb'],
  20042. mounted: function mounted() {
  20043. var _this = this;
  20044. this.separator = this.elBreadcrumb.separator;
  20045. this.separatorClass = this.elBreadcrumb.separatorClass;
  20046. var link = this.$refs.link;
  20047. link.setAttribute('role', 'link');
  20048. link.addEventListener('click', function (_) {
  20049. var to = _this.to,
  20050. $router = _this.$router;
  20051. if (!to || !$router) return;
  20052. _this.replace ? $router.replace(to) : $router.push(to);
  20053. });
  20054. }
  20055. });
  20056. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=script&lang=js&
  20057. /* harmony default export */ var src_breadcrumb_itemvue_type_script_lang_js_ = (breadcrumb_itemvue_type_script_lang_js_);
  20058. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue
  20059. /* normalize component */
  20060. var breadcrumb_item_component = normalizeComponent(
  20061. src_breadcrumb_itemvue_type_script_lang_js_,
  20062. breadcrumb_itemvue_type_template_id_fcf9eaac_render,
  20063. breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns,
  20064. false,
  20065. null,
  20066. null,
  20067. null
  20068. )
  20069. /* hot reload */
  20070. if (false) { var breadcrumb_item_api; }
  20071. breadcrumb_item_component.options.__file = "packages/breadcrumb/src/breadcrumb-item.vue"
  20072. /* harmony default export */ var breadcrumb_item = (breadcrumb_item_component.exports);
  20073. // CONCATENATED MODULE: ./packages/breadcrumb-item/index.js
  20074. /* istanbul ignore next */
  20075. breadcrumb_item.install = function (Vue) {
  20076. Vue.component(breadcrumb_item.name, breadcrumb_item);
  20077. };
  20078. /* harmony default export */ var packages_breadcrumb_item = (breadcrumb_item);
  20079. // 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&
  20080. var formvue_type_template_id_a1b5ff34_render = function() {
  20081. var _vm = this
  20082. var _h = _vm.$createElement
  20083. var _c = _vm._self._c || _h
  20084. return _c(
  20085. "form",
  20086. {
  20087. staticClass: "el-form",
  20088. class: [
  20089. _vm.labelPosition ? "el-form--label-" + _vm.labelPosition : "",
  20090. { "el-form--inline": _vm.inline }
  20091. ]
  20092. },
  20093. [_vm._t("default")],
  20094. 2
  20095. )
  20096. }
  20097. var formvue_type_template_id_a1b5ff34_staticRenderFns = []
  20098. formvue_type_template_id_a1b5ff34_render._withStripped = true
  20099. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=template&id=a1b5ff34&
  20100. // 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&
  20101. //
  20102. //
  20103. //
  20104. //
  20105. //
  20106. //
  20107. //
  20108. //
  20109. /* harmony default export */ var formvue_type_script_lang_js_ = ({
  20110. name: 'ElForm',
  20111. componentName: 'ElForm',
  20112. provide: function provide() {
  20113. return {
  20114. elForm: this
  20115. };
  20116. },
  20117. props: {
  20118. model: Object,
  20119. rules: Object,
  20120. labelPosition: String,
  20121. labelWidth: String,
  20122. labelSuffix: {
  20123. type: String,
  20124. default: ''
  20125. },
  20126. inline: Boolean,
  20127. inlineMessage: Boolean,
  20128. statusIcon: Boolean,
  20129. showMessage: {
  20130. type: Boolean,
  20131. default: true
  20132. },
  20133. size: String,
  20134. disabled: Boolean,
  20135. validateOnRuleChange: {
  20136. type: Boolean,
  20137. default: true
  20138. },
  20139. hideRequiredAsterisk: {
  20140. type: Boolean,
  20141. default: false
  20142. }
  20143. },
  20144. watch: {
  20145. rules: function rules() {
  20146. // remove then add event listeners on form-item after form rules change
  20147. this.fields.forEach(function (field) {
  20148. field.removeValidateEvents();
  20149. field.addValidateEvents();
  20150. });
  20151. if (this.validateOnRuleChange) {
  20152. this.validate(function () {});
  20153. }
  20154. }
  20155. },
  20156. computed: {
  20157. autoLabelWidth: function autoLabelWidth() {
  20158. if (!this.potentialLabelWidthArr.length) return 0;
  20159. var max = Math.max.apply(Math, this.potentialLabelWidthArr);
  20160. return max ? max + 'px' : '';
  20161. }
  20162. },
  20163. data: function data() {
  20164. return {
  20165. fields: [],
  20166. potentialLabelWidthArr: [] // use this array to calculate auto width
  20167. };
  20168. },
  20169. created: function created() {
  20170. var _this = this;
  20171. this.$on('el.form.addField', function (field) {
  20172. if (field) {
  20173. _this.fields.push(field);
  20174. }
  20175. });
  20176. /* istanbul ignore next */
  20177. this.$on('el.form.removeField', function (field) {
  20178. if (field.prop) {
  20179. _this.fields.splice(_this.fields.indexOf(field), 1);
  20180. }
  20181. });
  20182. },
  20183. methods: {
  20184. resetFields: function resetFields() {
  20185. if (!this.model) {
  20186. console.warn('[Element Warn][Form]model is required for resetFields to work.');
  20187. return;
  20188. }
  20189. this.fields.forEach(function (field) {
  20190. field.resetField();
  20191. });
  20192. },
  20193. clearValidate: function clearValidate() {
  20194. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  20195. var fields = props.length ? typeof props === 'string' ? this.fields.filter(function (field) {
  20196. return props === field.prop;
  20197. }) : this.fields.filter(function (field) {
  20198. return props.indexOf(field.prop) > -1;
  20199. }) : this.fields;
  20200. fields.forEach(function (field) {
  20201. field.clearValidate();
  20202. });
  20203. },
  20204. validate: function validate(callback) {
  20205. var _this2 = this;
  20206. if (!this.model) {
  20207. console.warn('[Element Warn][Form]model is required for validate to work!');
  20208. return;
  20209. }
  20210. var promise = void 0;
  20211. // if no callback, return promise
  20212. if (typeof callback !== 'function' && window.Promise) {
  20213. promise = new window.Promise(function (resolve, reject) {
  20214. callback = function callback(valid) {
  20215. valid ? resolve(valid) : reject(valid);
  20216. };
  20217. });
  20218. }
  20219. var valid = true;
  20220. var count = 0;
  20221. // 如果需要验证的fields为空,调用验证时立刻返回callback
  20222. if (this.fields.length === 0 && callback) {
  20223. callback(true);
  20224. }
  20225. var invalidFields = {};
  20226. this.fields.forEach(function (field) {
  20227. field.validate('', function (message, field) {
  20228. if (message) {
  20229. valid = false;
  20230. }
  20231. invalidFields = merge_default()({}, invalidFields, field);
  20232. if (typeof callback === 'function' && ++count === _this2.fields.length) {
  20233. callback(valid, invalidFields);
  20234. }
  20235. });
  20236. });
  20237. if (promise) {
  20238. return promise;
  20239. }
  20240. },
  20241. validateField: function validateField(props, cb) {
  20242. props = [].concat(props);
  20243. var fields = this.fields.filter(function (field) {
  20244. return props.indexOf(field.prop) !== -1;
  20245. });
  20246. if (!fields.length) {
  20247. console.warn('[Element Warn]please pass correct props!');
  20248. return;
  20249. }
  20250. fields.forEach(function (field) {
  20251. field.validate('', cb);
  20252. });
  20253. },
  20254. getLabelWidthIndex: function getLabelWidthIndex(width) {
  20255. var index = this.potentialLabelWidthArr.indexOf(width);
  20256. // it's impossible
  20257. if (index === -1) {
  20258. throw new Error('[ElementForm]unpected width ', width);
  20259. }
  20260. return index;
  20261. },
  20262. registerLabelWidth: function registerLabelWidth(val, oldVal) {
  20263. if (val && oldVal) {
  20264. var index = this.getLabelWidthIndex(oldVal);
  20265. this.potentialLabelWidthArr.splice(index, 1, val);
  20266. } else if (val) {
  20267. this.potentialLabelWidthArr.push(val);
  20268. }
  20269. },
  20270. deregisterLabelWidth: function deregisterLabelWidth(val) {
  20271. var index = this.getLabelWidthIndex(val);
  20272. this.potentialLabelWidthArr.splice(index, 1);
  20273. }
  20274. }
  20275. });
  20276. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=script&lang=js&
  20277. /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
  20278. // CONCATENATED MODULE: ./packages/form/src/form.vue
  20279. /* normalize component */
  20280. var form_component = normalizeComponent(
  20281. src_formvue_type_script_lang_js_,
  20282. formvue_type_template_id_a1b5ff34_render,
  20283. formvue_type_template_id_a1b5ff34_staticRenderFns,
  20284. false,
  20285. null,
  20286. null,
  20287. null
  20288. )
  20289. /* hot reload */
  20290. if (false) { var form_api; }
  20291. form_component.options.__file = "packages/form/src/form.vue"
  20292. /* harmony default export */ var src_form = (form_component.exports);
  20293. // CONCATENATED MODULE: ./packages/form/index.js
  20294. /* istanbul ignore next */
  20295. src_form.install = function (Vue) {
  20296. Vue.component(src_form.name, src_form);
  20297. };
  20298. /* harmony default export */ var packages_form = (src_form);
  20299. // 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&
  20300. var form_itemvue_type_template_id_b6f3db6c_render = function() {
  20301. var _vm = this
  20302. var _h = _vm.$createElement
  20303. var _c = _vm._self._c || _h
  20304. return _c(
  20305. "div",
  20306. {
  20307. staticClass: "el-form-item",
  20308. class: [
  20309. {
  20310. "el-form-item--feedback": _vm.elForm && _vm.elForm.statusIcon,
  20311. "is-error": _vm.validateState === "error",
  20312. "is-validating": _vm.validateState === "validating",
  20313. "is-success": _vm.validateState === "success",
  20314. "is-required": _vm.isRequired || _vm.required,
  20315. "is-no-asterisk": _vm.elForm && _vm.elForm.hideRequiredAsterisk
  20316. },
  20317. _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""
  20318. ]
  20319. },
  20320. [
  20321. _c(
  20322. "label-wrap",
  20323. {
  20324. attrs: {
  20325. "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
  20326. "update-all": _vm.form.labelWidth === "auto"
  20327. }
  20328. },
  20329. [
  20330. _vm.label || _vm.$slots.label
  20331. ? _c(
  20332. "label",
  20333. {
  20334. staticClass: "el-form-item__label",
  20335. style: _vm.labelStyle,
  20336. attrs: { for: _vm.labelFor }
  20337. },
  20338. [
  20339. _vm._t("label", [
  20340. _vm._v(_vm._s(_vm.label + _vm.form.labelSuffix))
  20341. ])
  20342. ],
  20343. 2
  20344. )
  20345. : _vm._e()
  20346. ]
  20347. ),
  20348. _c(
  20349. "div",
  20350. { staticClass: "el-form-item__content", style: _vm.contentStyle },
  20351. [
  20352. _vm._t("default"),
  20353. _c(
  20354. "transition",
  20355. { attrs: { name: "el-zoom-in-top" } },
  20356. [
  20357. _vm.validateState === "error" &&
  20358. _vm.showMessage &&
  20359. _vm.form.showMessage
  20360. ? _vm._t(
  20361. "error",
  20362. [
  20363. _c(
  20364. "div",
  20365. {
  20366. staticClass: "el-form-item__error",
  20367. class: {
  20368. "el-form-item__error--inline":
  20369. typeof _vm.inlineMessage === "boolean"
  20370. ? _vm.inlineMessage
  20371. : (_vm.elForm && _vm.elForm.inlineMessage) ||
  20372. false
  20373. }
  20374. },
  20375. [
  20376. _vm._v(
  20377. "\n " +
  20378. _vm._s(_vm.validateMessage) +
  20379. "\n "
  20380. )
  20381. ]
  20382. )
  20383. ],
  20384. { error: _vm.validateMessage }
  20385. )
  20386. : _vm._e()
  20387. ],
  20388. 2
  20389. )
  20390. ],
  20391. 2
  20392. )
  20393. ],
  20394. 1
  20395. )
  20396. }
  20397. var form_itemvue_type_template_id_b6f3db6c_staticRenderFns = []
  20398. form_itemvue_type_template_id_b6f3db6c_render._withStripped = true
  20399. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=template&id=b6f3db6c&
  20400. // EXTERNAL MODULE: external "async-validator"
  20401. var external_async_validator_ = __webpack_require__(38);
  20402. var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
  20403. // 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&
  20404. /* harmony default export */ var label_wrapvue_type_script_lang_js_ = ({
  20405. props: {
  20406. isAutoWidth: Boolean,
  20407. updateAll: Boolean
  20408. },
  20409. inject: ['elForm', 'elFormItem'],
  20410. render: function render() {
  20411. var h = arguments[0];
  20412. var slots = this.$slots.default;
  20413. if (!slots) return null;
  20414. if (this.isAutoWidth) {
  20415. var autoLabelWidth = this.elForm.autoLabelWidth;
  20416. var style = {};
  20417. if (autoLabelWidth && autoLabelWidth !== 'auto') {
  20418. var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
  20419. if (marginLeft) {
  20420. style.marginLeft = marginLeft + 'px';
  20421. }
  20422. }
  20423. return h(
  20424. 'div',
  20425. { 'class': 'el-form-item__label-wrap', style: style },
  20426. [slots]
  20427. );
  20428. } else {
  20429. return slots[0];
  20430. }
  20431. },
  20432. methods: {
  20433. getLabelWidth: function getLabelWidth() {
  20434. if (this.$el && this.$el.firstElementChild) {
  20435. var computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
  20436. return Math.ceil(parseFloat(computedWidth));
  20437. } else {
  20438. return 0;
  20439. }
  20440. },
  20441. updateLabelWidth: function updateLabelWidth() {
  20442. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'update';
  20443. if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
  20444. if (action === 'update') {
  20445. this.computedWidth = this.getLabelWidth();
  20446. } else if (action === 'remove') {
  20447. this.elForm.deregisterLabelWidth(this.computedWidth);
  20448. }
  20449. }
  20450. }
  20451. },
  20452. watch: {
  20453. computedWidth: function computedWidth(val, oldVal) {
  20454. if (this.updateAll) {
  20455. this.elForm.registerLabelWidth(val, oldVal);
  20456. this.elFormItem.updateComputedLabelWidth(val);
  20457. }
  20458. }
  20459. },
  20460. data: function data() {
  20461. return {
  20462. computedWidth: 0
  20463. };
  20464. },
  20465. mounted: function mounted() {
  20466. this.updateLabelWidth('update');
  20467. },
  20468. updated: function updated() {
  20469. this.updateLabelWidth('update');
  20470. },
  20471. beforeDestroy: function beforeDestroy() {
  20472. this.updateLabelWidth('remove');
  20473. }
  20474. });
  20475. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue?vue&type=script&lang=js&
  20476. /* harmony default export */ var src_label_wrapvue_type_script_lang_js_ = (label_wrapvue_type_script_lang_js_);
  20477. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue
  20478. var label_wrap_render, label_wrap_staticRenderFns
  20479. /* normalize component */
  20480. var label_wrap_component = normalizeComponent(
  20481. src_label_wrapvue_type_script_lang_js_,
  20482. label_wrap_render,
  20483. label_wrap_staticRenderFns,
  20484. false,
  20485. null,
  20486. null,
  20487. null
  20488. )
  20489. /* hot reload */
  20490. if (false) { var label_wrap_api; }
  20491. label_wrap_component.options.__file = "packages/form/src/label-wrap.vue"
  20492. /* harmony default export */ var label_wrap = (label_wrap_component.exports);
  20493. // 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&
  20494. //
  20495. //
  20496. //
  20497. //
  20498. //
  20499. //
  20500. //
  20501. //
  20502. //
  20503. //
  20504. //
  20505. //
  20506. //
  20507. //
  20508. //
  20509. //
  20510. //
  20511. //
  20512. //
  20513. //
  20514. //
  20515. //
  20516. //
  20517. //
  20518. //
  20519. //
  20520. //
  20521. //
  20522. //
  20523. //
  20524. //
  20525. //
  20526. //
  20527. //
  20528. //
  20529. //
  20530. //
  20531. //
  20532. //
  20533. //
  20534. /* harmony default export */ var form_itemvue_type_script_lang_js_ = ({
  20535. name: 'ElFormItem',
  20536. componentName: 'ElFormItem',
  20537. mixins: [emitter_default.a],
  20538. provide: function provide() {
  20539. return {
  20540. elFormItem: this
  20541. };
  20542. },
  20543. inject: ['elForm'],
  20544. props: {
  20545. label: String,
  20546. labelWidth: String,
  20547. prop: String,
  20548. required: {
  20549. type: Boolean,
  20550. default: undefined
  20551. },
  20552. rules: [Object, Array],
  20553. error: String,
  20554. validateStatus: String,
  20555. for: String,
  20556. inlineMessage: {
  20557. type: [String, Boolean],
  20558. default: ''
  20559. },
  20560. showMessage: {
  20561. type: Boolean,
  20562. default: true
  20563. },
  20564. size: String
  20565. },
  20566. components: {
  20567. // use this component to calculate auto width
  20568. LabelWrap: label_wrap
  20569. },
  20570. watch: {
  20571. error: {
  20572. immediate: true,
  20573. handler: function handler(value) {
  20574. this.validateMessage = value;
  20575. this.validateState = value ? 'error' : '';
  20576. }
  20577. },
  20578. validateStatus: function validateStatus(value) {
  20579. this.validateState = value;
  20580. }
  20581. },
  20582. computed: {
  20583. labelFor: function labelFor() {
  20584. return this.for || this.prop;
  20585. },
  20586. labelStyle: function labelStyle() {
  20587. var ret = {};
  20588. if (this.form.labelPosition === 'top') return ret;
  20589. var labelWidth = this.labelWidth || this.form.labelWidth;
  20590. if (labelWidth) {
  20591. ret.width = labelWidth;
  20592. }
  20593. return ret;
  20594. },
  20595. contentStyle: function contentStyle() {
  20596. var ret = {};
  20597. var label = this.label;
  20598. if (this.form.labelPosition === 'top' || this.form.inline) return ret;
  20599. if (!label && !this.labelWidth && this.isNested) return ret;
  20600. var labelWidth = this.labelWidth || this.form.labelWidth;
  20601. if (labelWidth === 'auto') {
  20602. if (this.labelWidth === 'auto') {
  20603. ret.marginLeft = this.computedLabelWidth;
  20604. } else if (this.form.labelWidth === 'auto') {
  20605. ret.marginLeft = this.elForm.autoLabelWidth;
  20606. }
  20607. } else {
  20608. ret.marginLeft = labelWidth;
  20609. }
  20610. return ret;
  20611. },
  20612. form: function form() {
  20613. var parent = this.$parent;
  20614. var parentName = parent.$options.componentName;
  20615. while (parentName !== 'ElForm') {
  20616. if (parentName === 'ElFormItem') {
  20617. this.isNested = true;
  20618. }
  20619. parent = parent.$parent;
  20620. parentName = parent.$options.componentName;
  20621. }
  20622. return parent;
  20623. },
  20624. fieldValue: function fieldValue() {
  20625. var model = this.form.model;
  20626. if (!model || !this.prop) {
  20627. return;
  20628. }
  20629. var path = this.prop;
  20630. if (path.indexOf(':') !== -1) {
  20631. path = path.replace(/:/, '.');
  20632. }
  20633. return Object(util_["getPropByPath"])(model, path, true).v;
  20634. },
  20635. isRequired: function isRequired() {
  20636. var rules = this.getRules();
  20637. var isRequired = false;
  20638. if (rules && rules.length) {
  20639. rules.every(function (rule) {
  20640. if (rule.required) {
  20641. isRequired = true;
  20642. return false;
  20643. }
  20644. return true;
  20645. });
  20646. }
  20647. return isRequired;
  20648. },
  20649. _formSize: function _formSize() {
  20650. return this.elForm.size;
  20651. },
  20652. elFormItemSize: function elFormItemSize() {
  20653. return this.size || this._formSize;
  20654. },
  20655. sizeClass: function sizeClass() {
  20656. return this.elFormItemSize || (this.$ELEMENT || {}).size;
  20657. }
  20658. },
  20659. data: function data() {
  20660. return {
  20661. validateState: '',
  20662. validateMessage: '',
  20663. validateDisabled: false,
  20664. validator: {},
  20665. isNested: false,
  20666. computedLabelWidth: ''
  20667. };
  20668. },
  20669. methods: {
  20670. validate: function validate(trigger) {
  20671. var _this = this;
  20672. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : util_["noop"];
  20673. this.validateDisabled = false;
  20674. var rules = this.getFilteredRule(trigger);
  20675. if ((!rules || rules.length === 0) && this.required === undefined) {
  20676. callback();
  20677. return true;
  20678. }
  20679. this.validateState = 'validating';
  20680. var descriptor = {};
  20681. if (rules && rules.length > 0) {
  20682. rules.forEach(function (rule) {
  20683. delete rule.trigger;
  20684. });
  20685. }
  20686. descriptor[this.prop] = rules;
  20687. var validator = new external_async_validator_default.a(descriptor);
  20688. var model = {};
  20689. model[this.prop] = this.fieldValue;
  20690. validator.validate(model, { firstFields: true }, function (errors, invalidFields) {
  20691. _this.validateState = !errors ? 'success' : 'error';
  20692. _this.validateMessage = errors ? errors[0].message : '';
  20693. callback(_this.validateMessage, invalidFields);
  20694. _this.elForm && _this.elForm.$emit('validate', _this.prop, !errors, _this.validateMessage || null);
  20695. });
  20696. },
  20697. clearValidate: function clearValidate() {
  20698. this.validateState = '';
  20699. this.validateMessage = '';
  20700. this.validateDisabled = false;
  20701. },
  20702. resetField: function resetField() {
  20703. this.validateState = '';
  20704. this.validateMessage = '';
  20705. var model = this.form.model;
  20706. var value = this.fieldValue;
  20707. var path = this.prop;
  20708. if (path.indexOf(':') !== -1) {
  20709. path = path.replace(/:/, '.');
  20710. }
  20711. var prop = Object(util_["getPropByPath"])(model, path, true);
  20712. this.validateDisabled = true;
  20713. if (Array.isArray(value)) {
  20714. prop.o[prop.k] = [].concat(this.initialValue);
  20715. } else {
  20716. prop.o[prop.k] = this.initialValue;
  20717. }
  20718. this.broadcast('ElTimeSelect', 'fieldReset', this.initialValue);
  20719. },
  20720. getRules: function getRules() {
  20721. var formRules = this.form.rules;
  20722. var selfRules = this.rules;
  20723. var requiredRule = this.required !== undefined ? { required: !!this.required } : [];
  20724. var prop = Object(util_["getPropByPath"])(formRules, this.prop || '');
  20725. formRules = formRules ? prop.o[this.prop || ''] || prop.v : [];
  20726. return [].concat(selfRules || formRules || []).concat(requiredRule);
  20727. },
  20728. getFilteredRule: function getFilteredRule(trigger) {
  20729. var rules = this.getRules();
  20730. return rules.filter(function (rule) {
  20731. if (!rule.trigger || trigger === '') return true;
  20732. if (Array.isArray(rule.trigger)) {
  20733. return rule.trigger.indexOf(trigger) > -1;
  20734. } else {
  20735. return rule.trigger === trigger;
  20736. }
  20737. }).map(function (rule) {
  20738. return merge_default()({}, rule);
  20739. });
  20740. },
  20741. onFieldBlur: function onFieldBlur() {
  20742. this.validate('blur');
  20743. },
  20744. onFieldChange: function onFieldChange() {
  20745. if (this.validateDisabled) {
  20746. this.validateDisabled = false;
  20747. return;
  20748. }
  20749. this.validate('change');
  20750. },
  20751. updateComputedLabelWidth: function updateComputedLabelWidth(width) {
  20752. this.computedLabelWidth = width ? width + 'px' : '';
  20753. },
  20754. addValidateEvents: function addValidateEvents() {
  20755. var rules = this.getRules();
  20756. if (rules.length || this.required !== undefined) {
  20757. this.$on('el.form.blur', this.onFieldBlur);
  20758. this.$on('el.form.change', this.onFieldChange);
  20759. }
  20760. },
  20761. removeValidateEvents: function removeValidateEvents() {
  20762. this.$off();
  20763. }
  20764. },
  20765. mounted: function mounted() {
  20766. if (this.prop) {
  20767. this.dispatch('ElForm', 'el.form.addField', [this]);
  20768. var initialValue = this.fieldValue;
  20769. if (Array.isArray(initialValue)) {
  20770. initialValue = [].concat(initialValue);
  20771. }
  20772. Object.defineProperty(this, 'initialValue', {
  20773. value: initialValue
  20774. });
  20775. this.addValidateEvents();
  20776. }
  20777. },
  20778. beforeDestroy: function beforeDestroy() {
  20779. this.dispatch('ElForm', 'el.form.removeField', [this]);
  20780. }
  20781. });
  20782. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=script&lang=js&
  20783. /* harmony default export */ var src_form_itemvue_type_script_lang_js_ = (form_itemvue_type_script_lang_js_);
  20784. // CONCATENATED MODULE: ./packages/form/src/form-item.vue
  20785. /* normalize component */
  20786. var form_item_component = normalizeComponent(
  20787. src_form_itemvue_type_script_lang_js_,
  20788. form_itemvue_type_template_id_b6f3db6c_render,
  20789. form_itemvue_type_template_id_b6f3db6c_staticRenderFns,
  20790. false,
  20791. null,
  20792. null,
  20793. null
  20794. )
  20795. /* hot reload */
  20796. if (false) { var form_item_api; }
  20797. form_item_component.options.__file = "packages/form/src/form-item.vue"
  20798. /* harmony default export */ var form_item = (form_item_component.exports);
  20799. // CONCATENATED MODULE: ./packages/form-item/index.js
  20800. /* istanbul ignore next */
  20801. form_item.install = function (Vue) {
  20802. Vue.component(form_item.name, form_item);
  20803. };
  20804. /* harmony default export */ var packages_form_item = (form_item);
  20805. // 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&
  20806. var tab_barvue_type_template_id_2031f33a_render = function() {
  20807. var _vm = this
  20808. var _h = _vm.$createElement
  20809. var _c = _vm._self._c || _h
  20810. return _c("div", {
  20811. staticClass: "el-tabs__active-bar",
  20812. class: "is-" + _vm.rootTabs.tabPosition,
  20813. style: _vm.barStyle
  20814. })
  20815. }
  20816. var tab_barvue_type_template_id_2031f33a_staticRenderFns = []
  20817. tab_barvue_type_template_id_2031f33a_render._withStripped = true
  20818. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=template&id=2031f33a&
  20819. // 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&
  20820. //
  20821. //
  20822. //
  20823. /* harmony default export */ var tab_barvue_type_script_lang_js_ = ({
  20824. name: 'TabBar',
  20825. props: {
  20826. tabs: Array
  20827. },
  20828. inject: ['rootTabs'],
  20829. computed: {
  20830. barStyle: {
  20831. get: function get() {
  20832. var _this = this;
  20833. var style = {};
  20834. var offset = 0;
  20835. var tabSize = 0;
  20836. var sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  20837. var sizeDir = sizeName === 'width' ? 'x' : 'y';
  20838. var firstUpperCase = function firstUpperCase(str) {
  20839. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  20840. return L.toUpperCase();
  20841. });
  20842. };
  20843. this.tabs.every(function (tab, index) {
  20844. var $el = Object(util_["arrayFind"])(_this.$parent.$refs.tabs || [], function (t) {
  20845. return t.id.replace('tab-', '') === tab.paneName;
  20846. });
  20847. if (!$el) {
  20848. return false;
  20849. }
  20850. if (!tab.active) {
  20851. offset += $el['client' + firstUpperCase(sizeName)];
  20852. return true;
  20853. } else {
  20854. tabSize = $el['client' + firstUpperCase(sizeName)];
  20855. if (sizeName === 'width' && _this.tabs.length > 1) {
  20856. tabSize -= index === 0 || index === _this.tabs.length - 1 ? 20 : 40;
  20857. }
  20858. return false;
  20859. }
  20860. });
  20861. if (sizeName === 'width' && offset !== 0) {
  20862. offset += 20;
  20863. }
  20864. var transform = 'translate' + firstUpperCase(sizeDir) + '(' + offset + 'px)';
  20865. style[sizeName] = tabSize + 'px';
  20866. style.transform = transform;
  20867. style.msTransform = transform;
  20868. style.webkitTransform = transform;
  20869. return style;
  20870. }
  20871. }
  20872. }
  20873. });
  20874. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js&
  20875. /* harmony default export */ var src_tab_barvue_type_script_lang_js_ = (tab_barvue_type_script_lang_js_);
  20876. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue
  20877. /* normalize component */
  20878. var tab_bar_component = normalizeComponent(
  20879. src_tab_barvue_type_script_lang_js_,
  20880. tab_barvue_type_template_id_2031f33a_render,
  20881. tab_barvue_type_template_id_2031f33a_staticRenderFns,
  20882. false,
  20883. null,
  20884. null,
  20885. null
  20886. )
  20887. /* hot reload */
  20888. if (false) { var tab_bar_api; }
  20889. tab_bar_component.options.__file = "packages/tabs/src/tab-bar.vue"
  20890. /* harmony default export */ var tab_bar = (tab_bar_component.exports);
  20891. // 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&
  20892. function noop() {}
  20893. var tab_navvue_type_script_lang_js_firstUpperCase = function firstUpperCase(str) {
  20894. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  20895. return L.toUpperCase();
  20896. });
  20897. };
  20898. /* harmony default export */ var tab_navvue_type_script_lang_js_ = ({
  20899. name: 'TabNav',
  20900. components: {
  20901. TabBar: tab_bar
  20902. },
  20903. inject: ['rootTabs'],
  20904. props: {
  20905. panes: Array,
  20906. currentName: String,
  20907. editable: Boolean,
  20908. onTabClick: {
  20909. type: Function,
  20910. default: noop
  20911. },
  20912. onTabRemove: {
  20913. type: Function,
  20914. default: noop
  20915. },
  20916. type: String,
  20917. stretch: Boolean
  20918. },
  20919. data: function data() {
  20920. return {
  20921. scrollable: false,
  20922. navOffset: 0,
  20923. isFocus: false,
  20924. focusable: true
  20925. };
  20926. },
  20927. computed: {
  20928. navStyle: function navStyle() {
  20929. var dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
  20930. return {
  20931. transform: 'translate' + dir + '(-' + this.navOffset + 'px)'
  20932. };
  20933. },
  20934. sizeName: function sizeName() {
  20935. return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  20936. }
  20937. },
  20938. methods: {
  20939. scrollPrev: function scrollPrev() {
  20940. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  20941. var currentOffset = this.navOffset;
  20942. if (!currentOffset) return;
  20943. var newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
  20944. this.navOffset = newOffset;
  20945. },
  20946. scrollNext: function scrollNext() {
  20947. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  20948. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  20949. var currentOffset = this.navOffset;
  20950. if (navSize - currentOffset <= containerSize) return;
  20951. var newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  20952. this.navOffset = newOffset;
  20953. },
  20954. scrollToActiveTab: function scrollToActiveTab() {
  20955. if (!this.scrollable) return;
  20956. var nav = this.$refs.nav;
  20957. var activeTab = this.$el.querySelector('.is-active');
  20958. if (!activeTab) return;
  20959. var navScroll = this.$refs.navScroll;
  20960. var activeTabBounding = activeTab.getBoundingClientRect();
  20961. var navScrollBounding = navScroll.getBoundingClientRect();
  20962. var maxOffset = nav.offsetWidth - navScrollBounding.width;
  20963. var currentOffset = this.navOffset;
  20964. var newOffset = currentOffset;
  20965. if (activeTabBounding.left < navScrollBounding.left) {
  20966. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  20967. }
  20968. if (activeTabBounding.right > navScrollBounding.right) {
  20969. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  20970. }
  20971. newOffset = Math.max(newOffset, 0);
  20972. this.navOffset = Math.min(newOffset, maxOffset);
  20973. },
  20974. update: function update() {
  20975. if (!this.$refs.nav) return;
  20976. var sizeName = this.sizeName;
  20977. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  20978. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  20979. var currentOffset = this.navOffset;
  20980. if (containerSize < navSize) {
  20981. var _currentOffset = this.navOffset;
  20982. this.scrollable = this.scrollable || {};
  20983. this.scrollable.prev = _currentOffset;
  20984. this.scrollable.next = _currentOffset + containerSize < navSize;
  20985. if (navSize - _currentOffset < containerSize) {
  20986. this.navOffset = navSize - containerSize;
  20987. }
  20988. } else {
  20989. this.scrollable = false;
  20990. if (currentOffset > 0) {
  20991. this.navOffset = 0;
  20992. }
  20993. }
  20994. },
  20995. changeTab: function changeTab(e) {
  20996. var keyCode = e.keyCode;
  20997. var nextIndex = void 0;
  20998. var currentIndex = void 0,
  20999. tabList = void 0;
  21000. if ([37, 38, 39, 40].indexOf(keyCode) !== -1) {
  21001. // 左右上下键更换tab
  21002. tabList = e.currentTarget.querySelectorAll('[role=tab]');
  21003. currentIndex = Array.prototype.indexOf.call(tabList, e.target);
  21004. } else {
  21005. return;
  21006. }
  21007. if (keyCode === 37 || keyCode === 38) {
  21008. // left
  21009. if (currentIndex === 0) {
  21010. // first
  21011. nextIndex = tabList.length - 1;
  21012. } else {
  21013. nextIndex = currentIndex - 1;
  21014. }
  21015. } else {
  21016. // right
  21017. if (currentIndex < tabList.length - 1) {
  21018. // not last
  21019. nextIndex = currentIndex + 1;
  21020. } else {
  21021. nextIndex = 0;
  21022. }
  21023. }
  21024. tabList[nextIndex].focus(); // 改变焦点元素
  21025. tabList[nextIndex].click(); // 选中下一个tab
  21026. this.setFocus();
  21027. },
  21028. setFocus: function setFocus() {
  21029. if (this.focusable) {
  21030. this.isFocus = true;
  21031. }
  21032. },
  21033. removeFocus: function removeFocus() {
  21034. this.isFocus = false;
  21035. },
  21036. visibilityChangeHandler: function visibilityChangeHandler() {
  21037. var _this = this;
  21038. var visibility = document.visibilityState;
  21039. if (visibility === 'hidden') {
  21040. this.focusable = false;
  21041. } else if (visibility === 'visible') {
  21042. setTimeout(function () {
  21043. _this.focusable = true;
  21044. }, 50);
  21045. }
  21046. },
  21047. windowBlurHandler: function windowBlurHandler() {
  21048. this.focusable = false;
  21049. },
  21050. windowFocusHandler: function windowFocusHandler() {
  21051. var _this2 = this;
  21052. setTimeout(function () {
  21053. _this2.focusable = true;
  21054. }, 50);
  21055. }
  21056. },
  21057. updated: function updated() {
  21058. this.update();
  21059. },
  21060. render: function render(h) {
  21061. var _this3 = this;
  21062. var type = this.type,
  21063. panes = this.panes,
  21064. editable = this.editable,
  21065. stretch = this.stretch,
  21066. onTabClick = this.onTabClick,
  21067. onTabRemove = this.onTabRemove,
  21068. navStyle = this.navStyle,
  21069. scrollable = this.scrollable,
  21070. scrollNext = this.scrollNext,
  21071. scrollPrev = this.scrollPrev,
  21072. changeTab = this.changeTab,
  21073. setFocus = this.setFocus,
  21074. removeFocus = this.removeFocus;
  21075. var scrollBtn = scrollable ? [h(
  21076. 'span',
  21077. { 'class': ['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled'], on: {
  21078. 'click': scrollPrev
  21079. }
  21080. },
  21081. [h('i', { 'class': 'el-icon-arrow-left' })]
  21082. ), h(
  21083. 'span',
  21084. { 'class': ['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled'], on: {
  21085. 'click': scrollNext
  21086. }
  21087. },
  21088. [h('i', { 'class': 'el-icon-arrow-right' })]
  21089. )] : null;
  21090. var tabs = this._l(panes, function (pane, index) {
  21091. var _ref;
  21092. var tabName = pane.name || pane.index || index;
  21093. var closable = pane.isClosable || editable;
  21094. pane.index = '' + index;
  21095. var btnClose = closable ? h('span', { 'class': 'el-icon-close', on: {
  21096. 'click': function click(ev) {
  21097. onTabRemove(pane, ev);
  21098. }
  21099. }
  21100. }) : null;
  21101. var tabLabelContent = pane.$slots.label || pane.label;
  21102. var tabindex = pane.active ? 0 : -1;
  21103. return h(
  21104. 'div',
  21105. {
  21106. 'class': (_ref = {
  21107. 'el-tabs__item': true
  21108. }, _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),
  21109. attrs: { id: 'tab-' + tabName,
  21110. 'aria-controls': 'pane-' + tabName,
  21111. role: 'tab',
  21112. 'aria-selected': pane.active,
  21113. tabindex: tabindex
  21114. },
  21115. key: 'tab-' + tabName, ref: 'tabs', refInFor: true,
  21116. on: {
  21117. 'focus': function focus() {
  21118. setFocus();
  21119. },
  21120. 'blur': function blur() {
  21121. removeFocus();
  21122. },
  21123. 'click': function click(ev) {
  21124. removeFocus();onTabClick(pane, tabName, ev);
  21125. },
  21126. 'keydown': function keydown(ev) {
  21127. if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) {
  21128. onTabRemove(pane, ev);
  21129. }
  21130. }
  21131. }
  21132. },
  21133. [tabLabelContent, btnClose]
  21134. );
  21135. });
  21136. return h(
  21137. 'div',
  21138. { 'class': ['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', 'is-' + this.rootTabs.tabPosition] },
  21139. [scrollBtn, h(
  21140. 'div',
  21141. { 'class': ['el-tabs__nav-scroll'], ref: 'navScroll' },
  21142. [h(
  21143. 'div',
  21144. {
  21145. 'class': ['el-tabs__nav', 'is-' + this.rootTabs.tabPosition, stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : ''],
  21146. ref: 'nav',
  21147. style: navStyle,
  21148. attrs: { role: 'tablist'
  21149. },
  21150. on: {
  21151. 'keydown': changeTab
  21152. }
  21153. },
  21154. [!type ? h('tab-bar', {
  21155. attrs: { tabs: panes }
  21156. }) : null, tabs]
  21157. )]
  21158. )]
  21159. );
  21160. },
  21161. mounted: function mounted() {
  21162. var _this4 = this;
  21163. Object(resize_event_["addResizeListener"])(this.$el, this.update);
  21164. document.addEventListener('visibilitychange', this.visibilityChangeHandler);
  21165. window.addEventListener('blur', this.windowBlurHandler);
  21166. window.addEventListener('focus', this.windowFocusHandler);
  21167. setTimeout(function () {
  21168. _this4.scrollToActiveTab();
  21169. }, 0);
  21170. },
  21171. beforeDestroy: function beforeDestroy() {
  21172. if (this.$el && this.update) Object(resize_event_["removeResizeListener"])(this.$el, this.update);
  21173. document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
  21174. window.removeEventListener('blur', this.windowBlurHandler);
  21175. window.removeEventListener('focus', this.windowFocusHandler);
  21176. }
  21177. });
  21178. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js&
  21179. /* harmony default export */ var src_tab_navvue_type_script_lang_js_ = (tab_navvue_type_script_lang_js_);
  21180. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue
  21181. var tab_nav_render, tab_nav_staticRenderFns
  21182. /* normalize component */
  21183. var tab_nav_component = normalizeComponent(
  21184. src_tab_navvue_type_script_lang_js_,
  21185. tab_nav_render,
  21186. tab_nav_staticRenderFns,
  21187. false,
  21188. null,
  21189. null,
  21190. null
  21191. )
  21192. /* hot reload */
  21193. if (false) { var tab_nav_api; }
  21194. tab_nav_component.options.__file = "packages/tabs/src/tab-nav.vue"
  21195. /* harmony default export */ var tab_nav = (tab_nav_component.exports);
  21196. // 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&
  21197. /* harmony default export */ var tabsvue_type_script_lang_js_ = ({
  21198. name: 'ElTabs',
  21199. components: {
  21200. TabNav: tab_nav
  21201. },
  21202. props: {
  21203. type: String,
  21204. activeName: String,
  21205. closable: Boolean,
  21206. addable: Boolean,
  21207. value: {},
  21208. editable: Boolean,
  21209. tabPosition: {
  21210. type: String,
  21211. default: 'top'
  21212. },
  21213. beforeLeave: Function,
  21214. stretch: Boolean
  21215. },
  21216. provide: function provide() {
  21217. return {
  21218. rootTabs: this
  21219. };
  21220. },
  21221. data: function data() {
  21222. return {
  21223. currentName: this.value || this.activeName,
  21224. panes: []
  21225. };
  21226. },
  21227. watch: {
  21228. activeName: function activeName(value) {
  21229. this.setCurrentName(value);
  21230. },
  21231. value: function value(_value) {
  21232. this.setCurrentName(_value);
  21233. },
  21234. currentName: function currentName(value) {
  21235. var _this = this;
  21236. if (this.$refs.nav) {
  21237. this.$nextTick(function () {
  21238. _this.$refs.nav.$nextTick(function (_) {
  21239. _this.$refs.nav.scrollToActiveTab();
  21240. });
  21241. });
  21242. }
  21243. }
  21244. },
  21245. methods: {
  21246. calcPaneInstances: function calcPaneInstances() {
  21247. var _this2 = this;
  21248. var isForceUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  21249. if (this.$slots.default) {
  21250. var paneSlots = this.$slots.default.filter(function (vnode) {
  21251. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane';
  21252. });
  21253. // update indeed
  21254. var panes = paneSlots.map(function (_ref) {
  21255. var componentInstance = _ref.componentInstance;
  21256. return componentInstance;
  21257. });
  21258. var panesChanged = !(panes.length === this.panes.length && panes.every(function (pane, index) {
  21259. return pane === _this2.panes[index];
  21260. }));
  21261. if (isForceUpdate || panesChanged) {
  21262. this.panes = panes;
  21263. }
  21264. } else if (this.panes.length !== 0) {
  21265. this.panes = [];
  21266. }
  21267. },
  21268. handleTabClick: function handleTabClick(tab, tabName, event) {
  21269. if (tab.disabled) return;
  21270. this.setCurrentName(tabName);
  21271. this.$emit('tab-click', tab, event);
  21272. },
  21273. handleTabRemove: function handleTabRemove(pane, ev) {
  21274. if (pane.disabled) return;
  21275. ev.stopPropagation();
  21276. this.$emit('edit', pane.name, 'remove');
  21277. this.$emit('tab-remove', pane.name);
  21278. },
  21279. handleTabAdd: function handleTabAdd() {
  21280. this.$emit('edit', null, 'add');
  21281. this.$emit('tab-add');
  21282. },
  21283. setCurrentName: function setCurrentName(value) {
  21284. var _this3 = this;
  21285. var changeCurrentName = function changeCurrentName() {
  21286. _this3.currentName = value;
  21287. _this3.$emit('input', value);
  21288. };
  21289. if (this.currentName !== value && this.beforeLeave) {
  21290. var before = this.beforeLeave(value, this.currentName);
  21291. if (before && before.then) {
  21292. before.then(function () {
  21293. changeCurrentName();
  21294. _this3.$refs.nav && _this3.$refs.nav.removeFocus();
  21295. }, function () {
  21296. // https://github.com/ElemeFE/element/pull/14816
  21297. // ignore promise rejection in `before-leave` hook
  21298. });
  21299. } else if (before !== false) {
  21300. changeCurrentName();
  21301. }
  21302. } else {
  21303. changeCurrentName();
  21304. }
  21305. }
  21306. },
  21307. render: function render(h) {
  21308. var _ref2;
  21309. var type = this.type,
  21310. handleTabClick = this.handleTabClick,
  21311. handleTabRemove = this.handleTabRemove,
  21312. handleTabAdd = this.handleTabAdd,
  21313. currentName = this.currentName,
  21314. panes = this.panes,
  21315. editable = this.editable,
  21316. addable = this.addable,
  21317. tabPosition = this.tabPosition,
  21318. stretch = this.stretch;
  21319. var newButton = editable || addable ? h(
  21320. 'span',
  21321. {
  21322. 'class': 'el-tabs__new-tab',
  21323. on: {
  21324. 'click': handleTabAdd,
  21325. 'keydown': function keydown(ev) {
  21326. if (ev.keyCode === 13) {
  21327. handleTabAdd();
  21328. }
  21329. }
  21330. },
  21331. attrs: {
  21332. tabindex: '0'
  21333. }
  21334. },
  21335. [h('i', { 'class': 'el-icon-plus' })]
  21336. ) : null;
  21337. var navData = {
  21338. props: {
  21339. currentName: currentName,
  21340. onTabClick: handleTabClick,
  21341. onTabRemove: handleTabRemove,
  21342. editable: editable,
  21343. type: type,
  21344. panes: panes,
  21345. stretch: stretch
  21346. },
  21347. ref: 'nav'
  21348. };
  21349. var header = h(
  21350. 'div',
  21351. { 'class': ['el-tabs__header', 'is-' + tabPosition] },
  21352. [newButton, h('tab-nav', navData)]
  21353. );
  21354. var panels = h(
  21355. 'div',
  21356. { 'class': 'el-tabs__content' },
  21357. [this.$slots.default]
  21358. );
  21359. return h(
  21360. 'div',
  21361. { 'class': (_ref2 = {
  21362. 'el-tabs': true,
  21363. 'el-tabs--card': type === 'card'
  21364. }, _ref2['el-tabs--' + tabPosition] = true, _ref2['el-tabs--border-card'] = type === 'border-card', _ref2) },
  21365. [tabPosition !== 'bottom' ? [header, panels] : [panels, header]]
  21366. );
  21367. },
  21368. created: function created() {
  21369. if (!this.currentName) {
  21370. this.setCurrentName('0');
  21371. }
  21372. this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
  21373. },
  21374. mounted: function mounted() {
  21375. this.calcPaneInstances();
  21376. },
  21377. updated: function updated() {
  21378. this.calcPaneInstances();
  21379. }
  21380. });
  21381. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue?vue&type=script&lang=js&
  21382. /* harmony default export */ var src_tabsvue_type_script_lang_js_ = (tabsvue_type_script_lang_js_);
  21383. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue
  21384. var tabs_render, tabs_staticRenderFns
  21385. /* normalize component */
  21386. var tabs_component = normalizeComponent(
  21387. src_tabsvue_type_script_lang_js_,
  21388. tabs_render,
  21389. tabs_staticRenderFns,
  21390. false,
  21391. null,
  21392. null,
  21393. null
  21394. )
  21395. /* hot reload */
  21396. if (false) { var tabs_api; }
  21397. tabs_component.options.__file = "packages/tabs/src/tabs.vue"
  21398. /* harmony default export */ var tabs = (tabs_component.exports);
  21399. // CONCATENATED MODULE: ./packages/tabs/index.js
  21400. /* istanbul ignore next */
  21401. tabs.install = function (Vue) {
  21402. Vue.component(tabs.name, tabs);
  21403. };
  21404. /* harmony default export */ var packages_tabs = (tabs);
  21405. // 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&
  21406. var tab_panevue_type_template_id_9145a070_render = function() {
  21407. var _vm = this
  21408. var _h = _vm.$createElement
  21409. var _c = _vm._self._c || _h
  21410. return !_vm.lazy || _vm.loaded || _vm.active
  21411. ? _c(
  21412. "div",
  21413. {
  21414. directives: [
  21415. {
  21416. name: "show",
  21417. rawName: "v-show",
  21418. value: _vm.active,
  21419. expression: "active"
  21420. }
  21421. ],
  21422. staticClass: "el-tab-pane",
  21423. attrs: {
  21424. role: "tabpanel",
  21425. "aria-hidden": !_vm.active,
  21426. id: "pane-" + _vm.paneName,
  21427. "aria-labelledby": "tab-" + _vm.paneName
  21428. }
  21429. },
  21430. [_vm._t("default")],
  21431. 2
  21432. )
  21433. : _vm._e()
  21434. }
  21435. var tab_panevue_type_template_id_9145a070_staticRenderFns = []
  21436. tab_panevue_type_template_id_9145a070_render._withStripped = true
  21437. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
  21438. // 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&
  21439. //
  21440. //
  21441. //
  21442. //
  21443. //
  21444. //
  21445. //
  21446. //
  21447. //
  21448. //
  21449. //
  21450. //
  21451. //
  21452. /* harmony default export */ var tab_panevue_type_script_lang_js_ = ({
  21453. name: 'ElTabPane',
  21454. componentName: 'ElTabPane',
  21455. props: {
  21456. label: String,
  21457. labelContent: Function,
  21458. name: String,
  21459. closable: Boolean,
  21460. disabled: Boolean,
  21461. lazy: Boolean
  21462. },
  21463. data: function data() {
  21464. return {
  21465. index: null,
  21466. loaded: false
  21467. };
  21468. },
  21469. computed: {
  21470. isClosable: function isClosable() {
  21471. return this.closable || this.$parent.closable;
  21472. },
  21473. active: function active() {
  21474. var active = this.$parent.currentName === (this.name || this.index);
  21475. if (active) {
  21476. this.loaded = true;
  21477. }
  21478. return active;
  21479. },
  21480. paneName: function paneName() {
  21481. return this.name || this.index;
  21482. }
  21483. },
  21484. updated: function updated() {
  21485. this.$parent.$emit('tab-nav-update');
  21486. }
  21487. });
  21488. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
  21489. /* harmony default export */ var src_tab_panevue_type_script_lang_js_ = (tab_panevue_type_script_lang_js_);
  21490. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue
  21491. /* normalize component */
  21492. var tab_pane_component = normalizeComponent(
  21493. src_tab_panevue_type_script_lang_js_,
  21494. tab_panevue_type_template_id_9145a070_render,
  21495. tab_panevue_type_template_id_9145a070_staticRenderFns,
  21496. false,
  21497. null,
  21498. null,
  21499. null
  21500. )
  21501. /* hot reload */
  21502. if (false) { var tab_pane_api; }
  21503. tab_pane_component.options.__file = "packages/tabs/src/tab-pane.vue"
  21504. /* harmony default export */ var tab_pane = (tab_pane_component.exports);
  21505. // CONCATENATED MODULE: ./packages/tab-pane/index.js
  21506. /* istanbul ignore next */
  21507. tab_pane.install = function (Vue) {
  21508. Vue.component(tab_pane.name, tab_pane);
  21509. };
  21510. /* harmony default export */ var packages_tab_pane = (tab_pane);
  21511. // 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&
  21512. /* harmony default export */ var tagvue_type_script_lang_js_ = ({
  21513. name: 'ElTag',
  21514. props: {
  21515. text: String,
  21516. closable: Boolean,
  21517. type: String,
  21518. hit: Boolean,
  21519. disableTransitions: Boolean,
  21520. color: String,
  21521. size: String
  21522. },
  21523. methods: {
  21524. handleClose: function handleClose(event) {
  21525. event.stopPropagation();
  21526. this.$emit('close', event);
  21527. },
  21528. handleClick: function handleClick(event) {
  21529. event.stopPropagation();
  21530. this.$emit('click', event);
  21531. }
  21532. },
  21533. computed: {
  21534. tagSize: function tagSize() {
  21535. return this.size || (this.$ELEMENT || {}).size;
  21536. }
  21537. },
  21538. render: function render(h) {
  21539. var classes = ['el-tag', this.type ? 'el-tag--' + this.type : '', this.tagSize ? 'el-tag--' + this.tagSize : '', { 'is-hit': this.hit }];
  21540. var tagEl = h(
  21541. 'span',
  21542. { 'class': classes, style: { backgroundColor: this.color }, on: {
  21543. 'click': this.handleClick
  21544. }
  21545. },
  21546. [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
  21547. 'click': this.handleClose
  21548. }
  21549. })]
  21550. );
  21551. return this.disableTransitions ? tagEl : h(
  21552. 'transition',
  21553. {
  21554. attrs: { name: 'el-zoom-in-center' }
  21555. },
  21556. [tagEl]
  21557. );
  21558. }
  21559. });
  21560. // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js&
  21561. /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_);
  21562. // CONCATENATED MODULE: ./packages/tag/src/tag.vue
  21563. var tag_render, tag_staticRenderFns
  21564. /* normalize component */
  21565. var tag_component = normalizeComponent(
  21566. src_tagvue_type_script_lang_js_,
  21567. tag_render,
  21568. tag_staticRenderFns,
  21569. false,
  21570. null,
  21571. null,
  21572. null
  21573. )
  21574. /* hot reload */
  21575. if (false) { var tag_api; }
  21576. tag_component.options.__file = "packages/tag/src/tag.vue"
  21577. /* harmony default export */ var tag = (tag_component.exports);
  21578. // CONCATENATED MODULE: ./packages/tag/index.js
  21579. /* istanbul ignore next */
  21580. tag.install = function (Vue) {
  21581. Vue.component(tag.name, tag);
  21582. };
  21583. /* harmony default export */ var packages_tag = (tag);
  21584. // 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&
  21585. var treevue_type_template_id_547575a6_render = function() {
  21586. var _vm = this
  21587. var _h = _vm.$createElement
  21588. var _c = _vm._self._c || _h
  21589. return _c(
  21590. "div",
  21591. {
  21592. staticClass: "el-tree",
  21593. class: {
  21594. "el-tree--highlight-current": _vm.highlightCurrent,
  21595. "is-dragging": !!_vm.dragState.draggingNode,
  21596. "is-drop-not-allow": !_vm.dragState.allowDrop,
  21597. "is-drop-inner": _vm.dragState.dropType === "inner"
  21598. },
  21599. attrs: { role: "tree" }
  21600. },
  21601. [
  21602. _vm._l(_vm.root.childNodes, function(child) {
  21603. return _c("el-tree-node", {
  21604. key: _vm.getNodeKey(child),
  21605. attrs: {
  21606. node: child,
  21607. props: _vm.props,
  21608. "render-after-expand": _vm.renderAfterExpand,
  21609. "show-checkbox": _vm.showCheckbox,
  21610. "render-content": _vm.renderContent
  21611. },
  21612. on: { "node-expand": _vm.handleNodeExpand }
  21613. })
  21614. }),
  21615. _vm.isEmpty
  21616. ? _c("div", { staticClass: "el-tree__empty-block" }, [
  21617. _c("span", { staticClass: "el-tree__empty-text" }, [
  21618. _vm._v(_vm._s(_vm.emptyText))
  21619. ])
  21620. ])
  21621. : _vm._e(),
  21622. _c("div", {
  21623. directives: [
  21624. {
  21625. name: "show",
  21626. rawName: "v-show",
  21627. value: _vm.dragState.showDropIndicator,
  21628. expression: "dragState.showDropIndicator"
  21629. }
  21630. ],
  21631. ref: "dropIndicator",
  21632. staticClass: "el-tree__drop-indicator"
  21633. })
  21634. ],
  21635. 2
  21636. )
  21637. }
  21638. var treevue_type_template_id_547575a6_staticRenderFns = []
  21639. treevue_type_template_id_547575a6_render._withStripped = true
  21640. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=547575a6&
  21641. // CONCATENATED MODULE: ./packages/tree/src/model/util.js
  21642. var NODE_KEY = '$treeNodeId';
  21643. var markNodeData = function markNodeData(node, data) {
  21644. if (!data || data[NODE_KEY]) return;
  21645. Object.defineProperty(data, NODE_KEY, {
  21646. value: node.id,
  21647. enumerable: false,
  21648. configurable: false,
  21649. writable: false
  21650. });
  21651. };
  21652. var util_getNodeKey = function getNodeKey(key, data) {
  21653. if (!key) return data[NODE_KEY];
  21654. return data[key];
  21655. };
  21656. var findNearestComponent = function findNearestComponent(element, componentName) {
  21657. var target = element;
  21658. while (target && target.tagName !== 'BODY') {
  21659. if (target.__vue__ && target.__vue__.$options.name === componentName) {
  21660. return target.__vue__;
  21661. }
  21662. target = target.parentNode;
  21663. }
  21664. return null;
  21665. };
  21666. // CONCATENATED MODULE: ./packages/tree/src/model/node.js
  21667. 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; }; }();
  21668. function node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21669. var getChildState = function getChildState(node) {
  21670. var all = true;
  21671. var none = true;
  21672. var allWithoutDisable = true;
  21673. for (var i = 0, j = node.length; i < j; i++) {
  21674. var n = node[i];
  21675. if (n.checked !== true || n.indeterminate) {
  21676. all = false;
  21677. if (!n.disabled) {
  21678. allWithoutDisable = false;
  21679. }
  21680. }
  21681. if (n.checked !== false || n.indeterminate) {
  21682. none = false;
  21683. }
  21684. }
  21685. return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
  21686. };
  21687. var reInitChecked = function reInitChecked(node) {
  21688. if (node.childNodes.length === 0) return;
  21689. var _getChildState = getChildState(node.childNodes),
  21690. all = _getChildState.all,
  21691. none = _getChildState.none,
  21692. half = _getChildState.half;
  21693. if (all) {
  21694. node.checked = true;
  21695. node.indeterminate = false;
  21696. } else if (half) {
  21697. node.checked = false;
  21698. node.indeterminate = true;
  21699. } else if (none) {
  21700. node.checked = false;
  21701. node.indeterminate = false;
  21702. }
  21703. var parent = node.parent;
  21704. if (!parent || parent.level === 0) return;
  21705. if (!node.store.checkStrictly) {
  21706. reInitChecked(parent);
  21707. }
  21708. };
  21709. var getPropertyFromData = function getPropertyFromData(node, prop) {
  21710. var props = node.store.props;
  21711. var data = node.data || {};
  21712. var config = props[prop];
  21713. if (typeof config === 'function') {
  21714. return config(data, node);
  21715. } else if (typeof config === 'string') {
  21716. return data[config];
  21717. } else if (typeof config === 'undefined') {
  21718. var dataProp = data[prop];
  21719. return dataProp === undefined ? '' : dataProp;
  21720. }
  21721. };
  21722. var nodeIdSeed = 0;
  21723. var node_Node = function () {
  21724. function Node(options) {
  21725. node_classCallCheck(this, Node);
  21726. this.id = nodeIdSeed++;
  21727. this.text = null;
  21728. this.checked = false;
  21729. this.indeterminate = false;
  21730. this.data = null;
  21731. this.expanded = false;
  21732. this.parent = null;
  21733. this.visible = true;
  21734. this.isCurrent = false;
  21735. for (var name in options) {
  21736. if (options.hasOwnProperty(name)) {
  21737. this[name] = options[name];
  21738. }
  21739. }
  21740. // internal
  21741. this.level = 0;
  21742. this.loaded = false;
  21743. this.childNodes = [];
  21744. this.loading = false;
  21745. if (this.parent) {
  21746. this.level = this.parent.level + 1;
  21747. }
  21748. var store = this.store;
  21749. if (!store) {
  21750. throw new Error('[Node]store is required!');
  21751. }
  21752. store.registerNode(this);
  21753. var props = store.props;
  21754. if (props && typeof props.isLeaf !== 'undefined') {
  21755. var isLeaf = getPropertyFromData(this, 'isLeaf');
  21756. if (typeof isLeaf === 'boolean') {
  21757. this.isLeafByUser = isLeaf;
  21758. }
  21759. }
  21760. if (store.lazy !== true && this.data) {
  21761. this.setData(this.data);
  21762. if (store.defaultExpandAll) {
  21763. this.expanded = true;
  21764. }
  21765. } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
  21766. this.expand();
  21767. }
  21768. if (!Array.isArray(this.data)) {
  21769. markNodeData(this, this.data);
  21770. }
  21771. if (!this.data) return;
  21772. var defaultExpandedKeys = store.defaultExpandedKeys;
  21773. var key = store.key;
  21774. if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
  21775. this.expand(null, store.autoExpandParent);
  21776. }
  21777. if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
  21778. store.currentNode = this;
  21779. store.currentNode.isCurrent = true;
  21780. }
  21781. if (store.lazy) {
  21782. store._initDefaultCheckedNode(this);
  21783. }
  21784. this.updateLeafState();
  21785. }
  21786. Node.prototype.setData = function setData(data) {
  21787. if (!Array.isArray(data)) {
  21788. markNodeData(this, data);
  21789. }
  21790. this.data = data;
  21791. this.childNodes = [];
  21792. var children = void 0;
  21793. if (this.level === 0 && this.data instanceof Array) {
  21794. children = this.data;
  21795. } else {
  21796. children = getPropertyFromData(this, 'children') || [];
  21797. }
  21798. for (var i = 0, j = children.length; i < j; i++) {
  21799. this.insertChild({ data: children[i] });
  21800. }
  21801. };
  21802. Node.prototype.contains = function contains(target) {
  21803. var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  21804. var walk = function walk(parent) {
  21805. var children = parent.childNodes || [];
  21806. var result = false;
  21807. for (var i = 0, j = children.length; i < j; i++) {
  21808. var child = children[i];
  21809. if (child === target || deep && walk(child)) {
  21810. result = true;
  21811. break;
  21812. }
  21813. }
  21814. return result;
  21815. };
  21816. return walk(this);
  21817. };
  21818. Node.prototype.remove = function remove() {
  21819. var parent = this.parent;
  21820. if (parent) {
  21821. parent.removeChild(this);
  21822. }
  21823. };
  21824. Node.prototype.insertChild = function insertChild(child, index, batch) {
  21825. if (!child) throw new Error('insertChild error: child is required.');
  21826. if (!(child instanceof Node)) {
  21827. if (!batch) {
  21828. var children = this.getChildren(true);
  21829. if (children.indexOf(child.data) === -1) {
  21830. if (typeof index === 'undefined' || index < 0) {
  21831. children.push(child.data);
  21832. } else {
  21833. children.splice(index, 0, child.data);
  21834. }
  21835. }
  21836. }
  21837. merge_default()(child, {
  21838. parent: this,
  21839. store: this.store
  21840. });
  21841. child = new Node(child);
  21842. }
  21843. child.level = this.level + 1;
  21844. if (typeof index === 'undefined' || index < 0) {
  21845. this.childNodes.push(child);
  21846. } else {
  21847. this.childNodes.splice(index, 0, child);
  21848. }
  21849. this.updateLeafState();
  21850. };
  21851. Node.prototype.insertBefore = function insertBefore(child, ref) {
  21852. var index = void 0;
  21853. if (ref) {
  21854. index = this.childNodes.indexOf(ref);
  21855. }
  21856. this.insertChild(child, index);
  21857. };
  21858. Node.prototype.insertAfter = function insertAfter(child, ref) {
  21859. var index = void 0;
  21860. if (ref) {
  21861. index = this.childNodes.indexOf(ref);
  21862. if (index !== -1) index += 1;
  21863. }
  21864. this.insertChild(child, index);
  21865. };
  21866. Node.prototype.removeChild = function removeChild(child) {
  21867. var children = this.getChildren() || [];
  21868. var dataIndex = children.indexOf(child.data);
  21869. if (dataIndex > -1) {
  21870. children.splice(dataIndex, 1);
  21871. }
  21872. var index = this.childNodes.indexOf(child);
  21873. if (index > -1) {
  21874. this.store && this.store.deregisterNode(child);
  21875. child.parent = null;
  21876. this.childNodes.splice(index, 1);
  21877. }
  21878. this.updateLeafState();
  21879. };
  21880. Node.prototype.removeChildByData = function removeChildByData(data) {
  21881. var targetNode = null;
  21882. for (var i = 0; i < this.childNodes.length; i++) {
  21883. if (this.childNodes[i].data === data) {
  21884. targetNode = this.childNodes[i];
  21885. break;
  21886. }
  21887. }
  21888. if (targetNode) {
  21889. this.removeChild(targetNode);
  21890. }
  21891. };
  21892. Node.prototype.expand = function expand(callback, expandParent) {
  21893. var _this = this;
  21894. var done = function done() {
  21895. if (expandParent) {
  21896. var parent = _this.parent;
  21897. while (parent.level > 0) {
  21898. parent.expanded = true;
  21899. parent = parent.parent;
  21900. }
  21901. }
  21902. _this.expanded = true;
  21903. if (callback) callback();
  21904. };
  21905. if (this.shouldLoadData()) {
  21906. this.loadData(function (data) {
  21907. if (data instanceof Array) {
  21908. if (_this.checked) {
  21909. _this.setChecked(true, true);
  21910. } else if (!_this.store.checkStrictly) {
  21911. reInitChecked(_this);
  21912. }
  21913. done();
  21914. }
  21915. });
  21916. } else {
  21917. done();
  21918. }
  21919. };
  21920. Node.prototype.doCreateChildren = function doCreateChildren(array) {
  21921. var _this2 = this;
  21922. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21923. array.forEach(function (item) {
  21924. _this2.insertChild(merge_default()({ data: item }, defaultProps), undefined, true);
  21925. });
  21926. };
  21927. Node.prototype.collapse = function collapse() {
  21928. this.expanded = false;
  21929. };
  21930. Node.prototype.shouldLoadData = function shouldLoadData() {
  21931. return this.store.lazy === true && this.store.load && !this.loaded;
  21932. };
  21933. Node.prototype.updateLeafState = function updateLeafState() {
  21934. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
  21935. this.isLeaf = this.isLeafByUser;
  21936. return;
  21937. }
  21938. var childNodes = this.childNodes;
  21939. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  21940. this.isLeaf = !childNodes || childNodes.length === 0;
  21941. return;
  21942. }
  21943. this.isLeaf = false;
  21944. };
  21945. Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
  21946. var _this3 = this;
  21947. this.indeterminate = value === 'half';
  21948. this.checked = value === true;
  21949. if (this.store.checkStrictly) return;
  21950. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  21951. var _getChildState2 = getChildState(this.childNodes),
  21952. all = _getChildState2.all,
  21953. allWithoutDisable = _getChildState2.allWithoutDisable;
  21954. if (!this.isLeaf && !all && allWithoutDisable) {
  21955. this.checked = false;
  21956. value = false;
  21957. }
  21958. var handleDescendants = function handleDescendants() {
  21959. if (deep) {
  21960. var childNodes = _this3.childNodes;
  21961. for (var i = 0, j = childNodes.length; i < j; i++) {
  21962. var child = childNodes[i];
  21963. passValue = passValue || value !== false;
  21964. var isCheck = child.disabled ? child.checked : passValue;
  21965. child.setChecked(isCheck, deep, true, passValue);
  21966. }
  21967. var _getChildState3 = getChildState(childNodes),
  21968. half = _getChildState3.half,
  21969. _all = _getChildState3.all;
  21970. if (!_all) {
  21971. _this3.checked = _all;
  21972. _this3.indeterminate = half;
  21973. }
  21974. }
  21975. };
  21976. if (this.shouldLoadData()) {
  21977. // Only work on lazy load data.
  21978. this.loadData(function () {
  21979. handleDescendants();
  21980. reInitChecked(_this3);
  21981. }, {
  21982. checked: value !== false
  21983. });
  21984. return;
  21985. } else {
  21986. handleDescendants();
  21987. }
  21988. }
  21989. var parent = this.parent;
  21990. if (!parent || parent.level === 0) return;
  21991. if (!recursion) {
  21992. reInitChecked(parent);
  21993. }
  21994. };
  21995. Node.prototype.getChildren = function getChildren() {
  21996. var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  21997. // this is data
  21998. if (this.level === 0) return this.data;
  21999. var data = this.data;
  22000. if (!data) return null;
  22001. var props = this.store.props;
  22002. var children = 'children';
  22003. if (props) {
  22004. children = props.children || 'children';
  22005. }
  22006. if (data[children] === undefined) {
  22007. data[children] = null;
  22008. }
  22009. if (forceInit && !data[children]) {
  22010. data[children] = [];
  22011. }
  22012. return data[children];
  22013. };
  22014. Node.prototype.updateChildren = function updateChildren() {
  22015. var _this4 = this;
  22016. var newData = this.getChildren() || [];
  22017. var oldData = this.childNodes.map(function (node) {
  22018. return node.data;
  22019. });
  22020. var newDataMap = {};
  22021. var newNodes = [];
  22022. newData.forEach(function (item, index) {
  22023. if (item[NODE_KEY]) {
  22024. newDataMap[item[NODE_KEY]] = { index: index, data: item };
  22025. } else {
  22026. newNodes.push({ index: index, data: item });
  22027. }
  22028. });
  22029. if (!this.store.lazy) {
  22030. oldData.forEach(function (item) {
  22031. if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
  22032. });
  22033. }
  22034. newNodes.forEach(function (_ref) {
  22035. var index = _ref.index,
  22036. data = _ref.data;
  22037. _this4.insertChild({ data: data }, index);
  22038. });
  22039. this.updateLeafState();
  22040. };
  22041. Node.prototype.loadData = function loadData(callback) {
  22042. var _this5 = this;
  22043. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22044. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  22045. this.loading = true;
  22046. var resolve = function resolve(children) {
  22047. _this5.loaded = true;
  22048. _this5.loading = false;
  22049. _this5.childNodes = [];
  22050. _this5.doCreateChildren(children, defaultProps);
  22051. _this5.updateLeafState();
  22052. if (callback) {
  22053. callback.call(_this5, children);
  22054. }
  22055. };
  22056. this.store.load(this, resolve);
  22057. } else {
  22058. if (callback) {
  22059. callback.call(this);
  22060. }
  22061. }
  22062. };
  22063. _createClass(Node, [{
  22064. key: 'label',
  22065. get: function get() {
  22066. return getPropertyFromData(this, 'label');
  22067. }
  22068. }, {
  22069. key: 'key',
  22070. get: function get() {
  22071. var nodeKey = this.store.key;
  22072. if (this.data) return this.data[nodeKey];
  22073. return null;
  22074. }
  22075. }, {
  22076. key: 'disabled',
  22077. get: function get() {
  22078. return getPropertyFromData(this, 'disabled');
  22079. }
  22080. }, {
  22081. key: 'nextSibling',
  22082. get: function get() {
  22083. var parent = this.parent;
  22084. if (parent) {
  22085. var index = parent.childNodes.indexOf(this);
  22086. if (index > -1) {
  22087. return parent.childNodes[index + 1];
  22088. }
  22089. }
  22090. return null;
  22091. }
  22092. }, {
  22093. key: 'previousSibling',
  22094. get: function get() {
  22095. var parent = this.parent;
  22096. if (parent) {
  22097. var index = parent.childNodes.indexOf(this);
  22098. if (index > -1) {
  22099. return index > 0 ? parent.childNodes[index - 1] : null;
  22100. }
  22101. }
  22102. return null;
  22103. }
  22104. }]);
  22105. return Node;
  22106. }();
  22107. /* harmony default export */ var model_node = (node_Node);
  22108. // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
  22109. 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; };
  22110. function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22111. var tree_store_TreeStore = function () {
  22112. function TreeStore(options) {
  22113. var _this = this;
  22114. tree_store_classCallCheck(this, TreeStore);
  22115. this.currentNode = null;
  22116. this.currentNodeKey = null;
  22117. for (var option in options) {
  22118. if (options.hasOwnProperty(option)) {
  22119. this[option] = options[option];
  22120. }
  22121. }
  22122. this.nodesMap = {};
  22123. this.root = new model_node({
  22124. data: this.data,
  22125. store: this
  22126. });
  22127. if (this.lazy && this.load) {
  22128. var loadFn = this.load;
  22129. loadFn(this.root, function (data) {
  22130. _this.root.doCreateChildren(data);
  22131. _this._initDefaultCheckedNodes();
  22132. });
  22133. } else {
  22134. this._initDefaultCheckedNodes();
  22135. }
  22136. }
  22137. TreeStore.prototype.filter = function filter(value) {
  22138. var filterNodeMethod = this.filterNodeMethod;
  22139. var lazy = this.lazy;
  22140. var traverse = function traverse(node) {
  22141. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22142. childNodes.forEach(function (child) {
  22143. child.visible = filterNodeMethod.call(child, value, child.data, child);
  22144. traverse(child);
  22145. });
  22146. if (!node.visible && childNodes.length) {
  22147. var allHidden = true;
  22148. childNodes.forEach(function (child) {
  22149. if (child.visible) allHidden = false;
  22150. });
  22151. if (node.root) {
  22152. node.root.visible = allHidden === false;
  22153. } else {
  22154. node.visible = allHidden === false;
  22155. }
  22156. }
  22157. if (!value) return;
  22158. if (node.visible && !node.isLeaf && !lazy) node.expand();
  22159. };
  22160. traverse(this);
  22161. };
  22162. TreeStore.prototype.setData = function setData(newVal) {
  22163. var instanceChanged = newVal !== this.root.data;
  22164. if (instanceChanged) {
  22165. this.root.setData(newVal);
  22166. this._initDefaultCheckedNodes();
  22167. } else {
  22168. this.root.updateChildren();
  22169. }
  22170. };
  22171. TreeStore.prototype.getNode = function getNode(data) {
  22172. if (data instanceof model_node) return data;
  22173. var key = (typeof data === 'undefined' ? 'undefined' : tree_store_typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
  22174. return this.nodesMap[key] || null;
  22175. };
  22176. TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
  22177. var refNode = this.getNode(refData);
  22178. refNode.parent.insertBefore({ data: data }, refNode);
  22179. };
  22180. TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
  22181. var refNode = this.getNode(refData);
  22182. refNode.parent.insertAfter({ data: data }, refNode);
  22183. };
  22184. TreeStore.prototype.remove = function remove(data) {
  22185. var node = this.getNode(data);
  22186. if (node && node.parent) {
  22187. if (node === this.currentNode) {
  22188. this.currentNode = null;
  22189. }
  22190. node.parent.removeChild(node);
  22191. }
  22192. };
  22193. TreeStore.prototype.append = function append(data, parentData) {
  22194. var parentNode = parentData ? this.getNode(parentData) : this.root;
  22195. if (parentNode) {
  22196. parentNode.insertChild({ data: data });
  22197. }
  22198. };
  22199. TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
  22200. var _this2 = this;
  22201. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22202. var nodesMap = this.nodesMap;
  22203. defaultCheckedKeys.forEach(function (checkedKey) {
  22204. var node = nodesMap[checkedKey];
  22205. if (node) {
  22206. node.setChecked(true, !_this2.checkStrictly);
  22207. }
  22208. });
  22209. };
  22210. TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
  22211. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22212. if (defaultCheckedKeys.indexOf(node.key) !== -1) {
  22213. node.setChecked(true, !this.checkStrictly);
  22214. }
  22215. };
  22216. TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
  22217. if (newVal !== this.defaultCheckedKeys) {
  22218. this.defaultCheckedKeys = newVal;
  22219. this._initDefaultCheckedNodes();
  22220. }
  22221. };
  22222. TreeStore.prototype.registerNode = function registerNode(node) {
  22223. var key = this.key;
  22224. if (!key || !node || !node.data) return;
  22225. var nodeKey = node.key;
  22226. if (nodeKey !== undefined) this.nodesMap[node.key] = node;
  22227. };
  22228. TreeStore.prototype.deregisterNode = function deregisterNode(node) {
  22229. var _this3 = this;
  22230. var key = this.key;
  22231. if (!key || !node || !node.data) return;
  22232. node.childNodes.forEach(function (child) {
  22233. _this3.deregisterNode(child);
  22234. });
  22235. delete this.nodesMap[node.key];
  22236. };
  22237. TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
  22238. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22239. var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22240. var checkedNodes = [];
  22241. var traverse = function traverse(node) {
  22242. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22243. childNodes.forEach(function (child) {
  22244. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
  22245. checkedNodes.push(child.data);
  22246. }
  22247. traverse(child);
  22248. });
  22249. };
  22250. traverse(this);
  22251. return checkedNodes;
  22252. };
  22253. TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
  22254. var _this4 = this;
  22255. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22256. return this.getCheckedNodes(leafOnly).map(function (data) {
  22257. return (data || {})[_this4.key];
  22258. });
  22259. };
  22260. TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
  22261. var nodes = [];
  22262. var traverse = function traverse(node) {
  22263. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22264. childNodes.forEach(function (child) {
  22265. if (child.indeterminate) {
  22266. nodes.push(child.data);
  22267. }
  22268. traverse(child);
  22269. });
  22270. };
  22271. traverse(this);
  22272. return nodes;
  22273. };
  22274. TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
  22275. var _this5 = this;
  22276. return this.getHalfCheckedNodes().map(function (data) {
  22277. return (data || {})[_this5.key];
  22278. });
  22279. };
  22280. TreeStore.prototype._getAllNodes = function _getAllNodes() {
  22281. var allNodes = [];
  22282. var nodesMap = this.nodesMap;
  22283. for (var nodeKey in nodesMap) {
  22284. if (nodesMap.hasOwnProperty(nodeKey)) {
  22285. allNodes.push(nodesMap[nodeKey]);
  22286. }
  22287. }
  22288. return allNodes;
  22289. };
  22290. TreeStore.prototype.updateChildren = function updateChildren(key, data) {
  22291. var node = this.nodesMap[key];
  22292. if (!node) return;
  22293. var childNodes = node.childNodes;
  22294. for (var i = childNodes.length - 1; i >= 0; i--) {
  22295. var child = childNodes[i];
  22296. this.remove(child.data);
  22297. }
  22298. for (var _i = 0, j = data.length; _i < j; _i++) {
  22299. var _child = data[_i];
  22300. this.append(_child, node.data);
  22301. }
  22302. };
  22303. TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
  22304. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22305. var checkedKeys = arguments[2];
  22306. var allNodes = this._getAllNodes().sort(function (a, b) {
  22307. return b.level - a.level;
  22308. });
  22309. var cache = Object.create(null);
  22310. var keys = Object.keys(checkedKeys);
  22311. allNodes.forEach(function (node) {
  22312. return node.setChecked(false, false);
  22313. });
  22314. for (var i = 0, j = allNodes.length; i < j; i++) {
  22315. var node = allNodes[i];
  22316. var nodeKey = node.data[key].toString();
  22317. var checked = keys.indexOf(nodeKey) > -1;
  22318. if (!checked) {
  22319. if (node.checked && !cache[nodeKey]) {
  22320. node.setChecked(false, false);
  22321. }
  22322. continue;
  22323. }
  22324. var parent = node.parent;
  22325. while (parent && parent.level > 0) {
  22326. cache[parent.data[key]] = true;
  22327. parent = parent.parent;
  22328. }
  22329. if (node.isLeaf || this.checkStrictly) {
  22330. node.setChecked(true, false);
  22331. continue;
  22332. }
  22333. node.setChecked(true, true);
  22334. if (leafOnly) {
  22335. (function () {
  22336. node.setChecked(false, false);
  22337. var traverse = function traverse(node) {
  22338. var childNodes = node.childNodes;
  22339. childNodes.forEach(function (child) {
  22340. if (!child.isLeaf) {
  22341. child.setChecked(false, false);
  22342. }
  22343. traverse(child);
  22344. });
  22345. };
  22346. traverse(node);
  22347. })();
  22348. }
  22349. }
  22350. };
  22351. TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
  22352. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22353. var key = this.key;
  22354. var checkedKeys = {};
  22355. array.forEach(function (item) {
  22356. checkedKeys[(item || {})[key]] = true;
  22357. });
  22358. this._setCheckedKeys(key, leafOnly, checkedKeys);
  22359. };
  22360. TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
  22361. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22362. this.defaultCheckedKeys = keys;
  22363. var key = this.key;
  22364. var checkedKeys = {};
  22365. keys.forEach(function (key) {
  22366. checkedKeys[key] = true;
  22367. });
  22368. this._setCheckedKeys(key, leafOnly, checkedKeys);
  22369. };
  22370. TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
  22371. var _this6 = this;
  22372. keys = keys || [];
  22373. this.defaultExpandedKeys = keys;
  22374. keys.forEach(function (key) {
  22375. var node = _this6.getNode(key);
  22376. if (node) node.expand(null, _this6.autoExpandParent);
  22377. });
  22378. };
  22379. TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
  22380. var node = this.getNode(data);
  22381. if (node) {
  22382. node.setChecked(!!checked, deep);
  22383. }
  22384. };
  22385. TreeStore.prototype.getCurrentNode = function getCurrentNode() {
  22386. return this.currentNode;
  22387. };
  22388. TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
  22389. var prevCurrentNode = this.currentNode;
  22390. if (prevCurrentNode) {
  22391. prevCurrentNode.isCurrent = false;
  22392. }
  22393. this.currentNode = currentNode;
  22394. this.currentNode.isCurrent = true;
  22395. };
  22396. TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
  22397. var key = node[this.key];
  22398. var currNode = this.nodesMap[key];
  22399. this.setCurrentNode(currNode);
  22400. };
  22401. TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
  22402. if (key === null) {
  22403. this.currentNode = null;
  22404. return;
  22405. }
  22406. var node = this.getNode(key);
  22407. if (node) {
  22408. this.setCurrentNode(node);
  22409. }
  22410. };
  22411. return TreeStore;
  22412. }();
  22413. /* harmony default export */ var tree_store = (tree_store_TreeStore);
  22414. ;
  22415. // 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&
  22416. var tree_nodevue_type_template_id_3ba3ef0e_render = function() {
  22417. var this$1 = this
  22418. var _vm = this
  22419. var _h = _vm.$createElement
  22420. var _c = _vm._self._c || _h
  22421. return _c(
  22422. "div",
  22423. {
  22424. directives: [
  22425. {
  22426. name: "show",
  22427. rawName: "v-show",
  22428. value: _vm.node.visible,
  22429. expression: "node.visible"
  22430. }
  22431. ],
  22432. ref: "node",
  22433. staticClass: "el-tree-node",
  22434. class: {
  22435. "is-expanded": _vm.expanded,
  22436. "is-current": _vm.node.isCurrent,
  22437. "is-hidden": !_vm.node.visible,
  22438. "is-focusable": !_vm.node.disabled,
  22439. "is-checked": !_vm.node.disabled && _vm.node.checked
  22440. },
  22441. attrs: {
  22442. role: "treeitem",
  22443. tabindex: "-1",
  22444. "aria-expanded": _vm.expanded,
  22445. "aria-disabled": _vm.node.disabled,
  22446. "aria-checked": _vm.node.checked,
  22447. draggable: _vm.tree.draggable
  22448. },
  22449. on: {
  22450. click: function($event) {
  22451. $event.stopPropagation()
  22452. return _vm.handleClick($event)
  22453. },
  22454. contextmenu: function($event) {
  22455. return this$1.handleContextMenu($event)
  22456. },
  22457. dragstart: function($event) {
  22458. $event.stopPropagation()
  22459. return _vm.handleDragStart($event)
  22460. },
  22461. dragover: function($event) {
  22462. $event.stopPropagation()
  22463. return _vm.handleDragOver($event)
  22464. },
  22465. dragend: function($event) {
  22466. $event.stopPropagation()
  22467. return _vm.handleDragEnd($event)
  22468. },
  22469. drop: function($event) {
  22470. $event.stopPropagation()
  22471. return _vm.handleDrop($event)
  22472. }
  22473. }
  22474. },
  22475. [
  22476. _c(
  22477. "div",
  22478. {
  22479. staticClass: "el-tree-node__content",
  22480. style: {
  22481. "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px"
  22482. }
  22483. },
  22484. [
  22485. _c("span", {
  22486. class: [
  22487. {
  22488. "is-leaf": _vm.node.isLeaf,
  22489. expanded: !_vm.node.isLeaf && _vm.expanded
  22490. },
  22491. "el-tree-node__expand-icon",
  22492. _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right"
  22493. ],
  22494. on: {
  22495. click: function($event) {
  22496. $event.stopPropagation()
  22497. return _vm.handleExpandIconClick($event)
  22498. }
  22499. }
  22500. }),
  22501. _vm.showCheckbox
  22502. ? _c("el-checkbox", {
  22503. attrs: {
  22504. indeterminate: _vm.node.indeterminate,
  22505. disabled: !!_vm.node.disabled
  22506. },
  22507. on: { change: _vm.handleCheckChange },
  22508. nativeOn: {
  22509. click: function($event) {
  22510. $event.stopPropagation()
  22511. }
  22512. },
  22513. model: {
  22514. value: _vm.node.checked,
  22515. callback: function($$v) {
  22516. _vm.$set(_vm.node, "checked", $$v)
  22517. },
  22518. expression: "node.checked"
  22519. }
  22520. })
  22521. : _vm._e(),
  22522. _vm.node.loading
  22523. ? _c("span", {
  22524. staticClass: "el-tree-node__loading-icon el-icon-loading"
  22525. })
  22526. : _vm._e(),
  22527. _c("node-content", { attrs: { node: _vm.node } })
  22528. ],
  22529. 1
  22530. ),
  22531. _c("el-collapse-transition", [
  22532. !_vm.renderAfterExpand || _vm.childNodeRendered
  22533. ? _c(
  22534. "div",
  22535. {
  22536. directives: [
  22537. {
  22538. name: "show",
  22539. rawName: "v-show",
  22540. value: _vm.expanded,
  22541. expression: "expanded"
  22542. }
  22543. ],
  22544. staticClass: "el-tree-node__children",
  22545. attrs: { role: "group", "aria-expanded": _vm.expanded }
  22546. },
  22547. _vm._l(_vm.node.childNodes, function(child) {
  22548. return _c("el-tree-node", {
  22549. key: _vm.getNodeKey(child),
  22550. attrs: {
  22551. "render-content": _vm.renderContent,
  22552. "render-after-expand": _vm.renderAfterExpand,
  22553. "show-checkbox": _vm.showCheckbox,
  22554. node: child
  22555. },
  22556. on: { "node-expand": _vm.handleChildNodeExpand }
  22557. })
  22558. }),
  22559. 1
  22560. )
  22561. : _vm._e()
  22562. ])
  22563. ],
  22564. 1
  22565. )
  22566. }
  22567. var tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns = []
  22568. tree_nodevue_type_template_id_3ba3ef0e_render._withStripped = true
  22569. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=3ba3ef0e&
  22570. // 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&
  22571. //
  22572. //
  22573. //
  22574. //
  22575. //
  22576. //
  22577. //
  22578. //
  22579. //
  22580. //
  22581. //
  22582. //
  22583. //
  22584. //
  22585. //
  22586. //
  22587. //
  22588. //
  22589. //
  22590. //
  22591. //
  22592. //
  22593. //
  22594. //
  22595. //
  22596. //
  22597. //
  22598. //
  22599. //
  22600. //
  22601. //
  22602. //
  22603. //
  22604. //
  22605. //
  22606. //
  22607. //
  22608. //
  22609. //
  22610. //
  22611. //
  22612. //
  22613. //
  22614. //
  22615. //
  22616. //
  22617. //
  22618. //
  22619. //
  22620. //
  22621. //
  22622. //
  22623. //
  22624. //
  22625. //
  22626. //
  22627. //
  22628. //
  22629. //
  22630. //
  22631. //
  22632. //
  22633. //
  22634. //
  22635. //
  22636. //
  22637. //
  22638. //
  22639. //
  22640. //
  22641. //
  22642. //
  22643. //
  22644. /* harmony default export */ var tree_nodevue_type_script_lang_js_ = ({
  22645. name: 'ElTreeNode',
  22646. componentName: 'ElTreeNode',
  22647. mixins: [emitter_default.a],
  22648. props: {
  22649. node: {
  22650. default: function _default() {
  22651. return {};
  22652. }
  22653. },
  22654. props: {},
  22655. renderContent: Function,
  22656. renderAfterExpand: {
  22657. type: Boolean,
  22658. default: true
  22659. },
  22660. showCheckbox: {
  22661. type: Boolean,
  22662. default: false
  22663. }
  22664. },
  22665. components: {
  22666. ElCollapseTransition: collapse_transition_default.a,
  22667. ElCheckbox: checkbox_default.a,
  22668. NodeContent: {
  22669. props: {
  22670. node: {
  22671. required: true
  22672. }
  22673. },
  22674. render: function render(h) {
  22675. var parent = this.$parent;
  22676. var tree = parent.tree;
  22677. var node = this.node;
  22678. var data = node.data,
  22679. store = node.store;
  22680. 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(
  22681. 'span',
  22682. { 'class': 'el-tree-node__label' },
  22683. [node.label]
  22684. );
  22685. }
  22686. }
  22687. },
  22688. data: function data() {
  22689. return {
  22690. tree: null,
  22691. expanded: false,
  22692. childNodeRendered: false,
  22693. oldChecked: null,
  22694. oldIndeterminate: null
  22695. };
  22696. },
  22697. watch: {
  22698. 'node.indeterminate': function nodeIndeterminate(val) {
  22699. this.handleSelectChange(this.node.checked, val);
  22700. },
  22701. 'node.checked': function nodeChecked(val) {
  22702. this.handleSelectChange(val, this.node.indeterminate);
  22703. },
  22704. 'node.expanded': function nodeExpanded(val) {
  22705. var _this = this;
  22706. this.$nextTick(function () {
  22707. return _this.expanded = val;
  22708. });
  22709. if (val) {
  22710. this.childNodeRendered = true;
  22711. }
  22712. }
  22713. },
  22714. methods: {
  22715. getNodeKey: function getNodeKey(node) {
  22716. return util_getNodeKey(this.tree.nodeKey, node.data);
  22717. },
  22718. handleSelectChange: function handleSelectChange(checked, indeterminate) {
  22719. if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
  22720. this.tree.$emit('check-change', this.node.data, checked, indeterminate);
  22721. }
  22722. this.oldChecked = checked;
  22723. this.indeterminate = indeterminate;
  22724. },
  22725. handleClick: function handleClick() {
  22726. var store = this.tree.store;
  22727. store.setCurrentNode(this.node);
  22728. this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
  22729. this.tree.currentNode = this;
  22730. if (this.tree.expandOnClickNode) {
  22731. this.handleExpandIconClick();
  22732. }
  22733. if (this.tree.checkOnClickNode && !this.node.disabled) {
  22734. this.handleCheckChange(null, {
  22735. target: { checked: !this.node.checked }
  22736. });
  22737. }
  22738. this.tree.$emit('node-click', this.node.data, this.node, this);
  22739. },
  22740. handleContextMenu: function handleContextMenu(event) {
  22741. if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
  22742. event.stopPropagation();
  22743. event.preventDefault();
  22744. }
  22745. this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
  22746. },
  22747. handleExpandIconClick: function handleExpandIconClick() {
  22748. if (this.node.isLeaf) return;
  22749. if (this.expanded) {
  22750. this.tree.$emit('node-collapse', this.node.data, this.node, this);
  22751. this.node.collapse();
  22752. } else {
  22753. this.node.expand();
  22754. this.$emit('node-expand', this.node.data, this.node, this);
  22755. }
  22756. },
  22757. handleCheckChange: function handleCheckChange(value, ev) {
  22758. var _this2 = this;
  22759. this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
  22760. this.$nextTick(function () {
  22761. var store = _this2.tree.store;
  22762. _this2.tree.$emit('check', _this2.node.data, {
  22763. checkedNodes: store.getCheckedNodes(),
  22764. checkedKeys: store.getCheckedKeys(),
  22765. halfCheckedNodes: store.getHalfCheckedNodes(),
  22766. halfCheckedKeys: store.getHalfCheckedKeys()
  22767. });
  22768. });
  22769. },
  22770. handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
  22771. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  22772. this.tree.$emit('node-expand', nodeData, node, instance);
  22773. },
  22774. handleDragStart: function handleDragStart(event) {
  22775. if (!this.tree.draggable) return;
  22776. this.tree.$emit('tree-node-drag-start', event, this);
  22777. },
  22778. handleDragOver: function handleDragOver(event) {
  22779. if (!this.tree.draggable) return;
  22780. this.tree.$emit('tree-node-drag-over', event, this);
  22781. event.preventDefault();
  22782. },
  22783. handleDrop: function handleDrop(event) {
  22784. event.preventDefault();
  22785. },
  22786. handleDragEnd: function handleDragEnd(event) {
  22787. if (!this.tree.draggable) return;
  22788. this.tree.$emit('tree-node-drag-end', event, this);
  22789. }
  22790. },
  22791. created: function created() {
  22792. var _this3 = this;
  22793. var parent = this.$parent;
  22794. if (parent.isTree) {
  22795. this.tree = parent;
  22796. } else {
  22797. this.tree = parent.tree;
  22798. }
  22799. var tree = this.tree;
  22800. if (!tree) {
  22801. console.warn('Can not find node\'s tree.');
  22802. }
  22803. var props = tree.props || {};
  22804. var childrenKey = props['children'] || 'children';
  22805. this.$watch('node.data.' + childrenKey, function () {
  22806. _this3.node.updateChildren();
  22807. });
  22808. if (this.node.expanded) {
  22809. this.expanded = true;
  22810. this.childNodeRendered = true;
  22811. }
  22812. if (this.tree.accordion) {
  22813. this.$on('tree-node-expand', function (node) {
  22814. if (_this3.node !== node) {
  22815. _this3.node.collapse();
  22816. }
  22817. });
  22818. }
  22819. }
  22820. });
  22821. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js&
  22822. /* harmony default export */ var src_tree_nodevue_type_script_lang_js_ = (tree_nodevue_type_script_lang_js_);
  22823. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
  22824. /* normalize component */
  22825. var tree_node_component = normalizeComponent(
  22826. src_tree_nodevue_type_script_lang_js_,
  22827. tree_nodevue_type_template_id_3ba3ef0e_render,
  22828. tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns,
  22829. false,
  22830. null,
  22831. null,
  22832. null
  22833. )
  22834. /* hot reload */
  22835. if (false) { var tree_node_api; }
  22836. tree_node_component.options.__file = "packages/tree/src/tree-node.vue"
  22837. /* harmony default export */ var tree_node = (tree_node_component.exports);
  22838. // 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&
  22839. //
  22840. //
  22841. //
  22842. //
  22843. //
  22844. //
  22845. //
  22846. //
  22847. //
  22848. //
  22849. //
  22850. //
  22851. //
  22852. //
  22853. //
  22854. //
  22855. //
  22856. //
  22857. //
  22858. //
  22859. //
  22860. //
  22861. //
  22862. //
  22863. //
  22864. //
  22865. //
  22866. //
  22867. //
  22868. //
  22869. //
  22870. //
  22871. /* harmony default export */ var treevue_type_script_lang_js_ = ({
  22872. name: 'ElTree',
  22873. mixins: [emitter_default.a],
  22874. components: {
  22875. ElTreeNode: tree_node
  22876. },
  22877. data: function data() {
  22878. return {
  22879. store: null,
  22880. root: null,
  22881. currentNode: null,
  22882. treeItems: null,
  22883. checkboxItems: [],
  22884. dragState: {
  22885. showDropIndicator: false,
  22886. draggingNode: null,
  22887. dropNode: null,
  22888. allowDrop: true
  22889. }
  22890. };
  22891. },
  22892. props: {
  22893. data: {
  22894. type: Array
  22895. },
  22896. emptyText: {
  22897. type: String,
  22898. default: function _default() {
  22899. return Object(lib_locale_["t"])('el.tree.emptyText');
  22900. }
  22901. },
  22902. renderAfterExpand: {
  22903. type: Boolean,
  22904. default: true
  22905. },
  22906. nodeKey: String,
  22907. checkStrictly: Boolean,
  22908. defaultExpandAll: Boolean,
  22909. expandOnClickNode: {
  22910. type: Boolean,
  22911. default: true
  22912. },
  22913. checkOnClickNode: Boolean,
  22914. checkDescendants: {
  22915. type: Boolean,
  22916. default: false
  22917. },
  22918. autoExpandParent: {
  22919. type: Boolean,
  22920. default: true
  22921. },
  22922. defaultCheckedKeys: Array,
  22923. defaultExpandedKeys: Array,
  22924. currentNodeKey: [String, Number],
  22925. renderContent: Function,
  22926. showCheckbox: {
  22927. type: Boolean,
  22928. default: false
  22929. },
  22930. draggable: {
  22931. type: Boolean,
  22932. default: false
  22933. },
  22934. allowDrag: Function,
  22935. allowDrop: Function,
  22936. props: {
  22937. default: function _default() {
  22938. return {
  22939. children: 'children',
  22940. label: 'label',
  22941. disabled: 'disabled'
  22942. };
  22943. }
  22944. },
  22945. lazy: {
  22946. type: Boolean,
  22947. default: false
  22948. },
  22949. highlightCurrent: Boolean,
  22950. load: Function,
  22951. filterNodeMethod: Function,
  22952. accordion: Boolean,
  22953. indent: {
  22954. type: Number,
  22955. default: 18
  22956. },
  22957. iconClass: String
  22958. },
  22959. computed: {
  22960. children: {
  22961. set: function set(value) {
  22962. this.data = value;
  22963. },
  22964. get: function get() {
  22965. return this.data;
  22966. }
  22967. },
  22968. treeItemArray: function treeItemArray() {
  22969. return Array.prototype.slice.call(this.treeItems);
  22970. },
  22971. isEmpty: function isEmpty() {
  22972. var childNodes = this.root.childNodes;
  22973. return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
  22974. var visible = _ref.visible;
  22975. return !visible;
  22976. });
  22977. }
  22978. },
  22979. watch: {
  22980. defaultCheckedKeys: function defaultCheckedKeys(newVal) {
  22981. this.store.setDefaultCheckedKey(newVal);
  22982. },
  22983. defaultExpandedKeys: function defaultExpandedKeys(newVal) {
  22984. this.store.defaultExpandedKeys = newVal;
  22985. this.store.setDefaultExpandedKeys(newVal);
  22986. },
  22987. data: function data(newVal) {
  22988. this.store.setData(newVal);
  22989. },
  22990. checkboxItems: function checkboxItems(val) {
  22991. Array.prototype.forEach.call(val, function (checkbox) {
  22992. checkbox.setAttribute('tabindex', -1);
  22993. });
  22994. },
  22995. checkStrictly: function checkStrictly(newVal) {
  22996. this.store.checkStrictly = newVal;
  22997. }
  22998. },
  22999. methods: {
  23000. filter: function filter(value) {
  23001. if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
  23002. this.store.filter(value);
  23003. },
  23004. getNodeKey: function getNodeKey(node) {
  23005. return util_getNodeKey(this.nodeKey, node.data);
  23006. },
  23007. getNodePath: function getNodePath(data) {
  23008. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
  23009. var node = this.store.getNode(data);
  23010. if (!node) return [];
  23011. var path = [node.data];
  23012. var parent = node.parent;
  23013. while (parent && parent !== this.root) {
  23014. path.push(parent.data);
  23015. parent = parent.parent;
  23016. }
  23017. return path.reverse();
  23018. },
  23019. getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
  23020. return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
  23021. },
  23022. getCheckedKeys: function getCheckedKeys(leafOnly) {
  23023. return this.store.getCheckedKeys(leafOnly);
  23024. },
  23025. getCurrentNode: function getCurrentNode() {
  23026. var currentNode = this.store.getCurrentNode();
  23027. return currentNode ? currentNode.data : null;
  23028. },
  23029. getCurrentKey: function getCurrentKey() {
  23030. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
  23031. var currentNode = this.getCurrentNode();
  23032. return currentNode ? currentNode[this.nodeKey] : null;
  23033. },
  23034. setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
  23035. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
  23036. this.store.setCheckedNodes(nodes, leafOnly);
  23037. },
  23038. setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
  23039. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
  23040. this.store.setCheckedKeys(keys, leafOnly);
  23041. },
  23042. setChecked: function setChecked(data, checked, deep) {
  23043. this.store.setChecked(data, checked, deep);
  23044. },
  23045. getHalfCheckedNodes: function getHalfCheckedNodes() {
  23046. return this.store.getHalfCheckedNodes();
  23047. },
  23048. getHalfCheckedKeys: function getHalfCheckedKeys() {
  23049. return this.store.getHalfCheckedKeys();
  23050. },
  23051. setCurrentNode: function setCurrentNode(node) {
  23052. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
  23053. this.store.setUserCurrentNode(node);
  23054. },
  23055. setCurrentKey: function setCurrentKey(key) {
  23056. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
  23057. this.store.setCurrentNodeKey(key);
  23058. },
  23059. getNode: function getNode(data) {
  23060. return this.store.getNode(data);
  23061. },
  23062. remove: function remove(data) {
  23063. this.store.remove(data);
  23064. },
  23065. append: function append(data, parentNode) {
  23066. this.store.append(data, parentNode);
  23067. },
  23068. insertBefore: function insertBefore(data, refNode) {
  23069. this.store.insertBefore(data, refNode);
  23070. },
  23071. insertAfter: function insertAfter(data, refNode) {
  23072. this.store.insertAfter(data, refNode);
  23073. },
  23074. handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
  23075. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23076. this.$emit('node-expand', nodeData, node, instance);
  23077. },
  23078. updateKeyChildren: function updateKeyChildren(key, data) {
  23079. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
  23080. this.store.updateChildren(key, data);
  23081. },
  23082. initTabIndex: function initTabIndex() {
  23083. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23084. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23085. var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
  23086. if (checkedItem.length) {
  23087. checkedItem[0].setAttribute('tabindex', 0);
  23088. return;
  23089. }
  23090. this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
  23091. },
  23092. handleKeydown: function handleKeydown(ev) {
  23093. var currentItem = ev.target;
  23094. if (currentItem.className.indexOf('el-tree-node') === -1) return;
  23095. var keyCode = ev.keyCode;
  23096. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23097. var currentIndex = this.treeItemArray.indexOf(currentItem);
  23098. var nextIndex = void 0;
  23099. if ([38, 40].indexOf(keyCode) > -1) {
  23100. // up、down
  23101. ev.preventDefault();
  23102. if (keyCode === 38) {
  23103. // up
  23104. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  23105. } else {
  23106. nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
  23107. }
  23108. this.treeItemArray[nextIndex].focus(); // 选中
  23109. }
  23110. if ([37, 39].indexOf(keyCode) > -1) {
  23111. // left、right 展开
  23112. ev.preventDefault();
  23113. currentItem.click(); // 选中
  23114. }
  23115. var hasInput = currentItem.querySelector('[type="checkbox"]');
  23116. if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
  23117. // space enter选中checkbox
  23118. ev.preventDefault();
  23119. hasInput.click();
  23120. }
  23121. }
  23122. },
  23123. created: function created() {
  23124. var _this = this;
  23125. this.isTree = true;
  23126. this.store = new tree_store({
  23127. key: this.nodeKey,
  23128. data: this.data,
  23129. lazy: this.lazy,
  23130. props: this.props,
  23131. load: this.load,
  23132. currentNodeKey: this.currentNodeKey,
  23133. checkStrictly: this.checkStrictly,
  23134. checkDescendants: this.checkDescendants,
  23135. defaultCheckedKeys: this.defaultCheckedKeys,
  23136. defaultExpandedKeys: this.defaultExpandedKeys,
  23137. autoExpandParent: this.autoExpandParent,
  23138. defaultExpandAll: this.defaultExpandAll,
  23139. filterNodeMethod: this.filterNodeMethod
  23140. });
  23141. this.root = this.store.root;
  23142. var dragState = this.dragState;
  23143. this.$on('tree-node-drag-start', function (event, treeNode) {
  23144. if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
  23145. event.preventDefault();
  23146. return false;
  23147. }
  23148. event.dataTransfer.effectAllowed = 'move';
  23149. // wrap in try catch to address IE's error when first param is 'text/plain'
  23150. try {
  23151. // setData is required for draggable to work in FireFox
  23152. // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
  23153. event.dataTransfer.setData('text/plain', '');
  23154. } catch (e) {}
  23155. dragState.draggingNode = treeNode;
  23156. _this.$emit('node-drag-start', treeNode.node, event);
  23157. });
  23158. this.$on('tree-node-drag-over', function (event, treeNode) {
  23159. var dropNode = findNearestComponent(event.target, 'ElTreeNode');
  23160. var oldDropNode = dragState.dropNode;
  23161. if (oldDropNode && oldDropNode !== dropNode) {
  23162. Object(dom_["removeClass"])(oldDropNode.$el, 'is-drop-inner');
  23163. }
  23164. var draggingNode = dragState.draggingNode;
  23165. if (!draggingNode || !dropNode) return;
  23166. var dropPrev = true;
  23167. var dropInner = true;
  23168. var dropNext = true;
  23169. var userAllowDropInner = true;
  23170. if (typeof _this.allowDrop === 'function') {
  23171. dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
  23172. userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
  23173. dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
  23174. }
  23175. event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
  23176. if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
  23177. if (oldDropNode) {
  23178. _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
  23179. }
  23180. _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
  23181. }
  23182. if (dropPrev || dropInner || dropNext) {
  23183. dragState.dropNode = dropNode;
  23184. }
  23185. if (dropNode.node.nextSibling === draggingNode.node) {
  23186. dropNext = false;
  23187. }
  23188. if (dropNode.node.previousSibling === draggingNode.node) {
  23189. dropPrev = false;
  23190. }
  23191. if (dropNode.node.contains(draggingNode.node, false)) {
  23192. dropInner = false;
  23193. }
  23194. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  23195. dropPrev = false;
  23196. dropInner = false;
  23197. dropNext = false;
  23198. }
  23199. var targetPosition = dropNode.$el.getBoundingClientRect();
  23200. var treePosition = _this.$el.getBoundingClientRect();
  23201. var dropType = void 0;
  23202. var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
  23203. var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
  23204. var indicatorTop = -9999;
  23205. var distance = event.clientY - targetPosition.top;
  23206. if (distance < targetPosition.height * prevPercent) {
  23207. dropType = 'before';
  23208. } else if (distance > targetPosition.height * nextPercent) {
  23209. dropType = 'after';
  23210. } else if (dropInner) {
  23211. dropType = 'inner';
  23212. } else {
  23213. dropType = 'none';
  23214. }
  23215. var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
  23216. var dropIndicator = _this.$refs.dropIndicator;
  23217. if (dropType === 'before') {
  23218. indicatorTop = iconPosition.top - treePosition.top;
  23219. } else if (dropType === 'after') {
  23220. indicatorTop = iconPosition.bottom - treePosition.top;
  23221. }
  23222. dropIndicator.style.top = indicatorTop + 'px';
  23223. dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
  23224. if (dropType === 'inner') {
  23225. Object(dom_["addClass"])(dropNode.$el, 'is-drop-inner');
  23226. } else {
  23227. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23228. }
  23229. dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
  23230. dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
  23231. dragState.dropType = dropType;
  23232. _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
  23233. });
  23234. this.$on('tree-node-drag-end', function (event) {
  23235. var draggingNode = dragState.draggingNode,
  23236. dropType = dragState.dropType,
  23237. dropNode = dragState.dropNode;
  23238. event.preventDefault();
  23239. event.dataTransfer.dropEffect = 'move';
  23240. if (draggingNode && dropNode) {
  23241. var draggingNodeCopy = { data: draggingNode.node.data };
  23242. if (dropType !== 'none') {
  23243. draggingNode.node.remove();
  23244. }
  23245. if (dropType === 'before') {
  23246. dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
  23247. } else if (dropType === 'after') {
  23248. dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
  23249. } else if (dropType === 'inner') {
  23250. dropNode.node.insertChild(draggingNodeCopy);
  23251. }
  23252. if (dropType !== 'none') {
  23253. _this.store.registerNode(draggingNodeCopy);
  23254. }
  23255. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23256. _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
  23257. if (dropType !== 'none') {
  23258. _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
  23259. }
  23260. }
  23261. if (draggingNode && !dropNode) {
  23262. _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
  23263. }
  23264. dragState.showDropIndicator = false;
  23265. dragState.draggingNode = null;
  23266. dragState.dropNode = null;
  23267. dragState.allowDrop = true;
  23268. });
  23269. },
  23270. mounted: function mounted() {
  23271. this.initTabIndex();
  23272. this.$el.addEventListener('keydown', this.handleKeydown);
  23273. },
  23274. updated: function updated() {
  23275. this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
  23276. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23277. }
  23278. });
  23279. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js&
  23280. /* harmony default export */ var src_treevue_type_script_lang_js_ = (treevue_type_script_lang_js_);
  23281. // CONCATENATED MODULE: ./packages/tree/src/tree.vue
  23282. /* normalize component */
  23283. var tree_component = normalizeComponent(
  23284. src_treevue_type_script_lang_js_,
  23285. treevue_type_template_id_547575a6_render,
  23286. treevue_type_template_id_547575a6_staticRenderFns,
  23287. false,
  23288. null,
  23289. null,
  23290. null
  23291. )
  23292. /* hot reload */
  23293. if (false) { var tree_api; }
  23294. tree_component.options.__file = "packages/tree/src/tree.vue"
  23295. /* harmony default export */ var tree = (tree_component.exports);
  23296. // CONCATENATED MODULE: ./packages/tree/index.js
  23297. /* istanbul ignore next */
  23298. tree.install = function (Vue) {
  23299. Vue.component(tree.name, tree);
  23300. };
  23301. /* harmony default export */ var packages_tree = (tree);
  23302. // 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&
  23303. var mainvue_type_template_id_6e53341b_render = function() {
  23304. var _vm = this
  23305. var _h = _vm.$createElement
  23306. var _c = _vm._self._c || _h
  23307. return _c("transition", { attrs: { name: "el-alert-fade" } }, [
  23308. _c(
  23309. "div",
  23310. {
  23311. directives: [
  23312. {
  23313. name: "show",
  23314. rawName: "v-show",
  23315. value: _vm.visible,
  23316. expression: "visible"
  23317. }
  23318. ],
  23319. staticClass: "el-alert",
  23320. class: [
  23321. _vm.typeClass,
  23322. _vm.center ? "is-center" : "",
  23323. "is-" + _vm.effect
  23324. ],
  23325. attrs: { role: "alert" }
  23326. },
  23327. [
  23328. _vm.showIcon
  23329. ? _c("i", {
  23330. staticClass: "el-alert__icon",
  23331. class: [_vm.iconClass, _vm.isBigIcon]
  23332. })
  23333. : _vm._e(),
  23334. _c("div", { staticClass: "el-alert__content" }, [
  23335. _vm.title || _vm.$slots.title
  23336. ? _c(
  23337. "span",
  23338. { staticClass: "el-alert__title", class: [_vm.isBoldTitle] },
  23339. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  23340. 2
  23341. )
  23342. : _vm._e(),
  23343. _vm.$slots.default && !_vm.description
  23344. ? _c(
  23345. "p",
  23346. { staticClass: "el-alert__description" },
  23347. [_vm._t("default")],
  23348. 2
  23349. )
  23350. : _vm._e(),
  23351. _vm.description && !_vm.$slots.default
  23352. ? _c("p", { staticClass: "el-alert__description" }, [
  23353. _vm._v(_vm._s(_vm.description))
  23354. ])
  23355. : _vm._e(),
  23356. _c(
  23357. "i",
  23358. {
  23359. directives: [
  23360. {
  23361. name: "show",
  23362. rawName: "v-show",
  23363. value: _vm.closable,
  23364. expression: "closable"
  23365. }
  23366. ],
  23367. staticClass: "el-alert__closebtn",
  23368. class: {
  23369. "is-customed": _vm.closeText !== "",
  23370. "el-icon-close": _vm.closeText === ""
  23371. },
  23372. on: {
  23373. click: function($event) {
  23374. _vm.close()
  23375. }
  23376. }
  23377. },
  23378. [_vm._v(_vm._s(_vm.closeText))]
  23379. )
  23380. ])
  23381. ]
  23382. )
  23383. ])
  23384. }
  23385. var mainvue_type_template_id_6e53341b_staticRenderFns = []
  23386. mainvue_type_template_id_6e53341b_render._withStripped = true
  23387. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=template&id=6e53341b&
  23388. // 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&
  23389. //
  23390. //
  23391. //
  23392. //
  23393. //
  23394. //
  23395. //
  23396. //
  23397. //
  23398. //
  23399. //
  23400. //
  23401. //
  23402. //
  23403. //
  23404. //
  23405. //
  23406. //
  23407. //
  23408. //
  23409. //
  23410. var TYPE_CLASSES_MAP = {
  23411. 'success': 'el-icon-success',
  23412. 'warning': 'el-icon-warning',
  23413. 'error': 'el-icon-error'
  23414. };
  23415. /* harmony default export */ var alert_src_mainvue_type_script_lang_js_ = ({
  23416. name: 'ElAlert',
  23417. props: {
  23418. title: {
  23419. type: String,
  23420. default: ''
  23421. },
  23422. description: {
  23423. type: String,
  23424. default: ''
  23425. },
  23426. type: {
  23427. type: String,
  23428. default: 'info'
  23429. },
  23430. closable: {
  23431. type: Boolean,
  23432. default: true
  23433. },
  23434. closeText: {
  23435. type: String,
  23436. default: ''
  23437. },
  23438. showIcon: Boolean,
  23439. center: Boolean,
  23440. effect: {
  23441. type: String,
  23442. default: 'light',
  23443. validator: function validator(value) {
  23444. return ['light', 'dark'].indexOf(value) !== -1;
  23445. }
  23446. }
  23447. },
  23448. data: function data() {
  23449. return {
  23450. visible: true
  23451. };
  23452. },
  23453. methods: {
  23454. close: function close() {
  23455. this.visible = false;
  23456. this.$emit('close');
  23457. }
  23458. },
  23459. computed: {
  23460. typeClass: function typeClass() {
  23461. return 'el-alert--' + this.type;
  23462. },
  23463. iconClass: function iconClass() {
  23464. return TYPE_CLASSES_MAP[this.type] || 'el-icon-info';
  23465. },
  23466. isBigIcon: function isBigIcon() {
  23467. return this.description || this.$slots.default ? 'is-big' : '';
  23468. },
  23469. isBoldTitle: function isBoldTitle() {
  23470. return this.description || this.$slots.default ? 'is-bold' : '';
  23471. }
  23472. }
  23473. });
  23474. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=script&lang=js&
  23475. /* harmony default export */ var packages_alert_src_mainvue_type_script_lang_js_ = (alert_src_mainvue_type_script_lang_js_);
  23476. // CONCATENATED MODULE: ./packages/alert/src/main.vue
  23477. /* normalize component */
  23478. var alert_src_main_component = normalizeComponent(
  23479. packages_alert_src_mainvue_type_script_lang_js_,
  23480. mainvue_type_template_id_6e53341b_render,
  23481. mainvue_type_template_id_6e53341b_staticRenderFns,
  23482. false,
  23483. null,
  23484. null,
  23485. null
  23486. )
  23487. /* hot reload */
  23488. if (false) { var alert_src_main_api; }
  23489. alert_src_main_component.options.__file = "packages/alert/src/main.vue"
  23490. /* harmony default export */ var alert_src_main = (alert_src_main_component.exports);
  23491. // CONCATENATED MODULE: ./packages/alert/index.js
  23492. /* istanbul ignore next */
  23493. alert_src_main.install = function (Vue) {
  23494. Vue.component(alert_src_main.name, alert_src_main);
  23495. };
  23496. /* harmony default export */ var packages_alert = (alert_src_main);
  23497. // 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&
  23498. var mainvue_type_template_id_43dbc3d8_render = function() {
  23499. var _vm = this
  23500. var _h = _vm.$createElement
  23501. var _c = _vm._self._c || _h
  23502. return _c("transition", { attrs: { name: "el-notification-fade" } }, [
  23503. _c(
  23504. "div",
  23505. {
  23506. directives: [
  23507. {
  23508. name: "show",
  23509. rawName: "v-show",
  23510. value: _vm.visible,
  23511. expression: "visible"
  23512. }
  23513. ],
  23514. class: ["el-notification", _vm.customClass, _vm.horizontalClass],
  23515. style: _vm.positionStyle,
  23516. attrs: { role: "alert" },
  23517. on: {
  23518. mouseenter: function($event) {
  23519. _vm.clearTimer()
  23520. },
  23521. mouseleave: function($event) {
  23522. _vm.startTimer()
  23523. },
  23524. click: _vm.click
  23525. }
  23526. },
  23527. [
  23528. _vm.type || _vm.iconClass
  23529. ? _c("i", {
  23530. staticClass: "el-notification__icon",
  23531. class: [_vm.typeClass, _vm.iconClass]
  23532. })
  23533. : _vm._e(),
  23534. _c(
  23535. "div",
  23536. {
  23537. staticClass: "el-notification__group",
  23538. class: { "is-with-icon": _vm.typeClass || _vm.iconClass }
  23539. },
  23540. [
  23541. _c("h2", {
  23542. staticClass: "el-notification__title",
  23543. domProps: { textContent: _vm._s(_vm.title) }
  23544. }),
  23545. _c(
  23546. "div",
  23547. {
  23548. directives: [
  23549. {
  23550. name: "show",
  23551. rawName: "v-show",
  23552. value: _vm.message,
  23553. expression: "message"
  23554. }
  23555. ],
  23556. staticClass: "el-notification__content"
  23557. },
  23558. [
  23559. _vm._t("default", [
  23560. !_vm.dangerouslyUseHTMLString
  23561. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  23562. : _c("p", { domProps: { innerHTML: _vm._s(_vm.message) } })
  23563. ])
  23564. ],
  23565. 2
  23566. ),
  23567. _vm.showClose
  23568. ? _c("div", {
  23569. staticClass: "el-notification__closeBtn el-icon-close",
  23570. on: {
  23571. click: function($event) {
  23572. $event.stopPropagation()
  23573. return _vm.close($event)
  23574. }
  23575. }
  23576. })
  23577. : _vm._e()
  23578. ]
  23579. )
  23580. ]
  23581. )
  23582. ])
  23583. }
  23584. var mainvue_type_template_id_43dbc3d8_staticRenderFns = []
  23585. mainvue_type_template_id_43dbc3d8_render._withStripped = true
  23586. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=43dbc3d8&
  23587. // 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&
  23588. //
  23589. //
  23590. //
  23591. //
  23592. //
  23593. //
  23594. //
  23595. //
  23596. //
  23597. //
  23598. //
  23599. //
  23600. //
  23601. //
  23602. //
  23603. //
  23604. //
  23605. //
  23606. //
  23607. //
  23608. //
  23609. //
  23610. //
  23611. //
  23612. //
  23613. //
  23614. //
  23615. //
  23616. //
  23617. //
  23618. //
  23619. //
  23620. //
  23621. var mainvue_type_script_lang_js_typeMap = {
  23622. success: 'success',
  23623. info: 'info',
  23624. warning: 'warning',
  23625. error: 'error'
  23626. };
  23627. /* harmony default export */ var notification_src_mainvue_type_script_lang_js_ = ({
  23628. data: function data() {
  23629. return {
  23630. visible: false,
  23631. title: '',
  23632. message: '',
  23633. duration: 4500,
  23634. type: '',
  23635. showClose: true,
  23636. customClass: '',
  23637. iconClass: '',
  23638. onClose: null,
  23639. onClick: null,
  23640. closed: false,
  23641. verticalOffset: 0,
  23642. timer: null,
  23643. dangerouslyUseHTMLString: false,
  23644. position: 'top-right'
  23645. };
  23646. },
  23647. computed: {
  23648. typeClass: function typeClass() {
  23649. return this.type && mainvue_type_script_lang_js_typeMap[this.type] ? 'el-icon-' + mainvue_type_script_lang_js_typeMap[this.type] : '';
  23650. },
  23651. horizontalClass: function horizontalClass() {
  23652. return this.position.indexOf('right') > -1 ? 'right' : 'left';
  23653. },
  23654. verticalProperty: function verticalProperty() {
  23655. return (/^top-/.test(this.position) ? 'top' : 'bottom'
  23656. );
  23657. },
  23658. positionStyle: function positionStyle() {
  23659. var _ref;
  23660. return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
  23661. }
  23662. },
  23663. watch: {
  23664. closed: function closed(newVal) {
  23665. if (newVal) {
  23666. this.visible = false;
  23667. this.$el.addEventListener('transitionend', this.destroyElement);
  23668. }
  23669. }
  23670. },
  23671. methods: {
  23672. destroyElement: function destroyElement() {
  23673. this.$el.removeEventListener('transitionend', this.destroyElement);
  23674. this.$destroy(true);
  23675. this.$el.parentNode.removeChild(this.$el);
  23676. },
  23677. click: function click() {
  23678. if (typeof this.onClick === 'function') {
  23679. this.onClick();
  23680. }
  23681. },
  23682. close: function close() {
  23683. this.closed = true;
  23684. if (typeof this.onClose === 'function') {
  23685. this.onClose();
  23686. }
  23687. },
  23688. clearTimer: function clearTimer() {
  23689. clearTimeout(this.timer);
  23690. },
  23691. startTimer: function startTimer() {
  23692. var _this = this;
  23693. if (this.duration > 0) {
  23694. this.timer = setTimeout(function () {
  23695. if (!_this.closed) {
  23696. _this.close();
  23697. }
  23698. }, this.duration);
  23699. }
  23700. },
  23701. keydown: function keydown(e) {
  23702. if (e.keyCode === 46 || e.keyCode === 8) {
  23703. this.clearTimer(); // detele 取消倒计时
  23704. } else if (e.keyCode === 27) {
  23705. // esc关闭消息
  23706. if (!this.closed) {
  23707. this.close();
  23708. }
  23709. } else {
  23710. this.startTimer(); // 恢复倒计时
  23711. }
  23712. }
  23713. },
  23714. mounted: function mounted() {
  23715. var _this2 = this;
  23716. if (this.duration > 0) {
  23717. this.timer = setTimeout(function () {
  23718. if (!_this2.closed) {
  23719. _this2.close();
  23720. }
  23721. }, this.duration);
  23722. }
  23723. document.addEventListener('keydown', this.keydown);
  23724. },
  23725. beforeDestroy: function beforeDestroy() {
  23726. document.removeEventListener('keydown', this.keydown);
  23727. }
  23728. });
  23729. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
  23730. /* harmony default export */ var packages_notification_src_mainvue_type_script_lang_js_ = (notification_src_mainvue_type_script_lang_js_);
  23731. // CONCATENATED MODULE: ./packages/notification/src/main.vue
  23732. /* normalize component */
  23733. var notification_src_main_component = normalizeComponent(
  23734. packages_notification_src_mainvue_type_script_lang_js_,
  23735. mainvue_type_template_id_43dbc3d8_render,
  23736. mainvue_type_template_id_43dbc3d8_staticRenderFns,
  23737. false,
  23738. null,
  23739. null,
  23740. null
  23741. )
  23742. /* hot reload */
  23743. if (false) { var notification_src_main_api; }
  23744. notification_src_main_component.options.__file = "packages/notification/src/main.vue"
  23745. /* harmony default export */ var notification_src_main = (notification_src_main_component.exports);
  23746. // CONCATENATED MODULE: ./packages/notification/src/main.js
  23747. var NotificationConstructor = external_vue_default.a.extend(notification_src_main);
  23748. var src_main_instance = void 0;
  23749. var instances = [];
  23750. var seed = 1;
  23751. var main_Notification = function Notification(options) {
  23752. if (external_vue_default.a.prototype.$isServer) return;
  23753. options = options || {};
  23754. var userOnClose = options.onClose;
  23755. var id = 'notification_' + seed++;
  23756. var position = options.position || 'top-right';
  23757. options.onClose = function () {
  23758. Notification.close(id, userOnClose);
  23759. };
  23760. src_main_instance = new NotificationConstructor({
  23761. data: options
  23762. });
  23763. if (Object(vdom_["isVNode"])(options.message)) {
  23764. src_main_instance.$slots.default = [options.message];
  23765. options.message = 'REPLACED_BY_VNODE';
  23766. }
  23767. src_main_instance.id = id;
  23768. src_main_instance.$mount();
  23769. document.body.appendChild(src_main_instance.$el);
  23770. src_main_instance.visible = true;
  23771. src_main_instance.dom = src_main_instance.$el;
  23772. src_main_instance.dom.style.zIndex = popup_["PopupManager"].nextZIndex();
  23773. var verticalOffset = options.offset || 0;
  23774. instances.filter(function (item) {
  23775. return item.position === position;
  23776. }).forEach(function (item) {
  23777. verticalOffset += item.$el.offsetHeight + 16;
  23778. });
  23779. verticalOffset += 16;
  23780. src_main_instance.verticalOffset = verticalOffset;
  23781. instances.push(src_main_instance);
  23782. return src_main_instance;
  23783. };
  23784. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  23785. main_Notification[type] = function (options) {
  23786. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  23787. options = {
  23788. message: options
  23789. };
  23790. }
  23791. options.type = type;
  23792. return main_Notification(options);
  23793. };
  23794. });
  23795. main_Notification.close = function (id, userOnClose) {
  23796. var index = -1;
  23797. var len = instances.length;
  23798. var instance = instances.filter(function (instance, i) {
  23799. if (instance.id === id) {
  23800. index = i;
  23801. return true;
  23802. }
  23803. return false;
  23804. })[0];
  23805. if (!instance) return;
  23806. if (typeof userOnClose === 'function') {
  23807. userOnClose(instance);
  23808. }
  23809. instances.splice(index, 1);
  23810. if (len <= 1) return;
  23811. var position = instance.position;
  23812. var removedHeight = instance.dom.offsetHeight;
  23813. for (var i = index; i < len - 1; i++) {
  23814. if (instances[i].position === position) {
  23815. instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
  23816. }
  23817. }
  23818. };
  23819. main_Notification.closeAll = function () {
  23820. for (var i = instances.length - 1; i >= 0; i--) {
  23821. instances[i].close();
  23822. }
  23823. };
  23824. /* harmony default export */ var packages_notification_src_main = (main_Notification);
  23825. // CONCATENATED MODULE: ./packages/notification/index.js
  23826. /* harmony default export */ var notification = (packages_notification_src_main);
  23827. // 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&
  23828. var mainvue_type_template_id_32708644_render = function() {
  23829. var _vm = this
  23830. var _h = _vm.$createElement
  23831. var _c = _vm._self._c || _h
  23832. return _c(
  23833. "div",
  23834. {
  23835. staticClass: "el-slider",
  23836. class: {
  23837. "is-vertical": _vm.vertical,
  23838. "el-slider--with-input": _vm.showInput
  23839. },
  23840. attrs: {
  23841. role: "slider",
  23842. "aria-valuemin": _vm.min,
  23843. "aria-valuemax": _vm.max,
  23844. "aria-orientation": _vm.vertical ? "vertical" : "horizontal",
  23845. "aria-disabled": _vm.sliderDisabled
  23846. }
  23847. },
  23848. [
  23849. _vm.showInput && !_vm.range
  23850. ? _c("el-input-number", {
  23851. ref: "input",
  23852. staticClass: "el-slider__input",
  23853. attrs: {
  23854. step: _vm.step,
  23855. disabled: _vm.sliderDisabled,
  23856. controls: _vm.showInputControls,
  23857. min: _vm.min,
  23858. max: _vm.max,
  23859. debounce: _vm.debounce,
  23860. size: _vm.inputSize
  23861. },
  23862. on: {
  23863. change: function($event) {
  23864. _vm.$nextTick(_vm.emitChange)
  23865. }
  23866. },
  23867. model: {
  23868. value: _vm.firstValue,
  23869. callback: function($$v) {
  23870. _vm.firstValue = $$v
  23871. },
  23872. expression: "firstValue"
  23873. }
  23874. })
  23875. : _vm._e(),
  23876. _c(
  23877. "div",
  23878. {
  23879. ref: "slider",
  23880. staticClass: "el-slider__runway",
  23881. class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
  23882. style: _vm.runwayStyle,
  23883. on: { click: _vm.onSliderClick }
  23884. },
  23885. [
  23886. _c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
  23887. _c("slider-button", {
  23888. ref: "button1",
  23889. attrs: {
  23890. vertical: _vm.vertical,
  23891. "tooltip-class": _vm.tooltipClass
  23892. },
  23893. model: {
  23894. value: _vm.firstValue,
  23895. callback: function($$v) {
  23896. _vm.firstValue = $$v
  23897. },
  23898. expression: "firstValue"
  23899. }
  23900. }),
  23901. _vm.range
  23902. ? _c("slider-button", {
  23903. ref: "button2",
  23904. attrs: {
  23905. vertical: _vm.vertical,
  23906. "tooltip-class": _vm.tooltipClass
  23907. },
  23908. model: {
  23909. value: _vm.secondValue,
  23910. callback: function($$v) {
  23911. _vm.secondValue = $$v
  23912. },
  23913. expression: "secondValue"
  23914. }
  23915. })
  23916. : _vm._e(),
  23917. _vm._l(_vm.stops, function(item, key) {
  23918. return _vm.showStops
  23919. ? _c("div", {
  23920. key: key,
  23921. staticClass: "el-slider__stop",
  23922. style: _vm.getStopStyle(item)
  23923. })
  23924. : _vm._e()
  23925. }),
  23926. _vm.markList.length > 0
  23927. ? [
  23928. _c(
  23929. "div",
  23930. _vm._l(_vm.markList, function(item, key) {
  23931. return _c("div", {
  23932. key: key,
  23933. staticClass: "el-slider__stop el-slider__marks-stop",
  23934. style: _vm.getStopStyle(item.position)
  23935. })
  23936. }),
  23937. 0
  23938. ),
  23939. _c(
  23940. "div",
  23941. { staticClass: "el-slider__marks" },
  23942. _vm._l(_vm.markList, function(item, key) {
  23943. return _c("slider-marker", {
  23944. key: key,
  23945. style: _vm.getStopStyle(item.position),
  23946. attrs: { mark: item.mark }
  23947. })
  23948. }),
  23949. 1
  23950. )
  23951. ]
  23952. : _vm._e()
  23953. ],
  23954. 2
  23955. )
  23956. ],
  23957. 1
  23958. )
  23959. }
  23960. var mainvue_type_template_id_32708644_staticRenderFns = []
  23961. mainvue_type_template_id_32708644_render._withStripped = true
  23962. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=32708644&
  23963. // EXTERNAL MODULE: external "element-ui/lib/input-number"
  23964. var input_number_ = __webpack_require__(39);
  23965. var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
  23966. // 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&
  23967. var buttonvue_type_template_id_e72d2ad2_render = function() {
  23968. var _vm = this
  23969. var _h = _vm.$createElement
  23970. var _c = _vm._self._c || _h
  23971. return _c(
  23972. "div",
  23973. {
  23974. ref: "button",
  23975. staticClass: "el-slider__button-wrapper",
  23976. class: { hover: _vm.hovering, dragging: _vm.dragging },
  23977. style: _vm.wrapperStyle,
  23978. attrs: { tabindex: "0" },
  23979. on: {
  23980. mouseenter: _vm.handleMouseEnter,
  23981. mouseleave: _vm.handleMouseLeave,
  23982. mousedown: _vm.onButtonDown,
  23983. touchstart: _vm.onButtonDown,
  23984. focus: _vm.handleMouseEnter,
  23985. blur: _vm.handleMouseLeave,
  23986. keydown: [
  23987. function($event) {
  23988. if (
  23989. !("button" in $event) &&
  23990. _vm._k($event.keyCode, "left", 37, $event.key, [
  23991. "Left",
  23992. "ArrowLeft"
  23993. ])
  23994. ) {
  23995. return null
  23996. }
  23997. if ("button" in $event && $event.button !== 0) {
  23998. return null
  23999. }
  24000. return _vm.onLeftKeyDown($event)
  24001. },
  24002. function($event) {
  24003. if (
  24004. !("button" in $event) &&
  24005. _vm._k($event.keyCode, "right", 39, $event.key, [
  24006. "Right",
  24007. "ArrowRight"
  24008. ])
  24009. ) {
  24010. return null
  24011. }
  24012. if ("button" in $event && $event.button !== 2) {
  24013. return null
  24014. }
  24015. return _vm.onRightKeyDown($event)
  24016. },
  24017. function($event) {
  24018. if (
  24019. !("button" in $event) &&
  24020. _vm._k($event.keyCode, "down", 40, $event.key, [
  24021. "Down",
  24022. "ArrowDown"
  24023. ])
  24024. ) {
  24025. return null
  24026. }
  24027. $event.preventDefault()
  24028. return _vm.onLeftKeyDown($event)
  24029. },
  24030. function($event) {
  24031. if (
  24032. !("button" in $event) &&
  24033. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  24034. ) {
  24035. return null
  24036. }
  24037. $event.preventDefault()
  24038. return _vm.onRightKeyDown($event)
  24039. }
  24040. ]
  24041. }
  24042. },
  24043. [
  24044. _c(
  24045. "el-tooltip",
  24046. {
  24047. ref: "tooltip",
  24048. attrs: {
  24049. placement: "top",
  24050. "popper-class": _vm.tooltipClass,
  24051. disabled: !_vm.showTooltip
  24052. }
  24053. },
  24054. [
  24055. _c("span", { attrs: { slot: "content" }, slot: "content" }, [
  24056. _vm._v(_vm._s(_vm.formatValue))
  24057. ]),
  24058. _c("div", {
  24059. staticClass: "el-slider__button",
  24060. class: { hover: _vm.hovering, dragging: _vm.dragging }
  24061. })
  24062. ]
  24063. )
  24064. ],
  24065. 1
  24066. )
  24067. }
  24068. var buttonvue_type_template_id_e72d2ad2_staticRenderFns = []
  24069. buttonvue_type_template_id_e72d2ad2_render._withStripped = true
  24070. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=e72d2ad2&
  24071. // 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&
  24072. //
  24073. //
  24074. //
  24075. //
  24076. //
  24077. //
  24078. //
  24079. //
  24080. //
  24081. //
  24082. //
  24083. //
  24084. //
  24085. //
  24086. //
  24087. //
  24088. //
  24089. //
  24090. //
  24091. //
  24092. //
  24093. //
  24094. //
  24095. //
  24096. //
  24097. //
  24098. //
  24099. //
  24100. //
  24101. /* harmony default export */ var slider_src_buttonvue_type_script_lang_js_ = ({
  24102. name: 'ElSliderButton',
  24103. components: {
  24104. ElTooltip: tooltip_default.a
  24105. },
  24106. props: {
  24107. value: {
  24108. type: Number,
  24109. default: 0
  24110. },
  24111. vertical: {
  24112. type: Boolean,
  24113. default: false
  24114. },
  24115. tooltipClass: String
  24116. },
  24117. data: function data() {
  24118. return {
  24119. hovering: false,
  24120. dragging: false,
  24121. isClick: false,
  24122. startX: 0,
  24123. currentX: 0,
  24124. startY: 0,
  24125. currentY: 0,
  24126. startPosition: 0,
  24127. newPosition: null,
  24128. oldValue: this.value
  24129. };
  24130. },
  24131. computed: {
  24132. disabled: function disabled() {
  24133. return this.$parent.sliderDisabled;
  24134. },
  24135. max: function max() {
  24136. return this.$parent.max;
  24137. },
  24138. min: function min() {
  24139. return this.$parent.min;
  24140. },
  24141. step: function step() {
  24142. return this.$parent.step;
  24143. },
  24144. showTooltip: function showTooltip() {
  24145. return this.$parent.showTooltip;
  24146. },
  24147. precision: function precision() {
  24148. return this.$parent.precision;
  24149. },
  24150. currentPosition: function currentPosition() {
  24151. return (this.value - this.min) / (this.max - this.min) * 100 + '%';
  24152. },
  24153. enableFormat: function enableFormat() {
  24154. return this.$parent.formatTooltip instanceof Function;
  24155. },
  24156. formatValue: function formatValue() {
  24157. return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
  24158. },
  24159. wrapperStyle: function wrapperStyle() {
  24160. return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
  24161. }
  24162. },
  24163. watch: {
  24164. dragging: function dragging(val) {
  24165. this.$parent.dragging = val;
  24166. }
  24167. },
  24168. methods: {
  24169. displayTooltip: function displayTooltip() {
  24170. this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
  24171. },
  24172. hideTooltip: function hideTooltip() {
  24173. this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
  24174. },
  24175. handleMouseEnter: function handleMouseEnter() {
  24176. this.hovering = true;
  24177. this.displayTooltip();
  24178. },
  24179. handleMouseLeave: function handleMouseLeave() {
  24180. this.hovering = false;
  24181. this.hideTooltip();
  24182. },
  24183. onButtonDown: function onButtonDown(event) {
  24184. if (this.disabled) return;
  24185. event.preventDefault();
  24186. this.onDragStart(event);
  24187. window.addEventListener('mousemove', this.onDragging);
  24188. window.addEventListener('touchmove', this.onDragging);
  24189. window.addEventListener('mouseup', this.onDragEnd);
  24190. window.addEventListener('touchend', this.onDragEnd);
  24191. window.addEventListener('contextmenu', this.onDragEnd);
  24192. },
  24193. onLeftKeyDown: function onLeftKeyDown() {
  24194. if (this.disabled) return;
  24195. this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
  24196. this.setPosition(this.newPosition);
  24197. this.$parent.emitChange();
  24198. },
  24199. onRightKeyDown: function onRightKeyDown() {
  24200. if (this.disabled) return;
  24201. this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
  24202. this.setPosition(this.newPosition);
  24203. this.$parent.emitChange();
  24204. },
  24205. onDragStart: function onDragStart(event) {
  24206. this.dragging = true;
  24207. this.isClick = true;
  24208. if (event.type === 'touchstart') {
  24209. event.clientY = event.touches[0].clientY;
  24210. event.clientX = event.touches[0].clientX;
  24211. }
  24212. if (this.vertical) {
  24213. this.startY = event.clientY;
  24214. } else {
  24215. this.startX = event.clientX;
  24216. }
  24217. this.startPosition = parseFloat(this.currentPosition);
  24218. this.newPosition = this.startPosition;
  24219. },
  24220. onDragging: function onDragging(event) {
  24221. if (this.dragging) {
  24222. this.isClick = false;
  24223. this.displayTooltip();
  24224. this.$parent.resetSize();
  24225. var diff = 0;
  24226. if (event.type === 'touchmove') {
  24227. event.clientY = event.touches[0].clientY;
  24228. event.clientX = event.touches[0].clientX;
  24229. }
  24230. if (this.vertical) {
  24231. this.currentY = event.clientY;
  24232. diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
  24233. } else {
  24234. this.currentX = event.clientX;
  24235. diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
  24236. }
  24237. this.newPosition = this.startPosition + diff;
  24238. this.setPosition(this.newPosition);
  24239. }
  24240. },
  24241. onDragEnd: function onDragEnd() {
  24242. var _this = this;
  24243. if (this.dragging) {
  24244. /*
  24245. * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
  24246. * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
  24247. */
  24248. setTimeout(function () {
  24249. _this.dragging = false;
  24250. _this.hideTooltip();
  24251. if (!_this.isClick) {
  24252. _this.setPosition(_this.newPosition);
  24253. _this.$parent.emitChange();
  24254. }
  24255. }, 0);
  24256. window.removeEventListener('mousemove', this.onDragging);
  24257. window.removeEventListener('touchmove', this.onDragging);
  24258. window.removeEventListener('mouseup', this.onDragEnd);
  24259. window.removeEventListener('touchend', this.onDragEnd);
  24260. window.removeEventListener('contextmenu', this.onDragEnd);
  24261. }
  24262. },
  24263. setPosition: function setPosition(newPosition) {
  24264. var _this2 = this;
  24265. if (newPosition === null || isNaN(newPosition)) return;
  24266. if (newPosition < 0) {
  24267. newPosition = 0;
  24268. } else if (newPosition > 100) {
  24269. newPosition = 100;
  24270. }
  24271. var lengthPerStep = 100 / ((this.max - this.min) / this.step);
  24272. var steps = Math.round(newPosition / lengthPerStep);
  24273. var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
  24274. value = parseFloat(value.toFixed(this.precision));
  24275. this.$emit('input', value);
  24276. this.$nextTick(function () {
  24277. _this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
  24278. });
  24279. if (!this.dragging && this.value !== this.oldValue) {
  24280. this.oldValue = this.value;
  24281. }
  24282. }
  24283. }
  24284. });
  24285. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js&
  24286. /* harmony default export */ var packages_slider_src_buttonvue_type_script_lang_js_ = (slider_src_buttonvue_type_script_lang_js_);
  24287. // CONCATENATED MODULE: ./packages/slider/src/button.vue
  24288. /* normalize component */
  24289. var src_button_component = normalizeComponent(
  24290. packages_slider_src_buttonvue_type_script_lang_js_,
  24291. buttonvue_type_template_id_e72d2ad2_render,
  24292. buttonvue_type_template_id_e72d2ad2_staticRenderFns,
  24293. false,
  24294. null,
  24295. null,
  24296. null
  24297. )
  24298. /* hot reload */
  24299. if (false) { var src_button_api; }
  24300. src_button_component.options.__file = "packages/slider/src/button.vue"
  24301. /* harmony default export */ var slider_src_button = (src_button_component.exports);
  24302. // CONCATENATED MODULE: ./packages/slider/src/marker.js
  24303. /* harmony default export */ var marker = ({
  24304. name: 'ElMarker',
  24305. props: {
  24306. mark: {
  24307. type: [String, Object]
  24308. }
  24309. },
  24310. render: function render() {
  24311. var h = arguments[0];
  24312. var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
  24313. return h(
  24314. 'div',
  24315. { 'class': 'el-slider__marks-text', style: this.mark.style || {} },
  24316. [label]
  24317. );
  24318. }
  24319. });
  24320. // 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&
  24321. //
  24322. //
  24323. //
  24324. //
  24325. //
  24326. //
  24327. //
  24328. //
  24329. //
  24330. //
  24331. //
  24332. //
  24333. //
  24334. //
  24335. //
  24336. //
  24337. //
  24338. //
  24339. //
  24340. //
  24341. //
  24342. //
  24343. //
  24344. //
  24345. //
  24346. //
  24347. //
  24348. //
  24349. //
  24350. //
  24351. //
  24352. //
  24353. //
  24354. //
  24355. //
  24356. //
  24357. //
  24358. //
  24359. //
  24360. //
  24361. //
  24362. //
  24363. //
  24364. //
  24365. //
  24366. //
  24367. //
  24368. //
  24369. //
  24370. //
  24371. //
  24372. //
  24373. //
  24374. //
  24375. //
  24376. //
  24377. //
  24378. //
  24379. //
  24380. //
  24381. //
  24382. //
  24383. //
  24384. //
  24385. //
  24386. //
  24387. //
  24388. //
  24389. //
  24390. //
  24391. //
  24392. //
  24393. //
  24394. //
  24395. //
  24396. /* harmony default export */ var slider_src_mainvue_type_script_lang_js_ = ({
  24397. name: 'ElSlider',
  24398. mixins: [emitter_default.a],
  24399. inject: {
  24400. elForm: {
  24401. default: ''
  24402. }
  24403. },
  24404. props: {
  24405. min: {
  24406. type: Number,
  24407. default: 0
  24408. },
  24409. max: {
  24410. type: Number,
  24411. default: 100
  24412. },
  24413. step: {
  24414. type: Number,
  24415. default: 1
  24416. },
  24417. value: {
  24418. type: [Number, Array],
  24419. default: 0
  24420. },
  24421. showInput: {
  24422. type: Boolean,
  24423. default: false
  24424. },
  24425. showInputControls: {
  24426. type: Boolean,
  24427. default: true
  24428. },
  24429. inputSize: {
  24430. type: String,
  24431. default: 'small'
  24432. },
  24433. showStops: {
  24434. type: Boolean,
  24435. default: false
  24436. },
  24437. showTooltip: {
  24438. type: Boolean,
  24439. default: true
  24440. },
  24441. formatTooltip: Function,
  24442. disabled: {
  24443. type: Boolean,
  24444. default: false
  24445. },
  24446. range: {
  24447. type: Boolean,
  24448. default: false
  24449. },
  24450. vertical: {
  24451. type: Boolean,
  24452. default: false
  24453. },
  24454. height: {
  24455. type: String
  24456. },
  24457. debounce: {
  24458. type: Number,
  24459. default: 300
  24460. },
  24461. label: {
  24462. type: String
  24463. },
  24464. tooltipClass: String,
  24465. marks: Object
  24466. },
  24467. components: {
  24468. ElInputNumber: input_number_default.a,
  24469. SliderButton: slider_src_button,
  24470. SliderMarker: marker
  24471. },
  24472. data: function data() {
  24473. return {
  24474. firstValue: null,
  24475. secondValue: null,
  24476. oldValue: null,
  24477. dragging: false,
  24478. sliderSize: 1
  24479. };
  24480. },
  24481. watch: {
  24482. value: function value(val, oldVal) {
  24483. if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
  24484. return item === oldVal[index];
  24485. })) {
  24486. return;
  24487. }
  24488. this.setValues();
  24489. },
  24490. dragging: function dragging(val) {
  24491. if (!val) {
  24492. this.setValues();
  24493. }
  24494. },
  24495. firstValue: function firstValue(val) {
  24496. if (this.range) {
  24497. this.$emit('input', [this.minValue, this.maxValue]);
  24498. } else {
  24499. this.$emit('input', val);
  24500. }
  24501. },
  24502. secondValue: function secondValue() {
  24503. if (this.range) {
  24504. this.$emit('input', [this.minValue, this.maxValue]);
  24505. }
  24506. },
  24507. min: function min() {
  24508. this.setValues();
  24509. },
  24510. max: function max() {
  24511. this.setValues();
  24512. }
  24513. },
  24514. methods: {
  24515. valueChanged: function valueChanged() {
  24516. var _this = this;
  24517. if (this.range) {
  24518. return ![this.minValue, this.maxValue].every(function (item, index) {
  24519. return item === _this.oldValue[index];
  24520. });
  24521. } else {
  24522. return this.value !== this.oldValue;
  24523. }
  24524. },
  24525. setValues: function setValues() {
  24526. if (this.min > this.max) {
  24527. console.error('[Element Error][Slider]min should not be greater than max.');
  24528. return;
  24529. }
  24530. var val = this.value;
  24531. if (this.range && Array.isArray(val)) {
  24532. if (val[1] < this.min) {
  24533. this.$emit('input', [this.min, this.min]);
  24534. } else if (val[0] > this.max) {
  24535. this.$emit('input', [this.max, this.max]);
  24536. } else if (val[0] < this.min) {
  24537. this.$emit('input', [this.min, val[1]]);
  24538. } else if (val[1] > this.max) {
  24539. this.$emit('input', [val[0], this.max]);
  24540. } else {
  24541. this.firstValue = val[0];
  24542. this.secondValue = val[1];
  24543. if (this.valueChanged()) {
  24544. this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
  24545. this.oldValue = val.slice();
  24546. }
  24547. }
  24548. } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
  24549. if (val < this.min) {
  24550. this.$emit('input', this.min);
  24551. } else if (val > this.max) {
  24552. this.$emit('input', this.max);
  24553. } else {
  24554. this.firstValue = val;
  24555. if (this.valueChanged()) {
  24556. this.dispatch('ElFormItem', 'el.form.change', val);
  24557. this.oldValue = val;
  24558. }
  24559. }
  24560. }
  24561. },
  24562. setPosition: function setPosition(percent) {
  24563. var targetValue = this.min + percent * (this.max - this.min) / 100;
  24564. if (!this.range) {
  24565. this.$refs.button1.setPosition(percent);
  24566. return;
  24567. }
  24568. var button = void 0;
  24569. if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
  24570. button = this.firstValue < this.secondValue ? 'button1' : 'button2';
  24571. } else {
  24572. button = this.firstValue > this.secondValue ? 'button1' : 'button2';
  24573. }
  24574. this.$refs[button].setPosition(percent);
  24575. },
  24576. onSliderClick: function onSliderClick(event) {
  24577. if (this.sliderDisabled || this.dragging) return;
  24578. this.resetSize();
  24579. if (this.vertical) {
  24580. var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
  24581. this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
  24582. } else {
  24583. var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  24584. this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
  24585. }
  24586. this.emitChange();
  24587. },
  24588. resetSize: function resetSize() {
  24589. if (this.$refs.slider) {
  24590. this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
  24591. }
  24592. },
  24593. emitChange: function emitChange() {
  24594. var _this2 = this;
  24595. this.$nextTick(function () {
  24596. _this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
  24597. });
  24598. },
  24599. getStopStyle: function getStopStyle(position) {
  24600. return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
  24601. }
  24602. },
  24603. computed: {
  24604. stops: function stops() {
  24605. var _this3 = this;
  24606. if (!this.showStops || this.min > this.max) return [];
  24607. if (this.step === 0) {
  24608. false && false;
  24609. return [];
  24610. }
  24611. var stopCount = (this.max - this.min) / this.step;
  24612. var stepWidth = 100 * this.step / (this.max - this.min);
  24613. var result = [];
  24614. for (var i = 1; i < stopCount; i++) {
  24615. result.push(i * stepWidth);
  24616. }
  24617. if (this.range) {
  24618. return result.filter(function (step) {
  24619. return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
  24620. });
  24621. } else {
  24622. return result.filter(function (step) {
  24623. return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
  24624. });
  24625. }
  24626. },
  24627. markList: function markList() {
  24628. var _this4 = this;
  24629. if (!this.marks) {
  24630. return [];
  24631. }
  24632. var marksKeys = Object.keys(this.marks);
  24633. return marksKeys.map(parseFloat).sort(function (a, b) {
  24634. return a - b;
  24635. }).filter(function (point) {
  24636. return point <= _this4.max && point >= _this4.min;
  24637. }).map(function (point) {
  24638. return {
  24639. point: point,
  24640. position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
  24641. mark: _this4.marks[point]
  24642. };
  24643. });
  24644. },
  24645. minValue: function minValue() {
  24646. return Math.min(this.firstValue, this.secondValue);
  24647. },
  24648. maxValue: function maxValue() {
  24649. return Math.max(this.firstValue, this.secondValue);
  24650. },
  24651. barSize: function barSize() {
  24652. return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
  24653. },
  24654. barStart: function barStart() {
  24655. return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
  24656. },
  24657. precision: function precision() {
  24658. var precisions = [this.min, this.max, this.step].map(function (item) {
  24659. var decimal = ('' + item).split('.')[1];
  24660. return decimal ? decimal.length : 0;
  24661. });
  24662. return Math.max.apply(null, precisions);
  24663. },
  24664. runwayStyle: function runwayStyle() {
  24665. return this.vertical ? { height: this.height } : {};
  24666. },
  24667. barStyle: function barStyle() {
  24668. return this.vertical ? {
  24669. height: this.barSize,
  24670. bottom: this.barStart
  24671. } : {
  24672. width: this.barSize,
  24673. left: this.barStart
  24674. };
  24675. },
  24676. sliderDisabled: function sliderDisabled() {
  24677. return this.disabled || (this.elForm || {}).disabled;
  24678. }
  24679. },
  24680. mounted: function mounted() {
  24681. var valuetext = void 0;
  24682. if (this.range) {
  24683. if (Array.isArray(this.value)) {
  24684. this.firstValue = Math.max(this.min, this.value[0]);
  24685. this.secondValue = Math.min(this.max, this.value[1]);
  24686. } else {
  24687. this.firstValue = this.min;
  24688. this.secondValue = this.max;
  24689. }
  24690. this.oldValue = [this.firstValue, this.secondValue];
  24691. valuetext = this.firstValue + '-' + this.secondValue;
  24692. } else {
  24693. if (typeof this.value !== 'number' || isNaN(this.value)) {
  24694. this.firstValue = this.min;
  24695. } else {
  24696. this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
  24697. }
  24698. this.oldValue = this.firstValue;
  24699. valuetext = this.firstValue;
  24700. }
  24701. this.$el.setAttribute('aria-valuetext', valuetext);
  24702. // label screen reader
  24703. this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
  24704. this.resetSize();
  24705. window.addEventListener('resize', this.resetSize);
  24706. },
  24707. beforeDestroy: function beforeDestroy() {
  24708. window.removeEventListener('resize', this.resetSize);
  24709. }
  24710. });
  24711. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js&
  24712. /* harmony default export */ var packages_slider_src_mainvue_type_script_lang_js_ = (slider_src_mainvue_type_script_lang_js_);
  24713. // CONCATENATED MODULE: ./packages/slider/src/main.vue
  24714. /* normalize component */
  24715. var slider_src_main_component = normalizeComponent(
  24716. packages_slider_src_mainvue_type_script_lang_js_,
  24717. mainvue_type_template_id_32708644_render,
  24718. mainvue_type_template_id_32708644_staticRenderFns,
  24719. false,
  24720. null,
  24721. null,
  24722. null
  24723. )
  24724. /* hot reload */
  24725. if (false) { var slider_src_main_api; }
  24726. slider_src_main_component.options.__file = "packages/slider/src/main.vue"
  24727. /* harmony default export */ var slider_src_main = (slider_src_main_component.exports);
  24728. // CONCATENATED MODULE: ./packages/slider/index.js
  24729. /* istanbul ignore next */
  24730. slider_src_main.install = function (Vue) {
  24731. Vue.component(slider_src_main.name, slider_src_main);
  24732. };
  24733. /* harmony default export */ var slider = (slider_src_main);
  24734. // 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&
  24735. var loadingvue_type_template_id_eee0a7ac_render = function() {
  24736. var _vm = this
  24737. var _h = _vm.$createElement
  24738. var _c = _vm._self._c || _h
  24739. return _c(
  24740. "transition",
  24741. {
  24742. attrs: { name: "el-loading-fade" },
  24743. on: { "after-leave": _vm.handleAfterLeave }
  24744. },
  24745. [
  24746. _c(
  24747. "div",
  24748. {
  24749. directives: [
  24750. {
  24751. name: "show",
  24752. rawName: "v-show",
  24753. value: _vm.visible,
  24754. expression: "visible"
  24755. }
  24756. ],
  24757. staticClass: "el-loading-mask",
  24758. class: [_vm.customClass, { "is-fullscreen": _vm.fullscreen }],
  24759. style: { backgroundColor: _vm.background || "" }
  24760. },
  24761. [
  24762. _c("div", { staticClass: "el-loading-spinner" }, [
  24763. !_vm.spinner
  24764. ? _c(
  24765. "svg",
  24766. {
  24767. staticClass: "circular",
  24768. attrs: { viewBox: "25 25 50 50" }
  24769. },
  24770. [
  24771. _c("circle", {
  24772. staticClass: "path",
  24773. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  24774. })
  24775. ]
  24776. )
  24777. : _c("i", { class: _vm.spinner }),
  24778. _vm.text
  24779. ? _c("p", { staticClass: "el-loading-text" }, [
  24780. _vm._v(_vm._s(_vm.text))
  24781. ])
  24782. : _vm._e()
  24783. ])
  24784. ]
  24785. )
  24786. ]
  24787. )
  24788. }
  24789. var loadingvue_type_template_id_eee0a7ac_staticRenderFns = []
  24790. loadingvue_type_template_id_eee0a7ac_render._withStripped = true
  24791. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  24792. // 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&
  24793. //
  24794. //
  24795. //
  24796. //
  24797. //
  24798. //
  24799. //
  24800. //
  24801. //
  24802. //
  24803. //
  24804. //
  24805. //
  24806. //
  24807. //
  24808. //
  24809. //
  24810. //
  24811. /* harmony default export */ var loadingvue_type_script_lang_js_ = ({
  24812. data: function data() {
  24813. return {
  24814. text: null,
  24815. spinner: null,
  24816. background: null,
  24817. fullscreen: true,
  24818. visible: false,
  24819. customClass: ''
  24820. };
  24821. },
  24822. methods: {
  24823. handleAfterLeave: function handleAfterLeave() {
  24824. this.$emit('after-leave');
  24825. },
  24826. setText: function setText(text) {
  24827. this.text = text;
  24828. }
  24829. }
  24830. });
  24831. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=script&lang=js&
  24832. /* harmony default export */ var src_loadingvue_type_script_lang_js_ = (loadingvue_type_script_lang_js_);
  24833. // CONCATENATED MODULE: ./packages/loading/src/loading.vue
  24834. /* normalize component */
  24835. var loading_component = normalizeComponent(
  24836. src_loadingvue_type_script_lang_js_,
  24837. loadingvue_type_template_id_eee0a7ac_render,
  24838. loadingvue_type_template_id_eee0a7ac_staticRenderFns,
  24839. false,
  24840. null,
  24841. null,
  24842. null
  24843. )
  24844. /* hot reload */
  24845. if (false) { var loading_api; }
  24846. loading_component.options.__file = "packages/loading/src/loading.vue"
  24847. /* harmony default export */ var loading = (loading_component.exports);
  24848. // EXTERNAL MODULE: external "element-ui/lib/utils/after-leave"
  24849. var after_leave_ = __webpack_require__(31);
  24850. var after_leave_default = /*#__PURE__*/__webpack_require__.n(after_leave_);
  24851. // CONCATENATED MODULE: ./packages/loading/src/directive.js
  24852. var Mask = external_vue_default.a.extend(loading);
  24853. var loadingDirective = {};
  24854. loadingDirective.install = function (Vue) {
  24855. if (Vue.prototype.$isServer) return;
  24856. var toggleLoading = function toggleLoading(el, binding) {
  24857. if (binding.value) {
  24858. Vue.nextTick(function () {
  24859. if (binding.modifiers.fullscreen) {
  24860. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  24861. el.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  24862. el.maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  24863. Object(dom_["addClass"])(el.mask, 'is-fullscreen');
  24864. insertDom(document.body, el, binding);
  24865. } else {
  24866. Object(dom_["removeClass"])(el.mask, 'is-fullscreen');
  24867. if (binding.modifiers.body) {
  24868. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  24869. ['top', 'left'].forEach(function (property) {
  24870. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  24871. el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - parseInt(Object(dom_["getStyle"])(document.body, 'margin-' + property), 10) + 'px';
  24872. });
  24873. ['height', 'width'].forEach(function (property) {
  24874. el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
  24875. });
  24876. insertDom(document.body, el, binding);
  24877. } else {
  24878. el.originalPosition = Object(dom_["getStyle"])(el, 'position');
  24879. insertDom(el, el, binding);
  24880. }
  24881. }
  24882. });
  24883. } else {
  24884. after_leave_default()(el.instance, function (_) {
  24885. el.domVisible = false;
  24886. var target = binding.modifiers.fullscreen || binding.modifiers.body ? document.body : el;
  24887. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  24888. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  24889. el.instance.hiding = false;
  24890. }, 300, true);
  24891. el.instance.visible = false;
  24892. el.instance.hiding = true;
  24893. }
  24894. };
  24895. var insertDom = function insertDom(parent, el, binding) {
  24896. if (!el.domVisible && Object(dom_["getStyle"])(el, 'display') !== 'none' && Object(dom_["getStyle"])(el, 'visibility') !== 'hidden') {
  24897. Object.keys(el.maskStyle).forEach(function (property) {
  24898. el.mask.style[property] = el.maskStyle[property];
  24899. });
  24900. if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed') {
  24901. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  24902. }
  24903. if (binding.modifiers.fullscreen && binding.modifiers.lock) {
  24904. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  24905. }
  24906. el.domVisible = true;
  24907. parent.appendChild(el.mask);
  24908. Vue.nextTick(function () {
  24909. if (el.instance.hiding) {
  24910. el.instance.$emit('after-leave');
  24911. } else {
  24912. el.instance.visible = true;
  24913. }
  24914. });
  24915. el.domInserted = true;
  24916. }
  24917. };
  24918. Vue.directive('loading', {
  24919. bind: function bind(el, binding, vnode) {
  24920. var textExr = el.getAttribute('element-loading-text');
  24921. var spinnerExr = el.getAttribute('element-loading-spinner');
  24922. var backgroundExr = el.getAttribute('element-loading-background');
  24923. var customClassExr = el.getAttribute('element-loading-custom-class');
  24924. var vm = vnode.context;
  24925. var mask = new Mask({
  24926. el: document.createElement('div'),
  24927. data: {
  24928. text: vm && vm[textExr] || textExr,
  24929. spinner: vm && vm[spinnerExr] || spinnerExr,
  24930. background: vm && vm[backgroundExr] || backgroundExr,
  24931. customClass: vm && vm[customClassExr] || customClassExr,
  24932. fullscreen: !!binding.modifiers.fullscreen
  24933. }
  24934. });
  24935. el.instance = mask;
  24936. el.mask = mask.$el;
  24937. el.maskStyle = {};
  24938. binding.value && toggleLoading(el, binding);
  24939. },
  24940. update: function update(el, binding) {
  24941. el.instance.setText(el.getAttribute('element-loading-text'));
  24942. if (binding.oldValue !== binding.value) {
  24943. toggleLoading(el, binding);
  24944. }
  24945. },
  24946. unbind: function unbind(el, binding) {
  24947. if (el.domInserted) {
  24948. el.mask && el.mask.parentNode && el.mask.parentNode.removeChild(el.mask);
  24949. toggleLoading(el, { value: false, modifiers: binding.modifiers });
  24950. }
  24951. el.instance && el.instance.$destroy();
  24952. }
  24953. });
  24954. };
  24955. /* harmony default export */ var src_directive = (loadingDirective);
  24956. // CONCATENATED MODULE: ./packages/loading/src/index.js
  24957. var LoadingConstructor = external_vue_default.a.extend(loading);
  24958. var src_defaults = {
  24959. text: null,
  24960. fullscreen: true,
  24961. body: false,
  24962. lock: false,
  24963. customClass: ''
  24964. };
  24965. var fullscreenLoading = void 0;
  24966. LoadingConstructor.prototype.originalPosition = '';
  24967. LoadingConstructor.prototype.originalOverflow = '';
  24968. LoadingConstructor.prototype.close = function () {
  24969. var _this = this;
  24970. if (this.fullscreen) {
  24971. fullscreenLoading = undefined;
  24972. }
  24973. after_leave_default()(this, function (_) {
  24974. var target = _this.fullscreen || _this.body ? document.body : _this.target;
  24975. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  24976. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  24977. if (_this.$el && _this.$el.parentNode) {
  24978. _this.$el.parentNode.removeChild(_this.$el);
  24979. }
  24980. _this.$destroy();
  24981. }, 300);
  24982. this.visible = false;
  24983. };
  24984. var src_addStyle = function addStyle(options, parent, instance) {
  24985. var maskStyle = {};
  24986. if (options.fullscreen) {
  24987. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  24988. instance.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  24989. maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  24990. } else if (options.body) {
  24991. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  24992. ['top', 'left'].forEach(function (property) {
  24993. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  24994. maskStyle[property] = options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
  24995. });
  24996. ['height', 'width'].forEach(function (property) {
  24997. maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
  24998. });
  24999. } else {
  25000. instance.originalPosition = Object(dom_["getStyle"])(parent, 'position');
  25001. }
  25002. Object.keys(maskStyle).forEach(function (property) {
  25003. instance.$el.style[property] = maskStyle[property];
  25004. });
  25005. };
  25006. var src_Loading = function Loading() {
  25007. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25008. if (external_vue_default.a.prototype.$isServer) return;
  25009. options = merge_default()({}, src_defaults, options);
  25010. if (typeof options.target === 'string') {
  25011. options.target = document.querySelector(options.target);
  25012. }
  25013. options.target = options.target || document.body;
  25014. if (options.target !== document.body) {
  25015. options.fullscreen = false;
  25016. } else {
  25017. options.body = true;
  25018. }
  25019. if (options.fullscreen && fullscreenLoading) {
  25020. return fullscreenLoading;
  25021. }
  25022. var parent = options.body ? document.body : options.target;
  25023. var instance = new LoadingConstructor({
  25024. el: document.createElement('div'),
  25025. data: options
  25026. });
  25027. src_addStyle(options, parent, instance);
  25028. if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed') {
  25029. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25030. }
  25031. if (options.fullscreen && options.lock) {
  25032. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25033. }
  25034. parent.appendChild(instance.$el);
  25035. external_vue_default.a.nextTick(function () {
  25036. instance.visible = true;
  25037. });
  25038. if (options.fullscreen) {
  25039. fullscreenLoading = instance;
  25040. }
  25041. return instance;
  25042. };
  25043. /* harmony default export */ var src = (src_Loading);
  25044. // CONCATENATED MODULE: ./packages/loading/index.js
  25045. /* harmony default export */ var packages_loading = ({
  25046. install: function install(Vue) {
  25047. Vue.use(src_directive);
  25048. Vue.prototype.$loading = src;
  25049. },
  25050. directive: src_directive,
  25051. service: src
  25052. });
  25053. // 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&
  25054. var iconvue_type_template_id_cb3fe7f4_render = function() {
  25055. var _vm = this
  25056. var _h = _vm.$createElement
  25057. var _c = _vm._self._c || _h
  25058. return _c("i", { class: "el-icon-" + _vm.name })
  25059. }
  25060. var iconvue_type_template_id_cb3fe7f4_staticRenderFns = []
  25061. iconvue_type_template_id_cb3fe7f4_render._withStripped = true
  25062. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=template&id=cb3fe7f4&
  25063. // 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&
  25064. //
  25065. //
  25066. //
  25067. //
  25068. /* harmony default export */ var iconvue_type_script_lang_js_ = ({
  25069. name: 'ElIcon',
  25070. props: {
  25071. name: String
  25072. }
  25073. });
  25074. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=script&lang=js&
  25075. /* harmony default export */ var src_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
  25076. // CONCATENATED MODULE: ./packages/icon/src/icon.vue
  25077. /* normalize component */
  25078. var icon_component = normalizeComponent(
  25079. src_iconvue_type_script_lang_js_,
  25080. iconvue_type_template_id_cb3fe7f4_render,
  25081. iconvue_type_template_id_cb3fe7f4_staticRenderFns,
  25082. false,
  25083. null,
  25084. null,
  25085. null
  25086. )
  25087. /* hot reload */
  25088. if (false) { var icon_api; }
  25089. icon_component.options.__file = "packages/icon/src/icon.vue"
  25090. /* harmony default export */ var icon = (icon_component.exports);
  25091. // CONCATENATED MODULE: ./packages/icon/index.js
  25092. /* istanbul ignore next */
  25093. icon.install = function (Vue) {
  25094. Vue.component(icon.name, icon);
  25095. };
  25096. /* harmony default export */ var packages_icon = (icon);
  25097. // CONCATENATED MODULE: ./packages/row/src/row.js
  25098. /* harmony default export */ var src_row = ({
  25099. name: 'ElRow',
  25100. componentName: 'ElRow',
  25101. props: {
  25102. tag: {
  25103. type: String,
  25104. default: 'div'
  25105. },
  25106. gutter: Number,
  25107. type: String,
  25108. justify: {
  25109. type: String,
  25110. default: 'start'
  25111. },
  25112. align: {
  25113. type: String,
  25114. default: 'top'
  25115. }
  25116. },
  25117. computed: {
  25118. style: function style() {
  25119. var ret = {};
  25120. if (this.gutter) {
  25121. ret.marginLeft = '-' + this.gutter / 2 + 'px';
  25122. ret.marginRight = ret.marginLeft;
  25123. }
  25124. return ret;
  25125. }
  25126. },
  25127. render: function render(h) {
  25128. return h(this.tag, {
  25129. class: ['el-row', this.justify !== 'start' ? 'is-justify-' + this.justify : '', this.align !== 'top' ? 'is-align-' + this.align : '', { 'el-row--flex': this.type === 'flex' }],
  25130. style: this.style
  25131. }, this.$slots.default);
  25132. }
  25133. });
  25134. // CONCATENATED MODULE: ./packages/row/index.js
  25135. /* istanbul ignore next */
  25136. src_row.install = function (Vue) {
  25137. Vue.component(src_row.name, src_row);
  25138. };
  25139. /* harmony default export */ var packages_row = (src_row);
  25140. // CONCATENATED MODULE: ./packages/col/src/col.js
  25141. 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; };
  25142. /* harmony default export */ var col = ({
  25143. name: 'ElCol',
  25144. props: {
  25145. span: {
  25146. type: Number,
  25147. default: 24
  25148. },
  25149. tag: {
  25150. type: String,
  25151. default: 'div'
  25152. },
  25153. offset: Number,
  25154. pull: Number,
  25155. push: Number,
  25156. xs: [Number, Object],
  25157. sm: [Number, Object],
  25158. md: [Number, Object],
  25159. lg: [Number, Object],
  25160. xl: [Number, Object]
  25161. },
  25162. computed: {
  25163. gutter: function gutter() {
  25164. var parent = this.$parent;
  25165. while (parent && parent.$options.componentName !== 'ElRow') {
  25166. parent = parent.$parent;
  25167. }
  25168. return parent ? parent.gutter : 0;
  25169. }
  25170. },
  25171. render: function render(h) {
  25172. var _this = this;
  25173. var classList = [];
  25174. var style = {};
  25175. if (this.gutter) {
  25176. style.paddingLeft = this.gutter / 2 + 'px';
  25177. style.paddingRight = style.paddingLeft;
  25178. }
  25179. ['span', 'offset', 'pull', 'push'].forEach(function (prop) {
  25180. if (_this[prop] || _this[prop] === 0) {
  25181. classList.push(prop !== 'span' ? 'el-col-' + prop + '-' + _this[prop] : 'el-col-' + _this[prop]);
  25182. }
  25183. });
  25184. ['xs', 'sm', 'md', 'lg', 'xl'].forEach(function (size) {
  25185. if (typeof _this[size] === 'number') {
  25186. classList.push('el-col-' + size + '-' + _this[size]);
  25187. } else if (col_typeof(_this[size]) === 'object') {
  25188. var props = _this[size];
  25189. Object.keys(props).forEach(function (prop) {
  25190. classList.push(prop !== 'span' ? 'el-col-' + size + '-' + prop + '-' + props[prop] : 'el-col-' + size + '-' + props[prop]);
  25191. });
  25192. }
  25193. });
  25194. return h(this.tag, {
  25195. class: ['el-col', classList],
  25196. style: style
  25197. }, this.$slots.default);
  25198. }
  25199. });
  25200. // CONCATENATED MODULE: ./packages/col/index.js
  25201. /* istanbul ignore next */
  25202. col.install = function (Vue) {
  25203. Vue.component(col.name, col);
  25204. };
  25205. /* harmony default export */ var packages_col = (col);
  25206. // 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&
  25207. var upload_listvue_type_template_id_173fedf5_render = function() {
  25208. var _vm = this
  25209. var _h = _vm.$createElement
  25210. var _c = _vm._self._c || _h
  25211. return _c(
  25212. "transition-group",
  25213. {
  25214. class: [
  25215. "el-upload-list",
  25216. "el-upload-list--" + _vm.listType,
  25217. { "is-disabled": _vm.disabled }
  25218. ],
  25219. attrs: { tag: "ul", name: "el-list" }
  25220. },
  25221. _vm._l(_vm.files, function(file) {
  25222. return _c(
  25223. "li",
  25224. {
  25225. key: file.uid,
  25226. class: [
  25227. "el-upload-list__item",
  25228. "is-" + file.status,
  25229. _vm.focusing ? "focusing" : ""
  25230. ],
  25231. attrs: { tabindex: "0" },
  25232. on: {
  25233. keydown: function($event) {
  25234. if (
  25235. !("button" in $event) &&
  25236. _vm._k($event.keyCode, "delete", [8, 46], $event.key, [
  25237. "Backspace",
  25238. "Delete",
  25239. "Del"
  25240. ])
  25241. ) {
  25242. return null
  25243. }
  25244. !_vm.disabled && _vm.$emit("remove", file)
  25245. },
  25246. focus: function($event) {
  25247. _vm.focusing = true
  25248. },
  25249. blur: function($event) {
  25250. _vm.focusing = false
  25251. },
  25252. click: function($event) {
  25253. _vm.focusing = false
  25254. }
  25255. }
  25256. },
  25257. [
  25258. file.status !== "uploading" &&
  25259. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  25260. ? _c("img", {
  25261. staticClass: "el-upload-list__item-thumbnail",
  25262. attrs: { src: file.url, alt: "" }
  25263. })
  25264. : _vm._e(),
  25265. _c(
  25266. "a",
  25267. {
  25268. staticClass: "el-upload-list__item-name",
  25269. on: {
  25270. click: function($event) {
  25271. _vm.handleClick(file)
  25272. }
  25273. }
  25274. },
  25275. [
  25276. _c("i", { staticClass: "el-icon-document" }),
  25277. _vm._v(_vm._s(file.name) + "\n ")
  25278. ]
  25279. ),
  25280. _c("label", { staticClass: "el-upload-list__item-status-label" }, [
  25281. _c("i", {
  25282. class: {
  25283. "el-icon-upload-success": true,
  25284. "el-icon-circle-check": _vm.listType === "text",
  25285. "el-icon-check":
  25286. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  25287. }
  25288. })
  25289. ]),
  25290. !_vm.disabled
  25291. ? _c("i", {
  25292. staticClass: "el-icon-close",
  25293. on: {
  25294. click: function($event) {
  25295. _vm.$emit("remove", file)
  25296. }
  25297. }
  25298. })
  25299. : _vm._e(),
  25300. !_vm.disabled
  25301. ? _c("i", { staticClass: "el-icon-close-tip" }, [
  25302. _vm._v(_vm._s(_vm.t("el.upload.deleteTip")))
  25303. ])
  25304. : _vm._e(),
  25305. file.status === "uploading"
  25306. ? _c("el-progress", {
  25307. attrs: {
  25308. type: _vm.listType === "picture-card" ? "circle" : "line",
  25309. "stroke-width": _vm.listType === "picture-card" ? 6 : 2,
  25310. percentage: _vm.parsePercentage(file.percentage)
  25311. }
  25312. })
  25313. : _vm._e(),
  25314. _vm.listType === "picture-card"
  25315. ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
  25316. _vm.handlePreview && _vm.listType === "picture-card"
  25317. ? _c(
  25318. "span",
  25319. {
  25320. staticClass: "el-upload-list__item-preview",
  25321. on: {
  25322. click: function($event) {
  25323. _vm.handlePreview(file)
  25324. }
  25325. }
  25326. },
  25327. [_c("i", { staticClass: "el-icon-zoom-in" })]
  25328. )
  25329. : _vm._e(),
  25330. !_vm.disabled
  25331. ? _c(
  25332. "span",
  25333. {
  25334. staticClass: "el-upload-list__item-delete",
  25335. on: {
  25336. click: function($event) {
  25337. _vm.$emit("remove", file)
  25338. }
  25339. }
  25340. },
  25341. [_c("i", { staticClass: "el-icon-delete" })]
  25342. )
  25343. : _vm._e()
  25344. ])
  25345. : _vm._e()
  25346. ],
  25347. 1
  25348. )
  25349. }),
  25350. 0
  25351. )
  25352. }
  25353. var upload_listvue_type_template_id_173fedf5_staticRenderFns = []
  25354. upload_listvue_type_template_id_173fedf5_render._withStripped = true
  25355. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
  25356. // EXTERNAL MODULE: external "element-ui/lib/progress"
  25357. var progress_ = __webpack_require__(32);
  25358. var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
  25359. // 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&
  25360. //
  25361. //
  25362. //
  25363. //
  25364. //
  25365. //
  25366. //
  25367. //
  25368. //
  25369. //
  25370. //
  25371. //
  25372. //
  25373. //
  25374. //
  25375. //
  25376. //
  25377. //
  25378. //
  25379. //
  25380. //
  25381. //
  25382. //
  25383. //
  25384. //
  25385. //
  25386. //
  25387. //
  25388. //
  25389. //
  25390. //
  25391. //
  25392. //
  25393. //
  25394. //
  25395. //
  25396. //
  25397. //
  25398. //
  25399. //
  25400. //
  25401. //
  25402. //
  25403. //
  25404. //
  25405. //
  25406. //
  25407. //
  25408. //
  25409. //
  25410. //
  25411. //
  25412. //
  25413. //
  25414. //
  25415. //
  25416. //
  25417. //
  25418. //
  25419. //
  25420. //
  25421. //
  25422. /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({
  25423. name: 'ElUploadList',
  25424. mixins: [locale_default.a],
  25425. data: function data() {
  25426. return {
  25427. focusing: false
  25428. };
  25429. },
  25430. components: { ElProgress: progress_default.a },
  25431. props: {
  25432. files: {
  25433. type: Array,
  25434. default: function _default() {
  25435. return [];
  25436. }
  25437. },
  25438. disabled: {
  25439. type: Boolean,
  25440. default: false
  25441. },
  25442. handlePreview: Function,
  25443. listType: String
  25444. },
  25445. methods: {
  25446. parsePercentage: function parsePercentage(val) {
  25447. return parseInt(val, 10);
  25448. },
  25449. handleClick: function handleClick(file) {
  25450. this.handlePreview && this.handlePreview(file);
  25451. }
  25452. }
  25453. });
  25454. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
  25455. /* harmony default export */ var src_upload_listvue_type_script_lang_js_ = (upload_listvue_type_script_lang_js_);
  25456. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
  25457. /* normalize component */
  25458. var upload_list_component = normalizeComponent(
  25459. src_upload_listvue_type_script_lang_js_,
  25460. upload_listvue_type_template_id_173fedf5_render,
  25461. upload_listvue_type_template_id_173fedf5_staticRenderFns,
  25462. false,
  25463. null,
  25464. null,
  25465. null
  25466. )
  25467. /* hot reload */
  25468. if (false) { var upload_list_api; }
  25469. upload_list_component.options.__file = "packages/upload/src/upload-list.vue"
  25470. /* harmony default export */ var upload_list = (upload_list_component.exports);
  25471. // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
  25472. var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(26);
  25473. var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
  25474. // CONCATENATED MODULE: ./packages/upload/src/ajax.js
  25475. function getError(action, option, xhr) {
  25476. var msg = void 0;
  25477. if (xhr.response) {
  25478. msg = '' + (xhr.response.error || xhr.response);
  25479. } else if (xhr.responseText) {
  25480. msg = '' + xhr.responseText;
  25481. } else {
  25482. msg = 'fail to post ' + action + ' ' + xhr.status;
  25483. }
  25484. var err = new Error(msg);
  25485. err.status = xhr.status;
  25486. err.method = 'post';
  25487. err.url = action;
  25488. return err;
  25489. }
  25490. function getBody(xhr) {
  25491. var text = xhr.responseText || xhr.response;
  25492. if (!text) {
  25493. return text;
  25494. }
  25495. try {
  25496. return JSON.parse(text);
  25497. } catch (e) {
  25498. return text;
  25499. }
  25500. }
  25501. function upload(option) {
  25502. if (typeof XMLHttpRequest === 'undefined') {
  25503. return;
  25504. }
  25505. var xhr = new XMLHttpRequest();
  25506. var action = option.action;
  25507. if (xhr.upload) {
  25508. xhr.upload.onprogress = function progress(e) {
  25509. if (e.total > 0) {
  25510. e.percent = e.loaded / e.total * 100;
  25511. }
  25512. option.onProgress(e);
  25513. };
  25514. }
  25515. var formData = new FormData();
  25516. if (option.data) {
  25517. Object.keys(option.data).forEach(function (key) {
  25518. formData.append(key, option.data[key]);
  25519. });
  25520. }
  25521. formData.append(option.filename, option.file, option.file.name);
  25522. xhr.onerror = function error(e) {
  25523. option.onError(e);
  25524. };
  25525. xhr.onload = function onload() {
  25526. if (xhr.status < 200 || xhr.status >= 300) {
  25527. return option.onError(getError(action, option, xhr));
  25528. }
  25529. option.onSuccess(getBody(xhr));
  25530. };
  25531. xhr.open('post', action, true);
  25532. if (option.withCredentials && 'withCredentials' in xhr) {
  25533. xhr.withCredentials = true;
  25534. }
  25535. var headers = option.headers || {};
  25536. for (var item in headers) {
  25537. if (headers.hasOwnProperty(item) && headers[item] !== null) {
  25538. xhr.setRequestHeader(item, headers[item]);
  25539. }
  25540. }
  25541. xhr.send(formData);
  25542. return xhr;
  25543. }
  25544. // 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&
  25545. var upload_draggervue_type_template_id_7ebbf219_render = function() {
  25546. var _vm = this
  25547. var _h = _vm.$createElement
  25548. var _c = _vm._self._c || _h
  25549. return _c(
  25550. "div",
  25551. {
  25552. staticClass: "el-upload-dragger",
  25553. class: {
  25554. "is-dragover": _vm.dragover
  25555. },
  25556. on: {
  25557. drop: function($event) {
  25558. $event.preventDefault()
  25559. return _vm.onDrop($event)
  25560. },
  25561. dragover: function($event) {
  25562. $event.preventDefault()
  25563. return _vm.onDragover($event)
  25564. },
  25565. dragleave: function($event) {
  25566. $event.preventDefault()
  25567. _vm.dragover = false
  25568. }
  25569. }
  25570. },
  25571. [_vm._t("default")],
  25572. 2
  25573. )
  25574. }
  25575. var upload_draggervue_type_template_id_7ebbf219_staticRenderFns = []
  25576. upload_draggervue_type_template_id_7ebbf219_render._withStripped = true
  25577. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219&
  25578. // 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&
  25579. //
  25580. //
  25581. //
  25582. //
  25583. //
  25584. //
  25585. //
  25586. //
  25587. //
  25588. //
  25589. //
  25590. //
  25591. //
  25592. /* harmony default export */ var upload_draggervue_type_script_lang_js_ = ({
  25593. name: 'ElUploadDrag',
  25594. props: {
  25595. disabled: Boolean
  25596. },
  25597. inject: {
  25598. uploader: {
  25599. default: ''
  25600. }
  25601. },
  25602. data: function data() {
  25603. return {
  25604. dragover: false
  25605. };
  25606. },
  25607. methods: {
  25608. onDragover: function onDragover() {
  25609. if (!this.disabled) {
  25610. this.dragover = true;
  25611. }
  25612. },
  25613. onDrop: function onDrop(e) {
  25614. if (this.disabled || !this.uploader) return;
  25615. var accept = this.uploader.accept;
  25616. this.dragover = false;
  25617. if (!accept) {
  25618. this.$emit('file', e.dataTransfer.files);
  25619. return;
  25620. }
  25621. this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
  25622. var type = file.type,
  25623. name = file.name;
  25624. var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
  25625. var baseType = type.replace(/\/.*$/, '');
  25626. return accept.split(',').map(function (type) {
  25627. return type.trim();
  25628. }).filter(function (type) {
  25629. return type;
  25630. }).some(function (acceptedType) {
  25631. if (/\..+$/.test(acceptedType)) {
  25632. return extension === acceptedType;
  25633. }
  25634. if (/\/\*$/.test(acceptedType)) {
  25635. return baseType === acceptedType.replace(/\/\*$/, '');
  25636. }
  25637. if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
  25638. return type === acceptedType;
  25639. }
  25640. return false;
  25641. });
  25642. }));
  25643. }
  25644. }
  25645. });
  25646. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js&
  25647. /* harmony default export */ var src_upload_draggervue_type_script_lang_js_ = (upload_draggervue_type_script_lang_js_);
  25648. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
  25649. /* normalize component */
  25650. var upload_dragger_component = normalizeComponent(
  25651. src_upload_draggervue_type_script_lang_js_,
  25652. upload_draggervue_type_template_id_7ebbf219_render,
  25653. upload_draggervue_type_template_id_7ebbf219_staticRenderFns,
  25654. false,
  25655. null,
  25656. null,
  25657. null
  25658. )
  25659. /* hot reload */
  25660. if (false) { var upload_dragger_api; }
  25661. upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vue"
  25662. /* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
  25663. // 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&
  25664. /* harmony default export */ var uploadvue_type_script_lang_js_ = ({
  25665. inject: ['uploader'],
  25666. components: {
  25667. UploadDragger: upload_dragger
  25668. },
  25669. props: {
  25670. type: String,
  25671. action: {
  25672. type: String,
  25673. required: true
  25674. },
  25675. name: {
  25676. type: String,
  25677. default: 'file'
  25678. },
  25679. data: Object,
  25680. headers: Object,
  25681. withCredentials: Boolean,
  25682. multiple: Boolean,
  25683. accept: String,
  25684. onStart: Function,
  25685. onProgress: Function,
  25686. onSuccess: Function,
  25687. onError: Function,
  25688. beforeUpload: Function,
  25689. drag: Boolean,
  25690. onPreview: {
  25691. type: Function,
  25692. default: function _default() {}
  25693. },
  25694. onRemove: {
  25695. type: Function,
  25696. default: function _default() {}
  25697. },
  25698. fileList: Array,
  25699. autoUpload: Boolean,
  25700. listType: String,
  25701. httpRequest: {
  25702. type: Function,
  25703. default: upload
  25704. },
  25705. disabled: Boolean,
  25706. limit: Number,
  25707. onExceed: Function
  25708. },
  25709. data: function data() {
  25710. return {
  25711. mouseover: false,
  25712. reqs: {}
  25713. };
  25714. },
  25715. methods: {
  25716. isImage: function isImage(str) {
  25717. return str.indexOf('image') !== -1;
  25718. },
  25719. handleChange: function handleChange(ev) {
  25720. var files = ev.target.files;
  25721. if (!files) return;
  25722. this.uploadFiles(files);
  25723. },
  25724. uploadFiles: function uploadFiles(files) {
  25725. var _this = this;
  25726. if (this.limit && this.fileList.length + files.length > this.limit) {
  25727. this.onExceed && this.onExceed(files, this.fileList);
  25728. return;
  25729. }
  25730. var postFiles = Array.prototype.slice.call(files);
  25731. if (!this.multiple) {
  25732. postFiles = postFiles.slice(0, 1);
  25733. }
  25734. if (postFiles.length === 0) {
  25735. return;
  25736. }
  25737. postFiles.forEach(function (rawFile) {
  25738. _this.onStart(rawFile);
  25739. if (_this.autoUpload) _this.upload(rawFile);
  25740. });
  25741. },
  25742. upload: function upload(rawFile) {
  25743. var _this2 = this;
  25744. this.$refs.input.value = null;
  25745. if (!this.beforeUpload) {
  25746. return this.post(rawFile);
  25747. }
  25748. var before = this.beforeUpload(rawFile);
  25749. if (before && before.then) {
  25750. before.then(function (processedFile) {
  25751. var fileType = Object.prototype.toString.call(processedFile);
  25752. if (fileType === '[object File]' || fileType === '[object Blob]') {
  25753. if (fileType === '[object Blob]') {
  25754. processedFile = new File([processedFile], rawFile.name, {
  25755. type: rawFile.type
  25756. });
  25757. }
  25758. for (var p in rawFile) {
  25759. if (rawFile.hasOwnProperty(p)) {
  25760. processedFile[p] = rawFile[p];
  25761. }
  25762. }
  25763. _this2.post(processedFile);
  25764. } else {
  25765. _this2.post(rawFile);
  25766. }
  25767. }, function () {
  25768. _this2.onRemove(null, rawFile);
  25769. });
  25770. } else if (before !== false) {
  25771. this.post(rawFile);
  25772. } else {
  25773. this.onRemove(null, rawFile);
  25774. }
  25775. },
  25776. abort: function abort(file) {
  25777. var reqs = this.reqs;
  25778. if (file) {
  25779. var uid = file;
  25780. if (file.uid) uid = file.uid;
  25781. if (reqs[uid]) {
  25782. reqs[uid].abort();
  25783. }
  25784. } else {
  25785. Object.keys(reqs).forEach(function (uid) {
  25786. if (reqs[uid]) reqs[uid].abort();
  25787. delete reqs[uid];
  25788. });
  25789. }
  25790. },
  25791. post: function post(rawFile) {
  25792. var _this3 = this;
  25793. var uid = rawFile.uid;
  25794. var options = {
  25795. headers: this.headers,
  25796. withCredentials: this.withCredentials,
  25797. file: rawFile,
  25798. data: this.data,
  25799. filename: this.name,
  25800. action: this.action,
  25801. onProgress: function onProgress(e) {
  25802. _this3.onProgress(e, rawFile);
  25803. },
  25804. onSuccess: function onSuccess(res) {
  25805. _this3.onSuccess(res, rawFile);
  25806. delete _this3.reqs[uid];
  25807. },
  25808. onError: function onError(err) {
  25809. _this3.onError(err, rawFile);
  25810. delete _this3.reqs[uid];
  25811. }
  25812. };
  25813. var req = this.httpRequest(options);
  25814. this.reqs[uid] = req;
  25815. if (req && req.then) {
  25816. req.then(options.onSuccess, options.onError);
  25817. }
  25818. },
  25819. handleClick: function handleClick() {
  25820. if (!this.disabled) {
  25821. this.$refs.input.value = null;
  25822. this.$refs.input.click();
  25823. }
  25824. },
  25825. handleKeydown: function handleKeydown(e) {
  25826. if (e.target !== e.currentTarget) return;
  25827. if (e.keyCode === 13 || e.keyCode === 32) {
  25828. this.handleClick();
  25829. }
  25830. }
  25831. },
  25832. render: function render(h) {
  25833. var handleClick = this.handleClick,
  25834. drag = this.drag,
  25835. name = this.name,
  25836. handleChange = this.handleChange,
  25837. multiple = this.multiple,
  25838. accept = this.accept,
  25839. listType = this.listType,
  25840. uploadFiles = this.uploadFiles,
  25841. disabled = this.disabled,
  25842. handleKeydown = this.handleKeydown;
  25843. var data = {
  25844. class: {
  25845. 'el-upload': true
  25846. },
  25847. on: {
  25848. click: handleClick,
  25849. keydown: handleKeydown
  25850. }
  25851. };
  25852. data.class['el-upload--' + listType] = true;
  25853. return h(
  25854. 'div',
  25855. external_babel_helper_vue_jsx_merge_props_default()([data, {
  25856. attrs: { tabindex: '0' }
  25857. }]),
  25858. [drag ? h(
  25859. 'upload-dragger',
  25860. {
  25861. attrs: { disabled: disabled },
  25862. on: {
  25863. 'file': uploadFiles
  25864. }
  25865. },
  25866. [this.$slots.default]
  25867. ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
  25868. ref: 'input', on: {
  25869. 'change': handleChange
  25870. }
  25871. })]
  25872. );
  25873. }
  25874. });
  25875. // CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js&
  25876. /* harmony default export */ var src_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_);
  25877. // CONCATENATED MODULE: ./packages/upload/src/upload.vue
  25878. var upload_render, upload_staticRenderFns
  25879. /* normalize component */
  25880. var upload_component = normalizeComponent(
  25881. src_uploadvue_type_script_lang_js_,
  25882. upload_render,
  25883. upload_staticRenderFns,
  25884. false,
  25885. null,
  25886. null,
  25887. null
  25888. )
  25889. /* hot reload */
  25890. if (false) { var upload_api; }
  25891. upload_component.options.__file = "packages/upload/src/upload.vue"
  25892. /* harmony default export */ var src_upload = (upload_component.exports);
  25893. // 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&
  25894. function srcvue_type_script_lang_js_noop() {}
  25895. /* harmony default export */ var srcvue_type_script_lang_js_ = ({
  25896. name: 'ElUpload',
  25897. mixins: [migrating_default.a],
  25898. components: {
  25899. ElProgress: progress_default.a,
  25900. UploadList: upload_list,
  25901. Upload: src_upload
  25902. },
  25903. provide: function provide() {
  25904. return {
  25905. uploader: this
  25906. };
  25907. },
  25908. inject: {
  25909. elForm: {
  25910. default: ''
  25911. }
  25912. },
  25913. props: {
  25914. action: {
  25915. type: String,
  25916. required: true
  25917. },
  25918. headers: {
  25919. type: Object,
  25920. default: function _default() {
  25921. return {};
  25922. }
  25923. },
  25924. data: Object,
  25925. multiple: Boolean,
  25926. name: {
  25927. type: String,
  25928. default: 'file'
  25929. },
  25930. drag: Boolean,
  25931. dragger: Boolean,
  25932. withCredentials: Boolean,
  25933. showFileList: {
  25934. type: Boolean,
  25935. default: true
  25936. },
  25937. accept: String,
  25938. type: {
  25939. type: String,
  25940. default: 'select'
  25941. },
  25942. beforeUpload: Function,
  25943. beforeRemove: Function,
  25944. onRemove: {
  25945. type: Function,
  25946. default: srcvue_type_script_lang_js_noop
  25947. },
  25948. onChange: {
  25949. type: Function,
  25950. default: srcvue_type_script_lang_js_noop
  25951. },
  25952. onPreview: {
  25953. type: Function
  25954. },
  25955. onSuccess: {
  25956. type: Function,
  25957. default: srcvue_type_script_lang_js_noop
  25958. },
  25959. onProgress: {
  25960. type: Function,
  25961. default: srcvue_type_script_lang_js_noop
  25962. },
  25963. onError: {
  25964. type: Function,
  25965. default: srcvue_type_script_lang_js_noop
  25966. },
  25967. fileList: {
  25968. type: Array,
  25969. default: function _default() {
  25970. return [];
  25971. }
  25972. },
  25973. autoUpload: {
  25974. type: Boolean,
  25975. default: true
  25976. },
  25977. listType: {
  25978. type: String,
  25979. default: 'text' // text,picture,picture-card
  25980. },
  25981. httpRequest: Function,
  25982. disabled: Boolean,
  25983. limit: Number,
  25984. onExceed: {
  25985. type: Function,
  25986. default: srcvue_type_script_lang_js_noop
  25987. }
  25988. },
  25989. data: function data() {
  25990. return {
  25991. uploadFiles: [],
  25992. dragOver: false,
  25993. draging: false,
  25994. tempIndex: 1
  25995. };
  25996. },
  25997. computed: {
  25998. uploadDisabled: function uploadDisabled() {
  25999. return this.disabled || (this.elForm || {}).disabled;
  26000. }
  26001. },
  26002. watch: {
  26003. listType: function listType(type) {
  26004. if (type === 'picture-card' || type === 'picture') {
  26005. this.uploadFiles = this.uploadFiles.map(function (file) {
  26006. if (!file.url && file.raw) {
  26007. try {
  26008. file.url = URL.createObjectURL(file.raw);
  26009. } catch (err) {
  26010. console.error('[Element Error][Upload]', err);
  26011. }
  26012. }
  26013. return file;
  26014. });
  26015. }
  26016. },
  26017. fileList: {
  26018. immediate: true,
  26019. handler: function handler(fileList) {
  26020. var _this = this;
  26021. this.uploadFiles = fileList.map(function (item) {
  26022. item.uid = item.uid || Date.now() + _this.tempIndex++;
  26023. item.status = item.status || 'success';
  26024. return item;
  26025. });
  26026. }
  26027. }
  26028. },
  26029. methods: {
  26030. handleStart: function handleStart(rawFile) {
  26031. rawFile.uid = Date.now() + this.tempIndex++;
  26032. var file = {
  26033. status: 'ready',
  26034. name: rawFile.name,
  26035. size: rawFile.size,
  26036. percentage: 0,
  26037. uid: rawFile.uid,
  26038. raw: rawFile
  26039. };
  26040. if (this.listType === 'picture-card' || this.listType === 'picture') {
  26041. try {
  26042. file.url = URL.createObjectURL(rawFile);
  26043. } catch (err) {
  26044. console.error('[Element Error][Upload]', err);
  26045. return;
  26046. }
  26047. }
  26048. this.uploadFiles.push(file);
  26049. this.onChange(file, this.uploadFiles);
  26050. },
  26051. handleProgress: function handleProgress(ev, rawFile) {
  26052. var file = this.getFile(rawFile);
  26053. this.onProgress(ev, file, this.uploadFiles);
  26054. file.status = 'uploading';
  26055. file.percentage = ev.percent || 0;
  26056. },
  26057. handleSuccess: function handleSuccess(res, rawFile) {
  26058. var file = this.getFile(rawFile);
  26059. if (file) {
  26060. file.status = 'success';
  26061. file.response = res;
  26062. this.onSuccess(res, file, this.uploadFiles);
  26063. this.onChange(file, this.uploadFiles);
  26064. }
  26065. },
  26066. handleError: function handleError(err, rawFile) {
  26067. var file = this.getFile(rawFile);
  26068. var fileList = this.uploadFiles;
  26069. file.status = 'fail';
  26070. fileList.splice(fileList.indexOf(file), 1);
  26071. this.onError(err, file, this.uploadFiles);
  26072. this.onChange(file, this.uploadFiles);
  26073. },
  26074. handleRemove: function handleRemove(file, raw) {
  26075. var _this2 = this;
  26076. if (raw) {
  26077. file = this.getFile(raw);
  26078. }
  26079. var doRemove = function doRemove() {
  26080. _this2.abort(file);
  26081. var fileList = _this2.uploadFiles;
  26082. fileList.splice(fileList.indexOf(file), 1);
  26083. _this2.onRemove(file, fileList);
  26084. };
  26085. if (!this.beforeRemove) {
  26086. doRemove();
  26087. } else if (typeof this.beforeRemove === 'function') {
  26088. var before = this.beforeRemove(file, this.uploadFiles);
  26089. if (before && before.then) {
  26090. before.then(function () {
  26091. doRemove();
  26092. }, srcvue_type_script_lang_js_noop);
  26093. } else if (before !== false) {
  26094. doRemove();
  26095. }
  26096. }
  26097. },
  26098. getFile: function getFile(rawFile) {
  26099. var fileList = this.uploadFiles;
  26100. var target = void 0;
  26101. fileList.every(function (item) {
  26102. target = rawFile.uid === item.uid ? item : null;
  26103. return !target;
  26104. });
  26105. return target;
  26106. },
  26107. abort: function abort(file) {
  26108. this.$refs['upload-inner'].abort(file);
  26109. },
  26110. clearFiles: function clearFiles() {
  26111. this.uploadFiles = [];
  26112. },
  26113. submit: function submit() {
  26114. var _this3 = this;
  26115. this.uploadFiles.filter(function (file) {
  26116. return file.status === 'ready';
  26117. }).forEach(function (file) {
  26118. _this3.$refs['upload-inner'].upload(file.raw);
  26119. });
  26120. },
  26121. getMigratingConfig: function getMigratingConfig() {
  26122. return {
  26123. props: {
  26124. 'default-file-list': 'default-file-list is renamed to file-list.',
  26125. 'show-upload-list': 'show-upload-list is renamed to show-file-list.',
  26126. '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'
  26127. }
  26128. };
  26129. }
  26130. },
  26131. beforeDestroy: function beforeDestroy() {
  26132. this.uploadFiles.forEach(function (file) {
  26133. if (file.url && file.url.indexOf('blob:') === 0) {
  26134. URL.revokeObjectURL(file.url);
  26135. }
  26136. });
  26137. },
  26138. render: function render(h) {
  26139. var uploadList = void 0;
  26140. if (this.showFileList) {
  26141. uploadList = h(upload_list, {
  26142. attrs: {
  26143. disabled: this.uploadDisabled,
  26144. listType: this.listType,
  26145. files: this.uploadFiles,
  26146. handlePreview: this.onPreview },
  26147. on: {
  26148. 'remove': this.handleRemove
  26149. }
  26150. });
  26151. }
  26152. var uploadData = {
  26153. props: {
  26154. type: this.type,
  26155. drag: this.drag,
  26156. action: this.action,
  26157. multiple: this.multiple,
  26158. 'before-upload': this.beforeUpload,
  26159. 'with-credentials': this.withCredentials,
  26160. headers: this.headers,
  26161. name: this.name,
  26162. data: this.data,
  26163. accept: this.accept,
  26164. fileList: this.uploadFiles,
  26165. autoUpload: this.autoUpload,
  26166. listType: this.listType,
  26167. disabled: this.uploadDisabled,
  26168. limit: this.limit,
  26169. 'on-exceed': this.onExceed,
  26170. 'on-start': this.handleStart,
  26171. 'on-progress': this.handleProgress,
  26172. 'on-success': this.handleSuccess,
  26173. 'on-error': this.handleError,
  26174. 'on-preview': this.onPreview,
  26175. 'on-remove': this.handleRemove,
  26176. 'http-request': this.httpRequest
  26177. },
  26178. ref: 'upload-inner'
  26179. };
  26180. var trigger = this.$slots.trigger || this.$slots.default;
  26181. var uploadComponent = h(
  26182. 'upload',
  26183. uploadData,
  26184. [trigger]
  26185. );
  26186. return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
  26187. }
  26188. });
  26189. // CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js&
  26190. /* harmony default export */ var upload_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
  26191. // CONCATENATED MODULE: ./packages/upload/src/index.vue
  26192. var src_render, src_staticRenderFns
  26193. /* normalize component */
  26194. var upload_src_component = normalizeComponent(
  26195. upload_srcvue_type_script_lang_js_,
  26196. src_render,
  26197. src_staticRenderFns,
  26198. false,
  26199. null,
  26200. null,
  26201. null
  26202. )
  26203. /* hot reload */
  26204. if (false) { var src_api; }
  26205. upload_src_component.options.__file = "packages/upload/src/index.vue"
  26206. /* harmony default export */ var upload_src = (upload_src_component.exports);
  26207. // CONCATENATED MODULE: ./packages/upload/index.js
  26208. /* istanbul ignore next */
  26209. upload_src.install = function (Vue) {
  26210. Vue.component(upload_src.name, upload_src);
  26211. };
  26212. /* harmony default export */ var packages_upload = (upload_src);
  26213. // 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&
  26214. var progressvue_type_template_id_229ee406_render = function() {
  26215. var _vm = this
  26216. var _h = _vm.$createElement
  26217. var _c = _vm._self._c || _h
  26218. return _c(
  26219. "div",
  26220. {
  26221. staticClass: "el-progress",
  26222. class: [
  26223. "el-progress--" + _vm.type,
  26224. _vm.status ? "is-" + _vm.status : "",
  26225. {
  26226. "el-progress--without-text": !_vm.showText,
  26227. "el-progress--text-inside": _vm.textInside
  26228. }
  26229. ],
  26230. attrs: {
  26231. role: "progressbar",
  26232. "aria-valuenow": _vm.percentage,
  26233. "aria-valuemin": "0",
  26234. "aria-valuemax": "100"
  26235. }
  26236. },
  26237. [
  26238. _vm.type === "line"
  26239. ? _c("div", { staticClass: "el-progress-bar" }, [
  26240. _c(
  26241. "div",
  26242. {
  26243. staticClass: "el-progress-bar__outer",
  26244. style: { height: _vm.strokeWidth + "px" }
  26245. },
  26246. [
  26247. _c(
  26248. "div",
  26249. {
  26250. staticClass: "el-progress-bar__inner",
  26251. style: _vm.barStyle
  26252. },
  26253. [
  26254. _vm.showText && _vm.textInside
  26255. ? _c(
  26256. "div",
  26257. { staticClass: "el-progress-bar__innerText" },
  26258. [_vm._v(_vm._s(_vm.percentage) + "%")]
  26259. )
  26260. : _vm._e()
  26261. ]
  26262. )
  26263. ]
  26264. )
  26265. ])
  26266. : _c(
  26267. "div",
  26268. {
  26269. staticClass: "el-progress-circle",
  26270. style: { height: _vm.width + "px", width: _vm.width + "px" }
  26271. },
  26272. [
  26273. _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
  26274. _c("path", {
  26275. staticClass: "el-progress-circle__track",
  26276. attrs: {
  26277. d: _vm.trackPath,
  26278. stroke: "#e5e9f2",
  26279. "stroke-width": _vm.relativeStrokeWidth,
  26280. fill: "none"
  26281. }
  26282. }),
  26283. _c("path", {
  26284. staticClass: "el-progress-circle__path",
  26285. style: _vm.circlePathStyle,
  26286. attrs: {
  26287. d: _vm.trackPath,
  26288. "stroke-linecap": "round",
  26289. stroke: _vm.stroke,
  26290. "stroke-width": _vm.relativeStrokeWidth,
  26291. fill: "none"
  26292. }
  26293. })
  26294. ])
  26295. ]
  26296. ),
  26297. _vm.showText && !_vm.textInside
  26298. ? _c(
  26299. "div",
  26300. {
  26301. staticClass: "el-progress__text",
  26302. style: { fontSize: _vm.progressTextSize + "px" }
  26303. },
  26304. [
  26305. !_vm.status
  26306. ? [_vm._v(_vm._s(_vm.percentage) + "%")]
  26307. : [
  26308. _vm.status === "text"
  26309. ? _vm._t("default")
  26310. : _c("i", { class: _vm.iconClass })
  26311. ]
  26312. ],
  26313. 2
  26314. )
  26315. : _vm._e()
  26316. ]
  26317. )
  26318. }
  26319. var progressvue_type_template_id_229ee406_staticRenderFns = []
  26320. progressvue_type_template_id_229ee406_render._withStripped = true
  26321. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=229ee406&
  26322. // 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&
  26323. //
  26324. //
  26325. //
  26326. //
  26327. //
  26328. //
  26329. //
  26330. //
  26331. //
  26332. //
  26333. //
  26334. //
  26335. //
  26336. //
  26337. //
  26338. //
  26339. //
  26340. //
  26341. //
  26342. //
  26343. //
  26344. //
  26345. //
  26346. //
  26347. //
  26348. //
  26349. //
  26350. //
  26351. //
  26352. //
  26353. //
  26354. //
  26355. //
  26356. //
  26357. //
  26358. //
  26359. //
  26360. //
  26361. /* harmony default export */ var progressvue_type_script_lang_js_ = ({
  26362. name: 'ElProgress',
  26363. props: {
  26364. type: {
  26365. type: String,
  26366. default: 'line',
  26367. validator: function validator(val) {
  26368. return ['line', 'circle'].indexOf(val) > -1;
  26369. }
  26370. },
  26371. percentage: {
  26372. type: Number,
  26373. default: 0,
  26374. required: true,
  26375. validator: function validator(val) {
  26376. return val >= 0 && val <= 100;
  26377. }
  26378. },
  26379. status: {
  26380. type: String,
  26381. validator: function validator(val) {
  26382. return ['text', 'success', 'exception'].indexOf(val) > -1;
  26383. }
  26384. },
  26385. strokeWidth: {
  26386. type: Number,
  26387. default: 6
  26388. },
  26389. textInside: {
  26390. type: Boolean,
  26391. default: false
  26392. },
  26393. width: {
  26394. type: Number,
  26395. default: 126
  26396. },
  26397. showText: {
  26398. type: Boolean,
  26399. default: true
  26400. },
  26401. color: {
  26402. type: String,
  26403. default: ''
  26404. }
  26405. },
  26406. computed: {
  26407. barStyle: function barStyle() {
  26408. var style = {};
  26409. style.width = this.percentage + '%';
  26410. style.backgroundColor = this.color;
  26411. return style;
  26412. },
  26413. relativeStrokeWidth: function relativeStrokeWidth() {
  26414. return (this.strokeWidth / this.width * 100).toFixed(1);
  26415. },
  26416. trackPath: function trackPath() {
  26417. var radius = parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
  26418. return 'M 50 50 m 0 -' + radius + ' a ' + radius + ' ' + radius + ' 0 1 1 0 ' + radius * 2 + ' a ' + radius + ' ' + radius + ' 0 1 1 0 -' + radius * 2;
  26419. },
  26420. perimeter: function perimeter() {
  26421. var radius = 50 - parseFloat(this.relativeStrokeWidth) / 2;
  26422. return 2 * Math.PI * radius;
  26423. },
  26424. circlePathStyle: function circlePathStyle() {
  26425. var perimeter = this.perimeter;
  26426. return {
  26427. strokeDasharray: perimeter + 'px,' + perimeter + 'px',
  26428. strokeDashoffset: (1 - this.percentage / 100) * perimeter + 'px',
  26429. transition: 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease'
  26430. };
  26431. },
  26432. stroke: function stroke() {
  26433. var ret = void 0;
  26434. if (this.color) {
  26435. ret = this.color;
  26436. } else {
  26437. switch (this.status) {
  26438. case 'success':
  26439. ret = '#13ce66';
  26440. break;
  26441. case 'exception':
  26442. ret = '#ff4949';
  26443. break;
  26444. default:
  26445. ret = '#20a0ff';
  26446. }
  26447. }
  26448. return ret;
  26449. },
  26450. iconClass: function iconClass() {
  26451. if (this.type === 'line') {
  26452. return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
  26453. } else {
  26454. return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
  26455. }
  26456. },
  26457. progressTextSize: function progressTextSize() {
  26458. return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
  26459. }
  26460. }
  26461. });
  26462. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js&
  26463. /* harmony default export */ var src_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_);
  26464. // CONCATENATED MODULE: ./packages/progress/src/progress.vue
  26465. /* normalize component */
  26466. var progress_component = normalizeComponent(
  26467. src_progressvue_type_script_lang_js_,
  26468. progressvue_type_template_id_229ee406_render,
  26469. progressvue_type_template_id_229ee406_staticRenderFns,
  26470. false,
  26471. null,
  26472. null,
  26473. null
  26474. )
  26475. /* hot reload */
  26476. if (false) { var progress_api; }
  26477. progress_component.options.__file = "packages/progress/src/progress.vue"
  26478. /* harmony default export */ var progress = (progress_component.exports);
  26479. // CONCATENATED MODULE: ./packages/progress/index.js
  26480. /* istanbul ignore next */
  26481. progress.install = function (Vue) {
  26482. Vue.component(progress.name, progress);
  26483. };
  26484. /* harmony default export */ var packages_progress = (progress);
  26485. // 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&
  26486. var spinnervue_type_template_id_697b8538_render = function() {
  26487. var _vm = this
  26488. var _h = _vm.$createElement
  26489. var _c = _vm._self._c || _h
  26490. return _c("span", { staticClass: "el-spinner" }, [
  26491. _c(
  26492. "svg",
  26493. {
  26494. staticClass: "el-spinner-inner",
  26495. style: { width: _vm.radius / 2 + "px", height: _vm.radius / 2 + "px" },
  26496. attrs: { viewBox: "0 0 50 50" }
  26497. },
  26498. [
  26499. _c("circle", {
  26500. staticClass: "path",
  26501. attrs: {
  26502. cx: "25",
  26503. cy: "25",
  26504. r: "20",
  26505. fill: "none",
  26506. stroke: _vm.strokeColor,
  26507. "stroke-width": _vm.strokeWidth
  26508. }
  26509. })
  26510. ]
  26511. )
  26512. ])
  26513. }
  26514. var spinnervue_type_template_id_697b8538_staticRenderFns = []
  26515. spinnervue_type_template_id_697b8538_render._withStripped = true
  26516. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=template&id=697b8538&
  26517. // 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&
  26518. //
  26519. //
  26520. //
  26521. //
  26522. //
  26523. //
  26524. //
  26525. /* harmony default export */ var spinnervue_type_script_lang_js_ = ({
  26526. name: 'ElSpinner',
  26527. props: {
  26528. type: String,
  26529. radius: {
  26530. type: Number,
  26531. default: 100
  26532. },
  26533. strokeWidth: {
  26534. type: Number,
  26535. default: 5
  26536. },
  26537. strokeColor: {
  26538. type: String,
  26539. default: '#efefef'
  26540. }
  26541. }
  26542. });
  26543. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=script&lang=js&
  26544. /* harmony default export */ var src_spinnervue_type_script_lang_js_ = (spinnervue_type_script_lang_js_);
  26545. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue
  26546. /* normalize component */
  26547. var spinner_component = normalizeComponent(
  26548. src_spinnervue_type_script_lang_js_,
  26549. spinnervue_type_template_id_697b8538_render,
  26550. spinnervue_type_template_id_697b8538_staticRenderFns,
  26551. false,
  26552. null,
  26553. null,
  26554. null
  26555. )
  26556. /* hot reload */
  26557. if (false) { var spinner_api; }
  26558. spinner_component.options.__file = "packages/spinner/src/spinner.vue"
  26559. /* harmony default export */ var spinner = (spinner_component.exports);
  26560. // CONCATENATED MODULE: ./packages/spinner/index.js
  26561. /* istanbul ignore next */
  26562. spinner.install = function (Vue) {
  26563. Vue.component(spinner.name, spinner);
  26564. };
  26565. /* harmony default export */ var packages_spinner = (spinner);
  26566. // 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&
  26567. var mainvue_type_template_id_455b9f60_render = function() {
  26568. var _vm = this
  26569. var _h = _vm.$createElement
  26570. var _c = _vm._self._c || _h
  26571. return _c(
  26572. "transition",
  26573. {
  26574. attrs: { name: "el-message-fade" },
  26575. on: { "after-leave": _vm.handleAfterLeave }
  26576. },
  26577. [
  26578. _c(
  26579. "div",
  26580. {
  26581. directives: [
  26582. {
  26583. name: "show",
  26584. rawName: "v-show",
  26585. value: _vm.visible,
  26586. expression: "visible"
  26587. }
  26588. ],
  26589. class: [
  26590. "el-message",
  26591. _vm.type && !_vm.iconClass ? "el-message--" + _vm.type : "",
  26592. _vm.center ? "is-center" : "",
  26593. _vm.showClose ? "is-closable" : "",
  26594. _vm.customClass
  26595. ],
  26596. attrs: { role: "alert" },
  26597. on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer }
  26598. },
  26599. [
  26600. _vm.iconClass
  26601. ? _c("i", { class: _vm.iconClass })
  26602. : _c("i", { class: _vm.typeClass }),
  26603. _vm._t("default", [
  26604. !_vm.dangerouslyUseHTMLString
  26605. ? _c("p", { staticClass: "el-message__content" }, [
  26606. _vm._v(_vm._s(_vm.message))
  26607. ])
  26608. : _c("p", {
  26609. staticClass: "el-message__content",
  26610. domProps: { innerHTML: _vm._s(_vm.message) }
  26611. })
  26612. ]),
  26613. _vm.showClose
  26614. ? _c("i", {
  26615. staticClass: "el-message__closeBtn el-icon-close",
  26616. on: { click: _vm.close }
  26617. })
  26618. : _vm._e()
  26619. ],
  26620. 2
  26621. )
  26622. ]
  26623. )
  26624. }
  26625. var mainvue_type_template_id_455b9f60_staticRenderFns = []
  26626. mainvue_type_template_id_455b9f60_render._withStripped = true
  26627. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  26628. // 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&
  26629. //
  26630. //
  26631. //
  26632. //
  26633. //
  26634. //
  26635. //
  26636. //
  26637. //
  26638. //
  26639. //
  26640. //
  26641. //
  26642. //
  26643. //
  26644. //
  26645. //
  26646. //
  26647. //
  26648. //
  26649. //
  26650. //
  26651. //
  26652. //
  26653. //
  26654. var src_mainvue_type_script_lang_js_typeMap = {
  26655. success: 'success',
  26656. info: 'info',
  26657. warning: 'warning',
  26658. error: 'error'
  26659. };
  26660. /* harmony default export */ var message_src_mainvue_type_script_lang_js_ = ({
  26661. data: function data() {
  26662. return {
  26663. visible: false,
  26664. message: '',
  26665. duration: 3000,
  26666. type: 'info',
  26667. iconClass: '',
  26668. customClass: '',
  26669. onClose: null,
  26670. showClose: false,
  26671. closed: false,
  26672. timer: null,
  26673. dangerouslyUseHTMLString: false,
  26674. center: false
  26675. };
  26676. },
  26677. computed: {
  26678. typeClass: function typeClass() {
  26679. return this.type && !this.iconClass ? 'el-message__icon el-icon-' + src_mainvue_type_script_lang_js_typeMap[this.type] : '';
  26680. }
  26681. },
  26682. watch: {
  26683. closed: function closed(newVal) {
  26684. if (newVal) {
  26685. this.visible = false;
  26686. }
  26687. }
  26688. },
  26689. methods: {
  26690. handleAfterLeave: function handleAfterLeave() {
  26691. this.$destroy(true);
  26692. this.$el.parentNode.removeChild(this.$el);
  26693. },
  26694. close: function close() {
  26695. this.closed = true;
  26696. if (typeof this.onClose === 'function') {
  26697. this.onClose(this);
  26698. }
  26699. },
  26700. clearTimer: function clearTimer() {
  26701. clearTimeout(this.timer);
  26702. },
  26703. startTimer: function startTimer() {
  26704. var _this = this;
  26705. if (this.duration > 0) {
  26706. this.timer = setTimeout(function () {
  26707. if (!_this.closed) {
  26708. _this.close();
  26709. }
  26710. }, this.duration);
  26711. }
  26712. },
  26713. keydown: function keydown(e) {
  26714. if (e.keyCode === 27) {
  26715. // esc关闭消息
  26716. if (!this.closed) {
  26717. this.close();
  26718. }
  26719. }
  26720. }
  26721. },
  26722. mounted: function mounted() {
  26723. this.startTimer();
  26724. document.addEventListener('keydown', this.keydown);
  26725. },
  26726. beforeDestroy: function beforeDestroy() {
  26727. document.removeEventListener('keydown', this.keydown);
  26728. }
  26729. });
  26730. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
  26731. /* harmony default export */ var packages_message_src_mainvue_type_script_lang_js_ = (message_src_mainvue_type_script_lang_js_);
  26732. // CONCATENATED MODULE: ./packages/message/src/main.vue
  26733. /* normalize component */
  26734. var message_src_main_component = normalizeComponent(
  26735. packages_message_src_mainvue_type_script_lang_js_,
  26736. mainvue_type_template_id_455b9f60_render,
  26737. mainvue_type_template_id_455b9f60_staticRenderFns,
  26738. false,
  26739. null,
  26740. null,
  26741. null
  26742. )
  26743. /* hot reload */
  26744. if (false) { var message_src_main_api; }
  26745. message_src_main_component.options.__file = "packages/message/src/main.vue"
  26746. /* harmony default export */ var message_src_main = (message_src_main_component.exports);
  26747. // CONCATENATED MODULE: ./packages/message/src/main.js
  26748. var MessageConstructor = external_vue_default.a.extend(message_src_main);
  26749. var message_src_main_instance = void 0;
  26750. var main_instances = [];
  26751. var main_seed = 1;
  26752. var main_Message = function Message(options) {
  26753. if (external_vue_default.a.prototype.$isServer) return;
  26754. options = options || {};
  26755. if (typeof options === 'string') {
  26756. options = {
  26757. message: options
  26758. };
  26759. }
  26760. var userOnClose = options.onClose;
  26761. var id = 'message_' + main_seed++;
  26762. options.onClose = function () {
  26763. Message.close(id, userOnClose);
  26764. };
  26765. message_src_main_instance = new MessageConstructor({
  26766. data: options
  26767. });
  26768. message_src_main_instance.id = id;
  26769. if (Object(vdom_["isVNode"])(message_src_main_instance.message)) {
  26770. message_src_main_instance.$slots.default = [message_src_main_instance.message];
  26771. message_src_main_instance.message = null;
  26772. }
  26773. message_src_main_instance.vm = message_src_main_instance.$mount();
  26774. document.body.appendChild(message_src_main_instance.vm.$el);
  26775. message_src_main_instance.vm.visible = true;
  26776. message_src_main_instance.dom = message_src_main_instance.vm.$el;
  26777. message_src_main_instance.dom.style.zIndex = popup_["PopupManager"].nextZIndex();
  26778. main_instances.push(message_src_main_instance);
  26779. return message_src_main_instance.vm;
  26780. };
  26781. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  26782. main_Message[type] = function (options) {
  26783. if (typeof options === 'string') {
  26784. options = {
  26785. message: options
  26786. };
  26787. }
  26788. options.type = type;
  26789. return main_Message(options);
  26790. };
  26791. });
  26792. main_Message.close = function (id, userOnClose) {
  26793. for (var i = 0, len = main_instances.length; i < len; i++) {
  26794. if (id === main_instances[i].id) {
  26795. if (typeof userOnClose === 'function') {
  26796. userOnClose(main_instances[i]);
  26797. }
  26798. main_instances.splice(i, 1);
  26799. break;
  26800. }
  26801. }
  26802. };
  26803. main_Message.closeAll = function () {
  26804. for (var i = main_instances.length - 1; i >= 0; i--) {
  26805. main_instances[i].close();
  26806. }
  26807. };
  26808. /* harmony default export */ var packages_message_src_main = (main_Message);
  26809. // CONCATENATED MODULE: ./packages/message/index.js
  26810. /* harmony default export */ var packages_message = (packages_message_src_main);
  26811. // 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&
  26812. var mainvue_type_template_id_7ccb6598_render = function() {
  26813. var _vm = this
  26814. var _h = _vm.$createElement
  26815. var _c = _vm._self._c || _h
  26816. return _c(
  26817. "div",
  26818. { staticClass: "el-badge" },
  26819. [
  26820. _vm._t("default"),
  26821. _c("transition", { attrs: { name: "el-zoom-in-center" } }, [
  26822. _c("sup", {
  26823. directives: [
  26824. {
  26825. name: "show",
  26826. rawName: "v-show",
  26827. value:
  26828. !_vm.hidden && (_vm.content || _vm.content === 0 || _vm.isDot),
  26829. expression: "!hidden && (content || content === 0 || isDot)"
  26830. }
  26831. ],
  26832. staticClass: "el-badge__content",
  26833. class: [
  26834. "el-badge__content--" + _vm.type,
  26835. {
  26836. "is-fixed": _vm.$slots.default,
  26837. "is-dot": _vm.isDot
  26838. }
  26839. ],
  26840. domProps: { textContent: _vm._s(_vm.content) }
  26841. })
  26842. ])
  26843. ],
  26844. 2
  26845. )
  26846. }
  26847. var mainvue_type_template_id_7ccb6598_staticRenderFns = []
  26848. mainvue_type_template_id_7ccb6598_render._withStripped = true
  26849. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=template&id=7ccb6598&
  26850. // 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&
  26851. //
  26852. //
  26853. //
  26854. //
  26855. //
  26856. //
  26857. //
  26858. //
  26859. //
  26860. //
  26861. //
  26862. //
  26863. //
  26864. //
  26865. //
  26866. //
  26867. //
  26868. //
  26869. //
  26870. //
  26871. /* harmony default export */ var badge_src_mainvue_type_script_lang_js_ = ({
  26872. name: 'ElBadge',
  26873. props: {
  26874. value: {},
  26875. max: Number,
  26876. isDot: Boolean,
  26877. hidden: Boolean,
  26878. type: {
  26879. type: String,
  26880. validator: function validator(val) {
  26881. return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
  26882. }
  26883. }
  26884. },
  26885. computed: {
  26886. content: function content() {
  26887. if (this.isDot) return;
  26888. var value = this.value;
  26889. var max = this.max;
  26890. if (typeof value === 'number' && typeof max === 'number') {
  26891. return max < value ? max + '+' : value;
  26892. }
  26893. return value;
  26894. }
  26895. }
  26896. });
  26897. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=script&lang=js&
  26898. /* harmony default export */ var packages_badge_src_mainvue_type_script_lang_js_ = (badge_src_mainvue_type_script_lang_js_);
  26899. // CONCATENATED MODULE: ./packages/badge/src/main.vue
  26900. /* normalize component */
  26901. var badge_src_main_component = normalizeComponent(
  26902. packages_badge_src_mainvue_type_script_lang_js_,
  26903. mainvue_type_template_id_7ccb6598_render,
  26904. mainvue_type_template_id_7ccb6598_staticRenderFns,
  26905. false,
  26906. null,
  26907. null,
  26908. null
  26909. )
  26910. /* hot reload */
  26911. if (false) { var badge_src_main_api; }
  26912. badge_src_main_component.options.__file = "packages/badge/src/main.vue"
  26913. /* harmony default export */ var badge_src_main = (badge_src_main_component.exports);
  26914. // CONCATENATED MODULE: ./packages/badge/index.js
  26915. /* istanbul ignore next */
  26916. badge_src_main.install = function (Vue) {
  26917. Vue.component(badge_src_main.name, badge_src_main);
  26918. };
  26919. /* harmony default export */ var badge = (badge_src_main);
  26920. // 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&
  26921. var mainvue_type_template_id_59a4a40f_render = function() {
  26922. var _vm = this
  26923. var _h = _vm.$createElement
  26924. var _c = _vm._self._c || _h
  26925. return _c(
  26926. "div",
  26927. {
  26928. staticClass: "el-card",
  26929. class: _vm.shadow ? "is-" + _vm.shadow + "-shadow" : "is-always-shadow"
  26930. },
  26931. [
  26932. _vm.$slots.header || _vm.header
  26933. ? _c(
  26934. "div",
  26935. { staticClass: "el-card__header" },
  26936. [_vm._t("header", [_vm._v(_vm._s(_vm.header))])],
  26937. 2
  26938. )
  26939. : _vm._e(),
  26940. _c(
  26941. "div",
  26942. { staticClass: "el-card__body", style: _vm.bodyStyle },
  26943. [_vm._t("default")],
  26944. 2
  26945. )
  26946. ]
  26947. )
  26948. }
  26949. var mainvue_type_template_id_59a4a40f_staticRenderFns = []
  26950. mainvue_type_template_id_59a4a40f_render._withStripped = true
  26951. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=template&id=59a4a40f&
  26952. // 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&
  26953. //
  26954. //
  26955. //
  26956. //
  26957. //
  26958. //
  26959. //
  26960. //
  26961. //
  26962. //
  26963. //
  26964. /* harmony default export */ var card_src_mainvue_type_script_lang_js_ = ({
  26965. name: 'ElCard',
  26966. props: {
  26967. header: {},
  26968. bodyStyle: {},
  26969. shadow: {
  26970. type: String
  26971. }
  26972. }
  26973. });
  26974. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=script&lang=js&
  26975. /* harmony default export */ var packages_card_src_mainvue_type_script_lang_js_ = (card_src_mainvue_type_script_lang_js_);
  26976. // CONCATENATED MODULE: ./packages/card/src/main.vue
  26977. /* normalize component */
  26978. var card_src_main_component = normalizeComponent(
  26979. packages_card_src_mainvue_type_script_lang_js_,
  26980. mainvue_type_template_id_59a4a40f_render,
  26981. mainvue_type_template_id_59a4a40f_staticRenderFns,
  26982. false,
  26983. null,
  26984. null,
  26985. null
  26986. )
  26987. /* hot reload */
  26988. if (false) { var card_src_main_api; }
  26989. card_src_main_component.options.__file = "packages/card/src/main.vue"
  26990. /* harmony default export */ var card_src_main = (card_src_main_component.exports);
  26991. // CONCATENATED MODULE: ./packages/card/index.js
  26992. /* istanbul ignore next */
  26993. card_src_main.install = function (Vue) {
  26994. Vue.component(card_src_main.name, card_src_main);
  26995. };
  26996. /* harmony default export */ var card = (card_src_main);
  26997. // 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&
  26998. var mainvue_type_template_id_ada57782_render = function() {
  26999. var _vm = this
  27000. var _h = _vm.$createElement
  27001. var _c = _vm._self._c || _h
  27002. return _c(
  27003. "div",
  27004. {
  27005. staticClass: "el-rate",
  27006. attrs: {
  27007. role: "slider",
  27008. "aria-valuenow": _vm.currentValue,
  27009. "aria-valuetext": _vm.text,
  27010. "aria-valuemin": "0",
  27011. "aria-valuemax": _vm.max,
  27012. tabindex: "0"
  27013. },
  27014. on: { keydown: _vm.handleKey }
  27015. },
  27016. [
  27017. _vm._l(_vm.max, function(item, key) {
  27018. return _c(
  27019. "span",
  27020. {
  27021. key: key,
  27022. staticClass: "el-rate__item",
  27023. style: { cursor: _vm.rateDisabled ? "auto" : "pointer" },
  27024. on: {
  27025. mousemove: function($event) {
  27026. _vm.setCurrentValue(item, $event)
  27027. },
  27028. mouseleave: _vm.resetCurrentValue,
  27029. click: function($event) {
  27030. _vm.selectValue(item)
  27031. }
  27032. }
  27033. },
  27034. [
  27035. _c(
  27036. "i",
  27037. {
  27038. staticClass: "el-rate__icon",
  27039. class: [
  27040. _vm.classes[item - 1],
  27041. { hover: _vm.hoverIndex === item }
  27042. ],
  27043. style: _vm.getIconStyle(item)
  27044. },
  27045. [
  27046. _vm.showDecimalIcon(item)
  27047. ? _c("i", {
  27048. staticClass: "el-rate__decimal",
  27049. class: _vm.decimalIconClass,
  27050. style: _vm.decimalStyle
  27051. })
  27052. : _vm._e()
  27053. ]
  27054. )
  27055. ]
  27056. )
  27057. }),
  27058. _vm.showText || _vm.showScore
  27059. ? _c(
  27060. "span",
  27061. { staticClass: "el-rate__text", style: { color: _vm.textColor } },
  27062. [_vm._v(_vm._s(_vm.text))]
  27063. )
  27064. : _vm._e()
  27065. ],
  27066. 2
  27067. )
  27068. }
  27069. var mainvue_type_template_id_ada57782_staticRenderFns = []
  27070. mainvue_type_template_id_ada57782_render._withStripped = true
  27071. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=template&id=ada57782&
  27072. // EXTERNAL MODULE: external "element-ui/lib/utils/types"
  27073. var types_ = __webpack_require__(25);
  27074. // 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&
  27075. //
  27076. //
  27077. //
  27078. //
  27079. //
  27080. //
  27081. //
  27082. //
  27083. //
  27084. //
  27085. //
  27086. //
  27087. //
  27088. //
  27089. //
  27090. //
  27091. //
  27092. //
  27093. //
  27094. //
  27095. //
  27096. //
  27097. //
  27098. //
  27099. //
  27100. //
  27101. //
  27102. //
  27103. //
  27104. //
  27105. //
  27106. //
  27107. //
  27108. //
  27109. /* harmony default export */ var rate_src_mainvue_type_script_lang_js_ = ({
  27110. name: 'ElRate',
  27111. mixins: [migrating_default.a],
  27112. inject: {
  27113. elForm: {
  27114. default: ''
  27115. }
  27116. },
  27117. data: function data() {
  27118. return {
  27119. pointerAtLeftHalf: true,
  27120. currentValue: this.value,
  27121. hoverIndex: -1
  27122. };
  27123. },
  27124. props: {
  27125. value: {
  27126. type: Number,
  27127. default: 0
  27128. },
  27129. lowThreshold: {
  27130. type: Number,
  27131. default: 2
  27132. },
  27133. highThreshold: {
  27134. type: Number,
  27135. default: 4
  27136. },
  27137. max: {
  27138. type: Number,
  27139. default: 5
  27140. },
  27141. colors: {
  27142. type: [Array, Object],
  27143. default: function _default() {
  27144. return ['#F7BA2A', '#F7BA2A', '#F7BA2A'];
  27145. }
  27146. },
  27147. voidColor: {
  27148. type: String,
  27149. default: '#C6D1DE'
  27150. },
  27151. disabledVoidColor: {
  27152. type: String,
  27153. default: '#EFF2F7'
  27154. },
  27155. iconClasses: {
  27156. type: [Array, Object],
  27157. default: function _default() {
  27158. return ['el-icon-star-on', 'el-icon-star-on', 'el-icon-star-on'];
  27159. }
  27160. },
  27161. voidIconClass: {
  27162. type: String,
  27163. default: 'el-icon-star-off'
  27164. },
  27165. disabledVoidIconClass: {
  27166. type: String,
  27167. default: 'el-icon-star-on'
  27168. },
  27169. disabled: {
  27170. type: Boolean,
  27171. default: false
  27172. },
  27173. allowHalf: {
  27174. type: Boolean,
  27175. default: false
  27176. },
  27177. showText: {
  27178. type: Boolean,
  27179. default: false
  27180. },
  27181. showScore: {
  27182. type: Boolean,
  27183. default: false
  27184. },
  27185. textColor: {
  27186. type: String,
  27187. default: '#1f2d3d'
  27188. },
  27189. texts: {
  27190. type: Array,
  27191. default: function _default() {
  27192. return ['极差', '失望', '一般', '满意', '惊喜'];
  27193. }
  27194. },
  27195. scoreTemplate: {
  27196. type: String,
  27197. default: '{value}'
  27198. }
  27199. },
  27200. computed: {
  27201. text: function text() {
  27202. var result = '';
  27203. if (this.showScore) {
  27204. result = this.scoreTemplate.replace(/\{\s*value\s*\}/, this.rateDisabled ? this.value : this.currentValue);
  27205. } else if (this.showText) {
  27206. result = this.texts[Math.ceil(this.currentValue) - 1];
  27207. }
  27208. return result;
  27209. },
  27210. decimalStyle: function decimalStyle() {
  27211. var width = '';
  27212. if (this.rateDisabled) {
  27213. width = this.valueDecimal + '%';
  27214. } else if (this.allowHalf) {
  27215. width = '50%';
  27216. }
  27217. return {
  27218. color: this.activeColor,
  27219. width: width
  27220. };
  27221. },
  27222. valueDecimal: function valueDecimal() {
  27223. return this.value * 100 - Math.floor(this.value) * 100;
  27224. },
  27225. classMap: function classMap() {
  27226. var _ref;
  27227. 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;
  27228. },
  27229. decimalIconClass: function decimalIconClass() {
  27230. return this.getValueFromMap(this.value, this.classMap);
  27231. },
  27232. voidClass: function voidClass() {
  27233. return this.rateDisabled ? this.disabledVoidIconClass : this.voidIconClass;
  27234. },
  27235. activeClass: function activeClass() {
  27236. return this.getValueFromMap(this.currentValue, this.classMap);
  27237. },
  27238. colorMap: function colorMap() {
  27239. var _ref2;
  27240. 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;
  27241. },
  27242. activeColor: function activeColor() {
  27243. return this.getValueFromMap(this.currentValue, this.colorMap);
  27244. },
  27245. classes: function classes() {
  27246. var result = [];
  27247. var i = 0;
  27248. var threshold = this.currentValue;
  27249. if (this.allowHalf && this.currentValue !== Math.floor(this.currentValue)) {
  27250. threshold--;
  27251. }
  27252. for (; i < threshold; i++) {
  27253. result.push(this.activeClass);
  27254. }
  27255. for (; i < this.max; i++) {
  27256. result.push(this.voidClass);
  27257. }
  27258. return result;
  27259. },
  27260. rateDisabled: function rateDisabled() {
  27261. return this.disabled || (this.elForm || {}).disabled;
  27262. }
  27263. },
  27264. watch: {
  27265. value: function value(val) {
  27266. this.currentValue = val;
  27267. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  27268. }
  27269. },
  27270. methods: {
  27271. getMigratingConfig: function getMigratingConfig() {
  27272. return {
  27273. props: {
  27274. 'text-template': 'text-template is renamed to score-template.'
  27275. }
  27276. };
  27277. },
  27278. getValueFromMap: function getValueFromMap(value, map) {
  27279. var matchedKeys = Object.keys(map).filter(function (key) {
  27280. var val = map[key];
  27281. var excluded = Object(types_["isObject"])(val) ? val.excluded : false;
  27282. return excluded ? value < key : value <= key;
  27283. }).sort(function (a, b) {
  27284. return a - b;
  27285. });
  27286. var matchedValue = map[matchedKeys[0]];
  27287. return Object(types_["isObject"])(matchedValue) ? matchedValue.value : matchedValue || '';
  27288. },
  27289. showDecimalIcon: function showDecimalIcon(item) {
  27290. var showWhenDisabled = this.rateDisabled && this.valueDecimal > 0 && item - 1 < this.value && item > this.value;
  27291. /* istanbul ignore next */
  27292. var showWhenAllowHalf = this.allowHalf && this.pointerAtLeftHalf && item - 0.5 <= this.currentValue && item > this.currentValue;
  27293. return showWhenDisabled || showWhenAllowHalf;
  27294. },
  27295. getIconStyle: function getIconStyle(item) {
  27296. var voidColor = this.rateDisabled ? this.disabledVoidColor : this.voidColor;
  27297. return {
  27298. color: item <= this.currentValue ? this.activeColor : voidColor
  27299. };
  27300. },
  27301. selectValue: function selectValue(value) {
  27302. if (this.rateDisabled) {
  27303. return;
  27304. }
  27305. if (this.allowHalf && this.pointerAtLeftHalf) {
  27306. this.$emit('input', this.currentValue);
  27307. this.$emit('change', this.currentValue);
  27308. } else {
  27309. this.$emit('input', value);
  27310. this.$emit('change', value);
  27311. }
  27312. },
  27313. handleKey: function handleKey(e) {
  27314. if (this.rateDisabled) {
  27315. return;
  27316. }
  27317. var currentValue = this.currentValue;
  27318. var keyCode = e.keyCode;
  27319. if (keyCode === 38 || keyCode === 39) {
  27320. // left / down
  27321. if (this.allowHalf) {
  27322. currentValue += 0.5;
  27323. } else {
  27324. currentValue += 1;
  27325. }
  27326. e.stopPropagation();
  27327. e.preventDefault();
  27328. } else if (keyCode === 37 || keyCode === 40) {
  27329. if (this.allowHalf) {
  27330. currentValue -= 0.5;
  27331. } else {
  27332. currentValue -= 1;
  27333. }
  27334. e.stopPropagation();
  27335. e.preventDefault();
  27336. }
  27337. currentValue = currentValue < 0 ? 0 : currentValue;
  27338. currentValue = currentValue > this.max ? this.max : currentValue;
  27339. this.$emit('input', currentValue);
  27340. this.$emit('change', currentValue);
  27341. },
  27342. setCurrentValue: function setCurrentValue(value, event) {
  27343. if (this.rateDisabled) {
  27344. return;
  27345. }
  27346. /* istanbul ignore if */
  27347. if (this.allowHalf) {
  27348. var target = event.target;
  27349. if (Object(dom_["hasClass"])(target, 'el-rate__item')) {
  27350. target = target.querySelector('.el-rate__icon');
  27351. }
  27352. if (Object(dom_["hasClass"])(target, 'el-rate__decimal')) {
  27353. target = target.parentNode;
  27354. }
  27355. this.pointerAtLeftHalf = event.offsetX * 2 <= target.clientWidth;
  27356. this.currentValue = this.pointerAtLeftHalf ? value - 0.5 : value;
  27357. } else {
  27358. this.currentValue = value;
  27359. }
  27360. this.hoverIndex = value;
  27361. },
  27362. resetCurrentValue: function resetCurrentValue() {
  27363. if (this.rateDisabled) {
  27364. return;
  27365. }
  27366. if (this.allowHalf) {
  27367. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  27368. }
  27369. this.currentValue = this.value;
  27370. this.hoverIndex = -1;
  27371. }
  27372. },
  27373. created: function created() {
  27374. if (!this.value) {
  27375. this.$emit('input', 0);
  27376. }
  27377. }
  27378. });
  27379. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=script&lang=js&
  27380. /* harmony default export */ var packages_rate_src_mainvue_type_script_lang_js_ = (rate_src_mainvue_type_script_lang_js_);
  27381. // CONCATENATED MODULE: ./packages/rate/src/main.vue
  27382. /* normalize component */
  27383. var rate_src_main_component = normalizeComponent(
  27384. packages_rate_src_mainvue_type_script_lang_js_,
  27385. mainvue_type_template_id_ada57782_render,
  27386. mainvue_type_template_id_ada57782_staticRenderFns,
  27387. false,
  27388. null,
  27389. null,
  27390. null
  27391. )
  27392. /* hot reload */
  27393. if (false) { var rate_src_main_api; }
  27394. rate_src_main_component.options.__file = "packages/rate/src/main.vue"
  27395. /* harmony default export */ var rate_src_main = (rate_src_main_component.exports);
  27396. // CONCATENATED MODULE: ./packages/rate/index.js
  27397. /* istanbul ignore next */
  27398. rate_src_main.install = function (Vue) {
  27399. Vue.component(rate_src_main.name, rate_src_main);
  27400. };
  27401. /* harmony default export */ var rate = (rate_src_main);
  27402. // 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&
  27403. var stepsvue_type_template_id_3c6b6dc0_render = function() {
  27404. var _vm = this
  27405. var _h = _vm.$createElement
  27406. var _c = _vm._self._c || _h
  27407. return _c(
  27408. "div",
  27409. {
  27410. staticClass: "el-steps",
  27411. class: [
  27412. !_vm.simple && "el-steps--" + _vm.direction,
  27413. _vm.simple && "el-steps--simple"
  27414. ]
  27415. },
  27416. [_vm._t("default")],
  27417. 2
  27418. )
  27419. }
  27420. var stepsvue_type_template_id_3c6b6dc0_staticRenderFns = []
  27421. stepsvue_type_template_id_3c6b6dc0_render._withStripped = true
  27422. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=template&id=3c6b6dc0&
  27423. // 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&
  27424. //
  27425. //
  27426. //
  27427. //
  27428. //
  27429. //
  27430. //
  27431. //
  27432. //
  27433. //
  27434. //
  27435. /* harmony default export */ var stepsvue_type_script_lang_js_ = ({
  27436. name: 'ElSteps',
  27437. mixins: [migrating_default.a],
  27438. props: {
  27439. space: [Number, String],
  27440. active: Number,
  27441. direction: {
  27442. type: String,
  27443. default: 'horizontal'
  27444. },
  27445. alignCenter: Boolean,
  27446. simple: Boolean,
  27447. finishStatus: {
  27448. type: String,
  27449. default: 'finish'
  27450. },
  27451. processStatus: {
  27452. type: String,
  27453. default: 'process'
  27454. }
  27455. },
  27456. data: function data() {
  27457. return {
  27458. steps: [],
  27459. stepOffset: 0
  27460. };
  27461. },
  27462. methods: {
  27463. getMigratingConfig: function getMigratingConfig() {
  27464. return {
  27465. props: {
  27466. 'center': 'center is removed.'
  27467. }
  27468. };
  27469. }
  27470. },
  27471. watch: {
  27472. active: function active(newVal, oldVal) {
  27473. this.$emit('change', newVal, oldVal);
  27474. },
  27475. steps: function steps(_steps) {
  27476. _steps.forEach(function (child, index) {
  27477. child.index = index;
  27478. });
  27479. }
  27480. }
  27481. });
  27482. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=script&lang=js&
  27483. /* harmony default export */ var src_stepsvue_type_script_lang_js_ = (stepsvue_type_script_lang_js_);
  27484. // CONCATENATED MODULE: ./packages/steps/src/steps.vue
  27485. /* normalize component */
  27486. var steps_component = normalizeComponent(
  27487. src_stepsvue_type_script_lang_js_,
  27488. stepsvue_type_template_id_3c6b6dc0_render,
  27489. stepsvue_type_template_id_3c6b6dc0_staticRenderFns,
  27490. false,
  27491. null,
  27492. null,
  27493. null
  27494. )
  27495. /* hot reload */
  27496. if (false) { var steps_api; }
  27497. steps_component.options.__file = "packages/steps/src/steps.vue"
  27498. /* harmony default export */ var steps = (steps_component.exports);
  27499. // CONCATENATED MODULE: ./packages/steps/index.js
  27500. /* istanbul ignore next */
  27501. steps.install = function (Vue) {
  27502. Vue.component(steps.name, steps);
  27503. };
  27504. /* harmony default export */ var packages_steps = (steps);
  27505. // 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&
  27506. var stepvue_type_template_id_f414a87a_render = function() {
  27507. var _vm = this
  27508. var _h = _vm.$createElement
  27509. var _c = _vm._self._c || _h
  27510. return _c(
  27511. "div",
  27512. {
  27513. staticClass: "el-step",
  27514. class: [
  27515. !_vm.isSimple && "is-" + _vm.$parent.direction,
  27516. _vm.isSimple && "is-simple",
  27517. _vm.isLast && !_vm.space && !_vm.isCenter && "is-flex",
  27518. _vm.isCenter && !_vm.isVertical && !_vm.isSimple && "is-center"
  27519. ],
  27520. style: _vm.style
  27521. },
  27522. [
  27523. _c(
  27524. "div",
  27525. { staticClass: "el-step__head", class: "is-" + _vm.currentStatus },
  27526. [
  27527. _c(
  27528. "div",
  27529. {
  27530. staticClass: "el-step__line",
  27531. style: _vm.isLast
  27532. ? ""
  27533. : { marginRight: _vm.$parent.stepOffset + "px" }
  27534. },
  27535. [
  27536. _c("i", {
  27537. staticClass: "el-step__line-inner",
  27538. style: _vm.lineStyle
  27539. })
  27540. ]
  27541. ),
  27542. _c(
  27543. "div",
  27544. {
  27545. staticClass: "el-step__icon",
  27546. class: "is-" + (_vm.icon ? "icon" : "text")
  27547. },
  27548. [
  27549. _vm.currentStatus !== "success" && _vm.currentStatus !== "error"
  27550. ? _vm._t("icon", [
  27551. _vm.icon
  27552. ? _c("i", {
  27553. staticClass: "el-step__icon-inner",
  27554. class: [_vm.icon]
  27555. })
  27556. : _vm._e(),
  27557. !_vm.icon && !_vm.isSimple
  27558. ? _c("div", { staticClass: "el-step__icon-inner" }, [
  27559. _vm._v(_vm._s(_vm.index + 1))
  27560. ])
  27561. : _vm._e()
  27562. ])
  27563. : _c("i", {
  27564. staticClass: "el-step__icon-inner is-status",
  27565. class: [
  27566. "el-icon-" +
  27567. (_vm.currentStatus === "success" ? "check" : "close")
  27568. ]
  27569. })
  27570. ],
  27571. 2
  27572. )
  27573. ]
  27574. ),
  27575. _c("div", { staticClass: "el-step__main" }, [
  27576. _c(
  27577. "div",
  27578. {
  27579. ref: "title",
  27580. staticClass: "el-step__title",
  27581. class: ["is-" + _vm.currentStatus]
  27582. },
  27583. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  27584. 2
  27585. ),
  27586. _vm.isSimple
  27587. ? _c("div", { staticClass: "el-step__arrow" })
  27588. : _c(
  27589. "div",
  27590. {
  27591. staticClass: "el-step__description",
  27592. class: ["is-" + _vm.currentStatus]
  27593. },
  27594. [_vm._t("description", [_vm._v(_vm._s(_vm.description))])],
  27595. 2
  27596. )
  27597. ])
  27598. ]
  27599. )
  27600. }
  27601. var stepvue_type_template_id_f414a87a_staticRenderFns = []
  27602. stepvue_type_template_id_f414a87a_render._withStripped = true
  27603. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=template&id=f414a87a&
  27604. // 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&
  27605. //
  27606. //
  27607. //
  27608. //
  27609. //
  27610. //
  27611. //
  27612. //
  27613. //
  27614. //
  27615. //
  27616. //
  27617. //
  27618. //
  27619. //
  27620. //
  27621. //
  27622. //
  27623. //
  27624. //
  27625. //
  27626. //
  27627. //
  27628. //
  27629. //
  27630. //
  27631. //
  27632. //
  27633. //
  27634. //
  27635. //
  27636. //
  27637. //
  27638. //
  27639. //
  27640. //
  27641. //
  27642. //
  27643. //
  27644. //
  27645. //
  27646. //
  27647. //
  27648. //
  27649. //
  27650. //
  27651. //
  27652. //
  27653. //
  27654. //
  27655. //
  27656. //
  27657. //
  27658. //
  27659. //
  27660. /* harmony default export */ var stepvue_type_script_lang_js_ = ({
  27661. name: 'ElStep',
  27662. props: {
  27663. title: String,
  27664. icon: String,
  27665. description: String,
  27666. status: String
  27667. },
  27668. data: function data() {
  27669. return {
  27670. index: -1,
  27671. lineStyle: {},
  27672. internalStatus: ''
  27673. };
  27674. },
  27675. beforeCreate: function beforeCreate() {
  27676. this.$parent.steps.push(this);
  27677. },
  27678. beforeDestroy: function beforeDestroy() {
  27679. var steps = this.$parent.steps;
  27680. var index = steps.indexOf(this);
  27681. if (index >= 0) {
  27682. steps.splice(index, 1);
  27683. }
  27684. },
  27685. computed: {
  27686. currentStatus: function currentStatus() {
  27687. return this.status || this.internalStatus;
  27688. },
  27689. prevStatus: function prevStatus() {
  27690. var prevStep = this.$parent.steps[this.index - 1];
  27691. return prevStep ? prevStep.currentStatus : 'wait';
  27692. },
  27693. isCenter: function isCenter() {
  27694. return this.$parent.alignCenter;
  27695. },
  27696. isVertical: function isVertical() {
  27697. return this.$parent.direction === 'vertical';
  27698. },
  27699. isSimple: function isSimple() {
  27700. return this.$parent.simple;
  27701. },
  27702. isLast: function isLast() {
  27703. var parent = this.$parent;
  27704. return parent.steps[parent.steps.length - 1] === this;
  27705. },
  27706. stepsCount: function stepsCount() {
  27707. return this.$parent.steps.length;
  27708. },
  27709. space: function space() {
  27710. var isSimple = this.isSimple,
  27711. space = this.$parent.space;
  27712. return isSimple ? '' : space;
  27713. },
  27714. style: function style() {
  27715. var style = {};
  27716. var parent = this.$parent;
  27717. var len = parent.steps.length;
  27718. var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
  27719. style.flexBasis = space;
  27720. if (this.isVertical) return style;
  27721. if (this.isLast) {
  27722. style.maxWidth = 100 / this.stepsCount + '%';
  27723. } else {
  27724. style.marginRight = -this.$parent.stepOffset + 'px';
  27725. }
  27726. return style;
  27727. }
  27728. },
  27729. methods: {
  27730. updateStatus: function updateStatus(val) {
  27731. var prevChild = this.$parent.$children[this.index - 1];
  27732. if (val > this.index) {
  27733. this.internalStatus = this.$parent.finishStatus;
  27734. } else if (val === this.index && this.prevStatus !== 'error') {
  27735. this.internalStatus = this.$parent.processStatus;
  27736. } else {
  27737. this.internalStatus = 'wait';
  27738. }
  27739. if (prevChild) prevChild.calcProgress(this.internalStatus);
  27740. },
  27741. calcProgress: function calcProgress(status) {
  27742. var step = 100;
  27743. var style = {};
  27744. style.transitionDelay = 150 * this.index + 'ms';
  27745. if (status === this.$parent.processStatus) {
  27746. step = this.currentStatus !== 'error' ? 0 : 0;
  27747. } else if (status === 'wait') {
  27748. step = 0;
  27749. style.transitionDelay = -150 * this.index + 'ms';
  27750. }
  27751. style.borderWidth = step && !this.isSimple ? '1px' : 0;
  27752. this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
  27753. this.lineStyle = style;
  27754. }
  27755. },
  27756. mounted: function mounted() {
  27757. var _this = this;
  27758. var unwatch = this.$watch('index', function (val) {
  27759. _this.$watch('$parent.active', _this.updateStatus, { immediate: true });
  27760. _this.$watch('$parent.processStatus', function () {
  27761. var activeIndex = _this.$parent.active;
  27762. _this.updateStatus(activeIndex);
  27763. }, { immediate: true });
  27764. unwatch();
  27765. });
  27766. }
  27767. });
  27768. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=script&lang=js&
  27769. /* harmony default export */ var src_stepvue_type_script_lang_js_ = (stepvue_type_script_lang_js_);
  27770. // CONCATENATED MODULE: ./packages/steps/src/step.vue
  27771. /* normalize component */
  27772. var step_component = normalizeComponent(
  27773. src_stepvue_type_script_lang_js_,
  27774. stepvue_type_template_id_f414a87a_render,
  27775. stepvue_type_template_id_f414a87a_staticRenderFns,
  27776. false,
  27777. null,
  27778. null,
  27779. null
  27780. )
  27781. /* hot reload */
  27782. if (false) { var step_api; }
  27783. step_component.options.__file = "packages/steps/src/step.vue"
  27784. /* harmony default export */ var step = (step_component.exports);
  27785. // CONCATENATED MODULE: ./packages/step/index.js
  27786. /* istanbul ignore next */
  27787. step.install = function (Vue) {
  27788. Vue.component(step.name, step);
  27789. };
  27790. /* harmony default export */ var packages_step = (step);
  27791. // 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&
  27792. var mainvue_type_template_id_5d5d1482_render = function() {
  27793. var _vm = this
  27794. var _h = _vm.$createElement
  27795. var _c = _vm._self._c || _h
  27796. return _c(
  27797. "div",
  27798. {
  27799. class: _vm.carouselClasses,
  27800. on: {
  27801. mouseenter: function($event) {
  27802. $event.stopPropagation()
  27803. return _vm.handleMouseEnter($event)
  27804. },
  27805. mouseleave: function($event) {
  27806. $event.stopPropagation()
  27807. return _vm.handleMouseLeave($event)
  27808. }
  27809. }
  27810. },
  27811. [
  27812. _c(
  27813. "div",
  27814. {
  27815. staticClass: "el-carousel__container",
  27816. style: { height: _vm.height }
  27817. },
  27818. [
  27819. _vm.arrowDisplay
  27820. ? _c("transition", { attrs: { name: "carousel-arrow-left" } }, [
  27821. _c(
  27822. "button",
  27823. {
  27824. directives: [
  27825. {
  27826. name: "show",
  27827. rawName: "v-show",
  27828. value:
  27829. (_vm.arrow === "always" || _vm.hover) &&
  27830. (_vm.loop || _vm.activeIndex > 0),
  27831. expression:
  27832. "(arrow === 'always' || hover) && (loop || activeIndex > 0)"
  27833. }
  27834. ],
  27835. staticClass: "el-carousel__arrow el-carousel__arrow--left",
  27836. attrs: { type: "button" },
  27837. on: {
  27838. mouseenter: function($event) {
  27839. _vm.handleButtonEnter("left")
  27840. },
  27841. mouseleave: _vm.handleButtonLeave,
  27842. click: function($event) {
  27843. $event.stopPropagation()
  27844. _vm.throttledArrowClick(_vm.activeIndex - 1)
  27845. }
  27846. }
  27847. },
  27848. [_c("i", { staticClass: "el-icon-arrow-left" })]
  27849. )
  27850. ])
  27851. : _vm._e(),
  27852. _vm.arrowDisplay
  27853. ? _c("transition", { attrs: { name: "carousel-arrow-right" } }, [
  27854. _c(
  27855. "button",
  27856. {
  27857. directives: [
  27858. {
  27859. name: "show",
  27860. rawName: "v-show",
  27861. value:
  27862. (_vm.arrow === "always" || _vm.hover) &&
  27863. (_vm.loop || _vm.activeIndex < _vm.items.length - 1),
  27864. expression:
  27865. "(arrow === 'always' || hover) && (loop || activeIndex < items.length - 1)"
  27866. }
  27867. ],
  27868. staticClass: "el-carousel__arrow el-carousel__arrow--right",
  27869. attrs: { type: "button" },
  27870. on: {
  27871. mouseenter: function($event) {
  27872. _vm.handleButtonEnter("right")
  27873. },
  27874. mouseleave: _vm.handleButtonLeave,
  27875. click: function($event) {
  27876. $event.stopPropagation()
  27877. _vm.throttledArrowClick(_vm.activeIndex + 1)
  27878. }
  27879. }
  27880. },
  27881. [_c("i", { staticClass: "el-icon-arrow-right" })]
  27882. )
  27883. ])
  27884. : _vm._e(),
  27885. _vm._t("default")
  27886. ],
  27887. 2
  27888. ),
  27889. _vm.indicatorPosition !== "none"
  27890. ? _c(
  27891. "ul",
  27892. { class: _vm.indicatorsClasses },
  27893. _vm._l(_vm.items, function(item, index) {
  27894. return _c(
  27895. "li",
  27896. {
  27897. key: index,
  27898. class: [
  27899. "el-carousel__indicator",
  27900. "el-carousel__indicator--" + _vm.direction,
  27901. { "is-active": index === _vm.activeIndex }
  27902. ],
  27903. on: {
  27904. mouseenter: function($event) {
  27905. _vm.throttledIndicatorHover(index)
  27906. },
  27907. click: function($event) {
  27908. $event.stopPropagation()
  27909. _vm.handleIndicatorClick(index)
  27910. }
  27911. }
  27912. },
  27913. [
  27914. _c("button", { staticClass: "el-carousel__button" }, [
  27915. _vm.hasLabel
  27916. ? _c("span", [_vm._v(_vm._s(item.label))])
  27917. : _vm._e()
  27918. ])
  27919. ]
  27920. )
  27921. }),
  27922. 0
  27923. )
  27924. : _vm._e()
  27925. ]
  27926. )
  27927. }
  27928. var mainvue_type_template_id_5d5d1482_staticRenderFns = []
  27929. mainvue_type_template_id_5d5d1482_render._withStripped = true
  27930. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=template&id=5d5d1482&
  27931. // EXTERNAL MODULE: external "throttle-debounce/throttle"
  27932. var throttle_ = __webpack_require__(27);
  27933. var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
  27934. // 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&
  27935. //
  27936. //
  27937. //
  27938. //
  27939. //
  27940. //
  27941. //
  27942. //
  27943. //
  27944. //
  27945. //
  27946. //
  27947. //
  27948. //
  27949. //
  27950. //
  27951. //
  27952. //
  27953. //
  27954. //
  27955. //
  27956. //
  27957. //
  27958. //
  27959. //
  27960. //
  27961. //
  27962. //
  27963. //
  27964. //
  27965. //
  27966. //
  27967. //
  27968. //
  27969. //
  27970. //
  27971. //
  27972. //
  27973. //
  27974. //
  27975. //
  27976. //
  27977. //
  27978. //
  27979. //
  27980. //
  27981. //
  27982. //
  27983. //
  27984. //
  27985. //
  27986. //
  27987. //
  27988. //
  27989. //
  27990. //
  27991. /* harmony default export */ var carousel_src_mainvue_type_script_lang_js_ = ({
  27992. name: 'ElCarousel',
  27993. props: {
  27994. initialIndex: {
  27995. type: Number,
  27996. default: 0
  27997. },
  27998. height: String,
  27999. trigger: {
  28000. type: String,
  28001. default: 'hover'
  28002. },
  28003. autoplay: {
  28004. type: Boolean,
  28005. default: true
  28006. },
  28007. interval: {
  28008. type: Number,
  28009. default: 3000
  28010. },
  28011. indicatorPosition: String,
  28012. indicator: {
  28013. type: Boolean,
  28014. default: true
  28015. },
  28016. arrow: {
  28017. type: String,
  28018. default: 'hover'
  28019. },
  28020. type: String,
  28021. loop: {
  28022. type: Boolean,
  28023. default: true
  28024. },
  28025. direction: {
  28026. type: String,
  28027. default: 'horizontal',
  28028. validator: function validator(val) {
  28029. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  28030. }
  28031. }
  28032. },
  28033. data: function data() {
  28034. return {
  28035. items: [],
  28036. activeIndex: -1,
  28037. containerWidth: 0,
  28038. timer: null,
  28039. hover: false
  28040. };
  28041. },
  28042. computed: {
  28043. arrowDisplay: function arrowDisplay() {
  28044. return this.arrow !== 'never' && this.direction !== 'vertical';
  28045. },
  28046. hasLabel: function hasLabel() {
  28047. return this.items.some(function (item) {
  28048. return item.label.toString().length > 0;
  28049. });
  28050. },
  28051. carouselClasses: function carouselClasses() {
  28052. var classes = ['el-carousel', 'el-carousel--' + this.direction];
  28053. if (this.type === 'card') {
  28054. classes.push('el-carousel--card');
  28055. }
  28056. return classes;
  28057. },
  28058. indicatorsClasses: function indicatorsClasses() {
  28059. var classes = ['el-carousel__indicators', 'el-carousel__indicators--' + this.direction];
  28060. if (this.hasLabel) {
  28061. classes.push('el-carousel__indicators--labels');
  28062. }
  28063. if (this.indicatorPosition === 'outside' || this.type === 'card') {
  28064. classes.push('el-carousel__indicators--outside');
  28065. }
  28066. return classes;
  28067. }
  28068. },
  28069. watch: {
  28070. items: function items(val) {
  28071. if (val.length > 0) this.setActiveItem(this.initialIndex);
  28072. },
  28073. activeIndex: function activeIndex(val, oldVal) {
  28074. this.resetItemPosition(oldVal);
  28075. this.$emit('change', val, oldVal);
  28076. },
  28077. autoplay: function autoplay(val) {
  28078. val ? this.startTimer() : this.pauseTimer();
  28079. },
  28080. loop: function loop() {
  28081. this.setActiveItem(this.activeIndex);
  28082. }
  28083. },
  28084. methods: {
  28085. handleMouseEnter: function handleMouseEnter() {
  28086. this.hover = true;
  28087. this.pauseTimer();
  28088. },
  28089. handleMouseLeave: function handleMouseLeave() {
  28090. this.hover = false;
  28091. this.startTimer();
  28092. },
  28093. itemInStage: function itemInStage(item, index) {
  28094. var length = this.items.length;
  28095. if (index === length - 1 && item.inStage && this.items[0].active || item.inStage && this.items[index + 1] && this.items[index + 1].active) {
  28096. return 'left';
  28097. } else if (index === 0 && item.inStage && this.items[length - 1].active || item.inStage && this.items[index - 1] && this.items[index - 1].active) {
  28098. return 'right';
  28099. }
  28100. return false;
  28101. },
  28102. handleButtonEnter: function handleButtonEnter(arrow) {
  28103. var _this = this;
  28104. if (this.direction === 'vertical') return;
  28105. this.items.forEach(function (item, index) {
  28106. if (arrow === _this.itemInStage(item, index)) {
  28107. item.hover = true;
  28108. }
  28109. });
  28110. },
  28111. handleButtonLeave: function handleButtonLeave() {
  28112. if (this.direction === 'vertical') return;
  28113. this.items.forEach(function (item) {
  28114. item.hover = false;
  28115. });
  28116. },
  28117. updateItems: function updateItems() {
  28118. this.items = this.$children.filter(function (child) {
  28119. return child.$options.name === 'ElCarouselItem';
  28120. });
  28121. },
  28122. resetItemPosition: function resetItemPosition(oldIndex) {
  28123. var _this2 = this;
  28124. this.items.forEach(function (item, index) {
  28125. item.translateItem(index, _this2.activeIndex, oldIndex);
  28126. });
  28127. },
  28128. playSlides: function playSlides() {
  28129. if (this.activeIndex < this.items.length - 1) {
  28130. this.activeIndex++;
  28131. } else if (this.loop) {
  28132. this.activeIndex = 0;
  28133. }
  28134. },
  28135. pauseTimer: function pauseTimer() {
  28136. if (this.timer) {
  28137. clearInterval(this.timer);
  28138. this.timer = null;
  28139. }
  28140. },
  28141. startTimer: function startTimer() {
  28142. if (this.interval <= 0 || !this.autoplay || this.timer) return;
  28143. this.timer = setInterval(this.playSlides, this.interval);
  28144. },
  28145. setActiveItem: function setActiveItem(index) {
  28146. if (typeof index === 'string') {
  28147. var filteredItems = this.items.filter(function (item) {
  28148. return item.name === index;
  28149. });
  28150. if (filteredItems.length > 0) {
  28151. index = this.items.indexOf(filteredItems[0]);
  28152. }
  28153. }
  28154. index = Number(index);
  28155. if (isNaN(index) || index !== Math.floor(index)) {
  28156. console.warn('[Element Warn][Carousel]index must be an integer.');
  28157. return;
  28158. }
  28159. var length = this.items.length;
  28160. var oldIndex = this.activeIndex;
  28161. if (index < 0) {
  28162. this.activeIndex = this.loop ? length - 1 : 0;
  28163. } else if (index >= length) {
  28164. this.activeIndex = this.loop ? 0 : length - 1;
  28165. } else {
  28166. this.activeIndex = index;
  28167. }
  28168. if (oldIndex === this.activeIndex) {
  28169. this.resetItemPosition(oldIndex);
  28170. }
  28171. },
  28172. prev: function prev() {
  28173. this.setActiveItem(this.activeIndex - 1);
  28174. },
  28175. next: function next() {
  28176. this.setActiveItem(this.activeIndex + 1);
  28177. },
  28178. handleIndicatorClick: function handleIndicatorClick(index) {
  28179. this.activeIndex = index;
  28180. },
  28181. handleIndicatorHover: function handleIndicatorHover(index) {
  28182. if (this.trigger === 'hover' && index !== this.activeIndex) {
  28183. this.activeIndex = index;
  28184. }
  28185. }
  28186. },
  28187. created: function created() {
  28188. var _this3 = this;
  28189. this.throttledArrowClick = throttle_default()(300, true, function (index) {
  28190. _this3.setActiveItem(index);
  28191. });
  28192. this.throttledIndicatorHover = throttle_default()(300, function (index) {
  28193. _this3.handleIndicatorHover(index);
  28194. });
  28195. },
  28196. mounted: function mounted() {
  28197. var _this4 = this;
  28198. this.updateItems();
  28199. this.$nextTick(function () {
  28200. Object(resize_event_["addResizeListener"])(_this4.$el, _this4.resetItemPosition);
  28201. if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
  28202. _this4.activeIndex = _this4.initialIndex;
  28203. }
  28204. _this4.startTimer();
  28205. });
  28206. },
  28207. beforeDestroy: function beforeDestroy() {
  28208. if (this.$el) Object(resize_event_["removeResizeListener"])(this.$el, this.resetItemPosition);
  28209. this.pauseTimer();
  28210. }
  28211. });
  28212. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=script&lang=js&
  28213. /* harmony default export */ var packages_carousel_src_mainvue_type_script_lang_js_ = (carousel_src_mainvue_type_script_lang_js_);
  28214. // CONCATENATED MODULE: ./packages/carousel/src/main.vue
  28215. /* normalize component */
  28216. var carousel_src_main_component = normalizeComponent(
  28217. packages_carousel_src_mainvue_type_script_lang_js_,
  28218. mainvue_type_template_id_5d5d1482_render,
  28219. mainvue_type_template_id_5d5d1482_staticRenderFns,
  28220. false,
  28221. null,
  28222. null,
  28223. null
  28224. )
  28225. /* hot reload */
  28226. if (false) { var carousel_src_main_api; }
  28227. carousel_src_main_component.options.__file = "packages/carousel/src/main.vue"
  28228. /* harmony default export */ var carousel_src_main = (carousel_src_main_component.exports);
  28229. // CONCATENATED MODULE: ./packages/carousel/index.js
  28230. /* istanbul ignore next */
  28231. carousel_src_main.install = function (Vue) {
  28232. Vue.component(carousel_src_main.name, carousel_src_main);
  28233. };
  28234. /* harmony default export */ var carousel = (carousel_src_main);
  28235. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  28236. var BAR_MAP = {
  28237. vertical: {
  28238. offset: 'offsetHeight',
  28239. scroll: 'scrollTop',
  28240. scrollSize: 'scrollHeight',
  28241. size: 'height',
  28242. key: 'vertical',
  28243. axis: 'Y',
  28244. client: 'clientY',
  28245. direction: 'top'
  28246. },
  28247. horizontal: {
  28248. offset: 'offsetWidth',
  28249. scroll: 'scrollLeft',
  28250. scrollSize: 'scrollWidth',
  28251. size: 'width',
  28252. key: 'horizontal',
  28253. axis: 'X',
  28254. client: 'clientX',
  28255. direction: 'left'
  28256. }
  28257. };
  28258. function renderThumbStyle(_ref) {
  28259. var move = _ref.move,
  28260. size = _ref.size,
  28261. bar = _ref.bar;
  28262. var style = {};
  28263. var translate = 'translate' + bar.axis + '(' + move + '%)';
  28264. style[bar.size] = size;
  28265. style.transform = translate;
  28266. style.msTransform = translate;
  28267. style.webkitTransform = translate;
  28268. return style;
  28269. };
  28270. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  28271. /* istanbul ignore next */
  28272. /* harmony default export */ var src_bar = ({
  28273. name: 'Bar',
  28274. props: {
  28275. vertical: Boolean,
  28276. size: String,
  28277. move: Number
  28278. },
  28279. computed: {
  28280. bar: function bar() {
  28281. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  28282. },
  28283. wrap: function wrap() {
  28284. return this.$parent.wrap;
  28285. }
  28286. },
  28287. render: function render(h) {
  28288. var size = this.size,
  28289. move = this.move,
  28290. bar = this.bar;
  28291. return h(
  28292. 'div',
  28293. {
  28294. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  28295. on: {
  28296. 'mousedown': this.clickTrackHandler
  28297. }
  28298. },
  28299. [h('div', {
  28300. ref: 'thumb',
  28301. 'class': 'el-scrollbar__thumb',
  28302. on: {
  28303. 'mousedown': this.clickThumbHandler
  28304. },
  28305. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  28306. );
  28307. },
  28308. methods: {
  28309. clickThumbHandler: function clickThumbHandler(e) {
  28310. // prevent click event of right button
  28311. if (e.ctrlKey || e.button === 2) {
  28312. return;
  28313. }
  28314. this.startDrag(e);
  28315. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  28316. },
  28317. clickTrackHandler: function clickTrackHandler(e) {
  28318. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  28319. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  28320. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  28321. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  28322. },
  28323. startDrag: function startDrag(e) {
  28324. e.stopImmediatePropagation();
  28325. this.cursorDown = true;
  28326. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  28327. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  28328. document.onselectstart = function () {
  28329. return false;
  28330. };
  28331. },
  28332. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  28333. if (this.cursorDown === false) return;
  28334. var prevPage = this[this.bar.axis];
  28335. if (!prevPage) return;
  28336. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  28337. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  28338. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  28339. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  28340. },
  28341. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  28342. this.cursorDown = false;
  28343. this[this.bar.axis] = 0;
  28344. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  28345. document.onselectstart = null;
  28346. }
  28347. },
  28348. destroyed: function destroyed() {
  28349. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  28350. }
  28351. });
  28352. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  28353. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  28354. /* istanbul ignore next */
  28355. /* harmony default export */ var scrollbar_src_main = ({
  28356. name: 'ElScrollbar',
  28357. components: { Bar: src_bar },
  28358. props: {
  28359. native: Boolean,
  28360. wrapStyle: {},
  28361. wrapClass: {},
  28362. viewClass: {},
  28363. viewStyle: {},
  28364. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  28365. tag: {
  28366. type: String,
  28367. default: 'div'
  28368. }
  28369. },
  28370. data: function data() {
  28371. return {
  28372. sizeWidth: '0',
  28373. sizeHeight: '0',
  28374. moveX: 0,
  28375. moveY: 0
  28376. };
  28377. },
  28378. computed: {
  28379. wrap: function wrap() {
  28380. return this.$refs.wrap;
  28381. }
  28382. },
  28383. render: function render(h) {
  28384. var gutter = scrollbar_width_default()();
  28385. var style = this.wrapStyle;
  28386. if (gutter) {
  28387. var gutterWith = '-' + gutter + 'px';
  28388. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  28389. if (Array.isArray(this.wrapStyle)) {
  28390. style = Object(util_["toObject"])(this.wrapStyle);
  28391. style.marginRight = style.marginBottom = gutterWith;
  28392. } else if (typeof this.wrapStyle === 'string') {
  28393. style += gutterStyle;
  28394. } else {
  28395. style = gutterStyle;
  28396. }
  28397. }
  28398. var view = h(this.tag, {
  28399. class: ['el-scrollbar__view', this.viewClass],
  28400. style: this.viewStyle,
  28401. ref: 'resize'
  28402. }, this.$slots.default);
  28403. var wrap = h(
  28404. 'div',
  28405. {
  28406. ref: 'wrap',
  28407. style: style,
  28408. on: {
  28409. 'scroll': this.handleScroll
  28410. },
  28411. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  28412. [[view]]
  28413. );
  28414. var nodes = void 0;
  28415. if (!this.native) {
  28416. nodes = [wrap, h(src_bar, {
  28417. attrs: {
  28418. move: this.moveX,
  28419. size: this.sizeWidth }
  28420. }), h(src_bar, {
  28421. attrs: {
  28422. vertical: true,
  28423. move: this.moveY,
  28424. size: this.sizeHeight }
  28425. })];
  28426. } else {
  28427. nodes = [h(
  28428. 'div',
  28429. {
  28430. ref: 'wrap',
  28431. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  28432. style: style },
  28433. [[view]]
  28434. )];
  28435. }
  28436. return h('div', { class: 'el-scrollbar' }, nodes);
  28437. },
  28438. methods: {
  28439. handleScroll: function handleScroll() {
  28440. var wrap = this.wrap;
  28441. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  28442. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  28443. },
  28444. update: function update() {
  28445. var heightPercentage = void 0,
  28446. widthPercentage = void 0;
  28447. var wrap = this.wrap;
  28448. if (!wrap) return;
  28449. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  28450. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  28451. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  28452. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  28453. }
  28454. },
  28455. mounted: function mounted() {
  28456. if (this.native) return;
  28457. this.$nextTick(this.update);
  28458. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  28459. },
  28460. beforeDestroy: function beforeDestroy() {
  28461. if (this.native) return;
  28462. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  28463. }
  28464. });
  28465. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  28466. /* istanbul ignore next */
  28467. scrollbar_src_main.install = function (Vue) {
  28468. Vue.component(scrollbar_src_main.name, scrollbar_src_main);
  28469. };
  28470. /* harmony default export */ var scrollbar = (scrollbar_src_main);
  28471. // 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&
  28472. var itemvue_type_template_id_1801ae19_render = function() {
  28473. var _vm = this
  28474. var _h = _vm.$createElement
  28475. var _c = _vm._self._c || _h
  28476. return _c(
  28477. "div",
  28478. {
  28479. directives: [
  28480. {
  28481. name: "show",
  28482. rawName: "v-show",
  28483. value: _vm.ready,
  28484. expression: "ready"
  28485. }
  28486. ],
  28487. staticClass: "el-carousel__item",
  28488. class: {
  28489. "is-active": _vm.active,
  28490. "el-carousel__item--card": _vm.$parent.type === "card",
  28491. "is-in-stage": _vm.inStage,
  28492. "is-hover": _vm.hover,
  28493. "is-animating": _vm.animating
  28494. },
  28495. style: _vm.itemStyle,
  28496. on: { click: _vm.handleItemClick }
  28497. },
  28498. [
  28499. _vm.$parent.type === "card"
  28500. ? _c("div", {
  28501. directives: [
  28502. {
  28503. name: "show",
  28504. rawName: "v-show",
  28505. value: !_vm.active,
  28506. expression: "!active"
  28507. }
  28508. ],
  28509. staticClass: "el-carousel__mask"
  28510. })
  28511. : _vm._e(),
  28512. _vm._t("default")
  28513. ],
  28514. 2
  28515. )
  28516. }
  28517. var itemvue_type_template_id_1801ae19_staticRenderFns = []
  28518. itemvue_type_template_id_1801ae19_render._withStripped = true
  28519. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=template&id=1801ae19&
  28520. // 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&
  28521. //
  28522. //
  28523. //
  28524. //
  28525. //
  28526. //
  28527. //
  28528. //
  28529. //
  28530. //
  28531. //
  28532. //
  28533. //
  28534. //
  28535. //
  28536. //
  28537. //
  28538. //
  28539. //
  28540. //
  28541. //
  28542. //
  28543. var CARD_SCALE = 0.83;
  28544. /* harmony default export */ var itemvue_type_script_lang_js_ = ({
  28545. name: 'ElCarouselItem',
  28546. props: {
  28547. name: String,
  28548. label: {
  28549. type: [String, Number],
  28550. default: ''
  28551. }
  28552. },
  28553. data: function data() {
  28554. return {
  28555. hover: false,
  28556. translate: 0,
  28557. scale: 1,
  28558. active: false,
  28559. ready: false,
  28560. inStage: false,
  28561. animating: false
  28562. };
  28563. },
  28564. methods: {
  28565. processIndex: function processIndex(index, activeIndex, length) {
  28566. if (activeIndex === 0 && index === length - 1) {
  28567. return -1;
  28568. } else if (activeIndex === length - 1 && index === 0) {
  28569. return length;
  28570. } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
  28571. return length + 1;
  28572. } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
  28573. return -2;
  28574. }
  28575. return index;
  28576. },
  28577. calcCardTranslate: function calcCardTranslate(index, activeIndex) {
  28578. var parentWidth = this.$parent.$el.offsetWidth;
  28579. if (this.inStage) {
  28580. return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
  28581. } else if (index < activeIndex) {
  28582. return -(1 + CARD_SCALE) * parentWidth / 4;
  28583. } else {
  28584. return (3 + CARD_SCALE) * parentWidth / 4;
  28585. }
  28586. },
  28587. calcTranslate: function calcTranslate(index, activeIndex, isVertical) {
  28588. var distance = this.$parent.$el[isVertical ? 'offsetHeight' : 'offsetWidth'];
  28589. return distance * (index - activeIndex);
  28590. },
  28591. translateItem: function translateItem(index, activeIndex, oldIndex) {
  28592. var parentType = this.$parent.type;
  28593. var parentDirection = this.parentDirection;
  28594. var length = this.$parent.items.length;
  28595. if (parentType !== 'card' && oldIndex !== undefined) {
  28596. this.animating = index === activeIndex || index === oldIndex;
  28597. }
  28598. if (index !== activeIndex && length > 2 && this.$parent.loop) {
  28599. index = this.processIndex(index, activeIndex, length);
  28600. }
  28601. if (parentType === 'card') {
  28602. if (parentDirection === 'vertical') {
  28603. console.warn('[Element Warn][Carousel]vertical directionis not supported in card mode');
  28604. }
  28605. this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
  28606. this.active = index === activeIndex;
  28607. this.translate = this.calcCardTranslate(index, activeIndex);
  28608. this.scale = this.active ? 1 : CARD_SCALE;
  28609. } else {
  28610. this.active = index === activeIndex;
  28611. var isVertical = parentDirection === 'vertical';
  28612. this.translate = this.calcTranslate(index, activeIndex, isVertical);
  28613. }
  28614. this.ready = true;
  28615. },
  28616. handleItemClick: function handleItemClick() {
  28617. var parent = this.$parent;
  28618. if (parent && parent.type === 'card') {
  28619. var index = parent.items.indexOf(this);
  28620. parent.setActiveItem(index);
  28621. }
  28622. }
  28623. },
  28624. computed: {
  28625. parentDirection: function parentDirection() {
  28626. return this.$parent.direction;
  28627. },
  28628. itemStyle: function itemStyle() {
  28629. var translateType = this.parentDirection === 'vertical' ? 'translateY' : 'translateX';
  28630. var value = translateType + '(' + this.translate + 'px) scale(' + this.scale + ')';
  28631. var style = {
  28632. transform: value
  28633. };
  28634. return Object(util_["autoprefixer"])(style);
  28635. }
  28636. },
  28637. created: function created() {
  28638. this.$parent && this.$parent.updateItems();
  28639. },
  28640. destroyed: function destroyed() {
  28641. this.$parent && this.$parent.updateItems();
  28642. }
  28643. });
  28644. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=script&lang=js&
  28645. /* harmony default export */ var src_itemvue_type_script_lang_js_ = (itemvue_type_script_lang_js_);
  28646. // CONCATENATED MODULE: ./packages/carousel/src/item.vue
  28647. /* normalize component */
  28648. var item_component = normalizeComponent(
  28649. src_itemvue_type_script_lang_js_,
  28650. itemvue_type_template_id_1801ae19_render,
  28651. itemvue_type_template_id_1801ae19_staticRenderFns,
  28652. false,
  28653. null,
  28654. null,
  28655. null
  28656. )
  28657. /* hot reload */
  28658. if (false) { var item_api; }
  28659. item_component.options.__file = "packages/carousel/src/item.vue"
  28660. /* harmony default export */ var src_item = (item_component.exports);
  28661. // CONCATENATED MODULE: ./packages/carousel-item/index.js
  28662. /* istanbul ignore next */
  28663. src_item.install = function (Vue) {
  28664. Vue.component(src_item.name, src_item);
  28665. };
  28666. /* harmony default export */ var carousel_item = (src_item);
  28667. // 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&
  28668. var collapsevue_type_template_id_461d57f4_render = function() {
  28669. var _vm = this
  28670. var _h = _vm.$createElement
  28671. var _c = _vm._self._c || _h
  28672. return _c(
  28673. "div",
  28674. {
  28675. staticClass: "el-collapse",
  28676. attrs: { role: "tablist", "aria-multiselectable": "true" }
  28677. },
  28678. [_vm._t("default")],
  28679. 2
  28680. )
  28681. }
  28682. var collapsevue_type_template_id_461d57f4_staticRenderFns = []
  28683. collapsevue_type_template_id_461d57f4_render._withStripped = true
  28684. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=461d57f4&
  28685. // 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&
  28686. //
  28687. //
  28688. //
  28689. //
  28690. //
  28691. /* harmony default export */ var collapsevue_type_script_lang_js_ = ({
  28692. name: 'ElCollapse',
  28693. componentName: 'ElCollapse',
  28694. props: {
  28695. accordion: Boolean,
  28696. value: {
  28697. type: [Array, String, Number],
  28698. default: function _default() {
  28699. return [];
  28700. }
  28701. }
  28702. },
  28703. data: function data() {
  28704. return {
  28705. activeNames: [].concat(this.value)
  28706. };
  28707. },
  28708. provide: function provide() {
  28709. return {
  28710. collapse: this
  28711. };
  28712. },
  28713. watch: {
  28714. value: function value(_value) {
  28715. this.activeNames = [].concat(_value);
  28716. }
  28717. },
  28718. methods: {
  28719. setActiveNames: function setActiveNames(activeNames) {
  28720. activeNames = [].concat(activeNames);
  28721. var value = this.accordion ? activeNames[0] : activeNames;
  28722. this.activeNames = activeNames;
  28723. this.$emit('input', value);
  28724. this.$emit('change', value);
  28725. },
  28726. handleItemClick: function handleItemClick(item) {
  28727. if (this.accordion) {
  28728. this.setActiveNames((this.activeNames[0] || this.activeNames[0] === 0) && this.activeNames[0] === item.name ? '' : item.name);
  28729. } else {
  28730. var activeNames = this.activeNames.slice(0);
  28731. var index = activeNames.indexOf(item.name);
  28732. if (index > -1) {
  28733. activeNames.splice(index, 1);
  28734. } else {
  28735. activeNames.push(item.name);
  28736. }
  28737. this.setActiveNames(activeNames);
  28738. }
  28739. }
  28740. },
  28741. created: function created() {
  28742. this.$on('item-click', this.handleItemClick);
  28743. }
  28744. });
  28745. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js&
  28746. /* harmony default export */ var src_collapsevue_type_script_lang_js_ = (collapsevue_type_script_lang_js_);
  28747. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
  28748. /* normalize component */
  28749. var collapse_component = normalizeComponent(
  28750. src_collapsevue_type_script_lang_js_,
  28751. collapsevue_type_template_id_461d57f4_render,
  28752. collapsevue_type_template_id_461d57f4_staticRenderFns,
  28753. false,
  28754. null,
  28755. null,
  28756. null
  28757. )
  28758. /* hot reload */
  28759. if (false) { var collapse_api; }
  28760. collapse_component.options.__file = "packages/collapse/src/collapse.vue"
  28761. /* harmony default export */ var collapse = (collapse_component.exports);
  28762. // CONCATENATED MODULE: ./packages/collapse/index.js
  28763. /* istanbul ignore next */
  28764. collapse.install = function (Vue) {
  28765. Vue.component(collapse.name, collapse);
  28766. };
  28767. /* harmony default export */ var packages_collapse = (collapse);
  28768. // 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&
  28769. var collapse_itemvue_type_template_id_2d05faac_render = function() {
  28770. var _vm = this
  28771. var _h = _vm.$createElement
  28772. var _c = _vm._self._c || _h
  28773. return _c(
  28774. "div",
  28775. {
  28776. staticClass: "el-collapse-item",
  28777. class: { "is-active": _vm.isActive, "is-disabled": _vm.disabled }
  28778. },
  28779. [
  28780. _c(
  28781. "div",
  28782. {
  28783. attrs: {
  28784. role: "tab",
  28785. "aria-expanded": _vm.isActive,
  28786. "aria-controls": "el-collapse-content-" + _vm.id,
  28787. "aria-describedby": "el-collapse-content-" + _vm.id
  28788. }
  28789. },
  28790. [
  28791. _c(
  28792. "div",
  28793. {
  28794. staticClass: "el-collapse-item__header",
  28795. class: {
  28796. focusing: _vm.focusing,
  28797. "is-active": _vm.isActive
  28798. },
  28799. attrs: {
  28800. role: "button",
  28801. id: "el-collapse-head-" + _vm.id,
  28802. tabindex: _vm.disabled ? undefined : 0
  28803. },
  28804. on: {
  28805. click: _vm.handleHeaderClick,
  28806. keyup: function($event) {
  28807. if (
  28808. !("button" in $event) &&
  28809. _vm._k($event.keyCode, "space", 32, $event.key, [
  28810. " ",
  28811. "Spacebar"
  28812. ]) &&
  28813. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  28814. ) {
  28815. return null
  28816. }
  28817. $event.stopPropagation()
  28818. return _vm.handleEnterClick($event)
  28819. },
  28820. focus: _vm.handleFocus,
  28821. blur: function($event) {
  28822. _vm.focusing = false
  28823. }
  28824. }
  28825. },
  28826. [
  28827. _vm._t("title", [_vm._v(_vm._s(_vm.title))]),
  28828. _c("i", {
  28829. staticClass: "el-collapse-item__arrow el-icon-arrow-right",
  28830. class: { "is-active": _vm.isActive }
  28831. })
  28832. ],
  28833. 2
  28834. )
  28835. ]
  28836. ),
  28837. _c("el-collapse-transition", [
  28838. _c(
  28839. "div",
  28840. {
  28841. directives: [
  28842. {
  28843. name: "show",
  28844. rawName: "v-show",
  28845. value: _vm.isActive,
  28846. expression: "isActive"
  28847. }
  28848. ],
  28849. staticClass: "el-collapse-item__wrap",
  28850. attrs: {
  28851. role: "tabpanel",
  28852. "aria-hidden": !_vm.isActive,
  28853. "aria-labelledby": "el-collapse-head-" + _vm.id,
  28854. id: "el-collapse-content-" + _vm.id
  28855. }
  28856. },
  28857. [
  28858. _c(
  28859. "div",
  28860. { staticClass: "el-collapse-item__content" },
  28861. [_vm._t("default")],
  28862. 2
  28863. )
  28864. ]
  28865. )
  28866. ])
  28867. ],
  28868. 1
  28869. )
  28870. }
  28871. var collapse_itemvue_type_template_id_2d05faac_staticRenderFns = []
  28872. collapse_itemvue_type_template_id_2d05faac_render._withStripped = true
  28873. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=2d05faac&
  28874. // 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&
  28875. //
  28876. //
  28877. //
  28878. //
  28879. //
  28880. //
  28881. //
  28882. //
  28883. //
  28884. //
  28885. //
  28886. //
  28887. //
  28888. //
  28889. //
  28890. //
  28891. //
  28892. //
  28893. //
  28894. //
  28895. //
  28896. //
  28897. //
  28898. //
  28899. //
  28900. //
  28901. //
  28902. //
  28903. //
  28904. //
  28905. //
  28906. //
  28907. //
  28908. //
  28909. //
  28910. //
  28911. //
  28912. //
  28913. //
  28914. //
  28915. //
  28916. //
  28917. //
  28918. //
  28919. //
  28920. //
  28921. /* harmony default export */ var collapse_itemvue_type_script_lang_js_ = ({
  28922. name: 'ElCollapseItem',
  28923. componentName: 'ElCollapseItem',
  28924. mixins: [emitter_default.a],
  28925. components: { ElCollapseTransition: collapse_transition_default.a },
  28926. data: function data() {
  28927. return {
  28928. contentWrapStyle: {
  28929. height: 'auto',
  28930. display: 'block'
  28931. },
  28932. contentHeight: 0,
  28933. focusing: false,
  28934. isClick: false,
  28935. id: Object(util_["generateId"])()
  28936. };
  28937. },
  28938. inject: ['collapse'],
  28939. props: {
  28940. title: String,
  28941. name: {
  28942. type: [String, Number],
  28943. default: function _default() {
  28944. return this._uid;
  28945. }
  28946. },
  28947. disabled: Boolean
  28948. },
  28949. computed: {
  28950. isActive: function isActive() {
  28951. return this.collapse.activeNames.indexOf(this.name) > -1;
  28952. }
  28953. },
  28954. methods: {
  28955. handleFocus: function handleFocus() {
  28956. var _this = this;
  28957. setTimeout(function () {
  28958. if (!_this.isClick) {
  28959. _this.focusing = true;
  28960. } else {
  28961. _this.isClick = false;
  28962. }
  28963. }, 50);
  28964. },
  28965. handleHeaderClick: function handleHeaderClick() {
  28966. if (this.disabled) return;
  28967. this.dispatch('ElCollapse', 'item-click', this);
  28968. this.focusing = false;
  28969. this.isClick = true;
  28970. },
  28971. handleEnterClick: function handleEnterClick() {
  28972. this.dispatch('ElCollapse', 'item-click', this);
  28973. }
  28974. }
  28975. });
  28976. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js&
  28977. /* harmony default export */ var src_collapse_itemvue_type_script_lang_js_ = (collapse_itemvue_type_script_lang_js_);
  28978. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
  28979. /* normalize component */
  28980. var collapse_item_component = normalizeComponent(
  28981. src_collapse_itemvue_type_script_lang_js_,
  28982. collapse_itemvue_type_template_id_2d05faac_render,
  28983. collapse_itemvue_type_template_id_2d05faac_staticRenderFns,
  28984. false,
  28985. null,
  28986. null,
  28987. null
  28988. )
  28989. /* hot reload */
  28990. if (false) { var collapse_item_api; }
  28991. collapse_item_component.options.__file = "packages/collapse/src/collapse-item.vue"
  28992. /* harmony default export */ var collapse_item = (collapse_item_component.exports);
  28993. // CONCATENATED MODULE: ./packages/collapse-item/index.js
  28994. /* istanbul ignore next */
  28995. collapse_item.install = function (Vue) {
  28996. Vue.component(collapse_item.name, collapse_item);
  28997. };
  28998. /* harmony default export */ var packages_collapse_item = (collapse_item);
  28999. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/main.vue?vue&type=template&id=2e869fa1&
  29000. var mainvue_type_template_id_2e869fa1_render = function() {
  29001. var _vm = this
  29002. var _h = _vm.$createElement
  29003. var _c = _vm._self._c || _h
  29004. return _c(
  29005. "span",
  29006. {
  29007. directives: [
  29008. {
  29009. name: "clickoutside",
  29010. rawName: "v-clickoutside",
  29011. value: _vm.handleClickoutside,
  29012. expression: "handleClickoutside"
  29013. }
  29014. ],
  29015. ref: "reference",
  29016. staticClass: "el-cascader",
  29017. class: [
  29018. {
  29019. "is-opened": _vm.menuVisible,
  29020. "is-disabled": _vm.cascaderDisabled
  29021. },
  29022. _vm.cascaderSize ? "el-cascader--" + _vm.cascaderSize : ""
  29023. ],
  29024. on: {
  29025. click: _vm.handleClick,
  29026. mouseenter: function($event) {
  29027. _vm.inputHover = true
  29028. },
  29029. focus: function($event) {
  29030. _vm.inputHover = true
  29031. },
  29032. mouseleave: function($event) {
  29033. _vm.inputHover = false
  29034. },
  29035. blur: function($event) {
  29036. _vm.inputHover = false
  29037. },
  29038. keydown: _vm.handleKeydown
  29039. }
  29040. },
  29041. [
  29042. _c(
  29043. "el-input",
  29044. {
  29045. ref: "input",
  29046. class: { "is-focus": _vm.menuVisible },
  29047. attrs: {
  29048. readonly: _vm.readonly,
  29049. placeholder: _vm.currentLabels.length ? undefined : _vm.placeholder,
  29050. "validate-event": false,
  29051. size: _vm.size,
  29052. disabled: _vm.cascaderDisabled
  29053. },
  29054. on: {
  29055. input: _vm.debouncedInputChange,
  29056. focus: _vm.handleFocus,
  29057. blur: _vm.handleBlur
  29058. },
  29059. nativeOn: {
  29060. compositionstart: function($event) {
  29061. return _vm.handleComposition($event)
  29062. },
  29063. compositionend: function($event) {
  29064. return _vm.handleComposition($event)
  29065. }
  29066. },
  29067. model: {
  29068. value: _vm.inputValue,
  29069. callback: function($$v) {
  29070. _vm.inputValue = $$v
  29071. },
  29072. expression: "inputValue"
  29073. }
  29074. },
  29075. [
  29076. _c("template", { slot: "suffix" }, [
  29077. _vm.clearable && _vm.inputHover && _vm.currentLabels.length
  29078. ? _c("i", {
  29079. key: "1",
  29080. staticClass:
  29081. "el-input__icon el-icon-circle-close el-cascader__clearIcon",
  29082. on: { click: _vm.clearValue }
  29083. })
  29084. : _c("i", {
  29085. key: "2",
  29086. staticClass: "el-input__icon el-icon-arrow-down",
  29087. class: { "is-reverse": _vm.menuVisible }
  29088. })
  29089. ])
  29090. ],
  29091. 2
  29092. ),
  29093. _c(
  29094. "span",
  29095. {
  29096. directives: [
  29097. {
  29098. name: "show",
  29099. rawName: "v-show",
  29100. value: _vm.inputValue === "" && !_vm.isOnComposition,
  29101. expression: "inputValue === '' && !isOnComposition"
  29102. }
  29103. ],
  29104. staticClass: "el-cascader__label"
  29105. },
  29106. [
  29107. _vm.showAllLevels
  29108. ? [
  29109. _vm._l(_vm.currentLabels, function(label, index) {
  29110. return [
  29111. _vm._v("\n " + _vm._s(label) + "\n "),
  29112. index < _vm.currentLabels.length - 1
  29113. ? _c("span", { key: index }, [
  29114. _vm._v(" " + _vm._s(_vm.separator) + " ")
  29115. ])
  29116. : _vm._e()
  29117. ]
  29118. })
  29119. ]
  29120. : [
  29121. _vm._v(
  29122. "\n " +
  29123. _vm._s(_vm.currentLabels[_vm.currentLabels.length - 1]) +
  29124. "\n "
  29125. )
  29126. ]
  29127. ],
  29128. 2
  29129. )
  29130. ],
  29131. 1
  29132. )
  29133. }
  29134. var mainvue_type_template_id_2e869fa1_staticRenderFns = []
  29135. mainvue_type_template_id_2e869fa1_render._withStripped = true
  29136. // CONCATENATED MODULE: ./packages/cascader/src/main.vue?vue&type=template&id=2e869fa1&
  29137. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/menu.vue?vue&type=script&lang=js&
  29138. var copyArray = function copyArray(arr, props) {
  29139. if (!arr || !Array.isArray(arr) || !props) return arr;
  29140. var result = [];
  29141. var configurableProps = ['__IS__FLAT__OPTIONS', 'label', 'value', 'disabled'];
  29142. var childrenProp = props.children || 'children';
  29143. arr.forEach(function (item) {
  29144. var itemCopy = {};
  29145. configurableProps.forEach(function (prop) {
  29146. var name = props[prop];
  29147. var value = item[name];
  29148. if (value === undefined) {
  29149. name = prop;
  29150. value = item[name];
  29151. }
  29152. if (value !== undefined) itemCopy[name] = value;
  29153. });
  29154. if (Array.isArray(item[childrenProp])) {
  29155. itemCopy[childrenProp] = copyArray(item[childrenProp], props);
  29156. }
  29157. result.push(itemCopy);
  29158. });
  29159. return result;
  29160. };
  29161. /* harmony default export */ var cascader_src_menuvue_type_script_lang_js_ = ({
  29162. name: 'ElCascaderMenu',
  29163. data: function data() {
  29164. return {
  29165. inputWidth: 0,
  29166. options: [],
  29167. props: {},
  29168. visible: false,
  29169. activeValue: [],
  29170. value: [],
  29171. expandTrigger: 'click',
  29172. changeOnSelect: false,
  29173. popperClass: '',
  29174. hoverTimer: 0,
  29175. clicking: false,
  29176. id: Object(util_["generateId"])()
  29177. };
  29178. },
  29179. watch: {
  29180. visible: function visible(value) {
  29181. if (value) {
  29182. this.activeValue = this.value;
  29183. }
  29184. },
  29185. value: {
  29186. immediate: true,
  29187. handler: function handler(value) {
  29188. this.activeValue = value;
  29189. }
  29190. }
  29191. },
  29192. computed: {
  29193. activeOptions: {
  29194. get: function get() {
  29195. var _this = this;
  29196. var activeValue = this.activeValue;
  29197. var configurableProps = ['label', 'value', 'children', 'disabled'];
  29198. var formatOptions = function formatOptions(options) {
  29199. options.forEach(function (option) {
  29200. if (option.__IS__FLAT__OPTIONS) return;
  29201. configurableProps.forEach(function (prop) {
  29202. var value = option[_this.props[prop] || prop];
  29203. if (value !== undefined) option[prop] = value;
  29204. });
  29205. if (Array.isArray(option.children)) {
  29206. formatOptions(option.children);
  29207. }
  29208. });
  29209. };
  29210. var loadActiveOptions = function loadActiveOptions(options) {
  29211. var activeOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  29212. var level = activeOptions.length;
  29213. activeOptions[level] = options;
  29214. var active = activeValue[level];
  29215. if (Object(shared_["isDef"])(active)) {
  29216. options = options.filter(function (option) {
  29217. return option.value === active;
  29218. })[0];
  29219. if (options && options.children) {
  29220. loadActiveOptions(options.children, activeOptions);
  29221. }
  29222. }
  29223. return activeOptions;
  29224. };
  29225. var optionsCopy = copyArray(this.options, this.props);
  29226. formatOptions(optionsCopy);
  29227. return loadActiveOptions(optionsCopy);
  29228. }
  29229. }
  29230. },
  29231. methods: {
  29232. select: function select(item, menuIndex) {
  29233. if (item.__IS__FLAT__OPTIONS) {
  29234. this.activeValue = item.value;
  29235. } else if (menuIndex) {
  29236. this.activeValue.splice(menuIndex, this.activeValue.length - 1, item.value);
  29237. } else {
  29238. this.activeValue = [item.value];
  29239. }
  29240. this.$emit('pick', this.activeValue.slice());
  29241. },
  29242. handleMenuLeave: function handleMenuLeave() {
  29243. this.$emit('menuLeave');
  29244. },
  29245. activeItem: function activeItem(item, menuIndex) {
  29246. var len = this.activeOptions.length;
  29247. this.activeValue.splice(menuIndex, len, item.value);
  29248. this.activeOptions.splice(menuIndex + 1, len, item.children);
  29249. if (this.changeOnSelect) {
  29250. this.$emit('pick', this.activeValue.slice(), false);
  29251. } else {
  29252. this.$emit('activeItemChange', this.activeValue);
  29253. }
  29254. },
  29255. scrollMenu: function scrollMenu(menu) {
  29256. scroll_into_view_default()(menu, menu.getElementsByClassName('is-active')[0]);
  29257. },
  29258. handleMenuEnter: function handleMenuEnter() {
  29259. var _this2 = this;
  29260. this.$nextTick(function () {
  29261. return _this2.$refs.menus.forEach(function (menu) {
  29262. return _this2.scrollMenu(menu);
  29263. });
  29264. });
  29265. }
  29266. },
  29267. render: function render(h) {
  29268. var _this3 = this;
  29269. var activeValue = this.activeValue,
  29270. activeOptions = this.activeOptions,
  29271. visible = this.visible,
  29272. expandTrigger = this.expandTrigger,
  29273. popperClass = this.popperClass,
  29274. hoverThreshold = this.hoverThreshold;
  29275. var itemId = null;
  29276. var itemIndex = 0;
  29277. var hoverMenuRefs = {};
  29278. var hoverMenuHandler = function hoverMenuHandler(e) {
  29279. var activeMenu = hoverMenuRefs.activeMenu;
  29280. if (!activeMenu) return;
  29281. var offsetX = e.offsetX;
  29282. var width = activeMenu.offsetWidth;
  29283. var height = activeMenu.offsetHeight;
  29284. if (e.target === hoverMenuRefs.activeItem) {
  29285. clearTimeout(_this3.hoverTimer);
  29286. var _hoverMenuRefs = hoverMenuRefs,
  29287. activeItem = _hoverMenuRefs.activeItem;
  29288. var offsetY_top = activeItem.offsetTop;
  29289. var offsetY_Bottom = offsetY_top + activeItem.offsetHeight;
  29290. hoverMenuRefs.hoverZone.innerHTML = '\n <path style="pointer-events: auto;" fill="transparent" d="M' + offsetX + ' ' + offsetY_top + ' L' + width + ' 0 V' + offsetY_top + ' Z" />\n <path style="pointer-events: auto;" fill="transparent" d="M' + offsetX + ' ' + offsetY_Bottom + ' L' + width + ' ' + height + ' V' + offsetY_Bottom + ' Z" />\n ';
  29291. } else {
  29292. if (!_this3.hoverTimer) {
  29293. _this3.hoverTimer = setTimeout(function () {
  29294. hoverMenuRefs.hoverZone.innerHTML = '';
  29295. }, hoverThreshold);
  29296. }
  29297. }
  29298. };
  29299. var menus = this._l(activeOptions, function (menu, menuIndex) {
  29300. var isFlat = false;
  29301. var menuId = 'menu-' + _this3.id + '-' + menuIndex;
  29302. var ownsId = 'menu-' + _this3.id + '-' + (menuIndex + 1);
  29303. var items = _this3._l(menu, function (item) {
  29304. var events = {
  29305. on: {}
  29306. };
  29307. if (item.__IS__FLAT__OPTIONS) isFlat = true;
  29308. if (!item.disabled) {
  29309. // keydown up/down/left/right/enter
  29310. events.on.keydown = function (ev) {
  29311. var keyCode = ev.keyCode;
  29312. if ([37, 38, 39, 40, 13, 9, 27].indexOf(keyCode) < 0) {
  29313. return;
  29314. }
  29315. var currentEle = ev.target;
  29316. var parentEle = _this3.$refs.menus[menuIndex];
  29317. var menuItemList = parentEle.querySelectorAll("[tabindex='-1']");
  29318. var currentIndex = Array.prototype.indexOf.call(menuItemList, currentEle); // 当前索引
  29319. var nextIndex = void 0,
  29320. nextMenu = void 0;
  29321. if ([38, 40].indexOf(keyCode) > -1) {
  29322. if (keyCode === 38) {
  29323. // up键
  29324. nextIndex = currentIndex !== 0 ? currentIndex - 1 : currentIndex;
  29325. } else if (keyCode === 40) {
  29326. // down
  29327. nextIndex = currentIndex !== menuItemList.length - 1 ? currentIndex + 1 : currentIndex;
  29328. }
  29329. menuItemList[nextIndex].focus();
  29330. } else if (keyCode === 37) {
  29331. // left键
  29332. if (menuIndex !== 0) {
  29333. var previousMenu = _this3.$refs.menus[menuIndex - 1];
  29334. previousMenu.querySelector('[aria-expanded=true]').focus();
  29335. }
  29336. } else if (keyCode === 39) {
  29337. // right
  29338. if (item.children) {
  29339. // 有子menu 选择子menu的第一个menuitem
  29340. nextMenu = _this3.$refs.menus[menuIndex + 1];
  29341. nextMenu.querySelectorAll("[tabindex='-1']")[0].focus();
  29342. }
  29343. } else if (keyCode === 13) {
  29344. if (!item.children) {
  29345. var id = currentEle.getAttribute('id');
  29346. parentEle.setAttribute('aria-activedescendant', id);
  29347. _this3.select(item, menuIndex);
  29348. _this3.$nextTick(function () {
  29349. return _this3.scrollMenu(_this3.$refs.menus[menuIndex]);
  29350. });
  29351. }
  29352. } else if (keyCode === 9 || keyCode === 27) {
  29353. // esc tab
  29354. _this3.$emit('closeInside');
  29355. }
  29356. };
  29357. if (item.children) {
  29358. var triggerEvent = {
  29359. click: 'click',
  29360. hover: 'mouseenter'
  29361. }[expandTrigger];
  29362. var triggerHandler = function triggerHandler() {
  29363. if (_this3.visible) {
  29364. _this3.activeItem(item, menuIndex);
  29365. _this3.$nextTick(function () {
  29366. // adjust self and next level
  29367. _this3.scrollMenu(_this3.$refs.menus[menuIndex]);
  29368. _this3.scrollMenu(_this3.$refs.menus[menuIndex + 1]);
  29369. });
  29370. }
  29371. };
  29372. events.on[triggerEvent] = triggerHandler;
  29373. if (triggerEvent === 'mouseenter' && _this3.changeOnSelect) {
  29374. events.on.click = function () {
  29375. if (_this3.activeValue.indexOf(item.value) !== -1) {
  29376. _this3.$emit('closeInside', true);
  29377. }
  29378. };
  29379. }
  29380. events.on['mousedown'] = function () {
  29381. _this3.clicking = true;
  29382. };
  29383. events.on['focus'] = function () {
  29384. // focus 选中
  29385. if (_this3.clicking) {
  29386. _this3.clicking = false;
  29387. return;
  29388. }
  29389. triggerHandler();
  29390. };
  29391. } else {
  29392. events.on.click = function () {
  29393. _this3.select(item, menuIndex);
  29394. _this3.$nextTick(function () {
  29395. return _this3.scrollMenu(_this3.$refs.menus[menuIndex]);
  29396. });
  29397. };
  29398. }
  29399. }
  29400. if (!item.disabled && !item.children) {
  29401. // no children set id
  29402. itemId = menuId + '-' + itemIndex;
  29403. itemIndex++;
  29404. }
  29405. return h(
  29406. 'li',
  29407. external_babel_helper_vue_jsx_merge_props_default()([{
  29408. 'class': {
  29409. 'el-cascader-menu__item': true,
  29410. 'el-cascader-menu__item--extensible': item.children,
  29411. 'is-active': item.value === activeValue[menuIndex],
  29412. 'is-disabled': item.disabled
  29413. },
  29414. ref: item.value === activeValue[menuIndex] ? 'activeItem' : null
  29415. }, events, {
  29416. attrs: {
  29417. tabindex: item.disabled ? null : -1,
  29418. role: 'menuitem',
  29419. 'aria-haspopup': !!item.children,
  29420. 'aria-expanded': item.value === activeValue[menuIndex],
  29421. id: itemId,
  29422. 'aria-owns': !item.children ? null : ownsId
  29423. }
  29424. }]),
  29425. [h('span', [item.label])]
  29426. );
  29427. });
  29428. var menuStyle = {};
  29429. if (isFlat) {
  29430. menuStyle.minWidth = _this3.inputWidth + 'px';
  29431. }
  29432. var isHoveredMenu = expandTrigger === 'hover' && activeValue.length - 1 === menuIndex;
  29433. var hoverMenuEvent = {
  29434. on: {}
  29435. };
  29436. if (isHoveredMenu) {
  29437. hoverMenuEvent.on.mousemove = hoverMenuHandler;
  29438. menuStyle.position = 'relative';
  29439. }
  29440. return h(
  29441. 'ul',
  29442. external_babel_helper_vue_jsx_merge_props_default()([{
  29443. 'class': {
  29444. 'el-cascader-menu': true,
  29445. 'el-cascader-menu--flexible': isFlat
  29446. }
  29447. }, hoverMenuEvent, {
  29448. style: menuStyle,
  29449. refInFor: true,
  29450. ref: 'menus',
  29451. attrs: { role: 'menu',
  29452. id: menuId
  29453. }
  29454. }]),
  29455. [items, isHoveredMenu ? h('svg', {
  29456. ref: 'hoverZone',
  29457. style: {
  29458. position: 'absolute',
  29459. top: 0,
  29460. height: '100%',
  29461. width: '100%',
  29462. left: 0,
  29463. pointerEvents: 'none'
  29464. }
  29465. }) : null]
  29466. );
  29467. });
  29468. if (expandTrigger === 'hover') {
  29469. this.$nextTick(function () {
  29470. var activeItem = _this3.$refs.activeItem;
  29471. if (activeItem) {
  29472. var activeMenu = activeItem.parentElement;
  29473. var hoverZone = _this3.$refs.hoverZone;
  29474. hoverMenuRefs = {
  29475. activeMenu: activeMenu,
  29476. activeItem: activeItem,
  29477. hoverZone: hoverZone
  29478. };
  29479. } else {
  29480. hoverMenuRefs = {};
  29481. }
  29482. });
  29483. }
  29484. return h(
  29485. 'transition',
  29486. {
  29487. attrs: { name: 'el-zoom-in-top' },
  29488. on: {
  29489. 'before-enter': this.handleMenuEnter,
  29490. 'after-leave': this.handleMenuLeave
  29491. }
  29492. },
  29493. [h(
  29494. 'div',
  29495. {
  29496. directives: [{
  29497. name: 'show',
  29498. value: visible
  29499. }],
  29500. 'class': ['el-cascader-menus el-popper', popperClass],
  29501. ref: 'wrapper'
  29502. },
  29503. [h('div', {
  29504. attrs: { 'x-arrow': true },
  29505. 'class': 'popper__arrow' }), menus]
  29506. )]
  29507. );
  29508. }
  29509. });
  29510. // CONCATENATED MODULE: ./packages/cascader/src/menu.vue?vue&type=script&lang=js&
  29511. /* harmony default export */ var packages_cascader_src_menuvue_type_script_lang_js_ = (cascader_src_menuvue_type_script_lang_js_);
  29512. // CONCATENATED MODULE: ./packages/cascader/src/menu.vue
  29513. var src_menu_render, src_menu_staticRenderFns
  29514. /* normalize component */
  29515. var src_menu_component = normalizeComponent(
  29516. packages_cascader_src_menuvue_type_script_lang_js_,
  29517. src_menu_render,
  29518. src_menu_staticRenderFns,
  29519. false,
  29520. null,
  29521. null,
  29522. null
  29523. )
  29524. /* hot reload */
  29525. if (false) { var src_menu_api; }
  29526. src_menu_component.options.__file = "packages/cascader/src/menu.vue"
  29527. /* harmony default export */ var cascader_src_menu = (src_menu_component.exports);
  29528. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/main.vue?vue&type=script&lang=js&
  29529. //
  29530. //
  29531. //
  29532. //
  29533. //
  29534. //
  29535. //
  29536. //
  29537. //
  29538. //
  29539. //
  29540. //
  29541. //
  29542. //
  29543. //
  29544. //
  29545. //
  29546. //
  29547. //
  29548. //
  29549. //
  29550. //
  29551. //
  29552. //
  29553. //
  29554. //
  29555. //
  29556. //
  29557. //
  29558. //
  29559. //
  29560. //
  29561. //
  29562. //
  29563. //
  29564. //
  29565. //
  29566. //
  29567. //
  29568. //
  29569. //
  29570. //
  29571. //
  29572. //
  29573. //
  29574. //
  29575. //
  29576. //
  29577. //
  29578. //
  29579. //
  29580. //
  29581. //
  29582. //
  29583. //
  29584. //
  29585. //
  29586. //
  29587. //
  29588. //
  29589. //
  29590. //
  29591. //
  29592. var popperMixin = {
  29593. props: {
  29594. placement: {
  29595. type: String,
  29596. default: 'bottom-start'
  29597. },
  29598. appendToBody: vue_popper_default.a.props.appendToBody,
  29599. arrowOffset: vue_popper_default.a.props.arrowOffset,
  29600. offset: vue_popper_default.a.props.offset,
  29601. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  29602. popperOptions: vue_popper_default.a.props.popperOptions
  29603. },
  29604. methods: vue_popper_default.a.methods,
  29605. data: vue_popper_default.a.data,
  29606. beforeDestroy: vue_popper_default.a.beforeDestroy
  29607. };
  29608. /* harmony default export */ var cascader_src_mainvue_type_script_lang_js_ = ({
  29609. name: 'ElCascader',
  29610. directives: { Clickoutside: clickoutside_default.a },
  29611. mixins: [popperMixin, emitter_default.a, locale_default.a],
  29612. inject: {
  29613. elForm: {
  29614. default: ''
  29615. },
  29616. elFormItem: {
  29617. default: ''
  29618. }
  29619. },
  29620. components: {
  29621. ElInput: input_default.a
  29622. },
  29623. props: {
  29624. options: {
  29625. type: Array,
  29626. required: true
  29627. },
  29628. props: {
  29629. type: Object,
  29630. default: function _default() {
  29631. return {
  29632. children: 'children',
  29633. label: 'label',
  29634. value: 'value',
  29635. disabled: 'disabled'
  29636. };
  29637. }
  29638. },
  29639. value: {
  29640. type: Array,
  29641. default: function _default() {
  29642. return [];
  29643. }
  29644. },
  29645. separator: {
  29646. type: String,
  29647. default: '/'
  29648. },
  29649. placeholder: {
  29650. type: String,
  29651. default: function _default() {
  29652. return Object(lib_locale_["t"])('el.cascader.placeholder');
  29653. }
  29654. },
  29655. disabled: Boolean,
  29656. clearable: {
  29657. type: Boolean,
  29658. default: false
  29659. },
  29660. changeOnSelect: Boolean,
  29661. popperClass: String,
  29662. expandTrigger: {
  29663. type: String,
  29664. default: 'click'
  29665. },
  29666. filterable: Boolean,
  29667. size: String,
  29668. showAllLevels: {
  29669. type: Boolean,
  29670. default: true
  29671. },
  29672. debounce: {
  29673. type: Number,
  29674. default: 300
  29675. },
  29676. beforeFilter: {
  29677. type: Function,
  29678. default: function _default() {
  29679. return function () {};
  29680. }
  29681. },
  29682. hoverThreshold: {
  29683. type: Number,
  29684. default: 500
  29685. }
  29686. },
  29687. data: function data() {
  29688. return {
  29689. currentValue: this.value || [],
  29690. menu: null,
  29691. debouncedInputChange: function debouncedInputChange() {},
  29692. menuVisible: false,
  29693. inputHover: false,
  29694. inputValue: '',
  29695. flatOptions: null,
  29696. id: Object(util_["generateId"])(),
  29697. needFocus: true,
  29698. isOnComposition: false
  29699. };
  29700. },
  29701. computed: {
  29702. labelKey: function labelKey() {
  29703. return this.props.label || 'label';
  29704. },
  29705. valueKey: function valueKey() {
  29706. return this.props.value || 'value';
  29707. },
  29708. childrenKey: function childrenKey() {
  29709. return this.props.children || 'children';
  29710. },
  29711. disabledKey: function disabledKey() {
  29712. return this.props.disabled || 'disabled';
  29713. },
  29714. currentLabels: function currentLabels() {
  29715. var _this = this;
  29716. var options = this.options;
  29717. var labels = [];
  29718. this.currentValue.forEach(function (value) {
  29719. var targetOption = options && options.filter(function (option) {
  29720. return option[_this.valueKey] === value;
  29721. })[0];
  29722. if (targetOption) {
  29723. labels.push(targetOption[_this.labelKey]);
  29724. options = targetOption[_this.childrenKey];
  29725. }
  29726. });
  29727. return labels;
  29728. },
  29729. _elFormItemSize: function _elFormItemSize() {
  29730. return (this.elFormItem || {}).elFormItemSize;
  29731. },
  29732. cascaderSize: function cascaderSize() {
  29733. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  29734. },
  29735. cascaderDisabled: function cascaderDisabled() {
  29736. return this.disabled || (this.elForm || {}).disabled;
  29737. },
  29738. readonly: function readonly() {
  29739. return !this.filterable || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.menuVisible;
  29740. }
  29741. },
  29742. watch: {
  29743. menuVisible: function menuVisible(value) {
  29744. this.$refs.input.$refs.input.setAttribute('aria-expanded', value);
  29745. value ? this.showMenu() : this.hideMenu();
  29746. this.$emit('visible-change', value);
  29747. },
  29748. value: function value(_value) {
  29749. this.currentValue = _value;
  29750. },
  29751. currentValue: function currentValue(value) {
  29752. this.dispatch('ElFormItem', 'el.form.change', [value]);
  29753. },
  29754. options: {
  29755. deep: true,
  29756. handler: function handler(value) {
  29757. if (!this.menu) {
  29758. this.initMenu();
  29759. }
  29760. this.flatOptions = this.flattenOptions(this.options);
  29761. this.menu.options = value;
  29762. }
  29763. }
  29764. },
  29765. methods: {
  29766. initMenu: function initMenu() {
  29767. this.menu = new external_vue_default.a(cascader_src_menu).$mount();
  29768. this.menu.options = this.options;
  29769. this.menu.props = this.props;
  29770. this.menu.expandTrigger = this.expandTrigger;
  29771. this.menu.changeOnSelect = this.changeOnSelect;
  29772. this.menu.popperClass = this.popperClass;
  29773. this.menu.hoverThreshold = this.hoverThreshold;
  29774. this.popperElm = this.menu.$el;
  29775. this.menu.$refs.menus[0].setAttribute('id', 'cascader-menu-' + this.id);
  29776. this.menu.$on('pick', this.handlePick);
  29777. this.menu.$on('activeItemChange', this.handleActiveItemChange);
  29778. this.menu.$on('menuLeave', this.doDestroy);
  29779. this.menu.$on('closeInside', this.handleClickoutside);
  29780. },
  29781. showMenu: function showMenu() {
  29782. var _this2 = this;
  29783. if (!this.menu) {
  29784. this.initMenu();
  29785. }
  29786. this.menu.value = this.currentValue.slice(0);
  29787. this.menu.visible = true;
  29788. this.menu.options = this.options;
  29789. this.$nextTick(function (_) {
  29790. _this2.updatePopper();
  29791. _this2.menu.inputWidth = _this2.$refs.input.$el.offsetWidth - 2;
  29792. });
  29793. },
  29794. hideMenu: function hideMenu() {
  29795. this.inputValue = '';
  29796. this.menu.visible = false;
  29797. if (this.needFocus) {
  29798. this.$refs.input.focus();
  29799. } else {
  29800. this.needFocus = true;
  29801. }
  29802. },
  29803. handleActiveItemChange: function handleActiveItemChange(value) {
  29804. var _this3 = this;
  29805. this.$nextTick(function (_) {
  29806. _this3.updatePopper();
  29807. });
  29808. this.$emit('active-item-change', value);
  29809. },
  29810. handleKeydown: function handleKeydown(e) {
  29811. var _this4 = this;
  29812. var keyCode = e.keyCode;
  29813. if (keyCode === 13) {
  29814. this.handleClick();
  29815. } else if (keyCode === 40) {
  29816. // down
  29817. this.menuVisible = true; // 打开
  29818. setTimeout(function () {
  29819. var firstMenu = _this4.popperElm.querySelectorAll('.el-cascader-menu')[0];
  29820. firstMenu.querySelectorAll("[tabindex='-1']")[0].focus();
  29821. });
  29822. e.stopPropagation();
  29823. e.preventDefault();
  29824. } else if (keyCode === 27 || keyCode === 9) {
  29825. // esc tab
  29826. this.inputValue = '';
  29827. if (this.menu) this.menu.visible = false;
  29828. }
  29829. },
  29830. handlePick: function handlePick(value) {
  29831. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  29832. this.currentValue = value;
  29833. this.$emit('input', value);
  29834. this.$emit('change', value);
  29835. if (close) {
  29836. this.menuVisible = false;
  29837. } else {
  29838. this.$nextTick(this.updatePopper);
  29839. }
  29840. },
  29841. handleInputChange: function handleInputChange(value) {
  29842. var _this5 = this;
  29843. if (!this.menuVisible) return;
  29844. var flatOptions = this.flatOptions;
  29845. if (!value) {
  29846. this.menu.options = this.options;
  29847. this.$nextTick(this.updatePopper);
  29848. return;
  29849. }
  29850. var filteredFlatOptions = flatOptions.filter(function (optionsStack) {
  29851. return optionsStack.some(function (option) {
  29852. return new RegExp(Object(util_["escapeRegexpString"])(value), 'i').test(option[_this5.labelKey]);
  29853. });
  29854. });
  29855. if (filteredFlatOptions.length > 0) {
  29856. filteredFlatOptions = filteredFlatOptions.map(function (optionStack) {
  29857. return {
  29858. __IS__FLAT__OPTIONS: true,
  29859. value: optionStack.map(function (item) {
  29860. return item[_this5.valueKey];
  29861. }),
  29862. label: _this5.renderFilteredOptionLabel(value, optionStack),
  29863. disabled: optionStack.some(function (item) {
  29864. return item[_this5.disabledKey];
  29865. })
  29866. };
  29867. });
  29868. } else {
  29869. filteredFlatOptions = [{
  29870. __IS__FLAT__OPTIONS: true,
  29871. label: this.t('el.cascader.noMatch'),
  29872. value: '',
  29873. disabled: true
  29874. }];
  29875. }
  29876. this.menu.options = filteredFlatOptions;
  29877. this.$nextTick(this.updatePopper);
  29878. },
  29879. renderFilteredOptionLabel: function renderFilteredOptionLabel(inputValue, optionsStack) {
  29880. var _this6 = this;
  29881. return optionsStack.map(function (option, index) {
  29882. var label = option[_this6.labelKey];
  29883. var keywordIndex = label.toLowerCase().indexOf(inputValue.toLowerCase());
  29884. var labelPart = label.slice(keywordIndex, inputValue.length + keywordIndex);
  29885. var node = keywordIndex > -1 ? _this6.highlightKeyword(label, labelPart) : label;
  29886. return index === 0 ? node : [' ' + _this6.separator + ' ', node];
  29887. });
  29888. },
  29889. highlightKeyword: function highlightKeyword(label, keyword) {
  29890. var _this7 = this;
  29891. var h = this._c;
  29892. return label.split(keyword).map(function (node, index) {
  29893. return index === 0 ? node : [h('span', { class: { 'el-cascader-menu__item__keyword': true } }, [_this7._v(keyword)]), node];
  29894. });
  29895. },
  29896. flattenOptions: function flattenOptions(options) {
  29897. var _this8 = this;
  29898. var ancestor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  29899. var flatOptions = [];
  29900. options.forEach(function (option) {
  29901. var optionsStack = ancestor.concat(option);
  29902. if (!option[_this8.childrenKey]) {
  29903. flatOptions.push(optionsStack);
  29904. } else {
  29905. if (_this8.changeOnSelect) {
  29906. flatOptions.push(optionsStack);
  29907. }
  29908. flatOptions = flatOptions.concat(_this8.flattenOptions(option[_this8.childrenKey], optionsStack));
  29909. }
  29910. });
  29911. return flatOptions;
  29912. },
  29913. clearValue: function clearValue(ev) {
  29914. ev.stopPropagation();
  29915. this.handlePick([], true);
  29916. },
  29917. handleClickoutside: function handleClickoutside() {
  29918. var pickFinished = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  29919. if (this.menuVisible && !pickFinished) {
  29920. this.needFocus = false;
  29921. }
  29922. this.menuVisible = false;
  29923. },
  29924. handleClick: function handleClick() {
  29925. if (this.cascaderDisabled) return;
  29926. this.$refs.input.focus();
  29927. if (this.filterable) {
  29928. this.menuVisible = true;
  29929. return;
  29930. }
  29931. this.menuVisible = !this.menuVisible;
  29932. },
  29933. handleFocus: function handleFocus(event) {
  29934. this.$emit('focus', event);
  29935. },
  29936. handleBlur: function handleBlur(event) {
  29937. this.$emit('blur', event);
  29938. },
  29939. handleComposition: function handleComposition(event) {
  29940. this.isOnComposition = event.type !== 'compositionend';
  29941. }
  29942. },
  29943. created: function created() {
  29944. var _this9 = this;
  29945. this.debouncedInputChange = debounce_default()(this.debounce, function (value) {
  29946. var before = _this9.beforeFilter(value);
  29947. if (before && before.then) {
  29948. _this9.menu.options = [{
  29949. __IS__FLAT__OPTIONS: true,
  29950. label: _this9.t('el.cascader.loading'),
  29951. value: '',
  29952. disabled: true
  29953. }];
  29954. before.then(function () {
  29955. _this9.$nextTick(function () {
  29956. _this9.handleInputChange(value);
  29957. });
  29958. });
  29959. } else if (before !== false) {
  29960. _this9.$nextTick(function () {
  29961. _this9.handleInputChange(value);
  29962. });
  29963. }
  29964. });
  29965. },
  29966. mounted: function mounted() {
  29967. this.flatOptions = this.flattenOptions(this.options);
  29968. }
  29969. });
  29970. // CONCATENATED MODULE: ./packages/cascader/src/main.vue?vue&type=script&lang=js&
  29971. /* harmony default export */ var packages_cascader_src_mainvue_type_script_lang_js_ = (cascader_src_mainvue_type_script_lang_js_);
  29972. // CONCATENATED MODULE: ./packages/cascader/src/main.vue
  29973. /* normalize component */
  29974. var cascader_src_main_component = normalizeComponent(
  29975. packages_cascader_src_mainvue_type_script_lang_js_,
  29976. mainvue_type_template_id_2e869fa1_render,
  29977. mainvue_type_template_id_2e869fa1_staticRenderFns,
  29978. false,
  29979. null,
  29980. null,
  29981. null
  29982. )
  29983. /* hot reload */
  29984. if (false) { var cascader_src_main_api; }
  29985. cascader_src_main_component.options.__file = "packages/cascader/src/main.vue"
  29986. /* harmony default export */ var cascader_src_main = (cascader_src_main_component.exports);
  29987. // CONCATENATED MODULE: ./packages/cascader/index.js
  29988. /* istanbul ignore next */
  29989. cascader_src_main.install = function (Vue) {
  29990. Vue.component(cascader_src_main.name, cascader_src_main);
  29991. };
  29992. /* harmony default export */ var cascader = (cascader_src_main);
  29993. // 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&
  29994. var mainvue_type_template_id_55c8ade7_render = function() {
  29995. var _vm = this
  29996. var _h = _vm.$createElement
  29997. var _c = _vm._self._c || _h
  29998. return _c(
  29999. "div",
  30000. {
  30001. directives: [
  30002. {
  30003. name: "clickoutside",
  30004. rawName: "v-clickoutside",
  30005. value: _vm.hide,
  30006. expression: "hide"
  30007. }
  30008. ],
  30009. class: [
  30010. "el-color-picker",
  30011. _vm.colorDisabled ? "is-disabled" : "",
  30012. _vm.colorSize ? "el-color-picker--" + _vm.colorSize : ""
  30013. ]
  30014. },
  30015. [
  30016. _vm.colorDisabled
  30017. ? _c("div", { staticClass: "el-color-picker__mask" })
  30018. : _vm._e(),
  30019. _c(
  30020. "div",
  30021. {
  30022. staticClass: "el-color-picker__trigger",
  30023. on: { click: _vm.handleTrigger }
  30024. },
  30025. [
  30026. _c(
  30027. "span",
  30028. {
  30029. staticClass: "el-color-picker__color",
  30030. class: { "is-alpha": _vm.showAlpha }
  30031. },
  30032. [
  30033. _c("span", {
  30034. staticClass: "el-color-picker__color-inner",
  30035. style: {
  30036. backgroundColor: _vm.displayedColor
  30037. }
  30038. }),
  30039. !_vm.value && !_vm.showPanelColor
  30040. ? _c("span", {
  30041. staticClass: "el-color-picker__empty el-icon-close"
  30042. })
  30043. : _vm._e()
  30044. ]
  30045. ),
  30046. _c("span", {
  30047. directives: [
  30048. {
  30049. name: "show",
  30050. rawName: "v-show",
  30051. value: _vm.value || _vm.showPanelColor,
  30052. expression: "value || showPanelColor"
  30053. }
  30054. ],
  30055. staticClass: "el-color-picker__icon el-icon-arrow-down"
  30056. })
  30057. ]
  30058. ),
  30059. _c("picker-dropdown", {
  30060. ref: "dropdown",
  30061. class: ["el-color-picker__panel", _vm.popperClass || ""],
  30062. attrs: {
  30063. color: _vm.color,
  30064. "show-alpha": _vm.showAlpha,
  30065. predefine: _vm.predefine
  30066. },
  30067. on: { pick: _vm.confirmValue, clear: _vm.clearValue },
  30068. model: {
  30069. value: _vm.showPicker,
  30070. callback: function($$v) {
  30071. _vm.showPicker = $$v
  30072. },
  30073. expression: "showPicker"
  30074. }
  30075. })
  30076. ],
  30077. 1
  30078. )
  30079. }
  30080. var mainvue_type_template_id_55c8ade7_staticRenderFns = []
  30081. mainvue_type_template_id_55c8ade7_render._withStripped = true
  30082. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  30083. // CONCATENATED MODULE: ./packages/color-picker/src/color.js
  30084. 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; };
  30085. function color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30086. var hsv2hsl = function hsv2hsl(hue, sat, val) {
  30087. return [hue, sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0, hue / 2];
  30088. };
  30089. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  30090. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  30091. var isOnePointZero = function isOnePointZero(n) {
  30092. return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
  30093. };
  30094. var isPercentage = function isPercentage(n) {
  30095. return typeof n === 'string' && n.indexOf('%') !== -1;
  30096. };
  30097. // Take input from [0, n] and return it as [0, 1]
  30098. var bound01 = function bound01(value, max) {
  30099. if (isOnePointZero(value)) value = '100%';
  30100. var processPercent = isPercentage(value);
  30101. value = Math.min(max, Math.max(0, parseFloat(value)));
  30102. // Automatically convert percentage into number
  30103. if (processPercent) {
  30104. value = parseInt(value * max, 10) / 100;
  30105. }
  30106. // Handle floating point rounding errors
  30107. if (Math.abs(value - max) < 0.000001) {
  30108. return 1;
  30109. }
  30110. // Convert into [0, 1] range if it isn't already
  30111. return value % max / parseFloat(max);
  30112. };
  30113. var INT_HEX_MAP = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' };
  30114. var toHex = function toHex(_ref) {
  30115. var r = _ref.r,
  30116. g = _ref.g,
  30117. b = _ref.b;
  30118. var hexOne = function hexOne(value) {
  30119. value = Math.min(Math.round(value), 255);
  30120. var high = Math.floor(value / 16);
  30121. var low = value % 16;
  30122. return '' + (INT_HEX_MAP[high] || high) + (INT_HEX_MAP[low] || low);
  30123. };
  30124. if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
  30125. return '#' + hexOne(r) + hexOne(g) + hexOne(b);
  30126. };
  30127. var HEX_INT_MAP = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 };
  30128. var parseHexChannel = function parseHexChannel(hex) {
  30129. if (hex.length === 2) {
  30130. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  30131. }
  30132. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  30133. };
  30134. var hsl2hsv = function hsl2hsv(hue, sat, light) {
  30135. sat = sat / 100;
  30136. light = light / 100;
  30137. var smin = sat;
  30138. var lmin = Math.max(light, 0.01);
  30139. var sv = void 0;
  30140. var v = void 0;
  30141. light *= 2;
  30142. sat *= light <= 1 ? light : 2 - light;
  30143. smin *= lmin <= 1 ? lmin : 2 - lmin;
  30144. v = (light + sat) / 2;
  30145. sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  30146. return {
  30147. h: hue,
  30148. s: sv * 100,
  30149. v: v * 100
  30150. };
  30151. };
  30152. // `rgbToHsv`
  30153. // Converts an RGB color value to HSV
  30154. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  30155. // *Returns:* { h, s, v } in [0,1]
  30156. var rgb2hsv = function rgb2hsv(r, g, b) {
  30157. r = bound01(r, 255);
  30158. g = bound01(g, 255);
  30159. b = bound01(b, 255);
  30160. var max = Math.max(r, g, b);
  30161. var min = Math.min(r, g, b);
  30162. var h = void 0,
  30163. s = void 0;
  30164. var v = max;
  30165. var d = max - min;
  30166. s = max === 0 ? 0 : d / max;
  30167. if (max === min) {
  30168. h = 0; // achromatic
  30169. } else {
  30170. switch (max) {
  30171. case r:
  30172. h = (g - b) / d + (g < b ? 6 : 0);
  30173. break;
  30174. case g:
  30175. h = (b - r) / d + 2;
  30176. break;
  30177. case b:
  30178. h = (r - g) / d + 4;
  30179. break;
  30180. }
  30181. h /= 6;
  30182. }
  30183. return { h: h * 360, s: s * 100, v: v * 100 };
  30184. };
  30185. // `hsvToRgb`
  30186. // Converts an HSV color value to RGB.
  30187. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  30188. // *Returns:* { r, g, b } in the set [0, 255]
  30189. var hsv2rgb = function hsv2rgb(h, s, v) {
  30190. h = bound01(h, 360) * 6;
  30191. s = bound01(s, 100);
  30192. v = bound01(v, 100);
  30193. var i = Math.floor(h);
  30194. var f = h - i;
  30195. var p = v * (1 - s);
  30196. var q = v * (1 - f * s);
  30197. var t = v * (1 - (1 - f) * s);
  30198. var mod = i % 6;
  30199. var r = [v, q, p, p, t, v][mod];
  30200. var g = [t, v, v, q, p, p][mod];
  30201. var b = [p, p, t, v, v, q][mod];
  30202. return {
  30203. r: Math.round(r * 255),
  30204. g: Math.round(g * 255),
  30205. b: Math.round(b * 255)
  30206. };
  30207. };
  30208. var Color = function () {
  30209. function Color(options) {
  30210. color_classCallCheck(this, Color);
  30211. this._hue = 0;
  30212. this._saturation = 100;
  30213. this._value = 100;
  30214. this._alpha = 100;
  30215. this.enableAlpha = false;
  30216. this.format = 'hex';
  30217. this.value = '';
  30218. options = options || {};
  30219. for (var option in options) {
  30220. if (options.hasOwnProperty(option)) {
  30221. this[option] = options[option];
  30222. }
  30223. }
  30224. this.doOnChange();
  30225. }
  30226. Color.prototype.set = function set(prop, value) {
  30227. if (arguments.length === 1 && (typeof prop === 'undefined' ? 'undefined' : color_typeof(prop)) === 'object') {
  30228. for (var p in prop) {
  30229. if (prop.hasOwnProperty(p)) {
  30230. this.set(p, prop[p]);
  30231. }
  30232. }
  30233. return;
  30234. }
  30235. this['_' + prop] = value;
  30236. this.doOnChange();
  30237. };
  30238. Color.prototype.get = function get(prop) {
  30239. return this['_' + prop];
  30240. };
  30241. Color.prototype.toRgb = function toRgb() {
  30242. return hsv2rgb(this._hue, this._saturation, this._value);
  30243. };
  30244. Color.prototype.fromString = function fromString(value) {
  30245. var _this = this;
  30246. if (!value) {
  30247. this._hue = 0;
  30248. this._saturation = 100;
  30249. this._value = 100;
  30250. this.doOnChange();
  30251. return;
  30252. }
  30253. var fromHSV = function fromHSV(h, s, v) {
  30254. _this._hue = Math.max(0, Math.min(360, h));
  30255. _this._saturation = Math.max(0, Math.min(100, s));
  30256. _this._value = Math.max(0, Math.min(100, v));
  30257. _this.doOnChange();
  30258. };
  30259. if (value.indexOf('hsl') !== -1) {
  30260. var parts = value.replace(/hsla|hsl|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  30261. return val !== '';
  30262. }).map(function (val, index) {
  30263. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  30264. });
  30265. if (parts.length === 4) {
  30266. this._alpha = Math.floor(parseFloat(parts[3]) * 100);
  30267. } else if (parts.length === 3) {
  30268. this._alpha = 100;
  30269. }
  30270. if (parts.length >= 3) {
  30271. var _hsl2hsv = hsl2hsv(parts[0], parts[1], parts[2]),
  30272. h = _hsl2hsv.h,
  30273. s = _hsl2hsv.s,
  30274. v = _hsl2hsv.v;
  30275. fromHSV(h, s, v);
  30276. }
  30277. } else if (value.indexOf('hsv') !== -1) {
  30278. var _parts = value.replace(/hsva|hsv|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  30279. return val !== '';
  30280. }).map(function (val, index) {
  30281. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  30282. });
  30283. if (_parts.length === 4) {
  30284. this._alpha = Math.floor(parseFloat(_parts[3]) * 100);
  30285. } else if (_parts.length === 3) {
  30286. this._alpha = 100;
  30287. }
  30288. if (_parts.length >= 3) {
  30289. fromHSV(_parts[0], _parts[1], _parts[2]);
  30290. }
  30291. } else if (value.indexOf('rgb') !== -1) {
  30292. var _parts2 = value.replace(/rgba|rgb|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  30293. return val !== '';
  30294. }).map(function (val, index) {
  30295. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  30296. });
  30297. if (_parts2.length === 4) {
  30298. this._alpha = Math.floor(parseFloat(_parts2[3]) * 100);
  30299. } else if (_parts2.length === 3) {
  30300. this._alpha = 100;
  30301. }
  30302. if (_parts2.length >= 3) {
  30303. var _rgb2hsv = rgb2hsv(_parts2[0], _parts2[1], _parts2[2]),
  30304. _h = _rgb2hsv.h,
  30305. _s = _rgb2hsv.s,
  30306. _v = _rgb2hsv.v;
  30307. fromHSV(_h, _s, _v);
  30308. }
  30309. } else if (value.indexOf('#') !== -1) {
  30310. var hex = value.replace('#', '').trim();
  30311. if (!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(hex)) return;
  30312. var r = void 0,
  30313. g = void 0,
  30314. b = void 0;
  30315. if (hex.length === 3) {
  30316. r = parseHexChannel(hex[0] + hex[0]);
  30317. g = parseHexChannel(hex[1] + hex[1]);
  30318. b = parseHexChannel(hex[2] + hex[2]);
  30319. } else if (hex.length === 6 || hex.length === 8) {
  30320. r = parseHexChannel(hex.substring(0, 2));
  30321. g = parseHexChannel(hex.substring(2, 4));
  30322. b = parseHexChannel(hex.substring(4, 6));
  30323. }
  30324. if (hex.length === 8) {
  30325. this._alpha = Math.floor(parseHexChannel(hex.substring(6)) / 255 * 100);
  30326. } else if (hex.length === 3 || hex.length === 6) {
  30327. this._alpha = 100;
  30328. }
  30329. var _rgb2hsv2 = rgb2hsv(r, g, b),
  30330. _h2 = _rgb2hsv2.h,
  30331. _s2 = _rgb2hsv2.s,
  30332. _v2 = _rgb2hsv2.v;
  30333. fromHSV(_h2, _s2, _v2);
  30334. }
  30335. };
  30336. Color.prototype.compare = function compare(color) {
  30337. 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;
  30338. };
  30339. Color.prototype.doOnChange = function doOnChange() {
  30340. var _hue = this._hue,
  30341. _saturation = this._saturation,
  30342. _value = this._value,
  30343. _alpha = this._alpha,
  30344. format = this.format;
  30345. if (this.enableAlpha) {
  30346. switch (format) {
  30347. case 'hsl':
  30348. var hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  30349. this.value = 'hsla(' + _hue + ', ' + Math.round(hsl[1] * 100) + '%, ' + Math.round(hsl[2] * 100) + '%, ' + _alpha / 100 + ')';
  30350. break;
  30351. case 'hsv':
  30352. this.value = 'hsva(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%, ' + _alpha / 100 + ')';
  30353. break;
  30354. default:
  30355. var _hsv2rgb = hsv2rgb(_hue, _saturation, _value),
  30356. r = _hsv2rgb.r,
  30357. g = _hsv2rgb.g,
  30358. b = _hsv2rgb.b;
  30359. this.value = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + _alpha / 100 + ')';
  30360. }
  30361. } else {
  30362. switch (format) {
  30363. case 'hsl':
  30364. var _hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  30365. this.value = 'hsl(' + _hue + ', ' + Math.round(_hsl[1] * 100) + '%, ' + Math.round(_hsl[2] * 100) + '%)';
  30366. break;
  30367. case 'hsv':
  30368. this.value = 'hsv(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%)';
  30369. break;
  30370. case 'rgb':
  30371. var _hsv2rgb2 = hsv2rgb(_hue, _saturation, _value),
  30372. _r = _hsv2rgb2.r,
  30373. _g = _hsv2rgb2.g,
  30374. _b = _hsv2rgb2.b;
  30375. this.value = 'rgb(' + _r + ', ' + _g + ', ' + _b + ')';
  30376. break;
  30377. default:
  30378. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  30379. }
  30380. }
  30381. };
  30382. return Color;
  30383. }();
  30384. /* harmony default export */ var src_color = (Color);
  30385. ;
  30386. // 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&
  30387. var picker_dropdownvue_type_template_id_06601625_render = function() {
  30388. var _vm = this
  30389. var _h = _vm.$createElement
  30390. var _c = _vm._self._c || _h
  30391. return _c(
  30392. "transition",
  30393. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  30394. [
  30395. _c(
  30396. "div",
  30397. {
  30398. directives: [
  30399. {
  30400. name: "show",
  30401. rawName: "v-show",
  30402. value: _vm.showPopper,
  30403. expression: "showPopper"
  30404. }
  30405. ],
  30406. staticClass: "el-color-dropdown"
  30407. },
  30408. [
  30409. _c(
  30410. "div",
  30411. { staticClass: "el-color-dropdown__main-wrapper" },
  30412. [
  30413. _c("hue-slider", {
  30414. ref: "hue",
  30415. staticStyle: { float: "right" },
  30416. attrs: { color: _vm.color, vertical: "" }
  30417. }),
  30418. _c("sv-panel", { ref: "sl", attrs: { color: _vm.color } })
  30419. ],
  30420. 1
  30421. ),
  30422. _vm.showAlpha
  30423. ? _c("alpha-slider", { ref: "alpha", attrs: { color: _vm.color } })
  30424. : _vm._e(),
  30425. _vm.predefine
  30426. ? _c("predefine", {
  30427. attrs: { color: _vm.color, colors: _vm.predefine }
  30428. })
  30429. : _vm._e(),
  30430. _c(
  30431. "div",
  30432. { staticClass: "el-color-dropdown__btns" },
  30433. [
  30434. _c(
  30435. "span",
  30436. { staticClass: "el-color-dropdown__value" },
  30437. [
  30438. _c("el-input", {
  30439. attrs: { "validate-event": false, size: "mini" },
  30440. on: { blur: _vm.handleConfirm },
  30441. nativeOn: {
  30442. keyup: function($event) {
  30443. if (
  30444. !("button" in $event) &&
  30445. _vm._k(
  30446. $event.keyCode,
  30447. "enter",
  30448. 13,
  30449. $event.key,
  30450. "Enter"
  30451. )
  30452. ) {
  30453. return null
  30454. }
  30455. return _vm.handleConfirm($event)
  30456. }
  30457. },
  30458. model: {
  30459. value: _vm.customInput,
  30460. callback: function($$v) {
  30461. _vm.customInput = $$v
  30462. },
  30463. expression: "customInput"
  30464. }
  30465. })
  30466. ],
  30467. 1
  30468. ),
  30469. _c(
  30470. "el-button",
  30471. {
  30472. staticClass: "el-color-dropdown__link-btn",
  30473. attrs: { size: "mini", type: "text" },
  30474. on: {
  30475. click: function($event) {
  30476. _vm.$emit("clear")
  30477. }
  30478. }
  30479. },
  30480. [
  30481. _vm._v(
  30482. "\n " +
  30483. _vm._s(_vm.t("el.colorpicker.clear")) +
  30484. "\n "
  30485. )
  30486. ]
  30487. ),
  30488. _c(
  30489. "el-button",
  30490. {
  30491. staticClass: "el-color-dropdown__btn",
  30492. attrs: { plain: "", size: "mini" },
  30493. on: { click: _vm.confirmValue }
  30494. },
  30495. [
  30496. _vm._v(
  30497. "\n " +
  30498. _vm._s(_vm.t("el.colorpicker.confirm")) +
  30499. "\n "
  30500. )
  30501. ]
  30502. )
  30503. ],
  30504. 1
  30505. )
  30506. ],
  30507. 1
  30508. )
  30509. ]
  30510. )
  30511. }
  30512. var picker_dropdownvue_type_template_id_06601625_staticRenderFns = []
  30513. picker_dropdownvue_type_template_id_06601625_render._withStripped = true
  30514. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  30515. // 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&
  30516. var sv_panelvue_type_template_id_d8583596_render = function() {
  30517. var _vm = this
  30518. var _h = _vm.$createElement
  30519. var _c = _vm._self._c || _h
  30520. return _c(
  30521. "div",
  30522. {
  30523. staticClass: "el-color-svpanel",
  30524. style: {
  30525. backgroundColor: _vm.background
  30526. }
  30527. },
  30528. [
  30529. _c("div", { staticClass: "el-color-svpanel__white" }),
  30530. _c("div", { staticClass: "el-color-svpanel__black" }),
  30531. _c(
  30532. "div",
  30533. {
  30534. staticClass: "el-color-svpanel__cursor",
  30535. style: {
  30536. top: _vm.cursorTop + "px",
  30537. left: _vm.cursorLeft + "px"
  30538. }
  30539. },
  30540. [_c("div")]
  30541. )
  30542. ]
  30543. )
  30544. }
  30545. var sv_panelvue_type_template_id_d8583596_staticRenderFns = []
  30546. sv_panelvue_type_template_id_d8583596_render._withStripped = true
  30547. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  30548. // CONCATENATED MODULE: ./packages/color-picker/src/draggable.js
  30549. var isDragging = false;
  30550. /* harmony default export */ var draggable = (function (element, options) {
  30551. if (external_vue_default.a.prototype.$isServer) return;
  30552. var moveFn = function moveFn(event) {
  30553. if (options.drag) {
  30554. options.drag(event);
  30555. }
  30556. };
  30557. var upFn = function upFn(event) {
  30558. document.removeEventListener('mousemove', moveFn);
  30559. document.removeEventListener('mouseup', upFn);
  30560. document.onselectstart = null;
  30561. document.ondragstart = null;
  30562. isDragging = false;
  30563. if (options.end) {
  30564. options.end(event);
  30565. }
  30566. };
  30567. element.addEventListener('mousedown', function (event) {
  30568. if (isDragging) return;
  30569. document.onselectstart = function () {
  30570. return false;
  30571. };
  30572. document.ondragstart = function () {
  30573. return false;
  30574. };
  30575. document.addEventListener('mousemove', moveFn);
  30576. document.addEventListener('mouseup', upFn);
  30577. isDragging = true;
  30578. if (options.start) {
  30579. options.start(event);
  30580. }
  30581. });
  30582. });
  30583. // 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&
  30584. //
  30585. //
  30586. //
  30587. //
  30588. //
  30589. //
  30590. //
  30591. //
  30592. //
  30593. //
  30594. //
  30595. //
  30596. //
  30597. //
  30598. //
  30599. //
  30600. //
  30601. /* harmony default export */ var sv_panelvue_type_script_lang_js_ = ({
  30602. name: 'el-sl-panel',
  30603. props: {
  30604. color: {
  30605. required: true
  30606. }
  30607. },
  30608. computed: {
  30609. colorValue: function colorValue() {
  30610. var hue = this.color.get('hue');
  30611. var value = this.color.get('value');
  30612. return { hue: hue, value: value };
  30613. }
  30614. },
  30615. watch: {
  30616. colorValue: function colorValue() {
  30617. this.update();
  30618. }
  30619. },
  30620. methods: {
  30621. update: function update() {
  30622. var saturation = this.color.get('saturation');
  30623. var value = this.color.get('value');
  30624. var el = this.$el;
  30625. var width = el.clientWidth,
  30626. height = el.clientHeight;
  30627. this.cursorLeft = saturation * width / 100;
  30628. this.cursorTop = (100 - value) * height / 100;
  30629. this.background = 'hsl(' + this.color.get('hue') + ', 100%, 50%)';
  30630. },
  30631. handleDrag: function handleDrag(event) {
  30632. var el = this.$el;
  30633. var rect = el.getBoundingClientRect();
  30634. var left = event.clientX - rect.left;
  30635. var top = event.clientY - rect.top;
  30636. left = Math.max(0, left);
  30637. left = Math.min(left, rect.width);
  30638. top = Math.max(0, top);
  30639. top = Math.min(top, rect.height);
  30640. this.cursorLeft = left;
  30641. this.cursorTop = top;
  30642. this.color.set({
  30643. saturation: left / rect.width * 100,
  30644. value: 100 - top / rect.height * 100
  30645. });
  30646. }
  30647. },
  30648. mounted: function mounted() {
  30649. var _this = this;
  30650. draggable(this.$el, {
  30651. drag: function drag(event) {
  30652. _this.handleDrag(event);
  30653. },
  30654. end: function end(event) {
  30655. _this.handleDrag(event);
  30656. }
  30657. });
  30658. this.update();
  30659. },
  30660. data: function data() {
  30661. return {
  30662. cursorTop: 0,
  30663. cursorLeft: 0,
  30664. background: 'hsl(0, 100%, 50%)'
  30665. };
  30666. }
  30667. });
  30668. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  30669. /* harmony default export */ var components_sv_panelvue_type_script_lang_js_ = (sv_panelvue_type_script_lang_js_);
  30670. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue
  30671. /* normalize component */
  30672. var sv_panel_component = normalizeComponent(
  30673. components_sv_panelvue_type_script_lang_js_,
  30674. sv_panelvue_type_template_id_d8583596_render,
  30675. sv_panelvue_type_template_id_d8583596_staticRenderFns,
  30676. false,
  30677. null,
  30678. null,
  30679. null
  30680. )
  30681. /* hot reload */
  30682. if (false) { var sv_panel_api; }
  30683. sv_panel_component.options.__file = "packages/color-picker/src/components/sv-panel.vue"
  30684. /* harmony default export */ var sv_panel = (sv_panel_component.exports);
  30685. // 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&
  30686. var hue_slidervue_type_template_id_5cdc43b1_render = function() {
  30687. var _vm = this
  30688. var _h = _vm.$createElement
  30689. var _c = _vm._self._c || _h
  30690. return _c(
  30691. "div",
  30692. {
  30693. staticClass: "el-color-hue-slider",
  30694. class: { "is-vertical": _vm.vertical }
  30695. },
  30696. [
  30697. _c("div", {
  30698. ref: "bar",
  30699. staticClass: "el-color-hue-slider__bar",
  30700. on: { click: _vm.handleClick }
  30701. }),
  30702. _c("div", {
  30703. ref: "thumb",
  30704. staticClass: "el-color-hue-slider__thumb",
  30705. style: {
  30706. left: _vm.thumbLeft + "px",
  30707. top: _vm.thumbTop + "px"
  30708. }
  30709. })
  30710. ]
  30711. )
  30712. }
  30713. var hue_slidervue_type_template_id_5cdc43b1_staticRenderFns = []
  30714. hue_slidervue_type_template_id_5cdc43b1_render._withStripped = true
  30715. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  30716. // 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&
  30717. //
  30718. //
  30719. //
  30720. //
  30721. //
  30722. //
  30723. //
  30724. //
  30725. //
  30726. //
  30727. //
  30728. //
  30729. //
  30730. /* harmony default export */ var hue_slidervue_type_script_lang_js_ = ({
  30731. name: 'el-color-hue-slider',
  30732. props: {
  30733. color: {
  30734. required: true
  30735. },
  30736. vertical: Boolean
  30737. },
  30738. data: function data() {
  30739. return {
  30740. thumbLeft: 0,
  30741. thumbTop: 0
  30742. };
  30743. },
  30744. computed: {
  30745. hueValue: function hueValue() {
  30746. var hue = this.color.get('hue');
  30747. return hue;
  30748. }
  30749. },
  30750. watch: {
  30751. hueValue: function hueValue() {
  30752. this.update();
  30753. }
  30754. },
  30755. methods: {
  30756. handleClick: function handleClick(event) {
  30757. var thumb = this.$refs.thumb;
  30758. var target = event.target;
  30759. if (target !== thumb) {
  30760. this.handleDrag(event);
  30761. }
  30762. },
  30763. handleDrag: function handleDrag(event) {
  30764. var rect = this.$el.getBoundingClientRect();
  30765. var thumb = this.$refs.thumb;
  30766. var hue = void 0;
  30767. if (!this.vertical) {
  30768. var left = event.clientX - rect.left;
  30769. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  30770. left = Math.max(thumb.offsetWidth / 2, left);
  30771. hue = Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 360);
  30772. } else {
  30773. var top = event.clientY - rect.top;
  30774. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  30775. top = Math.max(thumb.offsetHeight / 2, top);
  30776. hue = Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 360);
  30777. }
  30778. this.color.set('hue', hue);
  30779. },
  30780. getThumbLeft: function getThumbLeft() {
  30781. if (this.vertical) return 0;
  30782. var el = this.$el;
  30783. var hue = this.color.get('hue');
  30784. if (!el) return 0;
  30785. var thumb = this.$refs.thumb;
  30786. return Math.round(hue * (el.offsetWidth - thumb.offsetWidth / 2) / 360);
  30787. },
  30788. getThumbTop: function getThumbTop() {
  30789. if (!this.vertical) return 0;
  30790. var el = this.$el;
  30791. var hue = this.color.get('hue');
  30792. if (!el) return 0;
  30793. var thumb = this.$refs.thumb;
  30794. return Math.round(hue * (el.offsetHeight - thumb.offsetHeight / 2) / 360);
  30795. },
  30796. update: function update() {
  30797. this.thumbLeft = this.getThumbLeft();
  30798. this.thumbTop = this.getThumbTop();
  30799. }
  30800. },
  30801. mounted: function mounted() {
  30802. var _this = this;
  30803. var _$refs = this.$refs,
  30804. bar = _$refs.bar,
  30805. thumb = _$refs.thumb;
  30806. var dragConfig = {
  30807. drag: function drag(event) {
  30808. _this.handleDrag(event);
  30809. },
  30810. end: function end(event) {
  30811. _this.handleDrag(event);
  30812. }
  30813. };
  30814. draggable(bar, dragConfig);
  30815. draggable(thumb, dragConfig);
  30816. this.update();
  30817. }
  30818. });
  30819. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  30820. /* harmony default export */ var components_hue_slidervue_type_script_lang_js_ = (hue_slidervue_type_script_lang_js_);
  30821. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue
  30822. /* normalize component */
  30823. var hue_slider_component = normalizeComponent(
  30824. components_hue_slidervue_type_script_lang_js_,
  30825. hue_slidervue_type_template_id_5cdc43b1_render,
  30826. hue_slidervue_type_template_id_5cdc43b1_staticRenderFns,
  30827. false,
  30828. null,
  30829. null,
  30830. null
  30831. )
  30832. /* hot reload */
  30833. if (false) { var hue_slider_api; }
  30834. hue_slider_component.options.__file = "packages/color-picker/src/components/hue-slider.vue"
  30835. /* harmony default export */ var hue_slider = (hue_slider_component.exports);
  30836. // 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&
  30837. var alpha_slidervue_type_template_id_068c66cb_render = function() {
  30838. var _vm = this
  30839. var _h = _vm.$createElement
  30840. var _c = _vm._self._c || _h
  30841. return _c(
  30842. "div",
  30843. {
  30844. staticClass: "el-color-alpha-slider",
  30845. class: { "is-vertical": _vm.vertical }
  30846. },
  30847. [
  30848. _c("div", {
  30849. ref: "bar",
  30850. staticClass: "el-color-alpha-slider__bar",
  30851. style: {
  30852. background: _vm.background
  30853. },
  30854. on: { click: _vm.handleClick }
  30855. }),
  30856. _c("div", {
  30857. ref: "thumb",
  30858. staticClass: "el-color-alpha-slider__thumb",
  30859. style: {
  30860. left: _vm.thumbLeft + "px",
  30861. top: _vm.thumbTop + "px"
  30862. }
  30863. })
  30864. ]
  30865. )
  30866. }
  30867. var alpha_slidervue_type_template_id_068c66cb_staticRenderFns = []
  30868. alpha_slidervue_type_template_id_068c66cb_render._withStripped = true
  30869. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  30870. // 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&
  30871. //
  30872. //
  30873. //
  30874. //
  30875. //
  30876. //
  30877. //
  30878. //
  30879. //
  30880. //
  30881. //
  30882. //
  30883. //
  30884. //
  30885. //
  30886. //
  30887. //
  30888. //
  30889. //
  30890. /* harmony default export */ var alpha_slidervue_type_script_lang_js_ = ({
  30891. name: 'el-color-alpha-slider',
  30892. props: {
  30893. color: {
  30894. required: true
  30895. },
  30896. vertical: Boolean
  30897. },
  30898. watch: {
  30899. 'color._alpha': function color_alpha() {
  30900. this.update();
  30901. },
  30902. 'color.value': function colorValue() {
  30903. this.update();
  30904. }
  30905. },
  30906. methods: {
  30907. handleClick: function handleClick(event) {
  30908. var thumb = this.$refs.thumb;
  30909. var target = event.target;
  30910. if (target !== thumb) {
  30911. this.handleDrag(event);
  30912. }
  30913. },
  30914. handleDrag: function handleDrag(event) {
  30915. var rect = this.$el.getBoundingClientRect();
  30916. var thumb = this.$refs.thumb;
  30917. if (!this.vertical) {
  30918. var left = event.clientX - rect.left;
  30919. left = Math.max(thumb.offsetWidth / 2, left);
  30920. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  30921. this.color.set('alpha', Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 100));
  30922. } else {
  30923. var top = event.clientY - rect.top;
  30924. top = Math.max(thumb.offsetHeight / 2, top);
  30925. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  30926. this.color.set('alpha', Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 100));
  30927. }
  30928. },
  30929. getThumbLeft: function getThumbLeft() {
  30930. if (this.vertical) return 0;
  30931. var el = this.$el;
  30932. var alpha = this.color._alpha;
  30933. if (!el) return 0;
  30934. var thumb = this.$refs.thumb;
  30935. return Math.round(alpha * (el.offsetWidth - thumb.offsetWidth / 2) / 100);
  30936. },
  30937. getThumbTop: function getThumbTop() {
  30938. if (!this.vertical) return 0;
  30939. var el = this.$el;
  30940. var alpha = this.color._alpha;
  30941. if (!el) return 0;
  30942. var thumb = this.$refs.thumb;
  30943. return Math.round(alpha * (el.offsetHeight - thumb.offsetHeight / 2) / 100);
  30944. },
  30945. getBackground: function getBackground() {
  30946. if (this.color && this.color.value) {
  30947. var _color$toRgb = this.color.toRgb(),
  30948. r = _color$toRgb.r,
  30949. g = _color$toRgb.g,
  30950. b = _color$toRgb.b;
  30951. return 'linear-gradient(to right, rgba(' + r + ', ' + g + ', ' + b + ', 0) 0%, rgba(' + r + ', ' + g + ', ' + b + ', 1) 100%)';
  30952. }
  30953. return null;
  30954. },
  30955. update: function update() {
  30956. this.thumbLeft = this.getThumbLeft();
  30957. this.thumbTop = this.getThumbTop();
  30958. this.background = this.getBackground();
  30959. }
  30960. },
  30961. data: function data() {
  30962. return {
  30963. thumbLeft: 0,
  30964. thumbTop: 0,
  30965. background: null
  30966. };
  30967. },
  30968. mounted: function mounted() {
  30969. var _this = this;
  30970. var _$refs = this.$refs,
  30971. bar = _$refs.bar,
  30972. thumb = _$refs.thumb;
  30973. var dragConfig = {
  30974. drag: function drag(event) {
  30975. _this.handleDrag(event);
  30976. },
  30977. end: function end(event) {
  30978. _this.handleDrag(event);
  30979. }
  30980. };
  30981. draggable(bar, dragConfig);
  30982. draggable(thumb, dragConfig);
  30983. this.update();
  30984. }
  30985. });
  30986. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  30987. /* harmony default export */ var components_alpha_slidervue_type_script_lang_js_ = (alpha_slidervue_type_script_lang_js_);
  30988. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue
  30989. /* normalize component */
  30990. var alpha_slider_component = normalizeComponent(
  30991. components_alpha_slidervue_type_script_lang_js_,
  30992. alpha_slidervue_type_template_id_068c66cb_render,
  30993. alpha_slidervue_type_template_id_068c66cb_staticRenderFns,
  30994. false,
  30995. null,
  30996. null,
  30997. null
  30998. )
  30999. /* hot reload */
  31000. if (false) { var alpha_slider_api; }
  31001. alpha_slider_component.options.__file = "packages/color-picker/src/components/alpha-slider.vue"
  31002. /* harmony default export */ var alpha_slider = (alpha_slider_component.exports);
  31003. // 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&
  31004. var predefinevue_type_template_id_06e03093_render = function() {
  31005. var _vm = this
  31006. var _h = _vm.$createElement
  31007. var _c = _vm._self._c || _h
  31008. return _c("div", { staticClass: "el-color-predefine" }, [
  31009. _c(
  31010. "div",
  31011. { staticClass: "el-color-predefine__colors" },
  31012. _vm._l(_vm.rgbaColors, function(item, index) {
  31013. return _c(
  31014. "div",
  31015. {
  31016. key: _vm.colors[index],
  31017. staticClass: "el-color-predefine__color-selector",
  31018. class: { selected: item.selected, "is-alpha": item._alpha < 100 },
  31019. on: {
  31020. click: function($event) {
  31021. _vm.handleSelect(index)
  31022. }
  31023. }
  31024. },
  31025. [_c("div", { style: { "background-color": item.value } })]
  31026. )
  31027. }),
  31028. 0
  31029. )
  31030. ])
  31031. }
  31032. var predefinevue_type_template_id_06e03093_staticRenderFns = []
  31033. predefinevue_type_template_id_06e03093_render._withStripped = true
  31034. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  31035. // 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&
  31036. //
  31037. //
  31038. //
  31039. //
  31040. //
  31041. //
  31042. //
  31043. //
  31044. //
  31045. //
  31046. //
  31047. //
  31048. //
  31049. //
  31050. //
  31051. /* harmony default export */ var predefinevue_type_script_lang_js_ = ({
  31052. props: {
  31053. colors: { type: Array, required: true },
  31054. color: { required: true }
  31055. },
  31056. data: function data() {
  31057. return {
  31058. rgbaColors: this.parseColors(this.colors, this.color)
  31059. };
  31060. },
  31061. methods: {
  31062. handleSelect: function handleSelect(index) {
  31063. this.color.fromString(this.colors[index]);
  31064. },
  31065. parseColors: function parseColors(colors, color) {
  31066. return colors.map(function (value) {
  31067. var c = new src_color();
  31068. c.enableAlpha = true;
  31069. c.format = 'rgba';
  31070. c.fromString(value);
  31071. c.selected = c.value === color.value;
  31072. return c;
  31073. });
  31074. }
  31075. },
  31076. watch: {
  31077. '$parent.currentColor': function $parentCurrentColor(val) {
  31078. var color = new src_color();
  31079. color.fromString(val);
  31080. this.rgbaColors.forEach(function (item) {
  31081. item.selected = color.compare(item);
  31082. });
  31083. },
  31084. colors: function colors(newVal) {
  31085. this.rgbaColors = this.parseColors(newVal, this.color);
  31086. },
  31087. color: function color(newVal) {
  31088. this.rgbaColors = this.parseColors(this.colors, newVal);
  31089. }
  31090. }
  31091. });
  31092. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  31093. /* harmony default export */ var components_predefinevue_type_script_lang_js_ = (predefinevue_type_script_lang_js_);
  31094. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue
  31095. /* normalize component */
  31096. var predefine_component = normalizeComponent(
  31097. components_predefinevue_type_script_lang_js_,
  31098. predefinevue_type_template_id_06e03093_render,
  31099. predefinevue_type_template_id_06e03093_staticRenderFns,
  31100. false,
  31101. null,
  31102. null,
  31103. null
  31104. )
  31105. /* hot reload */
  31106. if (false) { var predefine_api; }
  31107. predefine_component.options.__file = "packages/color-picker/src/components/predefine.vue"
  31108. /* harmony default export */ var predefine = (predefine_component.exports);
  31109. // 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&
  31110. //
  31111. //
  31112. //
  31113. //
  31114. //
  31115. //
  31116. //
  31117. //
  31118. //
  31119. //
  31120. //
  31121. //
  31122. //
  31123. //
  31124. //
  31125. //
  31126. //
  31127. //
  31128. //
  31129. //
  31130. //
  31131. //
  31132. //
  31133. //
  31134. //
  31135. //
  31136. //
  31137. //
  31138. //
  31139. //
  31140. //
  31141. //
  31142. //
  31143. //
  31144. //
  31145. //
  31146. //
  31147. //
  31148. //
  31149. //
  31150. /* harmony default export */ var picker_dropdownvue_type_script_lang_js_ = ({
  31151. name: 'el-color-picker-dropdown',
  31152. mixins: [vue_popper_default.a, locale_default.a],
  31153. components: {
  31154. SvPanel: sv_panel,
  31155. HueSlider: hue_slider,
  31156. AlphaSlider: alpha_slider,
  31157. ElInput: input_default.a,
  31158. ElButton: button_default.a,
  31159. Predefine: predefine
  31160. },
  31161. props: {
  31162. color: {
  31163. required: true
  31164. },
  31165. showAlpha: Boolean,
  31166. predefine: Array
  31167. },
  31168. data: function data() {
  31169. return {
  31170. customInput: ''
  31171. };
  31172. },
  31173. computed: {
  31174. currentColor: function currentColor() {
  31175. var parent = this.$parent;
  31176. return !parent.value && !parent.showPanelColor ? '' : parent.color.value;
  31177. }
  31178. },
  31179. methods: {
  31180. confirmValue: function confirmValue() {
  31181. this.$emit('pick');
  31182. },
  31183. handleConfirm: function handleConfirm() {
  31184. this.color.fromString(this.customInput);
  31185. }
  31186. },
  31187. mounted: function mounted() {
  31188. this.$parent.popperElm = this.popperElm = this.$el;
  31189. this.referenceElm = this.$parent.$el;
  31190. },
  31191. watch: {
  31192. showPopper: function showPopper(val) {
  31193. var _this = this;
  31194. if (val === true) {
  31195. this.$nextTick(function () {
  31196. var _$refs = _this.$refs,
  31197. sl = _$refs.sl,
  31198. hue = _$refs.hue,
  31199. alpha = _$refs.alpha;
  31200. sl && sl.update();
  31201. hue && hue.update();
  31202. alpha && alpha.update();
  31203. });
  31204. }
  31205. },
  31206. currentColor: {
  31207. immediate: true,
  31208. handler: function handler(val) {
  31209. this.customInput = val;
  31210. }
  31211. }
  31212. }
  31213. });
  31214. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  31215. /* harmony default export */ var components_picker_dropdownvue_type_script_lang_js_ = (picker_dropdownvue_type_script_lang_js_);
  31216. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue
  31217. /* normalize component */
  31218. var picker_dropdown_component = normalizeComponent(
  31219. components_picker_dropdownvue_type_script_lang_js_,
  31220. picker_dropdownvue_type_template_id_06601625_render,
  31221. picker_dropdownvue_type_template_id_06601625_staticRenderFns,
  31222. false,
  31223. null,
  31224. null,
  31225. null
  31226. )
  31227. /* hot reload */
  31228. if (false) { var picker_dropdown_api; }
  31229. picker_dropdown_component.options.__file = "packages/color-picker/src/components/picker-dropdown.vue"
  31230. /* harmony default export */ var picker_dropdown = (picker_dropdown_component.exports);
  31231. // 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&
  31232. //
  31233. //
  31234. //
  31235. //
  31236. //
  31237. //
  31238. //
  31239. //
  31240. //
  31241. //
  31242. //
  31243. //
  31244. //
  31245. //
  31246. //
  31247. //
  31248. //
  31249. //
  31250. //
  31251. //
  31252. //
  31253. //
  31254. //
  31255. //
  31256. //
  31257. //
  31258. //
  31259. //
  31260. //
  31261. //
  31262. //
  31263. //
  31264. /* harmony default export */ var color_picker_src_mainvue_type_script_lang_js_ = ({
  31265. name: 'ElColorPicker',
  31266. mixins: [emitter_default.a],
  31267. props: {
  31268. value: String,
  31269. showAlpha: Boolean,
  31270. colorFormat: String,
  31271. disabled: Boolean,
  31272. size: String,
  31273. popperClass: String,
  31274. predefine: Array
  31275. },
  31276. inject: {
  31277. elForm: {
  31278. default: ''
  31279. },
  31280. elFormItem: {
  31281. default: ''
  31282. }
  31283. },
  31284. directives: { Clickoutside: clickoutside_default.a },
  31285. computed: {
  31286. displayedColor: function displayedColor() {
  31287. if (!this.value && !this.showPanelColor) {
  31288. return 'transparent';
  31289. }
  31290. return this.displayedRgb(this.color, this.showAlpha);
  31291. },
  31292. _elFormItemSize: function _elFormItemSize() {
  31293. return (this.elFormItem || {}).elFormItemSize;
  31294. },
  31295. colorSize: function colorSize() {
  31296. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  31297. },
  31298. colorDisabled: function colorDisabled() {
  31299. return this.disabled || (this.elForm || {}).disabled;
  31300. }
  31301. },
  31302. watch: {
  31303. value: function value(val) {
  31304. if (!val) {
  31305. this.showPanelColor = false;
  31306. } else if (val && val !== this.color.value) {
  31307. this.color.fromString(val);
  31308. }
  31309. },
  31310. color: {
  31311. deep: true,
  31312. handler: function handler() {
  31313. this.showPanelColor = true;
  31314. }
  31315. },
  31316. displayedColor: function displayedColor(val) {
  31317. if (!this.showPicker) return;
  31318. var currentValueColor = new src_color({
  31319. enableAlpha: this.showAlpha,
  31320. format: this.colorFormat
  31321. });
  31322. currentValueColor.fromString(this.value);
  31323. var currentValueColorRgb = this.displayedRgb(currentValueColor, this.showAlpha);
  31324. if (val !== currentValueColorRgb) {
  31325. this.$emit('active-change', val);
  31326. }
  31327. }
  31328. },
  31329. methods: {
  31330. handleTrigger: function handleTrigger() {
  31331. if (this.colorDisabled) return;
  31332. this.showPicker = !this.showPicker;
  31333. },
  31334. confirmValue: function confirmValue() {
  31335. var value = this.color.value;
  31336. this.$emit('input', value);
  31337. this.$emit('change', value);
  31338. this.dispatch('ElFormItem', 'el.form.change', value);
  31339. this.showPicker = false;
  31340. },
  31341. clearValue: function clearValue() {
  31342. this.$emit('input', null);
  31343. this.$emit('change', null);
  31344. if (this.value !== null) {
  31345. this.dispatch('ElFormItem', 'el.form.change', null);
  31346. }
  31347. this.showPanelColor = false;
  31348. this.showPicker = false;
  31349. this.resetColor();
  31350. },
  31351. hide: function hide() {
  31352. this.showPicker = false;
  31353. this.resetColor();
  31354. },
  31355. resetColor: function resetColor() {
  31356. var _this = this;
  31357. this.$nextTick(function (_) {
  31358. if (_this.value) {
  31359. _this.color.fromString(_this.value);
  31360. } else {
  31361. _this.showPanelColor = false;
  31362. }
  31363. });
  31364. },
  31365. displayedRgb: function displayedRgb(color, showAlpha) {
  31366. if (!(color instanceof src_color)) {
  31367. throw Error('color should be instance of Color Class');
  31368. }
  31369. var _color$toRgb = color.toRgb(),
  31370. r = _color$toRgb.r,
  31371. g = _color$toRgb.g,
  31372. b = _color$toRgb.b;
  31373. return showAlpha ? 'rgba(' + r + ', ' + g + ', ' + b + ', ' + color.get('alpha') / 100 + ')' : 'rgb(' + r + ', ' + g + ', ' + b + ')';
  31374. }
  31375. },
  31376. mounted: function mounted() {
  31377. var value = this.value;
  31378. if (value) {
  31379. this.color.fromString(value);
  31380. }
  31381. this.popperElm = this.$refs.dropdown.$el;
  31382. },
  31383. data: function data() {
  31384. var color = new src_color({
  31385. enableAlpha: this.showAlpha,
  31386. format: this.colorFormat
  31387. });
  31388. return {
  31389. color: color,
  31390. showPicker: false,
  31391. showPanelColor: false
  31392. };
  31393. },
  31394. components: {
  31395. PickerDropdown: picker_dropdown
  31396. }
  31397. });
  31398. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  31399. /* harmony default export */ var packages_color_picker_src_mainvue_type_script_lang_js_ = (color_picker_src_mainvue_type_script_lang_js_);
  31400. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue
  31401. /* normalize component */
  31402. var color_picker_src_main_component = normalizeComponent(
  31403. packages_color_picker_src_mainvue_type_script_lang_js_,
  31404. mainvue_type_template_id_55c8ade7_render,
  31405. mainvue_type_template_id_55c8ade7_staticRenderFns,
  31406. false,
  31407. null,
  31408. null,
  31409. null
  31410. )
  31411. /* hot reload */
  31412. if (false) { var color_picker_src_main_api; }
  31413. color_picker_src_main_component.options.__file = "packages/color-picker/src/main.vue"
  31414. /* harmony default export */ var color_picker_src_main = (color_picker_src_main_component.exports);
  31415. // CONCATENATED MODULE: ./packages/color-picker/index.js
  31416. /* istanbul ignore next */
  31417. color_picker_src_main.install = function (Vue) {
  31418. Vue.component(color_picker_src_main.name, color_picker_src_main);
  31419. };
  31420. /* harmony default export */ var color_picker = (color_picker_src_main);
  31421. // 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&
  31422. var mainvue_type_template_id_5c654dd8_render = function() {
  31423. var _vm = this
  31424. var _h = _vm.$createElement
  31425. var _c = _vm._self._c || _h
  31426. return _c(
  31427. "div",
  31428. { staticClass: "el-transfer" },
  31429. [
  31430. _c(
  31431. "transfer-panel",
  31432. _vm._b(
  31433. {
  31434. ref: "leftPanel",
  31435. attrs: {
  31436. data: _vm.sourceData,
  31437. title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
  31438. "default-checked": _vm.leftDefaultChecked,
  31439. placeholder:
  31440. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  31441. },
  31442. on: { "checked-change": _vm.onSourceCheckedChange }
  31443. },
  31444. "transfer-panel",
  31445. _vm.$props,
  31446. false
  31447. ),
  31448. [_vm._t("left-footer")],
  31449. 2
  31450. ),
  31451. _c(
  31452. "div",
  31453. { staticClass: "el-transfer__buttons" },
  31454. [
  31455. _c(
  31456. "el-button",
  31457. {
  31458. class: [
  31459. "el-transfer__button",
  31460. _vm.hasButtonTexts ? "is-with-texts" : ""
  31461. ],
  31462. attrs: {
  31463. type: "primary",
  31464. disabled: _vm.rightChecked.length === 0
  31465. },
  31466. nativeOn: {
  31467. click: function($event) {
  31468. return _vm.addToLeft($event)
  31469. }
  31470. }
  31471. },
  31472. [
  31473. _c("i", { staticClass: "el-icon-arrow-left" }),
  31474. _vm.buttonTexts[0] !== undefined
  31475. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
  31476. : _vm._e()
  31477. ]
  31478. ),
  31479. _c(
  31480. "el-button",
  31481. {
  31482. class: [
  31483. "el-transfer__button",
  31484. _vm.hasButtonTexts ? "is-with-texts" : ""
  31485. ],
  31486. attrs: {
  31487. type: "primary",
  31488. disabled: _vm.leftChecked.length === 0
  31489. },
  31490. nativeOn: {
  31491. click: function($event) {
  31492. return _vm.addToRight($event)
  31493. }
  31494. }
  31495. },
  31496. [
  31497. _vm.buttonTexts[1] !== undefined
  31498. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
  31499. : _vm._e(),
  31500. _c("i", { staticClass: "el-icon-arrow-right" })
  31501. ]
  31502. )
  31503. ],
  31504. 1
  31505. ),
  31506. _c(
  31507. "transfer-panel",
  31508. _vm._b(
  31509. {
  31510. ref: "rightPanel",
  31511. attrs: {
  31512. data: _vm.targetData,
  31513. title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
  31514. "default-checked": _vm.rightDefaultChecked,
  31515. placeholder:
  31516. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  31517. },
  31518. on: { "checked-change": _vm.onTargetCheckedChange }
  31519. },
  31520. "transfer-panel",
  31521. _vm.$props,
  31522. false
  31523. ),
  31524. [_vm._t("right-footer")],
  31525. 2
  31526. )
  31527. ],
  31528. 1
  31529. )
  31530. }
  31531. var mainvue_type_template_id_5c654dd8_staticRenderFns = []
  31532. mainvue_type_template_id_5c654dd8_render._withStripped = true
  31533. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
  31534. // 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&
  31535. var transfer_panelvue_type_template_id_2ddab8bd_render = function() {
  31536. var _vm = this
  31537. var _h = _vm.$createElement
  31538. var _c = _vm._self._c || _h
  31539. return _c("div", { staticClass: "el-transfer-panel" }, [
  31540. _c(
  31541. "p",
  31542. { staticClass: "el-transfer-panel__header" },
  31543. [
  31544. _c(
  31545. "el-checkbox",
  31546. {
  31547. attrs: { indeterminate: _vm.isIndeterminate },
  31548. on: { change: _vm.handleAllCheckedChange },
  31549. model: {
  31550. value: _vm.allChecked,
  31551. callback: function($$v) {
  31552. _vm.allChecked = $$v
  31553. },
  31554. expression: "allChecked"
  31555. }
  31556. },
  31557. [
  31558. _vm._v("\n " + _vm._s(_vm.title) + "\n "),
  31559. _c("span", [_vm._v(_vm._s(_vm.checkedSummary))])
  31560. ]
  31561. )
  31562. ],
  31563. 1
  31564. ),
  31565. _c(
  31566. "div",
  31567. {
  31568. class: [
  31569. "el-transfer-panel__body",
  31570. _vm.hasFooter ? "is-with-footer" : ""
  31571. ]
  31572. },
  31573. [
  31574. _vm.filterable
  31575. ? _c(
  31576. "el-input",
  31577. {
  31578. staticClass: "el-transfer-panel__filter",
  31579. attrs: { size: "small", placeholder: _vm.placeholder },
  31580. nativeOn: {
  31581. mouseenter: function($event) {
  31582. _vm.inputHover = true
  31583. },
  31584. mouseleave: function($event) {
  31585. _vm.inputHover = false
  31586. }
  31587. },
  31588. model: {
  31589. value: _vm.query,
  31590. callback: function($$v) {
  31591. _vm.query = $$v
  31592. },
  31593. expression: "query"
  31594. }
  31595. },
  31596. [
  31597. _c("i", {
  31598. class: ["el-input__icon", "el-icon-" + _vm.inputIcon],
  31599. attrs: { slot: "prefix" },
  31600. on: { click: _vm.clearQuery },
  31601. slot: "prefix"
  31602. })
  31603. ]
  31604. )
  31605. : _vm._e(),
  31606. _c(
  31607. "el-checkbox-group",
  31608. {
  31609. directives: [
  31610. {
  31611. name: "show",
  31612. rawName: "v-show",
  31613. value: !_vm.hasNoMatch && _vm.data.length > 0,
  31614. expression: "!hasNoMatch && data.length > 0"
  31615. }
  31616. ],
  31617. staticClass: "el-transfer-panel__list",
  31618. class: { "is-filterable": _vm.filterable },
  31619. model: {
  31620. value: _vm.checked,
  31621. callback: function($$v) {
  31622. _vm.checked = $$v
  31623. },
  31624. expression: "checked"
  31625. }
  31626. },
  31627. _vm._l(_vm.filteredData, function(item) {
  31628. return _c(
  31629. "el-checkbox",
  31630. {
  31631. key: item[_vm.keyProp],
  31632. staticClass: "el-transfer-panel__item",
  31633. attrs: {
  31634. label: item[_vm.keyProp],
  31635. disabled: item[_vm.disabledProp]
  31636. }
  31637. },
  31638. [_c("option-content", { attrs: { option: item } })],
  31639. 1
  31640. )
  31641. }),
  31642. 1
  31643. ),
  31644. _c(
  31645. "p",
  31646. {
  31647. directives: [
  31648. {
  31649. name: "show",
  31650. rawName: "v-show",
  31651. value: _vm.hasNoMatch,
  31652. expression: "hasNoMatch"
  31653. }
  31654. ],
  31655. staticClass: "el-transfer-panel__empty"
  31656. },
  31657. [_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
  31658. ),
  31659. _c(
  31660. "p",
  31661. {
  31662. directives: [
  31663. {
  31664. name: "show",
  31665. rawName: "v-show",
  31666. value: _vm.data.length === 0 && !_vm.hasNoMatch,
  31667. expression: "data.length === 0 && !hasNoMatch"
  31668. }
  31669. ],
  31670. staticClass: "el-transfer-panel__empty"
  31671. },
  31672. [_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
  31673. )
  31674. ],
  31675. 1
  31676. ),
  31677. _vm.hasFooter
  31678. ? _c(
  31679. "p",
  31680. { staticClass: "el-transfer-panel__footer" },
  31681. [_vm._t("default")],
  31682. 2
  31683. )
  31684. : _vm._e()
  31685. ])
  31686. }
  31687. var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
  31688. transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
  31689. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
  31690. // 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&
  31691. //
  31692. //
  31693. //
  31694. //
  31695. //
  31696. //
  31697. //
  31698. //
  31699. //
  31700. //
  31701. //
  31702. //
  31703. //
  31704. //
  31705. //
  31706. //
  31707. //
  31708. //
  31709. //
  31710. //
  31711. //
  31712. //
  31713. //
  31714. //
  31715. //
  31716. //
  31717. //
  31718. //
  31719. //
  31720. //
  31721. //
  31722. //
  31723. //
  31724. //
  31725. //
  31726. //
  31727. //
  31728. //
  31729. //
  31730. //
  31731. //
  31732. //
  31733. //
  31734. //
  31735. //
  31736. //
  31737. //
  31738. //
  31739. //
  31740. //
  31741. //
  31742. //
  31743. //
  31744. /* harmony default export */ var transfer_panelvue_type_script_lang_js_ = ({
  31745. mixins: [locale_default.a],
  31746. name: 'ElTransferPanel',
  31747. componentName: 'ElTransferPanel',
  31748. components: {
  31749. ElCheckboxGroup: checkbox_group_default.a,
  31750. ElCheckbox: checkbox_default.a,
  31751. ElInput: input_default.a,
  31752. OptionContent: {
  31753. props: {
  31754. option: Object
  31755. },
  31756. render: function render(h) {
  31757. var getParent = function getParent(vm) {
  31758. if (vm.$options.componentName === 'ElTransferPanel') {
  31759. return vm;
  31760. } else if (vm.$parent) {
  31761. return getParent(vm.$parent);
  31762. } else {
  31763. return vm;
  31764. }
  31765. };
  31766. var panel = getParent(this);
  31767. var transfer = panel.$parent || panel;
  31768. 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]]);
  31769. }
  31770. }
  31771. },
  31772. props: {
  31773. data: {
  31774. type: Array,
  31775. default: function _default() {
  31776. return [];
  31777. }
  31778. },
  31779. renderContent: Function,
  31780. placeholder: String,
  31781. title: String,
  31782. filterable: Boolean,
  31783. format: Object,
  31784. filterMethod: Function,
  31785. defaultChecked: Array,
  31786. props: Object
  31787. },
  31788. data: function data() {
  31789. return {
  31790. checked: [],
  31791. allChecked: false,
  31792. query: '',
  31793. inputHover: false,
  31794. checkChangeByUser: true
  31795. };
  31796. },
  31797. watch: {
  31798. checked: function checked(val, oldVal) {
  31799. this.updateAllChecked();
  31800. if (this.checkChangeByUser) {
  31801. var movedKeys = val.concat(oldVal).filter(function (v) {
  31802. return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
  31803. });
  31804. this.$emit('checked-change', val, movedKeys);
  31805. } else {
  31806. this.$emit('checked-change', val);
  31807. this.checkChangeByUser = true;
  31808. }
  31809. },
  31810. data: function data() {
  31811. var _this = this;
  31812. var checked = [];
  31813. var filteredDataKeys = this.filteredData.map(function (item) {
  31814. return item[_this.keyProp];
  31815. });
  31816. this.checked.forEach(function (item) {
  31817. if (filteredDataKeys.indexOf(item) > -1) {
  31818. checked.push(item);
  31819. }
  31820. });
  31821. this.checkChangeByUser = false;
  31822. this.checked = checked;
  31823. },
  31824. checkableData: function checkableData() {
  31825. this.updateAllChecked();
  31826. },
  31827. defaultChecked: {
  31828. immediate: true,
  31829. handler: function handler(val, oldVal) {
  31830. var _this2 = this;
  31831. if (oldVal && val.length === oldVal.length && val.every(function (item) {
  31832. return oldVal.indexOf(item) > -1;
  31833. })) return;
  31834. var checked = [];
  31835. var checkableDataKeys = this.checkableData.map(function (item) {
  31836. return item[_this2.keyProp];
  31837. });
  31838. val.forEach(function (item) {
  31839. if (checkableDataKeys.indexOf(item) > -1) {
  31840. checked.push(item);
  31841. }
  31842. });
  31843. this.checkChangeByUser = false;
  31844. this.checked = checked;
  31845. }
  31846. }
  31847. },
  31848. computed: {
  31849. filteredData: function filteredData() {
  31850. var _this3 = this;
  31851. return this.data.filter(function (item) {
  31852. if (typeof _this3.filterMethod === 'function') {
  31853. return _this3.filterMethod(_this3.query, item);
  31854. } else {
  31855. var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
  31856. return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
  31857. }
  31858. });
  31859. },
  31860. checkableData: function checkableData() {
  31861. var _this4 = this;
  31862. return this.filteredData.filter(function (item) {
  31863. return !item[_this4.disabledProp];
  31864. });
  31865. },
  31866. checkedSummary: function checkedSummary() {
  31867. var checkedLength = this.checked.length;
  31868. var dataLength = this.data.length;
  31869. var _format = this.format,
  31870. noChecked = _format.noChecked,
  31871. hasChecked = _format.hasChecked;
  31872. if (noChecked && hasChecked) {
  31873. return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
  31874. } else {
  31875. return checkedLength + '/' + dataLength;
  31876. }
  31877. },
  31878. isIndeterminate: function isIndeterminate() {
  31879. var checkedLength = this.checked.length;
  31880. return checkedLength > 0 && checkedLength < this.checkableData.length;
  31881. },
  31882. hasNoMatch: function hasNoMatch() {
  31883. return this.query.length > 0 && this.filteredData.length === 0;
  31884. },
  31885. inputIcon: function inputIcon() {
  31886. return this.query.length > 0 && this.inputHover ? 'circle-close' : 'search';
  31887. },
  31888. labelProp: function labelProp() {
  31889. return this.props.label || 'label';
  31890. },
  31891. keyProp: function keyProp() {
  31892. return this.props.key || 'key';
  31893. },
  31894. disabledProp: function disabledProp() {
  31895. return this.props.disabled || 'disabled';
  31896. },
  31897. hasFooter: function hasFooter() {
  31898. return !!this.$slots.default;
  31899. }
  31900. },
  31901. methods: {
  31902. updateAllChecked: function updateAllChecked() {
  31903. var _this5 = this;
  31904. var checkableDataKeys = this.checkableData.map(function (item) {
  31905. return item[_this5.keyProp];
  31906. });
  31907. this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
  31908. return _this5.checked.indexOf(item) > -1;
  31909. });
  31910. },
  31911. handleAllCheckedChange: function handleAllCheckedChange(value) {
  31912. var _this6 = this;
  31913. this.checked = value ? this.checkableData.map(function (item) {
  31914. return item[_this6.keyProp];
  31915. }) : [];
  31916. },
  31917. clearQuery: function clearQuery() {
  31918. if (this.inputIcon === 'circle-close') {
  31919. this.query = '';
  31920. }
  31921. }
  31922. }
  31923. });
  31924. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
  31925. /* harmony default export */ var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
  31926. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue
  31927. /* normalize component */
  31928. var transfer_panel_component = normalizeComponent(
  31929. src_transfer_panelvue_type_script_lang_js_,
  31930. transfer_panelvue_type_template_id_2ddab8bd_render,
  31931. transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
  31932. false,
  31933. null,
  31934. null,
  31935. null
  31936. )
  31937. /* hot reload */
  31938. if (false) { var transfer_panel_api; }
  31939. transfer_panel_component.options.__file = "packages/transfer/src/transfer-panel.vue"
  31940. /* harmony default export */ var transfer_panel = (transfer_panel_component.exports);
  31941. // 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&
  31942. //
  31943. //
  31944. //
  31945. //
  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. //
  31979. //
  31980. //
  31981. //
  31982. //
  31983. //
  31984. //
  31985. /* harmony default export */ var transfer_src_mainvue_type_script_lang_js_ = ({
  31986. name: 'ElTransfer',
  31987. mixins: [emitter_default.a, locale_default.a, migrating_default.a],
  31988. components: {
  31989. TransferPanel: transfer_panel,
  31990. ElButton: button_default.a
  31991. },
  31992. props: {
  31993. data: {
  31994. type: Array,
  31995. default: function _default() {
  31996. return [];
  31997. }
  31998. },
  31999. titles: {
  32000. type: Array,
  32001. default: function _default() {
  32002. return [];
  32003. }
  32004. },
  32005. buttonTexts: {
  32006. type: Array,
  32007. default: function _default() {
  32008. return [];
  32009. }
  32010. },
  32011. filterPlaceholder: {
  32012. type: String,
  32013. default: ''
  32014. },
  32015. filterMethod: Function,
  32016. leftDefaultChecked: {
  32017. type: Array,
  32018. default: function _default() {
  32019. return [];
  32020. }
  32021. },
  32022. rightDefaultChecked: {
  32023. type: Array,
  32024. default: function _default() {
  32025. return [];
  32026. }
  32027. },
  32028. renderContent: Function,
  32029. value: {
  32030. type: Array,
  32031. default: function _default() {
  32032. return [];
  32033. }
  32034. },
  32035. format: {
  32036. type: Object,
  32037. default: function _default() {
  32038. return {};
  32039. }
  32040. },
  32041. filterable: Boolean,
  32042. props: {
  32043. type: Object,
  32044. default: function _default() {
  32045. return {
  32046. label: 'label',
  32047. key: 'key',
  32048. disabled: 'disabled'
  32049. };
  32050. }
  32051. },
  32052. targetOrder: {
  32053. type: String,
  32054. default: 'original'
  32055. }
  32056. },
  32057. data: function data() {
  32058. return {
  32059. leftChecked: [],
  32060. rightChecked: []
  32061. };
  32062. },
  32063. computed: {
  32064. dataObj: function dataObj() {
  32065. var key = this.props.key;
  32066. return this.data.reduce(function (o, cur) {
  32067. return (o[cur[key]] = cur) && o;
  32068. }, {});
  32069. },
  32070. sourceData: function sourceData() {
  32071. var _this = this;
  32072. return this.data.filter(function (item) {
  32073. return _this.value.indexOf(item[_this.props.key]) === -1;
  32074. });
  32075. },
  32076. targetData: function targetData() {
  32077. var _this2 = this;
  32078. if (this.targetOrder === 'original') {
  32079. return this.data.filter(function (item) {
  32080. return _this2.value.indexOf(item[_this2.props.key]) > -1;
  32081. });
  32082. } else {
  32083. return this.value.reduce(function (arr, cur) {
  32084. var val = _this2.dataObj[cur];
  32085. if (val) {
  32086. arr.push(val);
  32087. }
  32088. return arr;
  32089. }, []);
  32090. }
  32091. },
  32092. hasButtonTexts: function hasButtonTexts() {
  32093. return this.buttonTexts.length === 2;
  32094. }
  32095. },
  32096. watch: {
  32097. value: function value(val) {
  32098. this.dispatch('ElFormItem', 'el.form.change', val);
  32099. }
  32100. },
  32101. methods: {
  32102. getMigratingConfig: function getMigratingConfig() {
  32103. return {
  32104. props: {
  32105. 'footer-format': 'footer-format is renamed to format.'
  32106. }
  32107. };
  32108. },
  32109. onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
  32110. this.leftChecked = val;
  32111. if (movedKeys === undefined) return;
  32112. this.$emit('left-check-change', val, movedKeys);
  32113. },
  32114. onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
  32115. this.rightChecked = val;
  32116. if (movedKeys === undefined) return;
  32117. this.$emit('right-check-change', val, movedKeys);
  32118. },
  32119. addToLeft: function addToLeft() {
  32120. var currentValue = this.value.slice();
  32121. this.rightChecked.forEach(function (item) {
  32122. var index = currentValue.indexOf(item);
  32123. if (index > -1) {
  32124. currentValue.splice(index, 1);
  32125. }
  32126. });
  32127. this.$emit('input', currentValue);
  32128. this.$emit('change', currentValue, 'left', this.rightChecked);
  32129. },
  32130. addToRight: function addToRight() {
  32131. var _this3 = this;
  32132. var currentValue = this.value.slice();
  32133. var itemsToBeMoved = [];
  32134. var key = this.props.key;
  32135. this.data.forEach(function (item) {
  32136. var itemKey = item[key];
  32137. if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
  32138. itemsToBeMoved.push(itemKey);
  32139. }
  32140. });
  32141. currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  32142. this.$emit('input', currentValue);
  32143. this.$emit('change', currentValue, 'right', this.leftChecked);
  32144. },
  32145. clearQuery: function clearQuery(which) {
  32146. if (which === 'left') {
  32147. this.$refs.leftPanel.query = '';
  32148. } else if (which === 'right') {
  32149. this.$refs.rightPanel.query = '';
  32150. }
  32151. }
  32152. }
  32153. });
  32154. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=script&lang=js&
  32155. /* harmony default export */ var packages_transfer_src_mainvue_type_script_lang_js_ = (transfer_src_mainvue_type_script_lang_js_);
  32156. // CONCATENATED MODULE: ./packages/transfer/src/main.vue
  32157. /* normalize component */
  32158. var transfer_src_main_component = normalizeComponent(
  32159. packages_transfer_src_mainvue_type_script_lang_js_,
  32160. mainvue_type_template_id_5c654dd8_render,
  32161. mainvue_type_template_id_5c654dd8_staticRenderFns,
  32162. false,
  32163. null,
  32164. null,
  32165. null
  32166. )
  32167. /* hot reload */
  32168. if (false) { var transfer_src_main_api; }
  32169. transfer_src_main_component.options.__file = "packages/transfer/src/main.vue"
  32170. /* harmony default export */ var transfer_src_main = (transfer_src_main_component.exports);
  32171. // CONCATENATED MODULE: ./packages/transfer/index.js
  32172. /* istanbul ignore next */
  32173. transfer_src_main.install = function (Vue) {
  32174. Vue.component(transfer_src_main.name, transfer_src_main);
  32175. };
  32176. /* harmony default export */ var transfer = (transfer_src_main);
  32177. // 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&
  32178. var mainvue_type_template_id_5bf181d4_render = function() {
  32179. var _vm = this
  32180. var _h = _vm.$createElement
  32181. var _c = _vm._self._c || _h
  32182. return _c(
  32183. "section",
  32184. { staticClass: "el-container", class: { "is-vertical": _vm.isVertical } },
  32185. [_vm._t("default")],
  32186. 2
  32187. )
  32188. }
  32189. var mainvue_type_template_id_5bf181d4_staticRenderFns = []
  32190. mainvue_type_template_id_5bf181d4_render._withStripped = true
  32191. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=template&id=5bf181d4&
  32192. // 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&
  32193. //
  32194. //
  32195. //
  32196. //
  32197. //
  32198. //
  32199. /* harmony default export */ var container_src_mainvue_type_script_lang_js_ = ({
  32200. name: 'ElContainer',
  32201. componentName: 'ElContainer',
  32202. props: {
  32203. direction: String
  32204. },
  32205. computed: {
  32206. isVertical: function isVertical() {
  32207. if (this.direction === 'vertical') {
  32208. return true;
  32209. } else if (this.direction === 'horizontal') {
  32210. return false;
  32211. }
  32212. return this.$slots && this.$slots.default ? this.$slots.default.some(function (vnode) {
  32213. var tag = vnode.componentOptions && vnode.componentOptions.tag;
  32214. return tag === 'el-header' || tag === 'el-footer';
  32215. }) : false;
  32216. }
  32217. }
  32218. });
  32219. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=script&lang=js&
  32220. /* harmony default export */ var packages_container_src_mainvue_type_script_lang_js_ = (container_src_mainvue_type_script_lang_js_);
  32221. // CONCATENATED MODULE: ./packages/container/src/main.vue
  32222. /* normalize component */
  32223. var container_src_main_component = normalizeComponent(
  32224. packages_container_src_mainvue_type_script_lang_js_,
  32225. mainvue_type_template_id_5bf181d4_render,
  32226. mainvue_type_template_id_5bf181d4_staticRenderFns,
  32227. false,
  32228. null,
  32229. null,
  32230. null
  32231. )
  32232. /* hot reload */
  32233. if (false) { var container_src_main_api; }
  32234. container_src_main_component.options.__file = "packages/container/src/main.vue"
  32235. /* harmony default export */ var container_src_main = (container_src_main_component.exports);
  32236. // CONCATENATED MODULE: ./packages/container/index.js
  32237. /* istanbul ignore next */
  32238. container_src_main.install = function (Vue) {
  32239. Vue.component(container_src_main.name, container_src_main);
  32240. };
  32241. /* harmony default export */ var container = (container_src_main);
  32242. // 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&
  32243. var mainvue_type_template_id_2b296ab2_render = function() {
  32244. var _vm = this
  32245. var _h = _vm.$createElement
  32246. var _c = _vm._self._c || _h
  32247. return _c(
  32248. "header",
  32249. { staticClass: "el-header", style: { height: _vm.height } },
  32250. [_vm._t("default")],
  32251. 2
  32252. )
  32253. }
  32254. var mainvue_type_template_id_2b296ab2_staticRenderFns = []
  32255. mainvue_type_template_id_2b296ab2_render._withStripped = true
  32256. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=template&id=2b296ab2&
  32257. // 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&
  32258. //
  32259. //
  32260. //
  32261. //
  32262. //
  32263. //
  32264. /* harmony default export */ var header_src_mainvue_type_script_lang_js_ = ({
  32265. name: 'ElHeader',
  32266. componentName: 'ElHeader',
  32267. props: {
  32268. height: {
  32269. type: String,
  32270. default: '60px'
  32271. }
  32272. }
  32273. });
  32274. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=script&lang=js&
  32275. /* harmony default export */ var packages_header_src_mainvue_type_script_lang_js_ = (header_src_mainvue_type_script_lang_js_);
  32276. // CONCATENATED MODULE: ./packages/header/src/main.vue
  32277. /* normalize component */
  32278. var header_src_main_component = normalizeComponent(
  32279. packages_header_src_mainvue_type_script_lang_js_,
  32280. mainvue_type_template_id_2b296ab2_render,
  32281. mainvue_type_template_id_2b296ab2_staticRenderFns,
  32282. false,
  32283. null,
  32284. null,
  32285. null
  32286. )
  32287. /* hot reload */
  32288. if (false) { var header_src_main_api; }
  32289. header_src_main_component.options.__file = "packages/header/src/main.vue"
  32290. /* harmony default export */ var header_src_main = (header_src_main_component.exports);
  32291. // CONCATENATED MODULE: ./packages/header/index.js
  32292. /* istanbul ignore next */
  32293. header_src_main.install = function (Vue) {
  32294. Vue.component(header_src_main.name, header_src_main);
  32295. };
  32296. /* harmony default export */ var header = (header_src_main);
  32297. // 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&
  32298. var mainvue_type_template_id_03411dbf_render = function() {
  32299. var _vm = this
  32300. var _h = _vm.$createElement
  32301. var _c = _vm._self._c || _h
  32302. return _c(
  32303. "aside",
  32304. { staticClass: "el-aside", style: { width: _vm.width } },
  32305. [_vm._t("default")],
  32306. 2
  32307. )
  32308. }
  32309. var mainvue_type_template_id_03411dbf_staticRenderFns = []
  32310. mainvue_type_template_id_03411dbf_render._withStripped = true
  32311. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=template&id=03411dbf&
  32312. // 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&
  32313. //
  32314. //
  32315. //
  32316. //
  32317. //
  32318. //
  32319. /* harmony default export */ var aside_src_mainvue_type_script_lang_js_ = ({
  32320. name: 'ElAside',
  32321. componentName: 'ElAside',
  32322. props: {
  32323. width: {
  32324. type: String,
  32325. default: '300px'
  32326. }
  32327. }
  32328. });
  32329. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=script&lang=js&
  32330. /* harmony default export */ var packages_aside_src_mainvue_type_script_lang_js_ = (aside_src_mainvue_type_script_lang_js_);
  32331. // CONCATENATED MODULE: ./packages/aside/src/main.vue
  32332. /* normalize component */
  32333. var aside_src_main_component = normalizeComponent(
  32334. packages_aside_src_mainvue_type_script_lang_js_,
  32335. mainvue_type_template_id_03411dbf_render,
  32336. mainvue_type_template_id_03411dbf_staticRenderFns,
  32337. false,
  32338. null,
  32339. null,
  32340. null
  32341. )
  32342. /* hot reload */
  32343. if (false) { var aside_src_main_api; }
  32344. aside_src_main_component.options.__file = "packages/aside/src/main.vue"
  32345. /* harmony default export */ var aside_src_main = (aside_src_main_component.exports);
  32346. // CONCATENATED MODULE: ./packages/aside/index.js
  32347. /* istanbul ignore next */
  32348. aside_src_main.install = function (Vue) {
  32349. Vue.component(aside_src_main.name, aside_src_main);
  32350. };
  32351. /* harmony default export */ var aside = (aside_src_main);
  32352. // 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&
  32353. var mainvue_type_template_id_2a3a7406_render = function() {
  32354. var _vm = this
  32355. var _h = _vm.$createElement
  32356. var _c = _vm._self._c || _h
  32357. return _c("main", { staticClass: "el-main" }, [_vm._t("default")], 2)
  32358. }
  32359. var mainvue_type_template_id_2a3a7406_staticRenderFns = []
  32360. mainvue_type_template_id_2a3a7406_render._withStripped = true
  32361. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=2a3a7406&
  32362. // 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&
  32363. //
  32364. //
  32365. //
  32366. //
  32367. //
  32368. //
  32369. /* harmony default export */ var main_src_mainvue_type_script_lang_js_ = ({
  32370. name: 'ElMain',
  32371. componentName: 'ElMain'
  32372. });
  32373. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=script&lang=js&
  32374. /* harmony default export */ var packages_main_src_mainvue_type_script_lang_js_ = (main_src_mainvue_type_script_lang_js_);
  32375. // CONCATENATED MODULE: ./packages/main/src/main.vue
  32376. /* normalize component */
  32377. var main_src_main_component = normalizeComponent(
  32378. packages_main_src_mainvue_type_script_lang_js_,
  32379. mainvue_type_template_id_2a3a7406_render,
  32380. mainvue_type_template_id_2a3a7406_staticRenderFns,
  32381. false,
  32382. null,
  32383. null,
  32384. null
  32385. )
  32386. /* hot reload */
  32387. if (false) { var main_src_main_api; }
  32388. main_src_main_component.options.__file = "packages/main/src/main.vue"
  32389. /* harmony default export */ var main_src_main = (main_src_main_component.exports);
  32390. // CONCATENATED MODULE: ./packages/main/index.js
  32391. /* istanbul ignore next */
  32392. main_src_main.install = function (Vue) {
  32393. Vue.component(main_src_main.name, main_src_main);
  32394. };
  32395. /* harmony default export */ var packages_main = (main_src_main);
  32396. // 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&
  32397. var mainvue_type_template_id_80210338_render = function() {
  32398. var _vm = this
  32399. var _h = _vm.$createElement
  32400. var _c = _vm._self._c || _h
  32401. return _c(
  32402. "footer",
  32403. { staticClass: "el-footer", style: { height: _vm.height } },
  32404. [_vm._t("default")],
  32405. 2
  32406. )
  32407. }
  32408. var mainvue_type_template_id_80210338_staticRenderFns = []
  32409. mainvue_type_template_id_80210338_render._withStripped = true
  32410. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=template&id=80210338&
  32411. // 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&
  32412. //
  32413. //
  32414. //
  32415. //
  32416. //
  32417. //
  32418. /* harmony default export */ var footer_src_mainvue_type_script_lang_js_ = ({
  32419. name: 'ElFooter',
  32420. componentName: 'ElFooter',
  32421. props: {
  32422. height: {
  32423. type: String,
  32424. default: '60px'
  32425. }
  32426. }
  32427. });
  32428. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=script&lang=js&
  32429. /* harmony default export */ var packages_footer_src_mainvue_type_script_lang_js_ = (footer_src_mainvue_type_script_lang_js_);
  32430. // CONCATENATED MODULE: ./packages/footer/src/main.vue
  32431. /* normalize component */
  32432. var footer_src_main_component = normalizeComponent(
  32433. packages_footer_src_mainvue_type_script_lang_js_,
  32434. mainvue_type_template_id_80210338_render,
  32435. mainvue_type_template_id_80210338_staticRenderFns,
  32436. false,
  32437. null,
  32438. null,
  32439. null
  32440. )
  32441. /* hot reload */
  32442. if (false) { var footer_src_main_api; }
  32443. footer_src_main_component.options.__file = "packages/footer/src/main.vue"
  32444. /* harmony default export */ var footer_src_main = (footer_src_main_component.exports);
  32445. // CONCATENATED MODULE: ./packages/footer/index.js
  32446. /* istanbul ignore next */
  32447. footer_src_main.install = function (Vue) {
  32448. Vue.component(footer_src_main.name, footer_src_main);
  32449. };
  32450. /* harmony default export */ var footer = (footer_src_main);
  32451. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/timeline/src/main.vue?vue&type=template&id=ef070f04&
  32452. var mainvue_type_template_id_ef070f04_render = function() {
  32453. var _vm = this
  32454. var _h = _vm.$createElement
  32455. var _c = _vm._self._c || _h
  32456. return _c(
  32457. "ul",
  32458. {
  32459. staticClass: "el-timeline",
  32460. class: {
  32461. "is-reverse": _vm.reverse
  32462. }
  32463. },
  32464. [_vm._t("default")],
  32465. 2
  32466. )
  32467. }
  32468. var mainvue_type_template_id_ef070f04_staticRenderFns = []
  32469. mainvue_type_template_id_ef070f04_render._withStripped = true
  32470. // CONCATENATED MODULE: ./packages/timeline/src/main.vue?vue&type=template&id=ef070f04&
  32471. // 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&
  32472. //
  32473. //
  32474. //
  32475. //
  32476. //
  32477. //
  32478. //
  32479. //
  32480. //
  32481. /* harmony default export */ var timeline_src_mainvue_type_script_lang_js_ = ({
  32482. name: 'ElTimeline',
  32483. props: {
  32484. reverse: {
  32485. type: Boolean,
  32486. default: false
  32487. }
  32488. },
  32489. provide: function provide() {
  32490. return {
  32491. timeline: this
  32492. };
  32493. },
  32494. watch: {
  32495. reverse: {
  32496. handler: function handler(newVal) {
  32497. if (newVal) {
  32498. this.$slots.default = [].concat(this.$slots.default).reverse();
  32499. }
  32500. },
  32501. immediate: true
  32502. }
  32503. }
  32504. });
  32505. // CONCATENATED MODULE: ./packages/timeline/src/main.vue?vue&type=script&lang=js&
  32506. /* harmony default export */ var packages_timeline_src_mainvue_type_script_lang_js_ = (timeline_src_mainvue_type_script_lang_js_);
  32507. // CONCATENATED MODULE: ./packages/timeline/src/main.vue
  32508. /* normalize component */
  32509. var timeline_src_main_component = normalizeComponent(
  32510. packages_timeline_src_mainvue_type_script_lang_js_,
  32511. mainvue_type_template_id_ef070f04_render,
  32512. mainvue_type_template_id_ef070f04_staticRenderFns,
  32513. false,
  32514. null,
  32515. null,
  32516. null
  32517. )
  32518. /* hot reload */
  32519. if (false) { var timeline_src_main_api; }
  32520. timeline_src_main_component.options.__file = "packages/timeline/src/main.vue"
  32521. /* harmony default export */ var timeline_src_main = (timeline_src_main_component.exports);
  32522. // CONCATENATED MODULE: ./packages/timeline/index.js
  32523. /* istanbul ignore next */
  32524. timeline_src_main.install = function (Vue) {
  32525. Vue.component(timeline_src_main.name, timeline_src_main);
  32526. };
  32527. /* harmony default export */ var timeline = (timeline_src_main);
  32528. // 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&
  32529. var itemvue_type_template_id_61a69e50_render = function() {
  32530. var _vm = this
  32531. var _h = _vm.$createElement
  32532. var _c = _vm._self._c || _h
  32533. return _c("li", { staticClass: "el-timeline-item" }, [
  32534. _c("div", { staticClass: "el-timeline-item__tail" }),
  32535. !_vm.$slots.dot
  32536. ? _c(
  32537. "div",
  32538. {
  32539. staticClass: "el-timeline-item__node",
  32540. class: [
  32541. "el-timeline-item__node--" + (_vm.size || ""),
  32542. "el-timeline-item__node--" + (_vm.type || "")
  32543. ],
  32544. style: {
  32545. backgroundColor: _vm.color
  32546. }
  32547. },
  32548. [
  32549. _vm.icon
  32550. ? _c("i", {
  32551. staticClass: "el-timeline-item__icon",
  32552. class: _vm.icon
  32553. })
  32554. : _vm._e()
  32555. ]
  32556. )
  32557. : _vm._e(),
  32558. _vm.$slots.dot
  32559. ? _c("div", { staticClass: "el-timeline-item__dot" }, [_vm._t("dot")], 2)
  32560. : _vm._e(),
  32561. _c("div", { staticClass: "el-timeline-item__wrapper" }, [
  32562. !_vm.hideTimestamp && _vm.placement === "top"
  32563. ? _c("div", { staticClass: "el-timeline-item__timestamp is-top" }, [
  32564. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  32565. ])
  32566. : _vm._e(),
  32567. _c(
  32568. "div",
  32569. { staticClass: "el-timeline-item__content" },
  32570. [_vm._t("default")],
  32571. 2
  32572. ),
  32573. !_vm.hideTimestamp && _vm.placement === "bottom"
  32574. ? _c("div", { staticClass: "el-timeline-item__timestamp is-bottom" }, [
  32575. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  32576. ])
  32577. : _vm._e()
  32578. ])
  32579. ])
  32580. }
  32581. var itemvue_type_template_id_61a69e50_staticRenderFns = []
  32582. itemvue_type_template_id_61a69e50_render._withStripped = true
  32583. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=template&id=61a69e50&
  32584. // 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&
  32585. //
  32586. //
  32587. //
  32588. //
  32589. //
  32590. //
  32591. //
  32592. //
  32593. //
  32594. //
  32595. //
  32596. //
  32597. //
  32598. //
  32599. //
  32600. //
  32601. //
  32602. //
  32603. //
  32604. //
  32605. //
  32606. //
  32607. //
  32608. //
  32609. //
  32610. //
  32611. //
  32612. //
  32613. //
  32614. //
  32615. //
  32616. //
  32617. //
  32618. //
  32619. //
  32620. //
  32621. //
  32622. //
  32623. //
  32624. //
  32625. //
  32626. /* harmony default export */ var timeline_src_itemvue_type_script_lang_js_ = ({
  32627. name: 'ElTimelineItem',
  32628. inject: ['timeline'],
  32629. props: {
  32630. timestamp: String,
  32631. hideTimestamp: {
  32632. type: Boolean,
  32633. default: false
  32634. },
  32635. placement: {
  32636. type: String,
  32637. default: 'bottom'
  32638. },
  32639. type: String,
  32640. color: String,
  32641. size: {
  32642. type: String,
  32643. default: 'normal'
  32644. },
  32645. icon: String
  32646. }
  32647. });
  32648. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=script&lang=js&
  32649. /* harmony default export */ var packages_timeline_src_itemvue_type_script_lang_js_ = (timeline_src_itemvue_type_script_lang_js_);
  32650. // CONCATENATED MODULE: ./packages/timeline/src/item.vue
  32651. /* normalize component */
  32652. var src_item_component = normalizeComponent(
  32653. packages_timeline_src_itemvue_type_script_lang_js_,
  32654. itemvue_type_template_id_61a69e50_render,
  32655. itemvue_type_template_id_61a69e50_staticRenderFns,
  32656. false,
  32657. null,
  32658. null,
  32659. null
  32660. )
  32661. /* hot reload */
  32662. if (false) { var src_item_api; }
  32663. src_item_component.options.__file = "packages/timeline/src/item.vue"
  32664. /* harmony default export */ var timeline_src_item = (src_item_component.exports);
  32665. // CONCATENATED MODULE: ./packages/timeline-item/index.js
  32666. /* istanbul ignore next */
  32667. timeline_src_item.install = function (Vue) {
  32668. Vue.component(timeline_src_item.name, timeline_src_item);
  32669. };
  32670. /* harmony default export */ var timeline_item = (timeline_src_item);
  32671. // 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&
  32672. var mainvue_type_template_id_01cf3b65_render = function() {
  32673. var _vm = this
  32674. var _h = _vm.$createElement
  32675. var _c = _vm._self._c || _h
  32676. return _c(
  32677. "a",
  32678. _vm._b(
  32679. {
  32680. class: [
  32681. "el-link",
  32682. _vm.type ? "el-link--" + _vm.type : "",
  32683. _vm.disabled && "is-disabled",
  32684. _vm.underline && !_vm.disabled && "is-underline"
  32685. ],
  32686. attrs: { href: _vm.href },
  32687. on: { click: _vm.handleClick }
  32688. },
  32689. "a",
  32690. _vm.$attrs,
  32691. false
  32692. ),
  32693. [
  32694. _vm.icon ? _c("el-icon", { class: _vm.icon }) : _vm._e(),
  32695. _vm.$slots.default
  32696. ? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
  32697. : _vm._e(),
  32698. _vm.$slots.icon ? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()] : _vm._e()
  32699. ],
  32700. 2
  32701. )
  32702. }
  32703. var mainvue_type_template_id_01cf3b65_staticRenderFns = []
  32704. mainvue_type_template_id_01cf3b65_render._withStripped = true
  32705. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=01cf3b65&
  32706. // 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&
  32707. //
  32708. //
  32709. //
  32710. //
  32711. //
  32712. //
  32713. //
  32714. //
  32715. //
  32716. //
  32717. //
  32718. //
  32719. //
  32720. //
  32721. //
  32722. //
  32723. //
  32724. //
  32725. //
  32726. //
  32727. //
  32728. //
  32729. //
  32730. /* harmony default export */ var link_src_mainvue_type_script_lang_js_ = ({
  32731. name: 'ElLink',
  32732. props: {
  32733. type: {
  32734. type: String,
  32735. default: 'default'
  32736. },
  32737. underline: {
  32738. type: Boolean,
  32739. default: true
  32740. },
  32741. disabled: Boolean,
  32742. href: String,
  32743. icon: String
  32744. },
  32745. methods: {
  32746. handleClick: function handleClick(event) {
  32747. if (!this.disabled) {
  32748. if (!this.href) {
  32749. this.$emit('click', event);
  32750. }
  32751. }
  32752. }
  32753. }
  32754. });
  32755. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js&
  32756. /* harmony default export */ var packages_link_src_mainvue_type_script_lang_js_ = (link_src_mainvue_type_script_lang_js_);
  32757. // CONCATENATED MODULE: ./packages/link/src/main.vue
  32758. /* normalize component */
  32759. var link_src_main_component = normalizeComponent(
  32760. packages_link_src_mainvue_type_script_lang_js_,
  32761. mainvue_type_template_id_01cf3b65_render,
  32762. mainvue_type_template_id_01cf3b65_staticRenderFns,
  32763. false,
  32764. null,
  32765. null,
  32766. null
  32767. )
  32768. /* hot reload */
  32769. if (false) { var link_src_main_api; }
  32770. link_src_main_component.options.__file = "packages/link/src/main.vue"
  32771. /* harmony default export */ var link_src_main = (link_src_main_component.exports);
  32772. // CONCATENATED MODULE: ./packages/link/index.js
  32773. /* istanbul ignore next */
  32774. link_src_main.install = function (Vue) {
  32775. Vue.component(link_src_main.name, link_src_main);
  32776. };
  32777. /* harmony default export */ var packages_link = (link_src_main);
  32778. // CONCATENATED MODULE: ./packages/divider/src/main.js
  32779. /* harmony default export */ var divider_src_main = ({
  32780. functional: true,
  32781. name: 'ElDivider',
  32782. props: {
  32783. direction: {
  32784. type: String,
  32785. default: 'horizontal',
  32786. validator: function validator(val) {
  32787. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  32788. }
  32789. },
  32790. contentPosition: {
  32791. type: String,
  32792. default: 'center',
  32793. validator: function validator(val) {
  32794. return ['left', 'center', 'right'].indexOf(val) !== -1;
  32795. }
  32796. }
  32797. },
  32798. render: function render(h, context) {
  32799. var $slots = context.slots();
  32800. var _context$props = context.props,
  32801. direction = _context$props.direction,
  32802. contentPosition = _context$props.contentPosition;
  32803. return h(
  32804. 'div',
  32805. { 'class': ['el-divider', 'el-divider--' + direction] },
  32806. [$slots.default && direction !== 'vertical' ? h(
  32807. 'div',
  32808. { 'class': ['el-divider__text', 'is-' + contentPosition] },
  32809. [$slots.default]
  32810. ) : null]
  32811. );
  32812. }
  32813. });
  32814. // CONCATENATED MODULE: ./packages/divider/index.js
  32815. /* istanbul ignore next */
  32816. divider_src_main.install = function (Vue) {
  32817. Vue.component(divider_src_main.name, divider_src_main);
  32818. };
  32819. /* harmony default export */ var divider = (divider_src_main);
  32820. // 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&
  32821. var mainvue_type_template_id_44d84a7c_render = function() {
  32822. var _vm = this
  32823. var _h = _vm.$createElement
  32824. var _c = _vm._self._c || _h
  32825. return _c(
  32826. "div",
  32827. { staticClass: "el-image" },
  32828. [
  32829. _vm.loading
  32830. ? _vm._t("placeholder", [
  32831. _c("div", { staticClass: "el-image__placeholder" })
  32832. ])
  32833. : _vm.error
  32834. ? _vm._t("error", [
  32835. _c("div", { staticClass: "el-image__error" }, [
  32836. _vm._v(_vm._s(_vm.t("el.image.error")))
  32837. ])
  32838. ])
  32839. : _c("img", {
  32840. staticClass: "el-image__inner",
  32841. style: { "object-fit": _vm.fit },
  32842. attrs: { src: _vm.src, alt: _vm.alt }
  32843. })
  32844. ],
  32845. 2
  32846. )
  32847. }
  32848. var mainvue_type_template_id_44d84a7c_staticRenderFns = []
  32849. mainvue_type_template_id_44d84a7c_render._withStripped = true
  32850. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=template&id=44d84a7c&
  32851. // 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&
  32852. //
  32853. //
  32854. //
  32855. //
  32856. //
  32857. //
  32858. //
  32859. //
  32860. //
  32861. //
  32862. //
  32863. //
  32864. //
  32865. //
  32866. //
  32867. //
  32868. //
  32869. /* harmony default export */ var image_src_mainvue_type_script_lang_js_ = ({
  32870. name: 'ElImage',
  32871. mixins: [locale_default.a],
  32872. props: {
  32873. src: String,
  32874. fit: String,
  32875. lazy: Boolean,
  32876. scrollContainer: [String, HTMLElement],
  32877. alt: String
  32878. },
  32879. data: function data() {
  32880. return {
  32881. loading: true,
  32882. error: false,
  32883. show: !this.lazy
  32884. };
  32885. },
  32886. watch: {
  32887. src: {
  32888. handler: function handler(val) {
  32889. this.show && this.loadImage(val);
  32890. },
  32891. immediate: true
  32892. },
  32893. show: function show(val) {
  32894. val && this.loadImage(this.src);
  32895. }
  32896. },
  32897. mounted: function mounted() {
  32898. this.lazy && this.addLazyLoadListener();
  32899. },
  32900. beforeDestroy: function beforeDestroy() {
  32901. this.lazy && this.removeLazyLoadListener();
  32902. },
  32903. methods: {
  32904. loadImage: function loadImage(val) {
  32905. // reset status
  32906. this.loading = true;
  32907. this.error = false;
  32908. var img = new Image();
  32909. img.onload = this.handleLoad.bind(this);
  32910. img.onerror = this.handleError.bind(this);
  32911. img.src = val;
  32912. },
  32913. handleLoad: function handleLoad(e) {
  32914. this.loading = false;
  32915. this.$emit('load', e);
  32916. },
  32917. handleError: function handleError(e) {
  32918. this.loading = false;
  32919. this.error = true;
  32920. this.$emit('error', e);
  32921. },
  32922. handleLazyLoad: function handleLazyLoad() {
  32923. if (Object(dom_["isInContainer"])(this.$el, this._scrollContainer)) {
  32924. this.show = true;
  32925. this.removeLazyLoadListener();
  32926. }
  32927. },
  32928. addLazyLoadListener: function addLazyLoadListener() {
  32929. if (this.$isServer) return;
  32930. var scrollContainer = this.scrollContainer;
  32931. var _scrollContainer = null;
  32932. if (Object(types_["isHtmlElement"])(scrollContainer)) {
  32933. _scrollContainer = scrollContainer;
  32934. } else if (Object(types_["isString"])(scrollContainer)) {
  32935. _scrollContainer = document.querySelector(scrollContainer);
  32936. } else {
  32937. _scrollContainer = Object(dom_["getScrollContainer"])(this.$el);
  32938. }
  32939. if (_scrollContainer) {
  32940. this._scrollContainer = _scrollContainer;
  32941. this._lazyLoadHandler = throttle_default()(200, this.handleLazyLoad);
  32942. Object(dom_["on"])(_scrollContainer, 'scroll', this._lazyLoadHandler);
  32943. this.handleLazyLoad();
  32944. }
  32945. },
  32946. removeLazyLoadListener: function removeLazyLoadListener() {
  32947. var _scrollContainer = this._scrollContainer,
  32948. _lazyLoadHandler = this._lazyLoadHandler;
  32949. if (this.$isServer || !_scrollContainer || !_lazyLoadHandler) return;
  32950. Object(dom_["off"])(_scrollContainer, 'scroll', _lazyLoadHandler);
  32951. this._scrollContainer = null;
  32952. this._lazyLoadHandler = null;
  32953. }
  32954. }
  32955. });
  32956. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=script&lang=js&
  32957. /* harmony default export */ var packages_image_src_mainvue_type_script_lang_js_ = (image_src_mainvue_type_script_lang_js_);
  32958. // CONCATENATED MODULE: ./packages/image/src/main.vue
  32959. /* normalize component */
  32960. var image_src_main_component = normalizeComponent(
  32961. packages_image_src_mainvue_type_script_lang_js_,
  32962. mainvue_type_template_id_44d84a7c_render,
  32963. mainvue_type_template_id_44d84a7c_staticRenderFns,
  32964. false,
  32965. null,
  32966. null,
  32967. null
  32968. )
  32969. /* hot reload */
  32970. if (false) { var image_src_main_api; }
  32971. image_src_main_component.options.__file = "packages/image/src/main.vue"
  32972. /* harmony default export */ var image_src_main = (image_src_main_component.exports);
  32973. // CONCATENATED MODULE: ./packages/image/index.js
  32974. /* istanbul ignore next */
  32975. image_src_main.install = function (Vue) {
  32976. Vue.component(image_src_main.name, image_src_main);
  32977. };
  32978. /* harmony default export */ var packages_image = (image_src_main);
  32979. // 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&
  32980. var mainvue_type_template_id_6d9756be_render = function() {
  32981. var _vm = this
  32982. var _h = _vm.$createElement
  32983. var _c = _vm._self._c || _h
  32984. return _c("div", { staticClass: "el-calendar" }, [
  32985. _c("div", { staticClass: "el-calendar__header" }, [
  32986. _c("div", { staticClass: "el-calendar__title" }, [
  32987. _vm._v("\n " + _vm._s(_vm.i18nDate) + "\n ")
  32988. ]),
  32989. _vm.validatedRange.length === 0
  32990. ? _c(
  32991. "div",
  32992. { staticClass: "el-calendar__button-group" },
  32993. [
  32994. _c(
  32995. "el-button-group",
  32996. [
  32997. _c(
  32998. "el-button",
  32999. {
  33000. attrs: { type: "plain", size: "mini" },
  33001. on: {
  33002. click: function($event) {
  33003. _vm.selectDate("prev-month")
  33004. }
  33005. }
  33006. },
  33007. [
  33008. _vm._v(
  33009. "\n " +
  33010. _vm._s(_vm.t("el.datepicker.prevMonth")) +
  33011. "\n "
  33012. )
  33013. ]
  33014. ),
  33015. _c(
  33016. "el-button",
  33017. {
  33018. attrs: { type: "plain", size: "mini" },
  33019. on: {
  33020. click: function($event) {
  33021. _vm.selectDate("today")
  33022. }
  33023. }
  33024. },
  33025. [
  33026. _vm._v(
  33027. "\n " +
  33028. _vm._s(_vm.t("el.datepicker.today")) +
  33029. "\n "
  33030. )
  33031. ]
  33032. ),
  33033. _c(
  33034. "el-button",
  33035. {
  33036. attrs: { type: "plain", size: "mini" },
  33037. on: {
  33038. click: function($event) {
  33039. _vm.selectDate("next-month")
  33040. }
  33041. }
  33042. },
  33043. [
  33044. _vm._v(
  33045. "\n " +
  33046. _vm._s(_vm.t("el.datepicker.nextMonth")) +
  33047. "\n "
  33048. )
  33049. ]
  33050. )
  33051. ],
  33052. 1
  33053. )
  33054. ],
  33055. 1
  33056. )
  33057. : _vm._e()
  33058. ]),
  33059. _vm.validatedRange.length === 0
  33060. ? _c(
  33061. "div",
  33062. { key: "no-range", staticClass: "el-calendar__body" },
  33063. [
  33064. _c("date-table", {
  33065. attrs: { date: _vm.date, "selected-day": _vm.realSelectedDay },
  33066. on: { pick: _vm.pickDay }
  33067. })
  33068. ],
  33069. 1
  33070. )
  33071. : _c(
  33072. "div",
  33073. { key: "has-range", staticClass: "el-calendar__body" },
  33074. _vm._l(_vm.validatedRange, function(range, index) {
  33075. return _c("date-table", {
  33076. key: index,
  33077. attrs: {
  33078. date: range[0],
  33079. "selected-day": _vm.realSelectedDay,
  33080. range: range,
  33081. "hide-header": index !== 0
  33082. },
  33083. on: { pick: _vm.pickDay }
  33084. })
  33085. }),
  33086. 1
  33087. )
  33088. ])
  33089. }
  33090. var mainvue_type_template_id_6d9756be_staticRenderFns = []
  33091. mainvue_type_template_id_6d9756be_render._withStripped = true
  33092. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
  33093. // EXTERNAL MODULE: external "element-ui/lib/utils/date"
  33094. var date_ = __webpack_require__(17);
  33095. var date_default = /*#__PURE__*/__webpack_require__.n(date_);
  33096. // 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&
  33097. /* harmony default export */ var src_date_tablevue_type_script_lang_js_ = ({
  33098. props: {
  33099. selectedDay: String, // formated date yyyy-MM-dd
  33100. range: {
  33101. type: Array,
  33102. validator: function validator(val) {
  33103. if (!(val && val.length)) return true;
  33104. var start = val[0],
  33105. end = val[1];
  33106. return Object(date_util_["validateRangeInOneMonth"])(start, end);
  33107. }
  33108. },
  33109. date: Date,
  33110. hideHeader: Boolean
  33111. },
  33112. inject: ['elCalendar'],
  33113. methods: {
  33114. toNestedArr: function toNestedArr(days) {
  33115. return Object(date_util_["range"])(days.length / 7).map(function (_, index) {
  33116. var start = index * 7;
  33117. return days.slice(start, start + 7);
  33118. });
  33119. },
  33120. getFormateDate: function getFormateDate(day, type) {
  33121. if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) {
  33122. throw new Error('invalid day or type');
  33123. }
  33124. var prefix = this.curMonthDatePrefix;
  33125. if (type === 'prev') {
  33126. prefix = this.prevMonthDatePrefix;
  33127. } else if (type === 'next') {
  33128. prefix = this.nextMonthDatePrefix;
  33129. }
  33130. day = ('00' + day).slice(-2);
  33131. return prefix + '-' + day;
  33132. },
  33133. getCellClass: function getCellClass(_ref) {
  33134. var text = _ref.text,
  33135. type = _ref.type;
  33136. var classes = [type];
  33137. if (type === 'current') {
  33138. var date = this.getFormateDate(text, type);
  33139. if (date === this.selectedDay) {
  33140. classes.push('is-selected');
  33141. }
  33142. if (date === this.formatedToday) {
  33143. classes.push('is-today');
  33144. }
  33145. }
  33146. return classes;
  33147. },
  33148. pickDay: function pickDay(_ref2) {
  33149. var text = _ref2.text,
  33150. type = _ref2.type;
  33151. var date = this.getFormateDate(text, type);
  33152. this.$emit('pick', date);
  33153. },
  33154. cellRenderProxy: function cellRenderProxy(_ref3) {
  33155. var text = _ref3.text,
  33156. type = _ref3.type;
  33157. var h = this.$createElement;
  33158. var render = this.elCalendar.$scopedSlots.dateCell;
  33159. if (!render) return h('span', [text]);
  33160. var day = this.getFormateDate(text, type);
  33161. var date = new Date(day);
  33162. var data = {
  33163. isSelected: this.selectedDay === day,
  33164. type: type + '-month',
  33165. day: day
  33166. };
  33167. return render({ date: date, data: data });
  33168. }
  33169. },
  33170. computed: {
  33171. prevMonthDatePrefix: function prevMonthDatePrefix() {
  33172. var temp = new Date(this.date.getTime());
  33173. temp.setDate(0);
  33174. return date_default.a.format(temp, 'yyyy-MM');
  33175. },
  33176. curMonthDatePrefix: function curMonthDatePrefix() {
  33177. return date_default.a.format(this.date, 'yyyy-MM');
  33178. },
  33179. nextMonthDatePrefix: function nextMonthDatePrefix() {
  33180. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  33181. return date_default.a.format(temp, 'yyyy-MM');
  33182. },
  33183. formatedToday: function formatedToday() {
  33184. return this.elCalendar.formatedToday;
  33185. },
  33186. isInRange: function isInRange() {
  33187. return this.range && this.range.length;
  33188. },
  33189. rows: function rows() {
  33190. var days = [];
  33191. // if range exists, should render days in range.
  33192. if (this.isInRange) {
  33193. var _range = this.range,
  33194. start = _range[0],
  33195. end = _range[1];
  33196. var currentMonthRange = Object(date_util_["range"])(end.getDate() - start.getDate() + 1).map(function (_, index) {
  33197. return {
  33198. text: start.getDate() + index,
  33199. type: 'current'
  33200. };
  33201. });
  33202. var remaining = currentMonthRange.length % 7;
  33203. remaining = remaining === 0 ? 0 : 7 - remaining;
  33204. var nextMonthRange = Object(date_util_["range"])(remaining).map(function (_, index) {
  33205. return {
  33206. text: index + 1,
  33207. type: 'next'
  33208. };
  33209. });
  33210. days = currentMonthRange.concat(nextMonthRange);
  33211. } else {
  33212. var date = this.date;
  33213. var firstDay = Object(date_util_["getFirstDayOfMonth"])(date);
  33214. var prevMonthDays = Object(date_util_["getPrevMonthLastDays"])(date, firstDay - 1).map(function (day) {
  33215. return {
  33216. text: day,
  33217. type: 'prev'
  33218. };
  33219. });
  33220. var currentMonthDays = Object(date_util_["getMonthDays"])(date).map(function (day) {
  33221. return {
  33222. text: day,
  33223. type: 'current'
  33224. };
  33225. });
  33226. days = [].concat(prevMonthDays, currentMonthDays);
  33227. var nextMonthDays = Object(date_util_["range"])(42 - days.length).map(function (_, index) {
  33228. return {
  33229. text: index + 1,
  33230. type: 'next'
  33231. };
  33232. });
  33233. days = days.concat(nextMonthDays);
  33234. }
  33235. return this.toNestedArr(days);
  33236. }
  33237. },
  33238. data: function data() {
  33239. var dayNames = Object(date_util_["getI18nSettings"])().dayNames;
  33240. return {
  33241. DAYS: dayNames.slice(1).concat(dayNames[0])
  33242. };
  33243. },
  33244. render: function render() {
  33245. var _this = this;
  33246. var h = arguments[0];
  33247. var thead = this.hideHeader ? null : h('thead', [this.DAYS.map(function (day) {
  33248. return h(
  33249. 'th',
  33250. { key: day },
  33251. [day]
  33252. );
  33253. })]);
  33254. return h(
  33255. 'table',
  33256. {
  33257. 'class': {
  33258. 'el-calendar-table': true,
  33259. 'is-range': this.isInRange
  33260. },
  33261. attrs: { cellspacing: '0',
  33262. cellpadding: '0' }
  33263. },
  33264. [thead, h('tbody', [this.rows.map(function (row, index) {
  33265. return h(
  33266. 'tr',
  33267. {
  33268. 'class': {
  33269. 'el-calendar-table__row': true,
  33270. 'el-calendar-table__row--hide-border': index === 0 && _this.hideHeader
  33271. },
  33272. key: index },
  33273. [row.map(function (cell, key) {
  33274. return h(
  33275. 'td',
  33276. { key: key,
  33277. 'class': _this.getCellClass(cell),
  33278. on: {
  33279. 'click': _this.pickDay.bind(_this, cell)
  33280. }
  33281. },
  33282. [h(
  33283. 'div',
  33284. { 'class': 'el-calendar-day' },
  33285. [_this.cellRenderProxy(cell)]
  33286. )]
  33287. );
  33288. })]
  33289. );
  33290. })])]
  33291. );
  33292. }
  33293. });
  33294. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
  33295. /* harmony default export */ var calendar_src_date_tablevue_type_script_lang_js_ = (src_date_tablevue_type_script_lang_js_);
  33296. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue
  33297. var date_table_render, date_table_staticRenderFns
  33298. /* normalize component */
  33299. var src_date_table_component = normalizeComponent(
  33300. calendar_src_date_tablevue_type_script_lang_js_,
  33301. date_table_render,
  33302. date_table_staticRenderFns,
  33303. false,
  33304. null,
  33305. null,
  33306. null
  33307. )
  33308. /* hot reload */
  33309. if (false) { var src_date_table_api; }
  33310. src_date_table_component.options.__file = "packages/calendar/src/date-table.vue"
  33311. /* harmony default export */ var src_date_table = (src_date_table_component.exports);
  33312. // 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&
  33313. //
  33314. //
  33315. //
  33316. //
  33317. //
  33318. //
  33319. //
  33320. //
  33321. //
  33322. //
  33323. //
  33324. //
  33325. //
  33326. //
  33327. //
  33328. //
  33329. //
  33330. //
  33331. //
  33332. //
  33333. //
  33334. //
  33335. //
  33336. //
  33337. //
  33338. //
  33339. //
  33340. //
  33341. //
  33342. //
  33343. //
  33344. //
  33345. //
  33346. //
  33347. //
  33348. //
  33349. //
  33350. //
  33351. //
  33352. //
  33353. //
  33354. //
  33355. //
  33356. //
  33357. //
  33358. //
  33359. //
  33360. //
  33361. //
  33362. //
  33363. //
  33364. //
  33365. //
  33366. //
  33367. //
  33368. //
  33369. var validTypes = ['prev-month', 'today', 'next-month'];
  33370. var oneDay = 86400000;
  33371. /* harmony default export */ var calendar_src_mainvue_type_script_lang_js_ = ({
  33372. name: 'ElCalendar',
  33373. mixins: [locale_default.a],
  33374. components: {
  33375. DateTable: src_date_table
  33376. },
  33377. props: {
  33378. value: [Date, String, Number],
  33379. range: {
  33380. type: Array,
  33381. validator: function validator(range) {
  33382. if (Array.isArray(range)) {
  33383. return range.length === 2 && range.every(function (item) {
  33384. return typeof item === 'string' || typeof item === 'number' || item instanceof Date;
  33385. });
  33386. } else {
  33387. return true;
  33388. }
  33389. }
  33390. }
  33391. },
  33392. provide: function provide() {
  33393. return {
  33394. elCalendar: this
  33395. };
  33396. },
  33397. methods: {
  33398. pickDay: function pickDay(day) {
  33399. this.realSelectedDay = day;
  33400. },
  33401. selectDate: function selectDate(type) {
  33402. if (validTypes.indexOf(type) === -1) {
  33403. throw new Error('invalid type ' + type);
  33404. }
  33405. var day = '';
  33406. if (type === 'prev-month') {
  33407. day = this.prevMonthDatePrefix + '-01';
  33408. } else if (type === 'next-month') {
  33409. day = this.nextMonthDatePrefix + '-01';
  33410. } else {
  33411. day = this.formatedToday;
  33412. }
  33413. if (day === this.formatedDate) return;
  33414. this.pickDay(day);
  33415. },
  33416. toDate: function toDate(val) {
  33417. if (!val) {
  33418. throw new Error('invalid val');
  33419. }
  33420. return val instanceof Date ? val : new Date(val);
  33421. }
  33422. },
  33423. computed: {
  33424. prevMonthDatePrefix: function prevMonthDatePrefix() {
  33425. var temp = new Date(this.date.getTime());
  33426. temp.setDate(0);
  33427. return date_default.a.format(temp, 'yyyy-MM');
  33428. },
  33429. curMonthDatePrefix: function curMonthDatePrefix() {
  33430. return date_default.a.format(this.date, 'yyyy-MM');
  33431. },
  33432. nextMonthDatePrefix: function nextMonthDatePrefix() {
  33433. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  33434. return date_default.a.format(temp, 'yyyy-MM');
  33435. },
  33436. formatedDate: function formatedDate() {
  33437. return date_default.a.format(this.date, 'yyyy-MM-dd');
  33438. },
  33439. i18nDate: function i18nDate() {
  33440. var year = this.formatedDate.slice(0, 4);
  33441. var month = this.formatedDate.slice(5, 7).replace('0', '');
  33442. return year + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + month);
  33443. },
  33444. formatedToday: function formatedToday() {
  33445. return date_default.a.format(this.now, 'yyyy-MM-dd');
  33446. },
  33447. realSelectedDay: {
  33448. get: function get() {
  33449. if (!this.value) return this.selectedDay;
  33450. return this.formatedDate;
  33451. },
  33452. set: function set(val) {
  33453. this.selectedDay = val;
  33454. var date = new Date(val);
  33455. this.$emit('input', date);
  33456. }
  33457. },
  33458. date: function date() {
  33459. if (!this.value) {
  33460. if (this.realSelectedDay) {
  33461. return new Date(this.selectedDay);
  33462. } else if (this.validatedRange.length) {
  33463. return this.validatedRange[0][0];
  33464. }
  33465. return this.now;
  33466. } else {
  33467. return this.toDate(this.value);
  33468. }
  33469. },
  33470. // if range is valid, we get a two-digit array
  33471. validatedRange: function validatedRange() {
  33472. var _this = this;
  33473. var range = this.range;
  33474. if (!range) return [];
  33475. var expetedMap = {
  33476. 0: {
  33477. value: 1,
  33478. message: 'start of range should be Monday.'
  33479. },
  33480. 1: {
  33481. value: 0,
  33482. message: 'end of range should be Sunday.'
  33483. }
  33484. };
  33485. range = range.reduce(function (prev, val, index) {
  33486. var date = _this.toDate(val);
  33487. if (date.getDay() !== expetedMap[index].value) {
  33488. console.warn('[ElementCalendar]', expetedMap[index].message, ' invalid range will be ignored');
  33489. } else {
  33490. prev = prev.concat(date);
  33491. }
  33492. return prev;
  33493. }, []);
  33494. if (range.length === 2) {
  33495. var _range = range,
  33496. start = _range[0],
  33497. end = _range[1];
  33498. if (start > end) {
  33499. console.warn('[ElementCalendar]end time should be greater than start time');
  33500. return [];
  33501. }
  33502. // start time and end time in one month
  33503. if (Object(date_util_["validateRangeInOneMonth"])(start, end)) {
  33504. return [[start, end]];
  33505. }
  33506. var data = [];
  33507. var startDay = new Date(start.getFullYear(), start.getMonth() + 1, 1);
  33508. var lastDay = this.toDate(startDay.getTime() - oneDay);
  33509. if (!Object(date_util_["validateRangeInOneMonth"])(startDay, end)) {
  33510. console.warn('[ElementCalendar]start time and end time interval must not exceed two months');
  33511. return [];
  33512. }
  33513. data.push([start, lastDay]);
  33514. var interval = startDay.getDay();
  33515. interval = interval <= 1 ? Math.abs(interval - 1) : 8 - interval;
  33516. startDay = this.toDate(startDay.getTime() + interval * oneDay);
  33517. if (startDay.getDate() < end.getDate()) {
  33518. data.push([startDay, end]);
  33519. }
  33520. return data;
  33521. }
  33522. return [];
  33523. }
  33524. },
  33525. data: function data() {
  33526. return {
  33527. selectedDay: '',
  33528. now: new Date()
  33529. };
  33530. }
  33531. });
  33532. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=script&lang=js&
  33533. /* harmony default export */ var packages_calendar_src_mainvue_type_script_lang_js_ = (calendar_src_mainvue_type_script_lang_js_);
  33534. // CONCATENATED MODULE: ./packages/calendar/src/main.vue
  33535. /* normalize component */
  33536. var calendar_src_main_component = normalizeComponent(
  33537. packages_calendar_src_mainvue_type_script_lang_js_,
  33538. mainvue_type_template_id_6d9756be_render,
  33539. mainvue_type_template_id_6d9756be_staticRenderFns,
  33540. false,
  33541. null,
  33542. null,
  33543. null
  33544. )
  33545. /* hot reload */
  33546. if (false) { var calendar_src_main_api; }
  33547. calendar_src_main_component.options.__file = "packages/calendar/src/main.vue"
  33548. /* harmony default export */ var calendar_src_main = (calendar_src_main_component.exports);
  33549. // CONCATENATED MODULE: ./packages/calendar/index.js
  33550. /* istanbul ignore next */
  33551. calendar_src_main.install = function (Vue) {
  33552. Vue.component(calendar_src_main.name, calendar_src_main);
  33553. };
  33554. /* harmony default export */ var calendar = (calendar_src_main);
  33555. // CONCATENATED MODULE: ./src/index.js
  33556. /* Automatically generated by './build/bin/build-entry.js' */
  33557. 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, cascader, color_picker, transfer, container, header, aside, packages_main, footer, timeline, timeline_item, packages_link, divider, packages_image, calendar, collapse_transition_default.a];
  33558. var src_install = function install(Vue) {
  33559. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  33560. lib_locale_default.a.use(opts.locale);
  33561. lib_locale_default.a.i18n(opts.i18n);
  33562. components.forEach(function (component) {
  33563. Vue.component(component.name, component);
  33564. });
  33565. Vue.use(packages_loading.directive);
  33566. Vue.prototype.$ELEMENT = {
  33567. size: opts.size || '',
  33568. zIndex: opts.zIndex || 2000
  33569. };
  33570. Vue.prototype.$loading = packages_loading.service;
  33571. Vue.prototype.$msgbox = message_box;
  33572. Vue.prototype.$alert = message_box.alert;
  33573. Vue.prototype.$confirm = message_box.confirm;
  33574. Vue.prototype.$prompt = message_box.prompt;
  33575. Vue.prototype.$notify = notification;
  33576. Vue.prototype.$message = packages_message;
  33577. };
  33578. /* istanbul ignore if */
  33579. if (typeof window !== 'undefined' && window.Vue) {
  33580. src_install(window.Vue);
  33581. }
  33582. /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
  33583. version: '2.8.2',
  33584. locale: lib_locale_default.a.use,
  33585. i18n: lib_locale_default.a.i18n,
  33586. install: src_install,
  33587. CollapseTransition: collapse_transition_default.a,
  33588. Loading: packages_loading,
  33589. Pagination: packages_pagination,
  33590. Dialog: dialog,
  33591. Autocomplete: packages_autocomplete,
  33592. Dropdown: packages_dropdown,
  33593. DropdownMenu: packages_dropdown_menu,
  33594. DropdownItem: packages_dropdown_item,
  33595. Menu: packages_menu,
  33596. Submenu: packages_submenu,
  33597. MenuItem: packages_menu_item,
  33598. MenuItemGroup: packages_menu_item_group,
  33599. Input: packages_input,
  33600. InputNumber: packages_input_number,
  33601. Radio: packages_radio,
  33602. RadioGroup: packages_radio_group,
  33603. RadioButton: packages_radio_button,
  33604. Checkbox: packages_checkbox,
  33605. CheckboxButton: packages_checkbox_button,
  33606. CheckboxGroup: packages_checkbox_group,
  33607. Switch: packages_switch,
  33608. Select: packages_select,
  33609. Option: packages_option,
  33610. OptionGroup: packages_option_group,
  33611. Button: packages_button,
  33612. ButtonGroup: packages_button_group,
  33613. Table: packages_table,
  33614. TableColumn: packages_table_column,
  33615. DatePicker: packages_date_picker,
  33616. TimeSelect: packages_time_select,
  33617. TimePicker: packages_time_picker,
  33618. Popover: popover,
  33619. Tooltip: packages_tooltip,
  33620. MessageBox: message_box,
  33621. Breadcrumb: packages_breadcrumb,
  33622. BreadcrumbItem: packages_breadcrumb_item,
  33623. Form: packages_form,
  33624. FormItem: packages_form_item,
  33625. Tabs: packages_tabs,
  33626. TabPane: packages_tab_pane,
  33627. Tag: packages_tag,
  33628. Tree: packages_tree,
  33629. Alert: packages_alert,
  33630. Notification: notification,
  33631. Slider: slider,
  33632. Icon: packages_icon,
  33633. Row: packages_row,
  33634. Col: packages_col,
  33635. Upload: packages_upload,
  33636. Progress: packages_progress,
  33637. Spinner: packages_spinner,
  33638. Message: packages_message,
  33639. Badge: badge,
  33640. Card: card,
  33641. Rate: rate,
  33642. Steps: packages_steps,
  33643. Step: packages_step,
  33644. Carousel: carousel,
  33645. Scrollbar: scrollbar,
  33646. CarouselItem: carousel_item,
  33647. Collapse: packages_collapse,
  33648. CollapseItem: packages_collapse_item,
  33649. Cascader: cascader,
  33650. ColorPicker: color_picker,
  33651. Transfer: transfer,
  33652. Container: container,
  33653. Header: header,
  33654. Aside: aside,
  33655. Main: packages_main,
  33656. Footer: footer,
  33657. Timeline: timeline,
  33658. TimelineItem: timeline_item,
  33659. Link: packages_link,
  33660. Divider: divider,
  33661. Image: packages_image,
  33662. Calendar: calendar
  33663. });
  33664. /***/ })
  33665. /******/ ])["default"];