index.common.js 1.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681
  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 = "";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = "fb15");
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ "00ee":
  90. /***/ (function(module, exports, __webpack_require__) {
  91. var wellKnownSymbol = __webpack_require__("b622");
  92. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  93. var test = {};
  94. test[TO_STRING_TAG] = 'z';
  95. module.exports = String(test) === '[object z]';
  96. /***/ }),
  97. /***/ "0366":
  98. /***/ (function(module, exports, __webpack_require__) {
  99. var aFunction = __webpack_require__("1c0b");
  100. // optional / simple context binding
  101. module.exports = function (fn, that, length) {
  102. aFunction(fn);
  103. if (that === undefined) return fn;
  104. switch (length) {
  105. case 0: return function () {
  106. return fn.call(that);
  107. };
  108. case 1: return function (a) {
  109. return fn.call(that, a);
  110. };
  111. case 2: return function (a, b) {
  112. return fn.call(that, a, b);
  113. };
  114. case 3: return function (a, b, c) {
  115. return fn.call(that, a, b, c);
  116. };
  117. }
  118. return function (/* ...args */) {
  119. return fn.apply(that, arguments);
  120. };
  121. };
  122. /***/ }),
  123. /***/ "057f":
  124. /***/ (function(module, exports, __webpack_require__) {
  125. var toIndexedObject = __webpack_require__("fc6a");
  126. var nativeGetOwnPropertyNames = __webpack_require__("241c").f;
  127. var toString = {}.toString;
  128. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  129. ? Object.getOwnPropertyNames(window) : [];
  130. var getWindowNames = function (it) {
  131. try {
  132. return nativeGetOwnPropertyNames(it);
  133. } catch (error) {
  134. return windowNames.slice();
  135. }
  136. };
  137. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  138. module.exports.f = function getOwnPropertyNames(it) {
  139. return windowNames && toString.call(it) == '[object Window]'
  140. ? getWindowNames(it)
  141. : nativeGetOwnPropertyNames(toIndexedObject(it));
  142. };
  143. /***/ }),
  144. /***/ "06cf":
  145. /***/ (function(module, exports, __webpack_require__) {
  146. var DESCRIPTORS = __webpack_require__("83ab");
  147. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  148. var createPropertyDescriptor = __webpack_require__("5c6c");
  149. var toIndexedObject = __webpack_require__("fc6a");
  150. var toPrimitive = __webpack_require__("c04e");
  151. var has = __webpack_require__("5135");
  152. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  153. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  154. // `Object.getOwnPropertyDescriptor` method
  155. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  156. exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  157. O = toIndexedObject(O);
  158. P = toPrimitive(P, true);
  159. if (IE8_DOM_DEFINE) try {
  160. return nativeGetOwnPropertyDescriptor(O, P);
  161. } catch (error) { /* empty */ }
  162. if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
  163. };
  164. /***/ }),
  165. /***/ "0ccb":
  166. /***/ (function(module, exports, __webpack_require__) {
  167. // https://github.com/tc39/proposal-string-pad-start-end
  168. var toLength = __webpack_require__("50c4");
  169. var repeat = __webpack_require__("1148");
  170. var requireObjectCoercible = __webpack_require__("1d80");
  171. var ceil = Math.ceil;
  172. // `String.prototype.{ padStart, padEnd }` methods implementation
  173. var createMethod = function (IS_END) {
  174. return function ($this, maxLength, fillString) {
  175. var S = String(requireObjectCoercible($this));
  176. var stringLength = S.length;
  177. var fillStr = fillString === undefined ? ' ' : String(fillString);
  178. var intMaxLength = toLength(maxLength);
  179. var fillLen, stringFiller;
  180. if (intMaxLength <= stringLength || fillStr == '') return S;
  181. fillLen = intMaxLength - stringLength;
  182. stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
  183. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  184. return IS_END ? S + stringFiller : stringFiller + S;
  185. };
  186. };
  187. module.exports = {
  188. // `String.prototype.padStart` method
  189. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  190. start: createMethod(false),
  191. // `String.prototype.padEnd` method
  192. // https://tc39.github.io/ecma262/#sec-string.prototype.padend
  193. end: createMethod(true)
  194. };
  195. /***/ }),
  196. /***/ "0cfb":
  197. /***/ (function(module, exports, __webpack_require__) {
  198. var DESCRIPTORS = __webpack_require__("83ab");
  199. var fails = __webpack_require__("d039");
  200. var createElement = __webpack_require__("cc12");
  201. // Thank's IE8 for his funny defineProperty
  202. module.exports = !DESCRIPTORS && !fails(function () {
  203. return Object.defineProperty(createElement('div'), 'a', {
  204. get: function () { return 7; }
  205. }).a != 7;
  206. });
  207. /***/ }),
  208. /***/ "0d3b":
  209. /***/ (function(module, exports, __webpack_require__) {
  210. var fails = __webpack_require__("d039");
  211. var wellKnownSymbol = __webpack_require__("b622");
  212. var IS_PURE = __webpack_require__("c430");
  213. var ITERATOR = wellKnownSymbol('iterator');
  214. module.exports = !fails(function () {
  215. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  216. var searchParams = url.searchParams;
  217. var result = '';
  218. url.pathname = 'c%20d';
  219. searchParams.forEach(function (value, key) {
  220. searchParams['delete']('b');
  221. result += key + value;
  222. });
  223. return (IS_PURE && !url.toJSON)
  224. || !searchParams.sort
  225. || url.href !== 'http://a/c%20d?a=1&c=3'
  226. || searchParams.get('c') !== '3'
  227. || String(new URLSearchParams('?a=1')) !== 'a=1'
  228. || !searchParams[ITERATOR]
  229. // throws in Edge
  230. || new URL('https://a@b').username !== 'a'
  231. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  232. // not punycoded in Edge
  233. || new URL('http://тест').host !== 'xn--e1aybc'
  234. // not escaped in Chrome 62-
  235. || new URL('http://a#б').hash !== '#%D0%B1'
  236. // fails in Chrome 66-
  237. || result !== 'a1c3'
  238. // throws in Safari
  239. || new URL('http://x', undefined).host !== 'x';
  240. });
  241. /***/ }),
  242. /***/ "1148":
  243. /***/ (function(module, exports, __webpack_require__) {
  244. "use strict";
  245. var toInteger = __webpack_require__("a691");
  246. var requireObjectCoercible = __webpack_require__("1d80");
  247. // `String.prototype.repeat` method implementation
  248. // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
  249. module.exports = ''.repeat || function repeat(count) {
  250. var str = String(requireObjectCoercible(this));
  251. var result = '';
  252. var n = toInteger(count);
  253. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  254. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  255. return result;
  256. };
  257. /***/ }),
  258. /***/ "1276":
  259. /***/ (function(module, exports, __webpack_require__) {
  260. "use strict";
  261. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  262. var isRegExp = __webpack_require__("44e7");
  263. var anObject = __webpack_require__("825a");
  264. var requireObjectCoercible = __webpack_require__("1d80");
  265. var speciesConstructor = __webpack_require__("4840");
  266. var advanceStringIndex = __webpack_require__("8aa5");
  267. var toLength = __webpack_require__("50c4");
  268. var callRegExpExec = __webpack_require__("14c3");
  269. var regexpExec = __webpack_require__("9263");
  270. var fails = __webpack_require__("d039");
  271. var arrayPush = [].push;
  272. var min = Math.min;
  273. var MAX_UINT32 = 0xFFFFFFFF;
  274. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  275. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  276. // @@split logic
  277. fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  278. var internalSplit;
  279. if (
  280. 'abbc'.split(/(b)*/)[1] == 'c' ||
  281. 'test'.split(/(?:)/, -1).length != 4 ||
  282. 'ab'.split(/(?:ab)*/).length != 2 ||
  283. '.'.split(/(.?)(.?)/).length != 4 ||
  284. '.'.split(/()()/).length > 1 ||
  285. ''.split(/.?/).length
  286. ) {
  287. // based on es5-shim implementation, need to rework it
  288. internalSplit = function (separator, limit) {
  289. var string = String(requireObjectCoercible(this));
  290. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  291. if (lim === 0) return [];
  292. if (separator === undefined) return [string];
  293. // If `separator` is not a regex, use native split
  294. if (!isRegExp(separator)) {
  295. return nativeSplit.call(string, separator, lim);
  296. }
  297. var output = [];
  298. var flags = (separator.ignoreCase ? 'i' : '') +
  299. (separator.multiline ? 'm' : '') +
  300. (separator.unicode ? 'u' : '') +
  301. (separator.sticky ? 'y' : '');
  302. var lastLastIndex = 0;
  303. // Make `global` and avoid `lastIndex` issues by working with a copy
  304. var separatorCopy = new RegExp(separator.source, flags + 'g');
  305. var match, lastIndex, lastLength;
  306. while (match = regexpExec.call(separatorCopy, string)) {
  307. lastIndex = separatorCopy.lastIndex;
  308. if (lastIndex > lastLastIndex) {
  309. output.push(string.slice(lastLastIndex, match.index));
  310. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  311. lastLength = match[0].length;
  312. lastLastIndex = lastIndex;
  313. if (output.length >= lim) break;
  314. }
  315. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  316. }
  317. if (lastLastIndex === string.length) {
  318. if (lastLength || !separatorCopy.test('')) output.push('');
  319. } else output.push(string.slice(lastLastIndex));
  320. return output.length > lim ? output.slice(0, lim) : output;
  321. };
  322. // Chakra, V8
  323. } else if ('0'.split(undefined, 0).length) {
  324. internalSplit = function (separator, limit) {
  325. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  326. };
  327. } else internalSplit = nativeSplit;
  328. return [
  329. // `String.prototype.split` method
  330. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  331. function split(separator, limit) {
  332. var O = requireObjectCoercible(this);
  333. var splitter = separator == undefined ? undefined : separator[SPLIT];
  334. return splitter !== undefined
  335. ? splitter.call(separator, O, limit)
  336. : internalSplit.call(String(O), separator, limit);
  337. },
  338. // `RegExp.prototype[@@split]` method
  339. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  340. //
  341. // NOTE: This cannot be properly polyfilled in engines that don't support
  342. // the 'y' flag.
  343. function (regexp, limit) {
  344. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  345. if (res.done) return res.value;
  346. var rx = anObject(regexp);
  347. var S = String(this);
  348. var C = speciesConstructor(rx, RegExp);
  349. var unicodeMatching = rx.unicode;
  350. var flags = (rx.ignoreCase ? 'i' : '') +
  351. (rx.multiline ? 'm' : '') +
  352. (rx.unicode ? 'u' : '') +
  353. (SUPPORTS_Y ? 'y' : 'g');
  354. // ^(? + rx + ) is needed, in combination with some S slicing, to
  355. // simulate the 'y' flag.
  356. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  357. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  358. if (lim === 0) return [];
  359. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  360. var p = 0;
  361. var q = 0;
  362. var A = [];
  363. while (q < S.length) {
  364. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  365. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  366. var e;
  367. if (
  368. z === null ||
  369. (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  370. ) {
  371. q = advanceStringIndex(S, q, unicodeMatching);
  372. } else {
  373. A.push(S.slice(p, q));
  374. if (A.length === lim) return A;
  375. for (var i = 1; i <= z.length - 1; i++) {
  376. A.push(z[i]);
  377. if (A.length === lim) return A;
  378. }
  379. q = p = e;
  380. }
  381. }
  382. A.push(S.slice(p));
  383. return A;
  384. }
  385. ];
  386. }, !SUPPORTS_Y);
  387. /***/ }),
  388. /***/ "13d5":
  389. /***/ (function(module, exports, __webpack_require__) {
  390. "use strict";
  391. var $ = __webpack_require__("23e7");
  392. var $reduce = __webpack_require__("d58f").left;
  393. var arrayMethodIsStrict = __webpack_require__("a640");
  394. var arrayMethodUsesToLength = __webpack_require__("ae40");
  395. var CHROME_VERSION = __webpack_require__("2d00");
  396. var IS_NODE = __webpack_require__("605d");
  397. var STRICT_METHOD = arrayMethodIsStrict('reduce');
  398. var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
  399. // Chrome 80-82 has a critical bug
  400. // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
  401. var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
  402. // `Array.prototype.reduce` method
  403. // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
  404. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
  405. reduce: function reduce(callbackfn /* , initialValue */) {
  406. return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  407. }
  408. });
  409. /***/ }),
  410. /***/ "14c3":
  411. /***/ (function(module, exports, __webpack_require__) {
  412. var classof = __webpack_require__("c6b6");
  413. var regexpExec = __webpack_require__("9263");
  414. // `RegExpExec` abstract operation
  415. // https://tc39.github.io/ecma262/#sec-regexpexec
  416. module.exports = function (R, S) {
  417. var exec = R.exec;
  418. if (typeof exec === 'function') {
  419. var result = exec.call(R, S);
  420. if (typeof result !== 'object') {
  421. throw TypeError('RegExp exec method returned something other than an Object or null');
  422. }
  423. return result;
  424. }
  425. if (classof(R) !== 'RegExp') {
  426. throw TypeError('RegExp#exec called on incompatible receiver');
  427. }
  428. return regexpExec.call(R, S);
  429. };
  430. /***/ }),
  431. /***/ "159b":
  432. /***/ (function(module, exports, __webpack_require__) {
  433. var global = __webpack_require__("da84");
  434. var DOMIterables = __webpack_require__("fdbc");
  435. var forEach = __webpack_require__("17c2");
  436. var createNonEnumerableProperty = __webpack_require__("9112");
  437. for (var COLLECTION_NAME in DOMIterables) {
  438. var Collection = global[COLLECTION_NAME];
  439. var CollectionPrototype = Collection && Collection.prototype;
  440. // some Chrome versions have non-configurable methods on DOMTokenList
  441. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  442. createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  443. } catch (error) {
  444. CollectionPrototype.forEach = forEach;
  445. }
  446. }
  447. /***/ }),
  448. /***/ "17c2":
  449. /***/ (function(module, exports, __webpack_require__) {
  450. "use strict";
  451. var $forEach = __webpack_require__("b727").forEach;
  452. var arrayMethodIsStrict = __webpack_require__("a640");
  453. var arrayMethodUsesToLength = __webpack_require__("ae40");
  454. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  455. var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
  456. // `Array.prototype.forEach` method implementation
  457. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  458. module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
  459. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  460. } : [].forEach;
  461. /***/ }),
  462. /***/ "19aa":
  463. /***/ (function(module, exports) {
  464. module.exports = function (it, Constructor, name) {
  465. if (!(it instanceof Constructor)) {
  466. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  467. } return it;
  468. };
  469. /***/ }),
  470. /***/ "1a97":
  471. /***/ (function(module, exports, __webpack_require__) {
  472. // extracted by mini-css-extract-plugin
  473. /***/ }),
  474. /***/ "1be4":
  475. /***/ (function(module, exports, __webpack_require__) {
  476. var getBuiltIn = __webpack_require__("d066");
  477. module.exports = getBuiltIn('document', 'documentElement');
  478. /***/ }),
  479. /***/ "1c0b":
  480. /***/ (function(module, exports) {
  481. module.exports = function (it) {
  482. if (typeof it != 'function') {
  483. throw TypeError(String(it) + ' is not a function');
  484. } return it;
  485. };
  486. /***/ }),
  487. /***/ "1c7e":
  488. /***/ (function(module, exports, __webpack_require__) {
  489. var wellKnownSymbol = __webpack_require__("b622");
  490. var ITERATOR = wellKnownSymbol('iterator');
  491. var SAFE_CLOSING = false;
  492. try {
  493. var called = 0;
  494. var iteratorWithReturn = {
  495. next: function () {
  496. return { done: !!called++ };
  497. },
  498. 'return': function () {
  499. SAFE_CLOSING = true;
  500. }
  501. };
  502. iteratorWithReturn[ITERATOR] = function () {
  503. return this;
  504. };
  505. // eslint-disable-next-line no-throw-literal
  506. Array.from(iteratorWithReturn, function () { throw 2; });
  507. } catch (error) { /* empty */ }
  508. module.exports = function (exec, SKIP_CLOSING) {
  509. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  510. var ITERATION_SUPPORT = false;
  511. try {
  512. var object = {};
  513. object[ITERATOR] = function () {
  514. return {
  515. next: function () {
  516. return { done: ITERATION_SUPPORT = true };
  517. }
  518. };
  519. };
  520. exec(object);
  521. } catch (error) { /* empty */ }
  522. return ITERATION_SUPPORT;
  523. };
  524. /***/ }),
  525. /***/ "1d80":
  526. /***/ (function(module, exports) {
  527. // `RequireObjectCoercible` abstract operation
  528. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  529. module.exports = function (it) {
  530. if (it == undefined) throw TypeError("Can't call method on " + it);
  531. return it;
  532. };
  533. /***/ }),
  534. /***/ "1dde":
  535. /***/ (function(module, exports, __webpack_require__) {
  536. var fails = __webpack_require__("d039");
  537. var wellKnownSymbol = __webpack_require__("b622");
  538. var V8_VERSION = __webpack_require__("2d00");
  539. var SPECIES = wellKnownSymbol('species');
  540. module.exports = function (METHOD_NAME) {
  541. // We can't use this feature detection in V8 since it causes
  542. // deoptimization and serious performance degradation
  543. // https://github.com/zloirock/core-js/issues/677
  544. return V8_VERSION >= 51 || !fails(function () {
  545. var array = [];
  546. var constructor = array.constructor = {};
  547. constructor[SPECIES] = function () {
  548. return { foo: 1 };
  549. };
  550. return array[METHOD_NAME](Boolean).foo !== 1;
  551. });
  552. };
  553. /***/ }),
  554. /***/ "2266":
  555. /***/ (function(module, exports, __webpack_require__) {
  556. var anObject = __webpack_require__("825a");
  557. var isArrayIteratorMethod = __webpack_require__("e95a");
  558. var toLength = __webpack_require__("50c4");
  559. var bind = __webpack_require__("0366");
  560. var getIteratorMethod = __webpack_require__("35a1");
  561. var iteratorClose = __webpack_require__("2a62");
  562. var Result = function (stopped, result) {
  563. this.stopped = stopped;
  564. this.result = result;
  565. };
  566. module.exports = function (iterable, unboundFunction, options) {
  567. var that = options && options.that;
  568. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  569. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  570. var INTERRUPTED = !!(options && options.INTERRUPTED);
  571. var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
  572. var iterator, iterFn, index, length, result, next, step;
  573. var stop = function (condition) {
  574. if (iterator) iteratorClose(iterator);
  575. return new Result(true, condition);
  576. };
  577. var callFn = function (value) {
  578. if (AS_ENTRIES) {
  579. anObject(value);
  580. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  581. } return INTERRUPTED ? fn(value, stop) : fn(value);
  582. };
  583. if (IS_ITERATOR) {
  584. iterator = iterable;
  585. } else {
  586. iterFn = getIteratorMethod(iterable);
  587. if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
  588. // optimisation for array iterators
  589. if (isArrayIteratorMethod(iterFn)) {
  590. for (index = 0, length = toLength(iterable.length); length > index; index++) {
  591. result = callFn(iterable[index]);
  592. if (result && result instanceof Result) return result;
  593. } return new Result(false);
  594. }
  595. iterator = iterFn.call(iterable);
  596. }
  597. next = iterator.next;
  598. while (!(step = next.call(iterator)).done) {
  599. try {
  600. result = callFn(step.value);
  601. } catch (error) {
  602. iteratorClose(iterator);
  603. throw error;
  604. }
  605. if (typeof result == 'object' && result && result instanceof Result) return result;
  606. } return new Result(false);
  607. };
  608. /***/ }),
  609. /***/ "23cb":
  610. /***/ (function(module, exports, __webpack_require__) {
  611. var toInteger = __webpack_require__("a691");
  612. var max = Math.max;
  613. var min = Math.min;
  614. // Helper for a popular repeating case of the spec:
  615. // Let integer be ? ToInteger(index).
  616. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  617. module.exports = function (index, length) {
  618. var integer = toInteger(index);
  619. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  620. };
  621. /***/ }),
  622. /***/ "23e7":
  623. /***/ (function(module, exports, __webpack_require__) {
  624. var global = __webpack_require__("da84");
  625. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  626. var createNonEnumerableProperty = __webpack_require__("9112");
  627. var redefine = __webpack_require__("6eeb");
  628. var setGlobal = __webpack_require__("ce4e");
  629. var copyConstructorProperties = __webpack_require__("e893");
  630. var isForced = __webpack_require__("94ca");
  631. /*
  632. options.target - name of the target object
  633. options.global - target is the global object
  634. options.stat - export as static methods of target
  635. options.proto - export as prototype methods of target
  636. options.real - real prototype method for the `pure` version
  637. options.forced - export even if the native feature is available
  638. options.bind - bind methods to the target, required for the `pure` version
  639. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  640. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  641. options.sham - add a flag to not completely full polyfills
  642. options.enumerable - export as enumerable property
  643. options.noTargetGet - prevent calling a getter on target
  644. */
  645. module.exports = function (options, source) {
  646. var TARGET = options.target;
  647. var GLOBAL = options.global;
  648. var STATIC = options.stat;
  649. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  650. if (GLOBAL) {
  651. target = global;
  652. } else if (STATIC) {
  653. target = global[TARGET] || setGlobal(TARGET, {});
  654. } else {
  655. target = (global[TARGET] || {}).prototype;
  656. }
  657. if (target) for (key in source) {
  658. sourceProperty = source[key];
  659. if (options.noTargetGet) {
  660. descriptor = getOwnPropertyDescriptor(target, key);
  661. targetProperty = descriptor && descriptor.value;
  662. } else targetProperty = target[key];
  663. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  664. // contained in target
  665. if (!FORCED && targetProperty !== undefined) {
  666. if (typeof sourceProperty === typeof targetProperty) continue;
  667. copyConstructorProperties(sourceProperty, targetProperty);
  668. }
  669. // add a flag to not completely full polyfills
  670. if (options.sham || (targetProperty && targetProperty.sham)) {
  671. createNonEnumerableProperty(sourceProperty, 'sham', true);
  672. }
  673. // extend global
  674. redefine(target, key, sourceProperty, options);
  675. }
  676. };
  677. /***/ }),
  678. /***/ "241c":
  679. /***/ (function(module, exports, __webpack_require__) {
  680. var internalObjectKeys = __webpack_require__("ca84");
  681. var enumBugKeys = __webpack_require__("7839");
  682. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  683. // `Object.getOwnPropertyNames` method
  684. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  685. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  686. return internalObjectKeys(O, hiddenKeys);
  687. };
  688. /***/ }),
  689. /***/ "2532":
  690. /***/ (function(module, exports, __webpack_require__) {
  691. "use strict";
  692. var $ = __webpack_require__("23e7");
  693. var notARegExp = __webpack_require__("5a34");
  694. var requireObjectCoercible = __webpack_require__("1d80");
  695. var correctIsRegExpLogic = __webpack_require__("ab13");
  696. // `String.prototype.includes` method
  697. // https://tc39.github.io/ecma262/#sec-string.prototype.includes
  698. $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
  699. includes: function includes(searchString /* , position = 0 */) {
  700. return !!~String(requireObjectCoercible(this))
  701. .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  702. }
  703. });
  704. /***/ }),
  705. /***/ "25f0":
  706. /***/ (function(module, exports, __webpack_require__) {
  707. "use strict";
  708. var redefine = __webpack_require__("6eeb");
  709. var anObject = __webpack_require__("825a");
  710. var fails = __webpack_require__("d039");
  711. var flags = __webpack_require__("ad6d");
  712. var TO_STRING = 'toString';
  713. var RegExpPrototype = RegExp.prototype;
  714. var nativeToString = RegExpPrototype[TO_STRING];
  715. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  716. // FF44- RegExp#toString has a wrong name
  717. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  718. // `RegExp.prototype.toString` method
  719. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  720. if (NOT_GENERIC || INCORRECT_NAME) {
  721. redefine(RegExp.prototype, TO_STRING, function toString() {
  722. var R = anObject(this);
  723. var p = String(R.source);
  724. var rf = R.flags;
  725. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
  726. return '/' + p + '/' + f;
  727. }, { unsafe: true });
  728. }
  729. /***/ }),
  730. /***/ "2626":
  731. /***/ (function(module, exports, __webpack_require__) {
  732. "use strict";
  733. var getBuiltIn = __webpack_require__("d066");
  734. var definePropertyModule = __webpack_require__("9bf2");
  735. var wellKnownSymbol = __webpack_require__("b622");
  736. var DESCRIPTORS = __webpack_require__("83ab");
  737. var SPECIES = wellKnownSymbol('species');
  738. module.exports = function (CONSTRUCTOR_NAME) {
  739. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  740. var defineProperty = definePropertyModule.f;
  741. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  742. defineProperty(Constructor, SPECIES, {
  743. configurable: true,
  744. get: function () { return this; }
  745. });
  746. }
  747. };
  748. /***/ }),
  749. /***/ "2a62":
  750. /***/ (function(module, exports, __webpack_require__) {
  751. var anObject = __webpack_require__("825a");
  752. module.exports = function (iterator) {
  753. var returnMethod = iterator['return'];
  754. if (returnMethod !== undefined) {
  755. return anObject(returnMethod.call(iterator)).value;
  756. }
  757. };
  758. /***/ }),
  759. /***/ "2b3d":
  760. /***/ (function(module, exports, __webpack_require__) {
  761. "use strict";
  762. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  763. __webpack_require__("3ca3");
  764. var $ = __webpack_require__("23e7");
  765. var DESCRIPTORS = __webpack_require__("83ab");
  766. var USE_NATIVE_URL = __webpack_require__("0d3b");
  767. var global = __webpack_require__("da84");
  768. var defineProperties = __webpack_require__("37e8");
  769. var redefine = __webpack_require__("6eeb");
  770. var anInstance = __webpack_require__("19aa");
  771. var has = __webpack_require__("5135");
  772. var assign = __webpack_require__("60da");
  773. var arrayFrom = __webpack_require__("4df4");
  774. var codeAt = __webpack_require__("6547").codeAt;
  775. var toASCII = __webpack_require__("5fb2");
  776. var setToStringTag = __webpack_require__("d44e");
  777. var URLSearchParamsModule = __webpack_require__("9861");
  778. var InternalStateModule = __webpack_require__("69f3");
  779. var NativeURL = global.URL;
  780. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  781. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  782. var setInternalState = InternalStateModule.set;
  783. var getInternalURLState = InternalStateModule.getterFor('URL');
  784. var floor = Math.floor;
  785. var pow = Math.pow;
  786. var INVALID_AUTHORITY = 'Invalid authority';
  787. var INVALID_SCHEME = 'Invalid scheme';
  788. var INVALID_HOST = 'Invalid host';
  789. var INVALID_PORT = 'Invalid port';
  790. var ALPHA = /[A-Za-z]/;
  791. var ALPHANUMERIC = /[\d+-.A-Za-z]/;
  792. var DIGIT = /\d/;
  793. var HEX_START = /^(0x|0X)/;
  794. var OCT = /^[0-7]+$/;
  795. var DEC = /^\d+$/;
  796. var HEX = /^[\dA-Fa-f]+$/;
  797. // eslint-disable-next-line no-control-regex
  798. var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
  799. // eslint-disable-next-line no-control-regex
  800. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
  801. // eslint-disable-next-line no-control-regex
  802. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
  803. // eslint-disable-next-line no-control-regex
  804. var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
  805. var EOF;
  806. var parseHost = function (url, input) {
  807. var result, codePoints, index;
  808. if (input.charAt(0) == '[') {
  809. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  810. result = parseIPv6(input.slice(1, -1));
  811. if (!result) return INVALID_HOST;
  812. url.host = result;
  813. // opaque host
  814. } else if (!isSpecial(url)) {
  815. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  816. result = '';
  817. codePoints = arrayFrom(input);
  818. for (index = 0; index < codePoints.length; index++) {
  819. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  820. }
  821. url.host = result;
  822. } else {
  823. input = toASCII(input);
  824. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  825. result = parseIPv4(input);
  826. if (result === null) return INVALID_HOST;
  827. url.host = result;
  828. }
  829. };
  830. var parseIPv4 = function (input) {
  831. var parts = input.split('.');
  832. var partsLength, numbers, index, part, radix, number, ipv4;
  833. if (parts.length && parts[parts.length - 1] == '') {
  834. parts.pop();
  835. }
  836. partsLength = parts.length;
  837. if (partsLength > 4) return input;
  838. numbers = [];
  839. for (index = 0; index < partsLength; index++) {
  840. part = parts[index];
  841. if (part == '') return input;
  842. radix = 10;
  843. if (part.length > 1 && part.charAt(0) == '0') {
  844. radix = HEX_START.test(part) ? 16 : 8;
  845. part = part.slice(radix == 8 ? 1 : 2);
  846. }
  847. if (part === '') {
  848. number = 0;
  849. } else {
  850. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  851. number = parseInt(part, radix);
  852. }
  853. numbers.push(number);
  854. }
  855. for (index = 0; index < partsLength; index++) {
  856. number = numbers[index];
  857. if (index == partsLength - 1) {
  858. if (number >= pow(256, 5 - partsLength)) return null;
  859. } else if (number > 255) return null;
  860. }
  861. ipv4 = numbers.pop();
  862. for (index = 0; index < numbers.length; index++) {
  863. ipv4 += numbers[index] * pow(256, 3 - index);
  864. }
  865. return ipv4;
  866. };
  867. // eslint-disable-next-line max-statements
  868. var parseIPv6 = function (input) {
  869. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  870. var pieceIndex = 0;
  871. var compress = null;
  872. var pointer = 0;
  873. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  874. var char = function () {
  875. return input.charAt(pointer);
  876. };
  877. if (char() == ':') {
  878. if (input.charAt(1) != ':') return;
  879. pointer += 2;
  880. pieceIndex++;
  881. compress = pieceIndex;
  882. }
  883. while (char()) {
  884. if (pieceIndex == 8) return;
  885. if (char() == ':') {
  886. if (compress !== null) return;
  887. pointer++;
  888. pieceIndex++;
  889. compress = pieceIndex;
  890. continue;
  891. }
  892. value = length = 0;
  893. while (length < 4 && HEX.test(char())) {
  894. value = value * 16 + parseInt(char(), 16);
  895. pointer++;
  896. length++;
  897. }
  898. if (char() == '.') {
  899. if (length == 0) return;
  900. pointer -= length;
  901. if (pieceIndex > 6) return;
  902. numbersSeen = 0;
  903. while (char()) {
  904. ipv4Piece = null;
  905. if (numbersSeen > 0) {
  906. if (char() == '.' && numbersSeen < 4) pointer++;
  907. else return;
  908. }
  909. if (!DIGIT.test(char())) return;
  910. while (DIGIT.test(char())) {
  911. number = parseInt(char(), 10);
  912. if (ipv4Piece === null) ipv4Piece = number;
  913. else if (ipv4Piece == 0) return;
  914. else ipv4Piece = ipv4Piece * 10 + number;
  915. if (ipv4Piece > 255) return;
  916. pointer++;
  917. }
  918. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  919. numbersSeen++;
  920. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  921. }
  922. if (numbersSeen != 4) return;
  923. break;
  924. } else if (char() == ':') {
  925. pointer++;
  926. if (!char()) return;
  927. } else if (char()) return;
  928. address[pieceIndex++] = value;
  929. }
  930. if (compress !== null) {
  931. swaps = pieceIndex - compress;
  932. pieceIndex = 7;
  933. while (pieceIndex != 0 && swaps > 0) {
  934. swap = address[pieceIndex];
  935. address[pieceIndex--] = address[compress + swaps - 1];
  936. address[compress + --swaps] = swap;
  937. }
  938. } else if (pieceIndex != 8) return;
  939. return address;
  940. };
  941. var findLongestZeroSequence = function (ipv6) {
  942. var maxIndex = null;
  943. var maxLength = 1;
  944. var currStart = null;
  945. var currLength = 0;
  946. var index = 0;
  947. for (; index < 8; index++) {
  948. if (ipv6[index] !== 0) {
  949. if (currLength > maxLength) {
  950. maxIndex = currStart;
  951. maxLength = currLength;
  952. }
  953. currStart = null;
  954. currLength = 0;
  955. } else {
  956. if (currStart === null) currStart = index;
  957. ++currLength;
  958. }
  959. }
  960. if (currLength > maxLength) {
  961. maxIndex = currStart;
  962. maxLength = currLength;
  963. }
  964. return maxIndex;
  965. };
  966. var serializeHost = function (host) {
  967. var result, index, compress, ignore0;
  968. // ipv4
  969. if (typeof host == 'number') {
  970. result = [];
  971. for (index = 0; index < 4; index++) {
  972. result.unshift(host % 256);
  973. host = floor(host / 256);
  974. } return result.join('.');
  975. // ipv6
  976. } else if (typeof host == 'object') {
  977. result = '';
  978. compress = findLongestZeroSequence(host);
  979. for (index = 0; index < 8; index++) {
  980. if (ignore0 && host[index] === 0) continue;
  981. if (ignore0) ignore0 = false;
  982. if (compress === index) {
  983. result += index ? ':' : '::';
  984. ignore0 = true;
  985. } else {
  986. result += host[index].toString(16);
  987. if (index < 7) result += ':';
  988. }
  989. }
  990. return '[' + result + ']';
  991. } return host;
  992. };
  993. var C0ControlPercentEncodeSet = {};
  994. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  995. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  996. });
  997. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  998. '#': 1, '?': 1, '{': 1, '}': 1
  999. });
  1000. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  1001. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  1002. });
  1003. var percentEncode = function (char, set) {
  1004. var code = codeAt(char, 0);
  1005. return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
  1006. };
  1007. var specialSchemes = {
  1008. ftp: 21,
  1009. file: null,
  1010. http: 80,
  1011. https: 443,
  1012. ws: 80,
  1013. wss: 443
  1014. };
  1015. var isSpecial = function (url) {
  1016. return has(specialSchemes, url.scheme);
  1017. };
  1018. var includesCredentials = function (url) {
  1019. return url.username != '' || url.password != '';
  1020. };
  1021. var cannotHaveUsernamePasswordPort = function (url) {
  1022. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  1023. };
  1024. var isWindowsDriveLetter = function (string, normalized) {
  1025. var second;
  1026. return string.length == 2 && ALPHA.test(string.charAt(0))
  1027. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  1028. };
  1029. var startsWithWindowsDriveLetter = function (string) {
  1030. var third;
  1031. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  1032. string.length == 2 ||
  1033. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  1034. );
  1035. };
  1036. var shortenURLsPath = function (url) {
  1037. var path = url.path;
  1038. var pathSize = path.length;
  1039. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  1040. path.pop();
  1041. }
  1042. };
  1043. var isSingleDot = function (segment) {
  1044. return segment === '.' || segment.toLowerCase() === '%2e';
  1045. };
  1046. var isDoubleDot = function (segment) {
  1047. segment = segment.toLowerCase();
  1048. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  1049. };
  1050. // States:
  1051. var SCHEME_START = {};
  1052. var SCHEME = {};
  1053. var NO_SCHEME = {};
  1054. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  1055. var PATH_OR_AUTHORITY = {};
  1056. var RELATIVE = {};
  1057. var RELATIVE_SLASH = {};
  1058. var SPECIAL_AUTHORITY_SLASHES = {};
  1059. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  1060. var AUTHORITY = {};
  1061. var HOST = {};
  1062. var HOSTNAME = {};
  1063. var PORT = {};
  1064. var FILE = {};
  1065. var FILE_SLASH = {};
  1066. var FILE_HOST = {};
  1067. var PATH_START = {};
  1068. var PATH = {};
  1069. var CANNOT_BE_A_BASE_URL_PATH = {};
  1070. var QUERY = {};
  1071. var FRAGMENT = {};
  1072. // eslint-disable-next-line max-statements
  1073. var parseURL = function (url, input, stateOverride, base) {
  1074. var state = stateOverride || SCHEME_START;
  1075. var pointer = 0;
  1076. var buffer = '';
  1077. var seenAt = false;
  1078. var seenBracket = false;
  1079. var seenPasswordToken = false;
  1080. var codePoints, char, bufferCodePoints, failure;
  1081. if (!stateOverride) {
  1082. url.scheme = '';
  1083. url.username = '';
  1084. url.password = '';
  1085. url.host = null;
  1086. url.port = null;
  1087. url.path = [];
  1088. url.query = null;
  1089. url.fragment = null;
  1090. url.cannotBeABaseURL = false;
  1091. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  1092. }
  1093. input = input.replace(TAB_AND_NEW_LINE, '');
  1094. codePoints = arrayFrom(input);
  1095. while (pointer <= codePoints.length) {
  1096. char = codePoints[pointer];
  1097. switch (state) {
  1098. case SCHEME_START:
  1099. if (char && ALPHA.test(char)) {
  1100. buffer += char.toLowerCase();
  1101. state = SCHEME;
  1102. } else if (!stateOverride) {
  1103. state = NO_SCHEME;
  1104. continue;
  1105. } else return INVALID_SCHEME;
  1106. break;
  1107. case SCHEME:
  1108. if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
  1109. buffer += char.toLowerCase();
  1110. } else if (char == ':') {
  1111. if (stateOverride && (
  1112. (isSpecial(url) != has(specialSchemes, buffer)) ||
  1113. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  1114. (url.scheme == 'file' && !url.host)
  1115. )) return;
  1116. url.scheme = buffer;
  1117. if (stateOverride) {
  1118. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  1119. return;
  1120. }
  1121. buffer = '';
  1122. if (url.scheme == 'file') {
  1123. state = FILE;
  1124. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  1125. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  1126. } else if (isSpecial(url)) {
  1127. state = SPECIAL_AUTHORITY_SLASHES;
  1128. } else if (codePoints[pointer + 1] == '/') {
  1129. state = PATH_OR_AUTHORITY;
  1130. pointer++;
  1131. } else {
  1132. url.cannotBeABaseURL = true;
  1133. url.path.push('');
  1134. state = CANNOT_BE_A_BASE_URL_PATH;
  1135. }
  1136. } else if (!stateOverride) {
  1137. buffer = '';
  1138. state = NO_SCHEME;
  1139. pointer = 0;
  1140. continue;
  1141. } else return INVALID_SCHEME;
  1142. break;
  1143. case NO_SCHEME:
  1144. if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
  1145. if (base.cannotBeABaseURL && char == '#') {
  1146. url.scheme = base.scheme;
  1147. url.path = base.path.slice();
  1148. url.query = base.query;
  1149. url.fragment = '';
  1150. url.cannotBeABaseURL = true;
  1151. state = FRAGMENT;
  1152. break;
  1153. }
  1154. state = base.scheme == 'file' ? FILE : RELATIVE;
  1155. continue;
  1156. case SPECIAL_RELATIVE_OR_AUTHORITY:
  1157. if (char == '/' && codePoints[pointer + 1] == '/') {
  1158. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1159. pointer++;
  1160. } else {
  1161. state = RELATIVE;
  1162. continue;
  1163. } break;
  1164. case PATH_OR_AUTHORITY:
  1165. if (char == '/') {
  1166. state = AUTHORITY;
  1167. break;
  1168. } else {
  1169. state = PATH;
  1170. continue;
  1171. }
  1172. case RELATIVE:
  1173. url.scheme = base.scheme;
  1174. if (char == EOF) {
  1175. url.username = base.username;
  1176. url.password = base.password;
  1177. url.host = base.host;
  1178. url.port = base.port;
  1179. url.path = base.path.slice();
  1180. url.query = base.query;
  1181. } else if (char == '/' || (char == '\\' && isSpecial(url))) {
  1182. state = RELATIVE_SLASH;
  1183. } else if (char == '?') {
  1184. url.username = base.username;
  1185. url.password = base.password;
  1186. url.host = base.host;
  1187. url.port = base.port;
  1188. url.path = base.path.slice();
  1189. url.query = '';
  1190. state = QUERY;
  1191. } else if (char == '#') {
  1192. url.username = base.username;
  1193. url.password = base.password;
  1194. url.host = base.host;
  1195. url.port = base.port;
  1196. url.path = base.path.slice();
  1197. url.query = base.query;
  1198. url.fragment = '';
  1199. state = FRAGMENT;
  1200. } else {
  1201. url.username = base.username;
  1202. url.password = base.password;
  1203. url.host = base.host;
  1204. url.port = base.port;
  1205. url.path = base.path.slice();
  1206. url.path.pop();
  1207. state = PATH;
  1208. continue;
  1209. } break;
  1210. case RELATIVE_SLASH:
  1211. if (isSpecial(url) && (char == '/' || char == '\\')) {
  1212. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1213. } else if (char == '/') {
  1214. state = AUTHORITY;
  1215. } else {
  1216. url.username = base.username;
  1217. url.password = base.password;
  1218. url.host = base.host;
  1219. url.port = base.port;
  1220. state = PATH;
  1221. continue;
  1222. } break;
  1223. case SPECIAL_AUTHORITY_SLASHES:
  1224. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1225. if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
  1226. pointer++;
  1227. break;
  1228. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  1229. if (char != '/' && char != '\\') {
  1230. state = AUTHORITY;
  1231. continue;
  1232. } break;
  1233. case AUTHORITY:
  1234. if (char == '@') {
  1235. if (seenAt) buffer = '%40' + buffer;
  1236. seenAt = true;
  1237. bufferCodePoints = arrayFrom(buffer);
  1238. for (var i = 0; i < bufferCodePoints.length; i++) {
  1239. var codePoint = bufferCodePoints[i];
  1240. if (codePoint == ':' && !seenPasswordToken) {
  1241. seenPasswordToken = true;
  1242. continue;
  1243. }
  1244. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  1245. if (seenPasswordToken) url.password += encodedCodePoints;
  1246. else url.username += encodedCodePoints;
  1247. }
  1248. buffer = '';
  1249. } else if (
  1250. char == EOF || char == '/' || char == '?' || char == '#' ||
  1251. (char == '\\' && isSpecial(url))
  1252. ) {
  1253. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  1254. pointer -= arrayFrom(buffer).length + 1;
  1255. buffer = '';
  1256. state = HOST;
  1257. } else buffer += char;
  1258. break;
  1259. case HOST:
  1260. case HOSTNAME:
  1261. if (stateOverride && url.scheme == 'file') {
  1262. state = FILE_HOST;
  1263. continue;
  1264. } else if (char == ':' && !seenBracket) {
  1265. if (buffer == '') return INVALID_HOST;
  1266. failure = parseHost(url, buffer);
  1267. if (failure) return failure;
  1268. buffer = '';
  1269. state = PORT;
  1270. if (stateOverride == HOSTNAME) return;
  1271. } else if (
  1272. char == EOF || char == '/' || char == '?' || char == '#' ||
  1273. (char == '\\' && isSpecial(url))
  1274. ) {
  1275. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  1276. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  1277. failure = parseHost(url, buffer);
  1278. if (failure) return failure;
  1279. buffer = '';
  1280. state = PATH_START;
  1281. if (stateOverride) return;
  1282. continue;
  1283. } else {
  1284. if (char == '[') seenBracket = true;
  1285. else if (char == ']') seenBracket = false;
  1286. buffer += char;
  1287. } break;
  1288. case PORT:
  1289. if (DIGIT.test(char)) {
  1290. buffer += char;
  1291. } else if (
  1292. char == EOF || char == '/' || char == '?' || char == '#' ||
  1293. (char == '\\' && isSpecial(url)) ||
  1294. stateOverride
  1295. ) {
  1296. if (buffer != '') {
  1297. var port = parseInt(buffer, 10);
  1298. if (port > 0xFFFF) return INVALID_PORT;
  1299. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  1300. buffer = '';
  1301. }
  1302. if (stateOverride) return;
  1303. state = PATH_START;
  1304. continue;
  1305. } else return INVALID_PORT;
  1306. break;
  1307. case FILE:
  1308. url.scheme = 'file';
  1309. if (char == '/' || char == '\\') state = FILE_SLASH;
  1310. else if (base && base.scheme == 'file') {
  1311. if (char == EOF) {
  1312. url.host = base.host;
  1313. url.path = base.path.slice();
  1314. url.query = base.query;
  1315. } else if (char == '?') {
  1316. url.host = base.host;
  1317. url.path = base.path.slice();
  1318. url.query = '';
  1319. state = QUERY;
  1320. } else if (char == '#') {
  1321. url.host = base.host;
  1322. url.path = base.path.slice();
  1323. url.query = base.query;
  1324. url.fragment = '';
  1325. state = FRAGMENT;
  1326. } else {
  1327. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1328. url.host = base.host;
  1329. url.path = base.path.slice();
  1330. shortenURLsPath(url);
  1331. }
  1332. state = PATH;
  1333. continue;
  1334. }
  1335. } else {
  1336. state = PATH;
  1337. continue;
  1338. } break;
  1339. case FILE_SLASH:
  1340. if (char == '/' || char == '\\') {
  1341. state = FILE_HOST;
  1342. break;
  1343. }
  1344. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1345. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  1346. else url.host = base.host;
  1347. }
  1348. state = PATH;
  1349. continue;
  1350. case FILE_HOST:
  1351. if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
  1352. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  1353. state = PATH;
  1354. } else if (buffer == '') {
  1355. url.host = '';
  1356. if (stateOverride) return;
  1357. state = PATH_START;
  1358. } else {
  1359. failure = parseHost(url, buffer);
  1360. if (failure) return failure;
  1361. if (url.host == 'localhost') url.host = '';
  1362. if (stateOverride) return;
  1363. buffer = '';
  1364. state = PATH_START;
  1365. } continue;
  1366. } else buffer += char;
  1367. break;
  1368. case PATH_START:
  1369. if (isSpecial(url)) {
  1370. state = PATH;
  1371. if (char != '/' && char != '\\') continue;
  1372. } else if (!stateOverride && char == '?') {
  1373. url.query = '';
  1374. state = QUERY;
  1375. } else if (!stateOverride && char == '#') {
  1376. url.fragment = '';
  1377. state = FRAGMENT;
  1378. } else if (char != EOF) {
  1379. state = PATH;
  1380. if (char != '/') continue;
  1381. } break;
  1382. case PATH:
  1383. if (
  1384. char == EOF || char == '/' ||
  1385. (char == '\\' && isSpecial(url)) ||
  1386. (!stateOverride && (char == '?' || char == '#'))
  1387. ) {
  1388. if (isDoubleDot(buffer)) {
  1389. shortenURLsPath(url);
  1390. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1391. url.path.push('');
  1392. }
  1393. } else if (isSingleDot(buffer)) {
  1394. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1395. url.path.push('');
  1396. }
  1397. } else {
  1398. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  1399. if (url.host) url.host = '';
  1400. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  1401. }
  1402. url.path.push(buffer);
  1403. }
  1404. buffer = '';
  1405. if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
  1406. while (url.path.length > 1 && url.path[0] === '') {
  1407. url.path.shift();
  1408. }
  1409. }
  1410. if (char == '?') {
  1411. url.query = '';
  1412. state = QUERY;
  1413. } else if (char == '#') {
  1414. url.fragment = '';
  1415. state = FRAGMENT;
  1416. }
  1417. } else {
  1418. buffer += percentEncode(char, pathPercentEncodeSet);
  1419. } break;
  1420. case CANNOT_BE_A_BASE_URL_PATH:
  1421. if (char == '?') {
  1422. url.query = '';
  1423. state = QUERY;
  1424. } else if (char == '#') {
  1425. url.fragment = '';
  1426. state = FRAGMENT;
  1427. } else if (char != EOF) {
  1428. url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
  1429. } break;
  1430. case QUERY:
  1431. if (!stateOverride && char == '#') {
  1432. url.fragment = '';
  1433. state = FRAGMENT;
  1434. } else if (char != EOF) {
  1435. if (char == "'" && isSpecial(url)) url.query += '%27';
  1436. else if (char == '#') url.query += '%23';
  1437. else url.query += percentEncode(char, C0ControlPercentEncodeSet);
  1438. } break;
  1439. case FRAGMENT:
  1440. if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
  1441. break;
  1442. }
  1443. pointer++;
  1444. }
  1445. };
  1446. // `URL` constructor
  1447. // https://url.spec.whatwg.org/#url-class
  1448. var URLConstructor = function URL(url /* , base */) {
  1449. var that = anInstance(this, URLConstructor, 'URL');
  1450. var base = arguments.length > 1 ? arguments[1] : undefined;
  1451. var urlString = String(url);
  1452. var state = setInternalState(that, { type: 'URL' });
  1453. var baseState, failure;
  1454. if (base !== undefined) {
  1455. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  1456. else {
  1457. failure = parseURL(baseState = {}, String(base));
  1458. if (failure) throw TypeError(failure);
  1459. }
  1460. }
  1461. failure = parseURL(state, urlString, null, baseState);
  1462. if (failure) throw TypeError(failure);
  1463. var searchParams = state.searchParams = new URLSearchParams();
  1464. var searchParamsState = getInternalSearchParamsState(searchParams);
  1465. searchParamsState.updateSearchParams(state.query);
  1466. searchParamsState.updateURL = function () {
  1467. state.query = String(searchParams) || null;
  1468. };
  1469. if (!DESCRIPTORS) {
  1470. that.href = serializeURL.call(that);
  1471. that.origin = getOrigin.call(that);
  1472. that.protocol = getProtocol.call(that);
  1473. that.username = getUsername.call(that);
  1474. that.password = getPassword.call(that);
  1475. that.host = getHost.call(that);
  1476. that.hostname = getHostname.call(that);
  1477. that.port = getPort.call(that);
  1478. that.pathname = getPathname.call(that);
  1479. that.search = getSearch.call(that);
  1480. that.searchParams = getSearchParams.call(that);
  1481. that.hash = getHash.call(that);
  1482. }
  1483. };
  1484. var URLPrototype = URLConstructor.prototype;
  1485. var serializeURL = function () {
  1486. var url = getInternalURLState(this);
  1487. var scheme = url.scheme;
  1488. var username = url.username;
  1489. var password = url.password;
  1490. var host = url.host;
  1491. var port = url.port;
  1492. var path = url.path;
  1493. var query = url.query;
  1494. var fragment = url.fragment;
  1495. var output = scheme + ':';
  1496. if (host !== null) {
  1497. output += '//';
  1498. if (includesCredentials(url)) {
  1499. output += username + (password ? ':' + password : '') + '@';
  1500. }
  1501. output += serializeHost(host);
  1502. if (port !== null) output += ':' + port;
  1503. } else if (scheme == 'file') output += '//';
  1504. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1505. if (query !== null) output += '?' + query;
  1506. if (fragment !== null) output += '#' + fragment;
  1507. return output;
  1508. };
  1509. var getOrigin = function () {
  1510. var url = getInternalURLState(this);
  1511. var scheme = url.scheme;
  1512. var port = url.port;
  1513. if (scheme == 'blob') try {
  1514. return new URL(scheme.path[0]).origin;
  1515. } catch (error) {
  1516. return 'null';
  1517. }
  1518. if (scheme == 'file' || !isSpecial(url)) return 'null';
  1519. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  1520. };
  1521. var getProtocol = function () {
  1522. return getInternalURLState(this).scheme + ':';
  1523. };
  1524. var getUsername = function () {
  1525. return getInternalURLState(this).username;
  1526. };
  1527. var getPassword = function () {
  1528. return getInternalURLState(this).password;
  1529. };
  1530. var getHost = function () {
  1531. var url = getInternalURLState(this);
  1532. var host = url.host;
  1533. var port = url.port;
  1534. return host === null ? ''
  1535. : port === null ? serializeHost(host)
  1536. : serializeHost(host) + ':' + port;
  1537. };
  1538. var getHostname = function () {
  1539. var host = getInternalURLState(this).host;
  1540. return host === null ? '' : serializeHost(host);
  1541. };
  1542. var getPort = function () {
  1543. var port = getInternalURLState(this).port;
  1544. return port === null ? '' : String(port);
  1545. };
  1546. var getPathname = function () {
  1547. var url = getInternalURLState(this);
  1548. var path = url.path;
  1549. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1550. };
  1551. var getSearch = function () {
  1552. var query = getInternalURLState(this).query;
  1553. return query ? '?' + query : '';
  1554. };
  1555. var getSearchParams = function () {
  1556. return getInternalURLState(this).searchParams;
  1557. };
  1558. var getHash = function () {
  1559. var fragment = getInternalURLState(this).fragment;
  1560. return fragment ? '#' + fragment : '';
  1561. };
  1562. var accessorDescriptor = function (getter, setter) {
  1563. return { get: getter, set: setter, configurable: true, enumerable: true };
  1564. };
  1565. if (DESCRIPTORS) {
  1566. defineProperties(URLPrototype, {
  1567. // `URL.prototype.href` accessors pair
  1568. // https://url.spec.whatwg.org/#dom-url-href
  1569. href: accessorDescriptor(serializeURL, function (href) {
  1570. var url = getInternalURLState(this);
  1571. var urlString = String(href);
  1572. var failure = parseURL(url, urlString);
  1573. if (failure) throw TypeError(failure);
  1574. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1575. }),
  1576. // `URL.prototype.origin` getter
  1577. // https://url.spec.whatwg.org/#dom-url-origin
  1578. origin: accessorDescriptor(getOrigin),
  1579. // `URL.prototype.protocol` accessors pair
  1580. // https://url.spec.whatwg.org/#dom-url-protocol
  1581. protocol: accessorDescriptor(getProtocol, function (protocol) {
  1582. var url = getInternalURLState(this);
  1583. parseURL(url, String(protocol) + ':', SCHEME_START);
  1584. }),
  1585. // `URL.prototype.username` accessors pair
  1586. // https://url.spec.whatwg.org/#dom-url-username
  1587. username: accessorDescriptor(getUsername, function (username) {
  1588. var url = getInternalURLState(this);
  1589. var codePoints = arrayFrom(String(username));
  1590. if (cannotHaveUsernamePasswordPort(url)) return;
  1591. url.username = '';
  1592. for (var i = 0; i < codePoints.length; i++) {
  1593. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1594. }
  1595. }),
  1596. // `URL.prototype.password` accessors pair
  1597. // https://url.spec.whatwg.org/#dom-url-password
  1598. password: accessorDescriptor(getPassword, function (password) {
  1599. var url = getInternalURLState(this);
  1600. var codePoints = arrayFrom(String(password));
  1601. if (cannotHaveUsernamePasswordPort(url)) return;
  1602. url.password = '';
  1603. for (var i = 0; i < codePoints.length; i++) {
  1604. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1605. }
  1606. }),
  1607. // `URL.prototype.host` accessors pair
  1608. // https://url.spec.whatwg.org/#dom-url-host
  1609. host: accessorDescriptor(getHost, function (host) {
  1610. var url = getInternalURLState(this);
  1611. if (url.cannotBeABaseURL) return;
  1612. parseURL(url, String(host), HOST);
  1613. }),
  1614. // `URL.prototype.hostname` accessors pair
  1615. // https://url.spec.whatwg.org/#dom-url-hostname
  1616. hostname: accessorDescriptor(getHostname, function (hostname) {
  1617. var url = getInternalURLState(this);
  1618. if (url.cannotBeABaseURL) return;
  1619. parseURL(url, String(hostname), HOSTNAME);
  1620. }),
  1621. // `URL.prototype.port` accessors pair
  1622. // https://url.spec.whatwg.org/#dom-url-port
  1623. port: accessorDescriptor(getPort, function (port) {
  1624. var url = getInternalURLState(this);
  1625. if (cannotHaveUsernamePasswordPort(url)) return;
  1626. port = String(port);
  1627. if (port == '') url.port = null;
  1628. else parseURL(url, port, PORT);
  1629. }),
  1630. // `URL.prototype.pathname` accessors pair
  1631. // https://url.spec.whatwg.org/#dom-url-pathname
  1632. pathname: accessorDescriptor(getPathname, function (pathname) {
  1633. var url = getInternalURLState(this);
  1634. if (url.cannotBeABaseURL) return;
  1635. url.path = [];
  1636. parseURL(url, pathname + '', PATH_START);
  1637. }),
  1638. // `URL.prototype.search` accessors pair
  1639. // https://url.spec.whatwg.org/#dom-url-search
  1640. search: accessorDescriptor(getSearch, function (search) {
  1641. var url = getInternalURLState(this);
  1642. search = String(search);
  1643. if (search == '') {
  1644. url.query = null;
  1645. } else {
  1646. if ('?' == search.charAt(0)) search = search.slice(1);
  1647. url.query = '';
  1648. parseURL(url, search, QUERY);
  1649. }
  1650. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1651. }),
  1652. // `URL.prototype.searchParams` getter
  1653. // https://url.spec.whatwg.org/#dom-url-searchparams
  1654. searchParams: accessorDescriptor(getSearchParams),
  1655. // `URL.prototype.hash` accessors pair
  1656. // https://url.spec.whatwg.org/#dom-url-hash
  1657. hash: accessorDescriptor(getHash, function (hash) {
  1658. var url = getInternalURLState(this);
  1659. hash = String(hash);
  1660. if (hash == '') {
  1661. url.fragment = null;
  1662. return;
  1663. }
  1664. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  1665. url.fragment = '';
  1666. parseURL(url, hash, FRAGMENT);
  1667. })
  1668. });
  1669. }
  1670. // `URL.prototype.toJSON` method
  1671. // https://url.spec.whatwg.org/#dom-url-tojson
  1672. redefine(URLPrototype, 'toJSON', function toJSON() {
  1673. return serializeURL.call(this);
  1674. }, { enumerable: true });
  1675. // `URL.prototype.toString` method
  1676. // https://url.spec.whatwg.org/#URL-stringification-behavior
  1677. redefine(URLPrototype, 'toString', function toString() {
  1678. return serializeURL.call(this);
  1679. }, { enumerable: true });
  1680. if (NativeURL) {
  1681. var nativeCreateObjectURL = NativeURL.createObjectURL;
  1682. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  1683. // `URL.createObjectURL` method
  1684. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  1685. // eslint-disable-next-line no-unused-vars
  1686. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  1687. return nativeCreateObjectURL.apply(NativeURL, arguments);
  1688. });
  1689. // `URL.revokeObjectURL` method
  1690. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  1691. // eslint-disable-next-line no-unused-vars
  1692. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  1693. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  1694. });
  1695. }
  1696. setToStringTag(URLConstructor, 'URL');
  1697. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  1698. URL: URLConstructor
  1699. });
  1700. /***/ }),
  1701. /***/ "2d00":
  1702. /***/ (function(module, exports, __webpack_require__) {
  1703. var global = __webpack_require__("da84");
  1704. var userAgent = __webpack_require__("342f");
  1705. var process = global.process;
  1706. var versions = process && process.versions;
  1707. var v8 = versions && versions.v8;
  1708. var match, version;
  1709. if (v8) {
  1710. match = v8.split('.');
  1711. version = match[0] + match[1];
  1712. } else if (userAgent) {
  1713. match = userAgent.match(/Edge\/(\d+)/);
  1714. if (!match || match[1] >= 74) {
  1715. match = userAgent.match(/Chrome\/(\d+)/);
  1716. if (match) version = match[1];
  1717. }
  1718. }
  1719. module.exports = version && +version;
  1720. /***/ }),
  1721. /***/ "342f":
  1722. /***/ (function(module, exports, __webpack_require__) {
  1723. var getBuiltIn = __webpack_require__("d066");
  1724. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  1725. /***/ }),
  1726. /***/ "35a1":
  1727. /***/ (function(module, exports, __webpack_require__) {
  1728. var classof = __webpack_require__("f5df");
  1729. var Iterators = __webpack_require__("3f8c");
  1730. var wellKnownSymbol = __webpack_require__("b622");
  1731. var ITERATOR = wellKnownSymbol('iterator');
  1732. module.exports = function (it) {
  1733. if (it != undefined) return it[ITERATOR]
  1734. || it['@@iterator']
  1735. || Iterators[classof(it)];
  1736. };
  1737. /***/ }),
  1738. /***/ "37e8":
  1739. /***/ (function(module, exports, __webpack_require__) {
  1740. var DESCRIPTORS = __webpack_require__("83ab");
  1741. var definePropertyModule = __webpack_require__("9bf2");
  1742. var anObject = __webpack_require__("825a");
  1743. var objectKeys = __webpack_require__("df75");
  1744. // `Object.defineProperties` method
  1745. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  1746. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  1747. anObject(O);
  1748. var keys = objectKeys(Properties);
  1749. var length = keys.length;
  1750. var index = 0;
  1751. var key;
  1752. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  1753. return O;
  1754. };
  1755. /***/ }),
  1756. /***/ "3bbe":
  1757. /***/ (function(module, exports, __webpack_require__) {
  1758. var isObject = __webpack_require__("861d");
  1759. module.exports = function (it) {
  1760. if (!isObject(it) && it !== null) {
  1761. throw TypeError("Can't set " + String(it) + ' as a prototype');
  1762. } return it;
  1763. };
  1764. /***/ }),
  1765. /***/ "3ca3":
  1766. /***/ (function(module, exports, __webpack_require__) {
  1767. "use strict";
  1768. var charAt = __webpack_require__("6547").charAt;
  1769. var InternalStateModule = __webpack_require__("69f3");
  1770. var defineIterator = __webpack_require__("7dd0");
  1771. var STRING_ITERATOR = 'String Iterator';
  1772. var setInternalState = InternalStateModule.set;
  1773. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  1774. // `String.prototype[@@iterator]` method
  1775. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1776. defineIterator(String, 'String', function (iterated) {
  1777. setInternalState(this, {
  1778. type: STRING_ITERATOR,
  1779. string: String(iterated),
  1780. index: 0
  1781. });
  1782. // `%StringIteratorPrototype%.next` method
  1783. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1784. }, function next() {
  1785. var state = getInternalState(this);
  1786. var string = state.string;
  1787. var index = state.index;
  1788. var point;
  1789. if (index >= string.length) return { value: undefined, done: true };
  1790. point = charAt(string, index);
  1791. state.index += point.length;
  1792. return { value: point, done: false };
  1793. });
  1794. /***/ }),
  1795. /***/ "3f8c":
  1796. /***/ (function(module, exports) {
  1797. module.exports = {};
  1798. /***/ }),
  1799. /***/ "408a":
  1800. /***/ (function(module, exports, __webpack_require__) {
  1801. var classof = __webpack_require__("c6b6");
  1802. // `thisNumberValue` abstract operation
  1803. // https://tc39.github.io/ecma262/#sec-thisnumbervalue
  1804. module.exports = function (value) {
  1805. if (typeof value != 'number' && classof(value) != 'Number') {
  1806. throw TypeError('Incorrect invocation');
  1807. }
  1808. return +value;
  1809. };
  1810. /***/ }),
  1811. /***/ "4160":
  1812. /***/ (function(module, exports, __webpack_require__) {
  1813. "use strict";
  1814. var $ = __webpack_require__("23e7");
  1815. var forEach = __webpack_require__("17c2");
  1816. // `Array.prototype.forEach` method
  1817. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  1818. $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
  1819. forEach: forEach
  1820. });
  1821. /***/ }),
  1822. /***/ "428f":
  1823. /***/ (function(module, exports, __webpack_require__) {
  1824. var global = __webpack_require__("da84");
  1825. module.exports = global;
  1826. /***/ }),
  1827. /***/ "44ad":
  1828. /***/ (function(module, exports, __webpack_require__) {
  1829. var fails = __webpack_require__("d039");
  1830. var classof = __webpack_require__("c6b6");
  1831. var split = ''.split;
  1832. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1833. module.exports = fails(function () {
  1834. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1835. // eslint-disable-next-line no-prototype-builtins
  1836. return !Object('z').propertyIsEnumerable(0);
  1837. }) ? function (it) {
  1838. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  1839. } : Object;
  1840. /***/ }),
  1841. /***/ "44d2":
  1842. /***/ (function(module, exports, __webpack_require__) {
  1843. var wellKnownSymbol = __webpack_require__("b622");
  1844. var create = __webpack_require__("7c73");
  1845. var definePropertyModule = __webpack_require__("9bf2");
  1846. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1847. var ArrayPrototype = Array.prototype;
  1848. // Array.prototype[@@unscopables]
  1849. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1850. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1851. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  1852. configurable: true,
  1853. value: create(null)
  1854. });
  1855. }
  1856. // add a key to Array.prototype[@@unscopables]
  1857. module.exports = function (key) {
  1858. ArrayPrototype[UNSCOPABLES][key] = true;
  1859. };
  1860. /***/ }),
  1861. /***/ "44e7":
  1862. /***/ (function(module, exports, __webpack_require__) {
  1863. var isObject = __webpack_require__("861d");
  1864. var classof = __webpack_require__("c6b6");
  1865. var wellKnownSymbol = __webpack_require__("b622");
  1866. var MATCH = wellKnownSymbol('match');
  1867. // `IsRegExp` abstract operation
  1868. // https://tc39.github.io/ecma262/#sec-isregexp
  1869. module.exports = function (it) {
  1870. var isRegExp;
  1871. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
  1872. };
  1873. /***/ }),
  1874. /***/ "45fc":
  1875. /***/ (function(module, exports, __webpack_require__) {
  1876. "use strict";
  1877. var $ = __webpack_require__("23e7");
  1878. var $some = __webpack_require__("b727").some;
  1879. var arrayMethodIsStrict = __webpack_require__("a640");
  1880. var arrayMethodUsesToLength = __webpack_require__("ae40");
  1881. var STRICT_METHOD = arrayMethodIsStrict('some');
  1882. var USES_TO_LENGTH = arrayMethodUsesToLength('some');
  1883. // `Array.prototype.some` method
  1884. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  1885. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
  1886. some: function some(callbackfn /* , thisArg */) {
  1887. return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1888. }
  1889. });
  1890. /***/ }),
  1891. /***/ "466d":
  1892. /***/ (function(module, exports, __webpack_require__) {
  1893. "use strict";
  1894. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  1895. var anObject = __webpack_require__("825a");
  1896. var toLength = __webpack_require__("50c4");
  1897. var requireObjectCoercible = __webpack_require__("1d80");
  1898. var advanceStringIndex = __webpack_require__("8aa5");
  1899. var regExpExec = __webpack_require__("14c3");
  1900. // @@match logic
  1901. fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  1902. return [
  1903. // `String.prototype.match` method
  1904. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  1905. function match(regexp) {
  1906. var O = requireObjectCoercible(this);
  1907. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  1908. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  1909. },
  1910. // `RegExp.prototype[@@match]` method
  1911. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  1912. function (regexp) {
  1913. var res = maybeCallNative(nativeMatch, regexp, this);
  1914. if (res.done) return res.value;
  1915. var rx = anObject(regexp);
  1916. var S = String(this);
  1917. if (!rx.global) return regExpExec(rx, S);
  1918. var fullUnicode = rx.unicode;
  1919. rx.lastIndex = 0;
  1920. var A = [];
  1921. var n = 0;
  1922. var result;
  1923. while ((result = regExpExec(rx, S)) !== null) {
  1924. var matchStr = String(result[0]);
  1925. A[n] = matchStr;
  1926. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1927. n++;
  1928. }
  1929. return n === 0 ? null : A;
  1930. }
  1931. ];
  1932. });
  1933. /***/ }),
  1934. /***/ "4840":
  1935. /***/ (function(module, exports, __webpack_require__) {
  1936. var anObject = __webpack_require__("825a");
  1937. var aFunction = __webpack_require__("1c0b");
  1938. var wellKnownSymbol = __webpack_require__("b622");
  1939. var SPECIES = wellKnownSymbol('species');
  1940. // `SpeciesConstructor` abstract operation
  1941. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  1942. module.exports = function (O, defaultConstructor) {
  1943. var C = anObject(O).constructor;
  1944. var S;
  1945. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
  1946. };
  1947. /***/ }),
  1948. /***/ "4930":
  1949. /***/ (function(module, exports, __webpack_require__) {
  1950. var fails = __webpack_require__("d039");
  1951. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1952. // Chrome 38 Symbol has incorrect toString conversion
  1953. // eslint-disable-next-line no-undef
  1954. return !String(Symbol());
  1955. });
  1956. /***/ }),
  1957. /***/ "498a":
  1958. /***/ (function(module, exports, __webpack_require__) {
  1959. "use strict";
  1960. var $ = __webpack_require__("23e7");
  1961. var $trim = __webpack_require__("58a8").trim;
  1962. var forcedStringTrimMethod = __webpack_require__("c8d2");
  1963. // `String.prototype.trim` method
  1964. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  1965. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  1966. trim: function trim() {
  1967. return $trim(this);
  1968. }
  1969. });
  1970. /***/ }),
  1971. /***/ "4d63":
  1972. /***/ (function(module, exports, __webpack_require__) {
  1973. var DESCRIPTORS = __webpack_require__("83ab");
  1974. var global = __webpack_require__("da84");
  1975. var isForced = __webpack_require__("94ca");
  1976. var inheritIfRequired = __webpack_require__("7156");
  1977. var defineProperty = __webpack_require__("9bf2").f;
  1978. var getOwnPropertyNames = __webpack_require__("241c").f;
  1979. var isRegExp = __webpack_require__("44e7");
  1980. var getFlags = __webpack_require__("ad6d");
  1981. var stickyHelpers = __webpack_require__("9f7f");
  1982. var redefine = __webpack_require__("6eeb");
  1983. var fails = __webpack_require__("d039");
  1984. var setInternalState = __webpack_require__("69f3").set;
  1985. var setSpecies = __webpack_require__("2626");
  1986. var wellKnownSymbol = __webpack_require__("b622");
  1987. var MATCH = wellKnownSymbol('match');
  1988. var NativeRegExp = global.RegExp;
  1989. var RegExpPrototype = NativeRegExp.prototype;
  1990. var re1 = /a/g;
  1991. var re2 = /a/g;
  1992. // "new" should create a new object, old webkit bug
  1993. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  1994. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  1995. var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
  1996. re2[MATCH] = false;
  1997. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  1998. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  1999. })));
  2000. // `RegExp` constructor
  2001. // https://tc39.github.io/ecma262/#sec-regexp-constructor
  2002. if (FORCED) {
  2003. var RegExpWrapper = function RegExp(pattern, flags) {
  2004. var thisIsRegExp = this instanceof RegExpWrapper;
  2005. var patternIsRegExp = isRegExp(pattern);
  2006. var flagsAreUndefined = flags === undefined;
  2007. var sticky;
  2008. if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
  2009. return pattern;
  2010. }
  2011. if (CORRECT_NEW) {
  2012. if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
  2013. } else if (pattern instanceof RegExpWrapper) {
  2014. if (flagsAreUndefined) flags = getFlags.call(pattern);
  2015. pattern = pattern.source;
  2016. }
  2017. if (UNSUPPORTED_Y) {
  2018. sticky = !!flags && flags.indexOf('y') > -1;
  2019. if (sticky) flags = flags.replace(/y/g, '');
  2020. }
  2021. var result = inheritIfRequired(
  2022. CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
  2023. thisIsRegExp ? this : RegExpPrototype,
  2024. RegExpWrapper
  2025. );
  2026. if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
  2027. return result;
  2028. };
  2029. var proxy = function (key) {
  2030. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  2031. configurable: true,
  2032. get: function () { return NativeRegExp[key]; },
  2033. set: function (it) { NativeRegExp[key] = it; }
  2034. });
  2035. };
  2036. var keys = getOwnPropertyNames(NativeRegExp);
  2037. var index = 0;
  2038. while (keys.length > index) proxy(keys[index++]);
  2039. RegExpPrototype.constructor = RegExpWrapper;
  2040. RegExpWrapper.prototype = RegExpPrototype;
  2041. redefine(global, 'RegExp', RegExpWrapper);
  2042. }
  2043. // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
  2044. setSpecies('RegExp');
  2045. /***/ }),
  2046. /***/ "4d64":
  2047. /***/ (function(module, exports, __webpack_require__) {
  2048. var toIndexedObject = __webpack_require__("fc6a");
  2049. var toLength = __webpack_require__("50c4");
  2050. var toAbsoluteIndex = __webpack_require__("23cb");
  2051. // `Array.prototype.{ indexOf, includes }` methods implementation
  2052. var createMethod = function (IS_INCLUDES) {
  2053. return function ($this, el, fromIndex) {
  2054. var O = toIndexedObject($this);
  2055. var length = toLength(O.length);
  2056. var index = toAbsoluteIndex(fromIndex, length);
  2057. var value;
  2058. // Array#includes uses SameValueZero equality algorithm
  2059. // eslint-disable-next-line no-self-compare
  2060. if (IS_INCLUDES && el != el) while (length > index) {
  2061. value = O[index++];
  2062. // eslint-disable-next-line no-self-compare
  2063. if (value != value) return true;
  2064. // Array#indexOf ignores holes, Array#includes - not
  2065. } else for (;length > index; index++) {
  2066. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  2067. } return !IS_INCLUDES && -1;
  2068. };
  2069. };
  2070. module.exports = {
  2071. // `Array.prototype.includes` method
  2072. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  2073. includes: createMethod(true),
  2074. // `Array.prototype.indexOf` method
  2075. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  2076. indexOf: createMethod(false)
  2077. };
  2078. /***/ }),
  2079. /***/ "4d90":
  2080. /***/ (function(module, exports, __webpack_require__) {
  2081. "use strict";
  2082. var $ = __webpack_require__("23e7");
  2083. var $padStart = __webpack_require__("0ccb").start;
  2084. var WEBKIT_BUG = __webpack_require__("9a0c");
  2085. // `String.prototype.padStart` method
  2086. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  2087. $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  2088. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  2089. return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  2090. }
  2091. });
  2092. /***/ }),
  2093. /***/ "4de4":
  2094. /***/ (function(module, exports, __webpack_require__) {
  2095. "use strict";
  2096. var $ = __webpack_require__("23e7");
  2097. var $filter = __webpack_require__("b727").filter;
  2098. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  2099. var arrayMethodUsesToLength = __webpack_require__("ae40");
  2100. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  2101. // Edge 14- issue
  2102. var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
  2103. // `Array.prototype.filter` method
  2104. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  2105. // with adding support of @@species
  2106. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  2107. filter: function filter(callbackfn /* , thisArg */) {
  2108. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2109. }
  2110. });
  2111. /***/ }),
  2112. /***/ "4df4":
  2113. /***/ (function(module, exports, __webpack_require__) {
  2114. "use strict";
  2115. var bind = __webpack_require__("0366");
  2116. var toObject = __webpack_require__("7b0b");
  2117. var callWithSafeIterationClosing = __webpack_require__("9bdd");
  2118. var isArrayIteratorMethod = __webpack_require__("e95a");
  2119. var toLength = __webpack_require__("50c4");
  2120. var createProperty = __webpack_require__("8418");
  2121. var getIteratorMethod = __webpack_require__("35a1");
  2122. // `Array.from` method implementation
  2123. // https://tc39.github.io/ecma262/#sec-array.from
  2124. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2125. var O = toObject(arrayLike);
  2126. var C = typeof this == 'function' ? this : Array;
  2127. var argumentsLength = arguments.length;
  2128. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  2129. var mapping = mapfn !== undefined;
  2130. var iteratorMethod = getIteratorMethod(O);
  2131. var index = 0;
  2132. var length, result, step, iterator, next, value;
  2133. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  2134. // if the target is not iterable or it's an array with the default iterator - use a simple case
  2135. if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
  2136. iterator = iteratorMethod.call(O);
  2137. next = iterator.next;
  2138. result = new C();
  2139. for (;!(step = next.call(iterator)).done; index++) {
  2140. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  2141. createProperty(result, index, value);
  2142. }
  2143. } else {
  2144. length = toLength(O.length);
  2145. result = new C(length);
  2146. for (;length > index; index++) {
  2147. value = mapping ? mapfn(O[index], index) : O[index];
  2148. createProperty(result, index, value);
  2149. }
  2150. }
  2151. result.length = index;
  2152. return result;
  2153. };
  2154. /***/ }),
  2155. /***/ "4ec9":
  2156. /***/ (function(module, exports, __webpack_require__) {
  2157. "use strict";
  2158. var collection = __webpack_require__("6d61");
  2159. var collectionStrong = __webpack_require__("6566");
  2160. // `Map` constructor
  2161. // https://tc39.github.io/ecma262/#sec-map-objects
  2162. module.exports = collection('Map', function (init) {
  2163. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  2164. }, collectionStrong);
  2165. /***/ }),
  2166. /***/ "50c4":
  2167. /***/ (function(module, exports, __webpack_require__) {
  2168. var toInteger = __webpack_require__("a691");
  2169. var min = Math.min;
  2170. // `ToLength` abstract operation
  2171. // https://tc39.github.io/ecma262/#sec-tolength
  2172. module.exports = function (argument) {
  2173. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  2174. };
  2175. /***/ }),
  2176. /***/ "5135":
  2177. /***/ (function(module, exports) {
  2178. var hasOwnProperty = {}.hasOwnProperty;
  2179. module.exports = function (it, key) {
  2180. return hasOwnProperty.call(it, key);
  2181. };
  2182. /***/ }),
  2183. /***/ "5319":
  2184. /***/ (function(module, exports, __webpack_require__) {
  2185. "use strict";
  2186. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2187. var anObject = __webpack_require__("825a");
  2188. var toObject = __webpack_require__("7b0b");
  2189. var toLength = __webpack_require__("50c4");
  2190. var toInteger = __webpack_require__("a691");
  2191. var requireObjectCoercible = __webpack_require__("1d80");
  2192. var advanceStringIndex = __webpack_require__("8aa5");
  2193. var regExpExec = __webpack_require__("14c3");
  2194. var max = Math.max;
  2195. var min = Math.min;
  2196. var floor = Math.floor;
  2197. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  2198. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  2199. var maybeToString = function (it) {
  2200. return it === undefined ? it : String(it);
  2201. };
  2202. // @@replace logic
  2203. fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  2204. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  2205. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  2206. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2207. return [
  2208. // `String.prototype.replace` method
  2209. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  2210. function replace(searchValue, replaceValue) {
  2211. var O = requireObjectCoercible(this);
  2212. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  2213. return replacer !== undefined
  2214. ? replacer.call(searchValue, O, replaceValue)
  2215. : nativeReplace.call(String(O), searchValue, replaceValue);
  2216. },
  2217. // `RegExp.prototype[@@replace]` method
  2218. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  2219. function (regexp, replaceValue) {
  2220. if (
  2221. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  2222. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  2223. ) {
  2224. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  2225. if (res.done) return res.value;
  2226. }
  2227. var rx = anObject(regexp);
  2228. var S = String(this);
  2229. var functionalReplace = typeof replaceValue === 'function';
  2230. if (!functionalReplace) replaceValue = String(replaceValue);
  2231. var global = rx.global;
  2232. if (global) {
  2233. var fullUnicode = rx.unicode;
  2234. rx.lastIndex = 0;
  2235. }
  2236. var results = [];
  2237. while (true) {
  2238. var result = regExpExec(rx, S);
  2239. if (result === null) break;
  2240. results.push(result);
  2241. if (!global) break;
  2242. var matchStr = String(result[0]);
  2243. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2244. }
  2245. var accumulatedResult = '';
  2246. var nextSourcePosition = 0;
  2247. for (var i = 0; i < results.length; i++) {
  2248. result = results[i];
  2249. var matched = String(result[0]);
  2250. var position = max(min(toInteger(result.index), S.length), 0);
  2251. var captures = [];
  2252. // NOTE: This is equivalent to
  2253. // captures = result.slice(1).map(maybeToString)
  2254. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2255. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2256. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2257. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  2258. var namedCaptures = result.groups;
  2259. if (functionalReplace) {
  2260. var replacerArgs = [matched].concat(captures, position, S);
  2261. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  2262. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  2263. } else {
  2264. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2265. }
  2266. if (position >= nextSourcePosition) {
  2267. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  2268. nextSourcePosition = position + matched.length;
  2269. }
  2270. }
  2271. return accumulatedResult + S.slice(nextSourcePosition);
  2272. }
  2273. ];
  2274. // https://tc39.github.io/ecma262/#sec-getsubstitution
  2275. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  2276. var tailPos = position + matched.length;
  2277. var m = captures.length;
  2278. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2279. if (namedCaptures !== undefined) {
  2280. namedCaptures = toObject(namedCaptures);
  2281. symbols = SUBSTITUTION_SYMBOLS;
  2282. }
  2283. return nativeReplace.call(replacement, symbols, function (match, ch) {
  2284. var capture;
  2285. switch (ch.charAt(0)) {
  2286. case '$': return '$';
  2287. case '&': return matched;
  2288. case '`': return str.slice(0, position);
  2289. case "'": return str.slice(tailPos);
  2290. case '<':
  2291. capture = namedCaptures[ch.slice(1, -1)];
  2292. break;
  2293. default: // \d\d?
  2294. var n = +ch;
  2295. if (n === 0) return match;
  2296. if (n > m) {
  2297. var f = floor(n / 10);
  2298. if (f === 0) return match;
  2299. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  2300. return match;
  2301. }
  2302. capture = captures[n - 1];
  2303. }
  2304. return capture === undefined ? '' : capture;
  2305. });
  2306. }
  2307. });
  2308. /***/ }),
  2309. /***/ "5692":
  2310. /***/ (function(module, exports, __webpack_require__) {
  2311. var IS_PURE = __webpack_require__("c430");
  2312. var store = __webpack_require__("c6cd");
  2313. (module.exports = function (key, value) {
  2314. return store[key] || (store[key] = value !== undefined ? value : {});
  2315. })('versions', []).push({
  2316. version: '3.8.1',
  2317. mode: IS_PURE ? 'pure' : 'global',
  2318. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  2319. });
  2320. /***/ }),
  2321. /***/ "56ef":
  2322. /***/ (function(module, exports, __webpack_require__) {
  2323. var getBuiltIn = __webpack_require__("d066");
  2324. var getOwnPropertyNamesModule = __webpack_require__("241c");
  2325. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2326. var anObject = __webpack_require__("825a");
  2327. // all object keys, includes non-enumerable and symbols
  2328. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  2329. var keys = getOwnPropertyNamesModule.f(anObject(it));
  2330. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2331. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  2332. };
  2333. /***/ }),
  2334. /***/ "5899":
  2335. /***/ (function(module, exports) {
  2336. // a string of all valid unicode whitespaces
  2337. // eslint-disable-next-line max-len
  2338. module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  2339. /***/ }),
  2340. /***/ "58a8":
  2341. /***/ (function(module, exports, __webpack_require__) {
  2342. var requireObjectCoercible = __webpack_require__("1d80");
  2343. var whitespaces = __webpack_require__("5899");
  2344. var whitespace = '[' + whitespaces + ']';
  2345. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  2346. var rtrim = RegExp(whitespace + whitespace + '*$');
  2347. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2348. var createMethod = function (TYPE) {
  2349. return function ($this) {
  2350. var string = String(requireObjectCoercible($this));
  2351. if (TYPE & 1) string = string.replace(ltrim, '');
  2352. if (TYPE & 2) string = string.replace(rtrim, '');
  2353. return string;
  2354. };
  2355. };
  2356. module.exports = {
  2357. // `String.prototype.{ trimLeft, trimStart }` methods
  2358. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  2359. start: createMethod(1),
  2360. // `String.prototype.{ trimRight, trimEnd }` methods
  2361. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  2362. end: createMethod(2),
  2363. // `String.prototype.trim` method
  2364. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  2365. trim: createMethod(3)
  2366. };
  2367. /***/ }),
  2368. /***/ "5a34":
  2369. /***/ (function(module, exports, __webpack_require__) {
  2370. var isRegExp = __webpack_require__("44e7");
  2371. module.exports = function (it) {
  2372. if (isRegExp(it)) {
  2373. throw TypeError("The method doesn't accept regular expressions");
  2374. } return it;
  2375. };
  2376. /***/ }),
  2377. /***/ "5c6c":
  2378. /***/ (function(module, exports) {
  2379. module.exports = function (bitmap, value) {
  2380. return {
  2381. enumerable: !(bitmap & 1),
  2382. configurable: !(bitmap & 2),
  2383. writable: !(bitmap & 4),
  2384. value: value
  2385. };
  2386. };
  2387. /***/ }),
  2388. /***/ "5fb2":
  2389. /***/ (function(module, exports, __webpack_require__) {
  2390. "use strict";
  2391. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  2392. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  2393. var base = 36;
  2394. var tMin = 1;
  2395. var tMax = 26;
  2396. var skew = 38;
  2397. var damp = 700;
  2398. var initialBias = 72;
  2399. var initialN = 128; // 0x80
  2400. var delimiter = '-'; // '\x2D'
  2401. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  2402. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  2403. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  2404. var baseMinusTMin = base - tMin;
  2405. var floor = Math.floor;
  2406. var stringFromCharCode = String.fromCharCode;
  2407. /**
  2408. * Creates an array containing the numeric code points of each Unicode
  2409. * character in the string. While JavaScript uses UCS-2 internally,
  2410. * this function will convert a pair of surrogate halves (each of which
  2411. * UCS-2 exposes as separate characters) into a single code point,
  2412. * matching UTF-16.
  2413. */
  2414. var ucs2decode = function (string) {
  2415. var output = [];
  2416. var counter = 0;
  2417. var length = string.length;
  2418. while (counter < length) {
  2419. var value = string.charCodeAt(counter++);
  2420. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  2421. // It's a high surrogate, and there is a next character.
  2422. var extra = string.charCodeAt(counter++);
  2423. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  2424. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  2425. } else {
  2426. // It's an unmatched surrogate; only append this code unit, in case the
  2427. // next code unit is the high surrogate of a surrogate pair.
  2428. output.push(value);
  2429. counter--;
  2430. }
  2431. } else {
  2432. output.push(value);
  2433. }
  2434. }
  2435. return output;
  2436. };
  2437. /**
  2438. * Converts a digit/integer into a basic code point.
  2439. */
  2440. var digitToBasic = function (digit) {
  2441. // 0..25 map to ASCII a..z or A..Z
  2442. // 26..35 map to ASCII 0..9
  2443. return digit + 22 + 75 * (digit < 26);
  2444. };
  2445. /**
  2446. * Bias adaptation function as per section 3.4 of RFC 3492.
  2447. * https://tools.ietf.org/html/rfc3492#section-3.4
  2448. */
  2449. var adapt = function (delta, numPoints, firstTime) {
  2450. var k = 0;
  2451. delta = firstTime ? floor(delta / damp) : delta >> 1;
  2452. delta += floor(delta / numPoints);
  2453. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  2454. delta = floor(delta / baseMinusTMin);
  2455. }
  2456. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  2457. };
  2458. /**
  2459. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  2460. * Punycode string of ASCII-only symbols.
  2461. */
  2462. // eslint-disable-next-line max-statements
  2463. var encode = function (input) {
  2464. var output = [];
  2465. // Convert the input in UCS-2 to an array of Unicode code points.
  2466. input = ucs2decode(input);
  2467. // Cache the length.
  2468. var inputLength = input.length;
  2469. // Initialize the state.
  2470. var n = initialN;
  2471. var delta = 0;
  2472. var bias = initialBias;
  2473. var i, currentValue;
  2474. // Handle the basic code points.
  2475. for (i = 0; i < input.length; i++) {
  2476. currentValue = input[i];
  2477. if (currentValue < 0x80) {
  2478. output.push(stringFromCharCode(currentValue));
  2479. }
  2480. }
  2481. var basicLength = output.length; // number of basic code points.
  2482. var handledCPCount = basicLength; // number of code points that have been handled;
  2483. // Finish the basic string with a delimiter unless it's empty.
  2484. if (basicLength) {
  2485. output.push(delimiter);
  2486. }
  2487. // Main encoding loop:
  2488. while (handledCPCount < inputLength) {
  2489. // All non-basic code points < n have been handled already. Find the next larger one:
  2490. var m = maxInt;
  2491. for (i = 0; i < input.length; i++) {
  2492. currentValue = input[i];
  2493. if (currentValue >= n && currentValue < m) {
  2494. m = currentValue;
  2495. }
  2496. }
  2497. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  2498. var handledCPCountPlusOne = handledCPCount + 1;
  2499. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  2500. throw RangeError(OVERFLOW_ERROR);
  2501. }
  2502. delta += (m - n) * handledCPCountPlusOne;
  2503. n = m;
  2504. for (i = 0; i < input.length; i++) {
  2505. currentValue = input[i];
  2506. if (currentValue < n && ++delta > maxInt) {
  2507. throw RangeError(OVERFLOW_ERROR);
  2508. }
  2509. if (currentValue == n) {
  2510. // Represent delta as a generalized variable-length integer.
  2511. var q = delta;
  2512. for (var k = base; /* no condition */; k += base) {
  2513. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  2514. if (q < t) break;
  2515. var qMinusT = q - t;
  2516. var baseMinusT = base - t;
  2517. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  2518. q = floor(qMinusT / baseMinusT);
  2519. }
  2520. output.push(stringFromCharCode(digitToBasic(q)));
  2521. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  2522. delta = 0;
  2523. ++handledCPCount;
  2524. }
  2525. }
  2526. ++delta;
  2527. ++n;
  2528. }
  2529. return output.join('');
  2530. };
  2531. module.exports = function (input) {
  2532. var encoded = [];
  2533. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  2534. var i, label;
  2535. for (i = 0; i < labels.length; i++) {
  2536. label = labels[i];
  2537. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  2538. }
  2539. return encoded.join('.');
  2540. };
  2541. /***/ }),
  2542. /***/ "605d":
  2543. /***/ (function(module, exports, __webpack_require__) {
  2544. var classof = __webpack_require__("c6b6");
  2545. var global = __webpack_require__("da84");
  2546. module.exports = classof(global.process) == 'process';
  2547. /***/ }),
  2548. /***/ "60da":
  2549. /***/ (function(module, exports, __webpack_require__) {
  2550. "use strict";
  2551. var DESCRIPTORS = __webpack_require__("83ab");
  2552. var fails = __webpack_require__("d039");
  2553. var objectKeys = __webpack_require__("df75");
  2554. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2555. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  2556. var toObject = __webpack_require__("7b0b");
  2557. var IndexedObject = __webpack_require__("44ad");
  2558. var nativeAssign = Object.assign;
  2559. var defineProperty = Object.defineProperty;
  2560. // `Object.assign` method
  2561. // https://tc39.github.io/ecma262/#sec-object.assign
  2562. module.exports = !nativeAssign || fails(function () {
  2563. // should have correct order of operations (Edge bug)
  2564. if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  2565. enumerable: true,
  2566. get: function () {
  2567. defineProperty(this, 'b', {
  2568. value: 3,
  2569. enumerable: false
  2570. });
  2571. }
  2572. }), { b: 2 })).b !== 1) return true;
  2573. // should work with symbols and should have deterministic property order (V8 bug)
  2574. var A = {};
  2575. var B = {};
  2576. // eslint-disable-next-line no-undef
  2577. var symbol = Symbol();
  2578. var alphabet = 'abcdefghijklmnopqrst';
  2579. A[symbol] = 7;
  2580. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  2581. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  2582. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  2583. var T = toObject(target);
  2584. var argumentsLength = arguments.length;
  2585. var index = 1;
  2586. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2587. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  2588. while (argumentsLength > index) {
  2589. var S = IndexedObject(arguments[index++]);
  2590. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  2591. var length = keys.length;
  2592. var j = 0;
  2593. var key;
  2594. while (length > j) {
  2595. key = keys[j++];
  2596. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  2597. }
  2598. } return T;
  2599. } : nativeAssign;
  2600. /***/ }),
  2601. /***/ "6547":
  2602. /***/ (function(module, exports, __webpack_require__) {
  2603. var toInteger = __webpack_require__("a691");
  2604. var requireObjectCoercible = __webpack_require__("1d80");
  2605. // `String.prototype.{ codePointAt, at }` methods implementation
  2606. var createMethod = function (CONVERT_TO_STRING) {
  2607. return function ($this, pos) {
  2608. var S = String(requireObjectCoercible($this));
  2609. var position = toInteger(pos);
  2610. var size = S.length;
  2611. var first, second;
  2612. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2613. first = S.charCodeAt(position);
  2614. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2615. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  2616. ? CONVERT_TO_STRING ? S.charAt(position) : first
  2617. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2618. };
  2619. };
  2620. module.exports = {
  2621. // `String.prototype.codePointAt` method
  2622. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  2623. codeAt: createMethod(false),
  2624. // `String.prototype.at` method
  2625. // https://github.com/mathiasbynens/String.prototype.at
  2626. charAt: createMethod(true)
  2627. };
  2628. /***/ }),
  2629. /***/ "6566":
  2630. /***/ (function(module, exports, __webpack_require__) {
  2631. "use strict";
  2632. var defineProperty = __webpack_require__("9bf2").f;
  2633. var create = __webpack_require__("7c73");
  2634. var redefineAll = __webpack_require__("e2cc");
  2635. var bind = __webpack_require__("0366");
  2636. var anInstance = __webpack_require__("19aa");
  2637. var iterate = __webpack_require__("2266");
  2638. var defineIterator = __webpack_require__("7dd0");
  2639. var setSpecies = __webpack_require__("2626");
  2640. var DESCRIPTORS = __webpack_require__("83ab");
  2641. var fastKey = __webpack_require__("f183").fastKey;
  2642. var InternalStateModule = __webpack_require__("69f3");
  2643. var setInternalState = InternalStateModule.set;
  2644. var internalStateGetterFor = InternalStateModule.getterFor;
  2645. module.exports = {
  2646. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  2647. var C = wrapper(function (that, iterable) {
  2648. anInstance(that, C, CONSTRUCTOR_NAME);
  2649. setInternalState(that, {
  2650. type: CONSTRUCTOR_NAME,
  2651. index: create(null),
  2652. first: undefined,
  2653. last: undefined,
  2654. size: 0
  2655. });
  2656. if (!DESCRIPTORS) that.size = 0;
  2657. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  2658. });
  2659. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2660. var define = function (that, key, value) {
  2661. var state = getInternalState(that);
  2662. var entry = getEntry(that, key);
  2663. var previous, index;
  2664. // change existing entry
  2665. if (entry) {
  2666. entry.value = value;
  2667. // create new entry
  2668. } else {
  2669. state.last = entry = {
  2670. index: index = fastKey(key, true),
  2671. key: key,
  2672. value: value,
  2673. previous: previous = state.last,
  2674. next: undefined,
  2675. removed: false
  2676. };
  2677. if (!state.first) state.first = entry;
  2678. if (previous) previous.next = entry;
  2679. if (DESCRIPTORS) state.size++;
  2680. else that.size++;
  2681. // add to index
  2682. if (index !== 'F') state.index[index] = entry;
  2683. } return that;
  2684. };
  2685. var getEntry = function (that, key) {
  2686. var state = getInternalState(that);
  2687. // fast case
  2688. var index = fastKey(key);
  2689. var entry;
  2690. if (index !== 'F') return state.index[index];
  2691. // frozen object case
  2692. for (entry = state.first; entry; entry = entry.next) {
  2693. if (entry.key == key) return entry;
  2694. }
  2695. };
  2696. redefineAll(C.prototype, {
  2697. // 23.1.3.1 Map.prototype.clear()
  2698. // 23.2.3.2 Set.prototype.clear()
  2699. clear: function clear() {
  2700. var that = this;
  2701. var state = getInternalState(that);
  2702. var data = state.index;
  2703. var entry = state.first;
  2704. while (entry) {
  2705. entry.removed = true;
  2706. if (entry.previous) entry.previous = entry.previous.next = undefined;
  2707. delete data[entry.index];
  2708. entry = entry.next;
  2709. }
  2710. state.first = state.last = undefined;
  2711. if (DESCRIPTORS) state.size = 0;
  2712. else that.size = 0;
  2713. },
  2714. // 23.1.3.3 Map.prototype.delete(key)
  2715. // 23.2.3.4 Set.prototype.delete(value)
  2716. 'delete': function (key) {
  2717. var that = this;
  2718. var state = getInternalState(that);
  2719. var entry = getEntry(that, key);
  2720. if (entry) {
  2721. var next = entry.next;
  2722. var prev = entry.previous;
  2723. delete state.index[entry.index];
  2724. entry.removed = true;
  2725. if (prev) prev.next = next;
  2726. if (next) next.previous = prev;
  2727. if (state.first == entry) state.first = next;
  2728. if (state.last == entry) state.last = prev;
  2729. if (DESCRIPTORS) state.size--;
  2730. else that.size--;
  2731. } return !!entry;
  2732. },
  2733. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  2734. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  2735. forEach: function forEach(callbackfn /* , that = undefined */) {
  2736. var state = getInternalState(this);
  2737. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  2738. var entry;
  2739. while (entry = entry ? entry.next : state.first) {
  2740. boundFunction(entry.value, entry.key, this);
  2741. // revert to the last existing entry
  2742. while (entry && entry.removed) entry = entry.previous;
  2743. }
  2744. },
  2745. // 23.1.3.7 Map.prototype.has(key)
  2746. // 23.2.3.7 Set.prototype.has(value)
  2747. has: function has(key) {
  2748. return !!getEntry(this, key);
  2749. }
  2750. });
  2751. redefineAll(C.prototype, IS_MAP ? {
  2752. // 23.1.3.6 Map.prototype.get(key)
  2753. get: function get(key) {
  2754. var entry = getEntry(this, key);
  2755. return entry && entry.value;
  2756. },
  2757. // 23.1.3.9 Map.prototype.set(key, value)
  2758. set: function set(key, value) {
  2759. return define(this, key === 0 ? 0 : key, value);
  2760. }
  2761. } : {
  2762. // 23.2.3.1 Set.prototype.add(value)
  2763. add: function add(value) {
  2764. return define(this, value = value === 0 ? 0 : value, value);
  2765. }
  2766. });
  2767. if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
  2768. get: function () {
  2769. return getInternalState(this).size;
  2770. }
  2771. });
  2772. return C;
  2773. },
  2774. setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
  2775. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  2776. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2777. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  2778. // add .keys, .values, .entries, [@@iterator]
  2779. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  2780. defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
  2781. setInternalState(this, {
  2782. type: ITERATOR_NAME,
  2783. target: iterated,
  2784. state: getInternalCollectionState(iterated),
  2785. kind: kind,
  2786. last: undefined
  2787. });
  2788. }, function () {
  2789. var state = getInternalIteratorState(this);
  2790. var kind = state.kind;
  2791. var entry = state.last;
  2792. // revert to the last existing entry
  2793. while (entry && entry.removed) entry = entry.previous;
  2794. // get next entry
  2795. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  2796. // or finish the iteration
  2797. state.target = undefined;
  2798. return { value: undefined, done: true };
  2799. }
  2800. // return step by kind
  2801. if (kind == 'keys') return { value: entry.key, done: false };
  2802. if (kind == 'values') return { value: entry.value, done: false };
  2803. return { value: [entry.key, entry.value], done: false };
  2804. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  2805. // add [@@species], 23.1.2.2, 23.2.2.2
  2806. setSpecies(CONSTRUCTOR_NAME);
  2807. }
  2808. };
  2809. /***/ }),
  2810. /***/ "65f0":
  2811. /***/ (function(module, exports, __webpack_require__) {
  2812. var isObject = __webpack_require__("861d");
  2813. var isArray = __webpack_require__("e8b5");
  2814. var wellKnownSymbol = __webpack_require__("b622");
  2815. var SPECIES = wellKnownSymbol('species');
  2816. // `ArraySpeciesCreate` abstract operation
  2817. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  2818. module.exports = function (originalArray, length) {
  2819. var C;
  2820. if (isArray(originalArray)) {
  2821. C = originalArray.constructor;
  2822. // cross-realm fallback
  2823. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2824. else if (isObject(C)) {
  2825. C = C[SPECIES];
  2826. if (C === null) C = undefined;
  2827. }
  2828. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  2829. };
  2830. /***/ }),
  2831. /***/ "69f3":
  2832. /***/ (function(module, exports, __webpack_require__) {
  2833. var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
  2834. var global = __webpack_require__("da84");
  2835. var isObject = __webpack_require__("861d");
  2836. var createNonEnumerableProperty = __webpack_require__("9112");
  2837. var objectHas = __webpack_require__("5135");
  2838. var shared = __webpack_require__("c6cd");
  2839. var sharedKey = __webpack_require__("f772");
  2840. var hiddenKeys = __webpack_require__("d012");
  2841. var WeakMap = global.WeakMap;
  2842. var set, get, has;
  2843. var enforce = function (it) {
  2844. return has(it) ? get(it) : set(it, {});
  2845. };
  2846. var getterFor = function (TYPE) {
  2847. return function (it) {
  2848. var state;
  2849. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  2850. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  2851. } return state;
  2852. };
  2853. };
  2854. if (NATIVE_WEAK_MAP) {
  2855. var store = shared.state || (shared.state = new WeakMap());
  2856. var wmget = store.get;
  2857. var wmhas = store.has;
  2858. var wmset = store.set;
  2859. set = function (it, metadata) {
  2860. metadata.facade = it;
  2861. wmset.call(store, it, metadata);
  2862. return metadata;
  2863. };
  2864. get = function (it) {
  2865. return wmget.call(store, it) || {};
  2866. };
  2867. has = function (it) {
  2868. return wmhas.call(store, it);
  2869. };
  2870. } else {
  2871. var STATE = sharedKey('state');
  2872. hiddenKeys[STATE] = true;
  2873. set = function (it, metadata) {
  2874. metadata.facade = it;
  2875. createNonEnumerableProperty(it, STATE, metadata);
  2876. return metadata;
  2877. };
  2878. get = function (it) {
  2879. return objectHas(it, STATE) ? it[STATE] : {};
  2880. };
  2881. has = function (it) {
  2882. return objectHas(it, STATE);
  2883. };
  2884. }
  2885. module.exports = {
  2886. set: set,
  2887. get: get,
  2888. has: has,
  2889. enforce: enforce,
  2890. getterFor: getterFor
  2891. };
  2892. /***/ }),
  2893. /***/ "6d61":
  2894. /***/ (function(module, exports, __webpack_require__) {
  2895. "use strict";
  2896. var $ = __webpack_require__("23e7");
  2897. var global = __webpack_require__("da84");
  2898. var isForced = __webpack_require__("94ca");
  2899. var redefine = __webpack_require__("6eeb");
  2900. var InternalMetadataModule = __webpack_require__("f183");
  2901. var iterate = __webpack_require__("2266");
  2902. var anInstance = __webpack_require__("19aa");
  2903. var isObject = __webpack_require__("861d");
  2904. var fails = __webpack_require__("d039");
  2905. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  2906. var setToStringTag = __webpack_require__("d44e");
  2907. var inheritIfRequired = __webpack_require__("7156");
  2908. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  2909. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  2910. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  2911. var ADDER = IS_MAP ? 'set' : 'add';
  2912. var NativeConstructor = global[CONSTRUCTOR_NAME];
  2913. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  2914. var Constructor = NativeConstructor;
  2915. var exported = {};
  2916. var fixMethod = function (KEY) {
  2917. var nativeMethod = NativePrototype[KEY];
  2918. redefine(NativePrototype, KEY,
  2919. KEY == 'add' ? function add(value) {
  2920. nativeMethod.call(this, value === 0 ? 0 : value);
  2921. return this;
  2922. } : KEY == 'delete' ? function (key) {
  2923. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  2924. } : KEY == 'get' ? function get(key) {
  2925. return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
  2926. } : KEY == 'has' ? function has(key) {
  2927. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  2928. } : function set(key, value) {
  2929. nativeMethod.call(this, key === 0 ? 0 : key, value);
  2930. return this;
  2931. }
  2932. );
  2933. };
  2934. // eslint-disable-next-line max-len
  2935. if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
  2936. new NativeConstructor().entries().next();
  2937. })))) {
  2938. // create collection constructor
  2939. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  2940. InternalMetadataModule.REQUIRED = true;
  2941. } else if (isForced(CONSTRUCTOR_NAME, true)) {
  2942. var instance = new Constructor();
  2943. // early implementations not supports chaining
  2944. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  2945. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  2946. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  2947. // most early implementations doesn't supports iterables, most modern - not close it correctly
  2948. // eslint-disable-next-line no-new
  2949. var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
  2950. // for early implementations -0 and +0 not the same
  2951. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  2952. // V8 ~ Chromium 42- fails only with 5+ elements
  2953. var $instance = new NativeConstructor();
  2954. var index = 5;
  2955. while (index--) $instance[ADDER](index, index);
  2956. return !$instance.has(-0);
  2957. });
  2958. if (!ACCEPT_ITERABLES) {
  2959. Constructor = wrapper(function (dummy, iterable) {
  2960. anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
  2961. var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
  2962. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  2963. return that;
  2964. });
  2965. Constructor.prototype = NativePrototype;
  2966. NativePrototype.constructor = Constructor;
  2967. }
  2968. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  2969. fixMethod('delete');
  2970. fixMethod('has');
  2971. IS_MAP && fixMethod('get');
  2972. }
  2973. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  2974. // weak collections should not contains .clear method
  2975. if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
  2976. }
  2977. exported[CONSTRUCTOR_NAME] = Constructor;
  2978. $({ global: true, forced: Constructor != NativeConstructor }, exported);
  2979. setToStringTag(Constructor, CONSTRUCTOR_NAME);
  2980. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  2981. return Constructor;
  2982. };
  2983. /***/ }),
  2984. /***/ "6eeb":
  2985. /***/ (function(module, exports, __webpack_require__) {
  2986. var global = __webpack_require__("da84");
  2987. var createNonEnumerableProperty = __webpack_require__("9112");
  2988. var has = __webpack_require__("5135");
  2989. var setGlobal = __webpack_require__("ce4e");
  2990. var inspectSource = __webpack_require__("8925");
  2991. var InternalStateModule = __webpack_require__("69f3");
  2992. var getInternalState = InternalStateModule.get;
  2993. var enforceInternalState = InternalStateModule.enforce;
  2994. var TEMPLATE = String(String).split('String');
  2995. (module.exports = function (O, key, value, options) {
  2996. var unsafe = options ? !!options.unsafe : false;
  2997. var simple = options ? !!options.enumerable : false;
  2998. var noTargetGet = options ? !!options.noTargetGet : false;
  2999. var state;
  3000. if (typeof value == 'function') {
  3001. if (typeof key == 'string' && !has(value, 'name')) {
  3002. createNonEnumerableProperty(value, 'name', key);
  3003. }
  3004. state = enforceInternalState(value);
  3005. if (!state.source) {
  3006. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  3007. }
  3008. }
  3009. if (O === global) {
  3010. if (simple) O[key] = value;
  3011. else setGlobal(key, value);
  3012. return;
  3013. } else if (!unsafe) {
  3014. delete O[key];
  3015. } else if (!noTargetGet && O[key]) {
  3016. simple = true;
  3017. }
  3018. if (simple) O[key] = value;
  3019. else createNonEnumerableProperty(O, key, value);
  3020. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  3021. })(Function.prototype, 'toString', function toString() {
  3022. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  3023. });
  3024. /***/ }),
  3025. /***/ "7156":
  3026. /***/ (function(module, exports, __webpack_require__) {
  3027. var isObject = __webpack_require__("861d");
  3028. var setPrototypeOf = __webpack_require__("d2bb");
  3029. // makes subclassing work correct for wrapped built-ins
  3030. module.exports = function ($this, dummy, Wrapper) {
  3031. var NewTarget, NewTargetPrototype;
  3032. if (
  3033. // it can work only with native `setPrototypeOf`
  3034. setPrototypeOf &&
  3035. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  3036. typeof (NewTarget = dummy.constructor) == 'function' &&
  3037. NewTarget !== Wrapper &&
  3038. isObject(NewTargetPrototype = NewTarget.prototype) &&
  3039. NewTargetPrototype !== Wrapper.prototype
  3040. ) setPrototypeOf($this, NewTargetPrototype);
  3041. return $this;
  3042. };
  3043. /***/ }),
  3044. /***/ "7418":
  3045. /***/ (function(module, exports) {
  3046. exports.f = Object.getOwnPropertySymbols;
  3047. /***/ }),
  3048. /***/ "746f":
  3049. /***/ (function(module, exports, __webpack_require__) {
  3050. var path = __webpack_require__("428f");
  3051. var has = __webpack_require__("5135");
  3052. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  3053. var defineProperty = __webpack_require__("9bf2").f;
  3054. module.exports = function (NAME) {
  3055. var Symbol = path.Symbol || (path.Symbol = {});
  3056. if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
  3057. value: wrappedWellKnownSymbolModule.f(NAME)
  3058. });
  3059. };
  3060. /***/ }),
  3061. /***/ "7839":
  3062. /***/ (function(module, exports) {
  3063. // IE8- don't enum bug keys
  3064. module.exports = [
  3065. 'constructor',
  3066. 'hasOwnProperty',
  3067. 'isPrototypeOf',
  3068. 'propertyIsEnumerable',
  3069. 'toLocaleString',
  3070. 'toString',
  3071. 'valueOf'
  3072. ];
  3073. /***/ }),
  3074. /***/ "7b0b":
  3075. /***/ (function(module, exports, __webpack_require__) {
  3076. var requireObjectCoercible = __webpack_require__("1d80");
  3077. // `ToObject` abstract operation
  3078. // https://tc39.github.io/ecma262/#sec-toobject
  3079. module.exports = function (argument) {
  3080. return Object(requireObjectCoercible(argument));
  3081. };
  3082. /***/ }),
  3083. /***/ "7c73":
  3084. /***/ (function(module, exports, __webpack_require__) {
  3085. var anObject = __webpack_require__("825a");
  3086. var defineProperties = __webpack_require__("37e8");
  3087. var enumBugKeys = __webpack_require__("7839");
  3088. var hiddenKeys = __webpack_require__("d012");
  3089. var html = __webpack_require__("1be4");
  3090. var documentCreateElement = __webpack_require__("cc12");
  3091. var sharedKey = __webpack_require__("f772");
  3092. var GT = '>';
  3093. var LT = '<';
  3094. var PROTOTYPE = 'prototype';
  3095. var SCRIPT = 'script';
  3096. var IE_PROTO = sharedKey('IE_PROTO');
  3097. var EmptyConstructor = function () { /* empty */ };
  3098. var scriptTag = function (content) {
  3099. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  3100. };
  3101. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  3102. var NullProtoObjectViaActiveX = function (activeXDocument) {
  3103. activeXDocument.write(scriptTag(''));
  3104. activeXDocument.close();
  3105. var temp = activeXDocument.parentWindow.Object;
  3106. activeXDocument = null; // avoid memory leak
  3107. return temp;
  3108. };
  3109. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  3110. var NullProtoObjectViaIFrame = function () {
  3111. // Thrash, waste and sodomy: IE GC bug
  3112. var iframe = documentCreateElement('iframe');
  3113. var JS = 'java' + SCRIPT + ':';
  3114. var iframeDocument;
  3115. iframe.style.display = 'none';
  3116. html.appendChild(iframe);
  3117. // https://github.com/zloirock/core-js/issues/475
  3118. iframe.src = String(JS);
  3119. iframeDocument = iframe.contentWindow.document;
  3120. iframeDocument.open();
  3121. iframeDocument.write(scriptTag('document.F=Object'));
  3122. iframeDocument.close();
  3123. return iframeDocument.F;
  3124. };
  3125. // Check for document.domain and active x support
  3126. // No need to use active x approach when document.domain is not set
  3127. // see https://github.com/es-shims/es5-shim/issues/150
  3128. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  3129. // avoid IE GC bug
  3130. var activeXDocument;
  3131. var NullProtoObject = function () {
  3132. try {
  3133. /* global ActiveXObject */
  3134. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  3135. } catch (error) { /* ignore */ }
  3136. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  3137. var length = enumBugKeys.length;
  3138. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  3139. return NullProtoObject();
  3140. };
  3141. hiddenKeys[IE_PROTO] = true;
  3142. // `Object.create` method
  3143. // https://tc39.github.io/ecma262/#sec-object.create
  3144. module.exports = Object.create || function create(O, Properties) {
  3145. var result;
  3146. if (O !== null) {
  3147. EmptyConstructor[PROTOTYPE] = anObject(O);
  3148. result = new EmptyConstructor();
  3149. EmptyConstructor[PROTOTYPE] = null;
  3150. // add "__proto__" for Object.getPrototypeOf polyfill
  3151. result[IE_PROTO] = O;
  3152. } else result = NullProtoObject();
  3153. return Properties === undefined ? result : defineProperties(result, Properties);
  3154. };
  3155. /***/ }),
  3156. /***/ "7db0":
  3157. /***/ (function(module, exports, __webpack_require__) {
  3158. "use strict";
  3159. var $ = __webpack_require__("23e7");
  3160. var $find = __webpack_require__("b727").find;
  3161. var addToUnscopables = __webpack_require__("44d2");
  3162. var arrayMethodUsesToLength = __webpack_require__("ae40");
  3163. var FIND = 'find';
  3164. var SKIPS_HOLES = true;
  3165. var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
  3166. // Shouldn't skip holes
  3167. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  3168. // `Array.prototype.find` method
  3169. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  3170. $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
  3171. find: function find(callbackfn /* , that = undefined */) {
  3172. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3173. }
  3174. });
  3175. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  3176. addToUnscopables(FIND);
  3177. /***/ }),
  3178. /***/ "7dd0":
  3179. /***/ (function(module, exports, __webpack_require__) {
  3180. "use strict";
  3181. var $ = __webpack_require__("23e7");
  3182. var createIteratorConstructor = __webpack_require__("9ed3");
  3183. var getPrototypeOf = __webpack_require__("e163");
  3184. var setPrototypeOf = __webpack_require__("d2bb");
  3185. var setToStringTag = __webpack_require__("d44e");
  3186. var createNonEnumerableProperty = __webpack_require__("9112");
  3187. var redefine = __webpack_require__("6eeb");
  3188. var wellKnownSymbol = __webpack_require__("b622");
  3189. var IS_PURE = __webpack_require__("c430");
  3190. var Iterators = __webpack_require__("3f8c");
  3191. var IteratorsCore = __webpack_require__("ae93");
  3192. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3193. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3194. var ITERATOR = wellKnownSymbol('iterator');
  3195. var KEYS = 'keys';
  3196. var VALUES = 'values';
  3197. var ENTRIES = 'entries';
  3198. var returnThis = function () { return this; };
  3199. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3200. createIteratorConstructor(IteratorConstructor, NAME, next);
  3201. var getIterationMethod = function (KIND) {
  3202. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3203. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3204. switch (KIND) {
  3205. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3206. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3207. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3208. } return function () { return new IteratorConstructor(this); };
  3209. };
  3210. var TO_STRING_TAG = NAME + ' Iterator';
  3211. var INCORRECT_VALUES_NAME = false;
  3212. var IterablePrototype = Iterable.prototype;
  3213. var nativeIterator = IterablePrototype[ITERATOR]
  3214. || IterablePrototype['@@iterator']
  3215. || DEFAULT && IterablePrototype[DEFAULT];
  3216. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3217. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3218. var CurrentIteratorPrototype, methods, KEY;
  3219. // fix native
  3220. if (anyNativeIterator) {
  3221. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3222. if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3223. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3224. if (setPrototypeOf) {
  3225. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3226. } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
  3227. createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
  3228. }
  3229. }
  3230. // Set @@toStringTag to native iterators
  3231. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  3232. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  3233. }
  3234. }
  3235. // fix Array#{values, @@iterator}.name in V8 / FF
  3236. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3237. INCORRECT_VALUES_NAME = true;
  3238. defaultIterator = function values() { return nativeIterator.call(this); };
  3239. }
  3240. // define iterator
  3241. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  3242. createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
  3243. }
  3244. Iterators[NAME] = defaultIterator;
  3245. // export additional methods
  3246. if (DEFAULT) {
  3247. methods = {
  3248. values: getIterationMethod(VALUES),
  3249. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3250. entries: getIterationMethod(ENTRIES)
  3251. };
  3252. if (FORCED) for (KEY in methods) {
  3253. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3254. redefine(IterablePrototype, KEY, methods[KEY]);
  3255. }
  3256. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3257. }
  3258. return methods;
  3259. };
  3260. /***/ }),
  3261. /***/ "7f9a":
  3262. /***/ (function(module, exports, __webpack_require__) {
  3263. var global = __webpack_require__("da84");
  3264. var inspectSource = __webpack_require__("8925");
  3265. var WeakMap = global.WeakMap;
  3266. module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  3267. /***/ }),
  3268. /***/ "7fd6":
  3269. /***/ (function(module, exports) {
  3270. module.exports = require("xe-utils/ctor");
  3271. /***/ }),
  3272. /***/ "825a":
  3273. /***/ (function(module, exports, __webpack_require__) {
  3274. var isObject = __webpack_require__("861d");
  3275. module.exports = function (it) {
  3276. if (!isObject(it)) {
  3277. throw TypeError(String(it) + ' is not an object');
  3278. } return it;
  3279. };
  3280. /***/ }),
  3281. /***/ "83ab":
  3282. /***/ (function(module, exports, __webpack_require__) {
  3283. var fails = __webpack_require__("d039");
  3284. // Thank's IE8 for his funny defineProperty
  3285. module.exports = !fails(function () {
  3286. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  3287. });
  3288. /***/ }),
  3289. /***/ "8418":
  3290. /***/ (function(module, exports, __webpack_require__) {
  3291. "use strict";
  3292. var toPrimitive = __webpack_require__("c04e");
  3293. var definePropertyModule = __webpack_require__("9bf2");
  3294. var createPropertyDescriptor = __webpack_require__("5c6c");
  3295. module.exports = function (object, key, value) {
  3296. var propertyKey = toPrimitive(key);
  3297. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  3298. else object[propertyKey] = value;
  3299. };
  3300. /***/ }),
  3301. /***/ "857a":
  3302. /***/ (function(module, exports, __webpack_require__) {
  3303. var requireObjectCoercible = __webpack_require__("1d80");
  3304. var quot = /"/g;
  3305. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  3306. // https://tc39.github.io/ecma262/#sec-createhtml
  3307. module.exports = function (string, tag, attribute, value) {
  3308. var S = String(requireObjectCoercible(string));
  3309. var p1 = '<' + tag;
  3310. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  3311. return p1 + '>' + S + '</' + tag + '>';
  3312. };
  3313. /***/ }),
  3314. /***/ "861d":
  3315. /***/ (function(module, exports) {
  3316. module.exports = function (it) {
  3317. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3318. };
  3319. /***/ }),
  3320. /***/ "8875":
  3321. /***/ (function(module, exports, __webpack_require__) {
  3322. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
  3323. // MIT license
  3324. // source: https://github.com/amiller-gh/currentScript-polyfill
  3325. // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
  3326. (function (root, factory) {
  3327. if (true) {
  3328. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  3329. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  3330. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  3331. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  3332. } else {}
  3333. }(typeof self !== 'undefined' ? self : this, function () {
  3334. function getCurrentScript () {
  3335. var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
  3336. // for chrome
  3337. if (!descriptor && 'currentScript' in document && document.currentScript) {
  3338. return document.currentScript
  3339. }
  3340. // for other browsers with native support for currentScript
  3341. if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
  3342. return document.currentScript
  3343. }
  3344. // IE 8-10 support script readyState
  3345. // IE 11+ & Firefox support stack trace
  3346. try {
  3347. throw new Error();
  3348. }
  3349. catch (err) {
  3350. // Find the second match for the "at" string to get file src url from stack.
  3351. var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
  3352. ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
  3353. stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
  3354. scriptLocation = (stackDetails && stackDetails[1]) || false,
  3355. line = (stackDetails && stackDetails[2]) || false,
  3356. currentLocation = document.location.href.replace(document.location.hash, ''),
  3357. pageSource,
  3358. inlineScriptSourceRegExp,
  3359. inlineScriptSource,
  3360. scripts = document.getElementsByTagName('script'); // Live NodeList collection
  3361. if (scriptLocation === currentLocation) {
  3362. pageSource = document.documentElement.outerHTML;
  3363. inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
  3364. inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
  3365. }
  3366. for (var i = 0; i < scripts.length; i++) {
  3367. // If ready state is interactive, return the script tag
  3368. if (scripts[i].readyState === 'interactive') {
  3369. return scripts[i];
  3370. }
  3371. // If src matches, return the script tag
  3372. if (scripts[i].src === scriptLocation) {
  3373. return scripts[i];
  3374. }
  3375. // If inline source matches, return the script tag
  3376. if (
  3377. scriptLocation === currentLocation &&
  3378. scripts[i].innerHTML &&
  3379. scripts[i].innerHTML.trim() === inlineScriptSource
  3380. ) {
  3381. return scripts[i];
  3382. }
  3383. }
  3384. // If no match, return null
  3385. return null;
  3386. }
  3387. };
  3388. return getCurrentScript
  3389. }));
  3390. /***/ }),
  3391. /***/ "8925":
  3392. /***/ (function(module, exports, __webpack_require__) {
  3393. var store = __webpack_require__("c6cd");
  3394. var functionToString = Function.toString;
  3395. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  3396. if (typeof store.inspectSource != 'function') {
  3397. store.inspectSource = function (it) {
  3398. return functionToString.call(it);
  3399. };
  3400. }
  3401. module.exports = store.inspectSource;
  3402. /***/ }),
  3403. /***/ "8aa5":
  3404. /***/ (function(module, exports, __webpack_require__) {
  3405. "use strict";
  3406. var charAt = __webpack_require__("6547").charAt;
  3407. // `AdvanceStringIndex` abstract operation
  3408. // https://tc39.github.io/ecma262/#sec-advancestringindex
  3409. module.exports = function (S, index, unicode) {
  3410. return index + (unicode ? charAt(S, index).length : 1);
  3411. };
  3412. /***/ }),
  3413. /***/ "90e3":
  3414. /***/ (function(module, exports) {
  3415. var id = 0;
  3416. var postfix = Math.random();
  3417. module.exports = function (key) {
  3418. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  3419. };
  3420. /***/ }),
  3421. /***/ "9112":
  3422. /***/ (function(module, exports, __webpack_require__) {
  3423. var DESCRIPTORS = __webpack_require__("83ab");
  3424. var definePropertyModule = __webpack_require__("9bf2");
  3425. var createPropertyDescriptor = __webpack_require__("5c6c");
  3426. module.exports = DESCRIPTORS ? function (object, key, value) {
  3427. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  3428. } : function (object, key, value) {
  3429. object[key] = value;
  3430. return object;
  3431. };
  3432. /***/ }),
  3433. /***/ "9263":
  3434. /***/ (function(module, exports, __webpack_require__) {
  3435. "use strict";
  3436. var regexpFlags = __webpack_require__("ad6d");
  3437. var stickyHelpers = __webpack_require__("9f7f");
  3438. var nativeExec = RegExp.prototype.exec;
  3439. // This always refers to the native implementation, because the
  3440. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  3441. // which loads this file before patching the method.
  3442. var nativeReplace = String.prototype.replace;
  3443. var patchedExec = nativeExec;
  3444. var UPDATES_LAST_INDEX_WRONG = (function () {
  3445. var re1 = /a/;
  3446. var re2 = /b*/g;
  3447. nativeExec.call(re1, 'a');
  3448. nativeExec.call(re2, 'a');
  3449. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  3450. })();
  3451. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
  3452. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  3453. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  3454. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  3455. if (PATCH) {
  3456. patchedExec = function exec(str) {
  3457. var re = this;
  3458. var lastIndex, reCopy, match, i;
  3459. var sticky = UNSUPPORTED_Y && re.sticky;
  3460. var flags = regexpFlags.call(re);
  3461. var source = re.source;
  3462. var charsAdded = 0;
  3463. var strCopy = str;
  3464. if (sticky) {
  3465. flags = flags.replace('y', '');
  3466. if (flags.indexOf('g') === -1) {
  3467. flags += 'g';
  3468. }
  3469. strCopy = String(str).slice(re.lastIndex);
  3470. // Support anchored sticky behavior.
  3471. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  3472. source = '(?: ' + source + ')';
  3473. strCopy = ' ' + strCopy;
  3474. charsAdded++;
  3475. }
  3476. // ^(? + rx + ) is needed, in combination with some str slicing, to
  3477. // simulate the 'y' flag.
  3478. reCopy = new RegExp('^(?:' + source + ')', flags);
  3479. }
  3480. if (NPCG_INCLUDED) {
  3481. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  3482. }
  3483. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  3484. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  3485. if (sticky) {
  3486. if (match) {
  3487. match.input = match.input.slice(charsAdded);
  3488. match[0] = match[0].slice(charsAdded);
  3489. match.index = re.lastIndex;
  3490. re.lastIndex += match[0].length;
  3491. } else re.lastIndex = 0;
  3492. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  3493. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  3494. }
  3495. if (NPCG_INCLUDED && match && match.length > 1) {
  3496. // Fix browsers whose `exec` methods don't consistently return `undefined`
  3497. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  3498. nativeReplace.call(match[0], reCopy, function () {
  3499. for (i = 1; i < arguments.length - 2; i++) {
  3500. if (arguments[i] === undefined) match[i] = undefined;
  3501. }
  3502. });
  3503. }
  3504. return match;
  3505. };
  3506. }
  3507. module.exports = patchedExec;
  3508. /***/ }),
  3509. /***/ "94ca":
  3510. /***/ (function(module, exports, __webpack_require__) {
  3511. var fails = __webpack_require__("d039");
  3512. var replacement = /#|\.prototype\./;
  3513. var isForced = function (feature, detection) {
  3514. var value = data[normalize(feature)];
  3515. return value == POLYFILL ? true
  3516. : value == NATIVE ? false
  3517. : typeof detection == 'function' ? fails(detection)
  3518. : !!detection;
  3519. };
  3520. var normalize = isForced.normalize = function (string) {
  3521. return String(string).replace(replacement, '.').toLowerCase();
  3522. };
  3523. var data = isForced.data = {};
  3524. var NATIVE = isForced.NATIVE = 'N';
  3525. var POLYFILL = isForced.POLYFILL = 'P';
  3526. module.exports = isForced;
  3527. /***/ }),
  3528. /***/ "9861":
  3529. /***/ (function(module, exports, __webpack_require__) {
  3530. "use strict";
  3531. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  3532. __webpack_require__("e260");
  3533. var $ = __webpack_require__("23e7");
  3534. var getBuiltIn = __webpack_require__("d066");
  3535. var USE_NATIVE_URL = __webpack_require__("0d3b");
  3536. var redefine = __webpack_require__("6eeb");
  3537. var redefineAll = __webpack_require__("e2cc");
  3538. var setToStringTag = __webpack_require__("d44e");
  3539. var createIteratorConstructor = __webpack_require__("9ed3");
  3540. var InternalStateModule = __webpack_require__("69f3");
  3541. var anInstance = __webpack_require__("19aa");
  3542. var hasOwn = __webpack_require__("5135");
  3543. var bind = __webpack_require__("0366");
  3544. var classof = __webpack_require__("f5df");
  3545. var anObject = __webpack_require__("825a");
  3546. var isObject = __webpack_require__("861d");
  3547. var create = __webpack_require__("7c73");
  3548. var createPropertyDescriptor = __webpack_require__("5c6c");
  3549. var getIterator = __webpack_require__("9a1f");
  3550. var getIteratorMethod = __webpack_require__("35a1");
  3551. var wellKnownSymbol = __webpack_require__("b622");
  3552. var $fetch = getBuiltIn('fetch');
  3553. var Headers = getBuiltIn('Headers');
  3554. var ITERATOR = wellKnownSymbol('iterator');
  3555. var URL_SEARCH_PARAMS = 'URLSearchParams';
  3556. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  3557. var setInternalState = InternalStateModule.set;
  3558. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  3559. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  3560. var plus = /\+/g;
  3561. var sequences = Array(4);
  3562. var percentSequence = function (bytes) {
  3563. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  3564. };
  3565. var percentDecode = function (sequence) {
  3566. try {
  3567. return decodeURIComponent(sequence);
  3568. } catch (error) {
  3569. return sequence;
  3570. }
  3571. };
  3572. var deserialize = function (it) {
  3573. var result = it.replace(plus, ' ');
  3574. var bytes = 4;
  3575. try {
  3576. return decodeURIComponent(result);
  3577. } catch (error) {
  3578. while (bytes) {
  3579. result = result.replace(percentSequence(bytes--), percentDecode);
  3580. }
  3581. return result;
  3582. }
  3583. };
  3584. var find = /[!'()~]|%20/g;
  3585. var replace = {
  3586. '!': '%21',
  3587. "'": '%27',
  3588. '(': '%28',
  3589. ')': '%29',
  3590. '~': '%7E',
  3591. '%20': '+'
  3592. };
  3593. var replacer = function (match) {
  3594. return replace[match];
  3595. };
  3596. var serialize = function (it) {
  3597. return encodeURIComponent(it).replace(find, replacer);
  3598. };
  3599. var parseSearchParams = function (result, query) {
  3600. if (query) {
  3601. var attributes = query.split('&');
  3602. var index = 0;
  3603. var attribute, entry;
  3604. while (index < attributes.length) {
  3605. attribute = attributes[index++];
  3606. if (attribute.length) {
  3607. entry = attribute.split('=');
  3608. result.push({
  3609. key: deserialize(entry.shift()),
  3610. value: deserialize(entry.join('='))
  3611. });
  3612. }
  3613. }
  3614. }
  3615. };
  3616. var updateSearchParams = function (query) {
  3617. this.entries.length = 0;
  3618. parseSearchParams(this.entries, query);
  3619. };
  3620. var validateArgumentsLength = function (passed, required) {
  3621. if (passed < required) throw TypeError('Not enough arguments');
  3622. };
  3623. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  3624. setInternalState(this, {
  3625. type: URL_SEARCH_PARAMS_ITERATOR,
  3626. iterator: getIterator(getInternalParamsState(params).entries),
  3627. kind: kind
  3628. });
  3629. }, 'Iterator', function next() {
  3630. var state = getInternalIteratorState(this);
  3631. var kind = state.kind;
  3632. var step = state.iterator.next();
  3633. var entry = step.value;
  3634. if (!step.done) {
  3635. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  3636. } return step;
  3637. });
  3638. // `URLSearchParams` constructor
  3639. // https://url.spec.whatwg.org/#interface-urlsearchparams
  3640. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  3641. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3642. var init = arguments.length > 0 ? arguments[0] : undefined;
  3643. var that = this;
  3644. var entries = [];
  3645. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  3646. setInternalState(that, {
  3647. type: URL_SEARCH_PARAMS,
  3648. entries: entries,
  3649. updateURL: function () { /* empty */ },
  3650. updateSearchParams: updateSearchParams
  3651. });
  3652. if (init !== undefined) {
  3653. if (isObject(init)) {
  3654. iteratorMethod = getIteratorMethod(init);
  3655. if (typeof iteratorMethod === 'function') {
  3656. iterator = iteratorMethod.call(init);
  3657. next = iterator.next;
  3658. while (!(step = next.call(iterator)).done) {
  3659. entryIterator = getIterator(anObject(step.value));
  3660. entryNext = entryIterator.next;
  3661. if (
  3662. (first = entryNext.call(entryIterator)).done ||
  3663. (second = entryNext.call(entryIterator)).done ||
  3664. !entryNext.call(entryIterator).done
  3665. ) throw TypeError('Expected sequence with length 2');
  3666. entries.push({ key: first.value + '', value: second.value + '' });
  3667. }
  3668. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
  3669. } else {
  3670. parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
  3671. }
  3672. }
  3673. };
  3674. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  3675. redefineAll(URLSearchParamsPrototype, {
  3676. // `URLSearchParams.prototype.append` method
  3677. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  3678. append: function append(name, value) {
  3679. validateArgumentsLength(arguments.length, 2);
  3680. var state = getInternalParamsState(this);
  3681. state.entries.push({ key: name + '', value: value + '' });
  3682. state.updateURL();
  3683. },
  3684. // `URLSearchParams.prototype.delete` method
  3685. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  3686. 'delete': function (name) {
  3687. validateArgumentsLength(arguments.length, 1);
  3688. var state = getInternalParamsState(this);
  3689. var entries = state.entries;
  3690. var key = name + '';
  3691. var index = 0;
  3692. while (index < entries.length) {
  3693. if (entries[index].key === key) entries.splice(index, 1);
  3694. else index++;
  3695. }
  3696. state.updateURL();
  3697. },
  3698. // `URLSearchParams.prototype.get` method
  3699. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  3700. get: function get(name) {
  3701. validateArgumentsLength(arguments.length, 1);
  3702. var entries = getInternalParamsState(this).entries;
  3703. var key = name + '';
  3704. var index = 0;
  3705. for (; index < entries.length; index++) {
  3706. if (entries[index].key === key) return entries[index].value;
  3707. }
  3708. return null;
  3709. },
  3710. // `URLSearchParams.prototype.getAll` method
  3711. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  3712. getAll: function getAll(name) {
  3713. validateArgumentsLength(arguments.length, 1);
  3714. var entries = getInternalParamsState(this).entries;
  3715. var key = name + '';
  3716. var result = [];
  3717. var index = 0;
  3718. for (; index < entries.length; index++) {
  3719. if (entries[index].key === key) result.push(entries[index].value);
  3720. }
  3721. return result;
  3722. },
  3723. // `URLSearchParams.prototype.has` method
  3724. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  3725. has: function has(name) {
  3726. validateArgumentsLength(arguments.length, 1);
  3727. var entries = getInternalParamsState(this).entries;
  3728. var key = name + '';
  3729. var index = 0;
  3730. while (index < entries.length) {
  3731. if (entries[index++].key === key) return true;
  3732. }
  3733. return false;
  3734. },
  3735. // `URLSearchParams.prototype.set` method
  3736. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  3737. set: function set(name, value) {
  3738. validateArgumentsLength(arguments.length, 1);
  3739. var state = getInternalParamsState(this);
  3740. var entries = state.entries;
  3741. var found = false;
  3742. var key = name + '';
  3743. var val = value + '';
  3744. var index = 0;
  3745. var entry;
  3746. for (; index < entries.length; index++) {
  3747. entry = entries[index];
  3748. if (entry.key === key) {
  3749. if (found) entries.splice(index--, 1);
  3750. else {
  3751. found = true;
  3752. entry.value = val;
  3753. }
  3754. }
  3755. }
  3756. if (!found) entries.push({ key: key, value: val });
  3757. state.updateURL();
  3758. },
  3759. // `URLSearchParams.prototype.sort` method
  3760. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  3761. sort: function sort() {
  3762. var state = getInternalParamsState(this);
  3763. var entries = state.entries;
  3764. // Array#sort is not stable in some engines
  3765. var slice = entries.slice();
  3766. var entry, entriesIndex, sliceIndex;
  3767. entries.length = 0;
  3768. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  3769. entry = slice[sliceIndex];
  3770. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  3771. if (entries[entriesIndex].key > entry.key) {
  3772. entries.splice(entriesIndex, 0, entry);
  3773. break;
  3774. }
  3775. }
  3776. if (entriesIndex === sliceIndex) entries.push(entry);
  3777. }
  3778. state.updateURL();
  3779. },
  3780. // `URLSearchParams.prototype.forEach` method
  3781. forEach: function forEach(callback /* , thisArg */) {
  3782. var entries = getInternalParamsState(this).entries;
  3783. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  3784. var index = 0;
  3785. var entry;
  3786. while (index < entries.length) {
  3787. entry = entries[index++];
  3788. boundFunction(entry.value, entry.key, this);
  3789. }
  3790. },
  3791. // `URLSearchParams.prototype.keys` method
  3792. keys: function keys() {
  3793. return new URLSearchParamsIterator(this, 'keys');
  3794. },
  3795. // `URLSearchParams.prototype.values` method
  3796. values: function values() {
  3797. return new URLSearchParamsIterator(this, 'values');
  3798. },
  3799. // `URLSearchParams.prototype.entries` method
  3800. entries: function entries() {
  3801. return new URLSearchParamsIterator(this, 'entries');
  3802. }
  3803. }, { enumerable: true });
  3804. // `URLSearchParams.prototype[@@iterator]` method
  3805. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
  3806. // `URLSearchParams.prototype.toString` method
  3807. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  3808. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  3809. var entries = getInternalParamsState(this).entries;
  3810. var result = [];
  3811. var index = 0;
  3812. var entry;
  3813. while (index < entries.length) {
  3814. entry = entries[index++];
  3815. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  3816. } return result.join('&');
  3817. }, { enumerable: true });
  3818. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3819. $({ global: true, forced: !USE_NATIVE_URL }, {
  3820. URLSearchParams: URLSearchParamsConstructor
  3821. });
  3822. // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
  3823. // https://github.com/zloirock/core-js/issues/674
  3824. if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
  3825. $({ global: true, enumerable: true, forced: true }, {
  3826. fetch: function fetch(input /* , init */) {
  3827. var args = [input];
  3828. var init, body, headers;
  3829. if (arguments.length > 1) {
  3830. init = arguments[1];
  3831. if (isObject(init)) {
  3832. body = init.body;
  3833. if (classof(body) === URL_SEARCH_PARAMS) {
  3834. headers = init.headers ? new Headers(init.headers) : new Headers();
  3835. if (!headers.has('content-type')) {
  3836. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  3837. }
  3838. init = create(init, {
  3839. body: createPropertyDescriptor(0, String(body)),
  3840. headers: createPropertyDescriptor(0, headers)
  3841. });
  3842. }
  3843. }
  3844. args.push(init);
  3845. } return $fetch.apply(this, args);
  3846. }
  3847. });
  3848. }
  3849. module.exports = {
  3850. URLSearchParams: URLSearchParamsConstructor,
  3851. getState: getInternalParamsState
  3852. };
  3853. /***/ }),
  3854. /***/ "99af":
  3855. /***/ (function(module, exports, __webpack_require__) {
  3856. "use strict";
  3857. var $ = __webpack_require__("23e7");
  3858. var fails = __webpack_require__("d039");
  3859. var isArray = __webpack_require__("e8b5");
  3860. var isObject = __webpack_require__("861d");
  3861. var toObject = __webpack_require__("7b0b");
  3862. var toLength = __webpack_require__("50c4");
  3863. var createProperty = __webpack_require__("8418");
  3864. var arraySpeciesCreate = __webpack_require__("65f0");
  3865. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  3866. var wellKnownSymbol = __webpack_require__("b622");
  3867. var V8_VERSION = __webpack_require__("2d00");
  3868. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  3869. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  3870. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  3871. // We can't use this feature detection in V8 since it causes
  3872. // deoptimization and serious performance degradation
  3873. // https://github.com/zloirock/core-js/issues/679
  3874. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  3875. var array = [];
  3876. array[IS_CONCAT_SPREADABLE] = false;
  3877. return array.concat()[0] !== array;
  3878. });
  3879. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  3880. var isConcatSpreadable = function (O) {
  3881. if (!isObject(O)) return false;
  3882. var spreadable = O[IS_CONCAT_SPREADABLE];
  3883. return spreadable !== undefined ? !!spreadable : isArray(O);
  3884. };
  3885. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  3886. // `Array.prototype.concat` method
  3887. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  3888. // with adding support of @@isConcatSpreadable and @@species
  3889. $({ target: 'Array', proto: true, forced: FORCED }, {
  3890. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  3891. var O = toObject(this);
  3892. var A = arraySpeciesCreate(O, 0);
  3893. var n = 0;
  3894. var i, k, length, len, E;
  3895. for (i = -1, length = arguments.length; i < length; i++) {
  3896. E = i === -1 ? O : arguments[i];
  3897. if (isConcatSpreadable(E)) {
  3898. len = toLength(E.length);
  3899. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  3900. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  3901. } else {
  3902. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  3903. createProperty(A, n++, E);
  3904. }
  3905. }
  3906. A.length = n;
  3907. return A;
  3908. }
  3909. });
  3910. /***/ }),
  3911. /***/ "9a0c":
  3912. /***/ (function(module, exports, __webpack_require__) {
  3913. // https://github.com/zloirock/core-js/issues/280
  3914. var userAgent = __webpack_require__("342f");
  3915. // eslint-disable-next-line unicorn/no-unsafe-regex
  3916. module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  3917. /***/ }),
  3918. /***/ "9a1f":
  3919. /***/ (function(module, exports, __webpack_require__) {
  3920. var anObject = __webpack_require__("825a");
  3921. var getIteratorMethod = __webpack_require__("35a1");
  3922. module.exports = function (it) {
  3923. var iteratorMethod = getIteratorMethod(it);
  3924. if (typeof iteratorMethod != 'function') {
  3925. throw TypeError(String(it) + ' is not iterable');
  3926. } return anObject(iteratorMethod.call(it));
  3927. };
  3928. /***/ }),
  3929. /***/ "9bdd":
  3930. /***/ (function(module, exports, __webpack_require__) {
  3931. var anObject = __webpack_require__("825a");
  3932. var iteratorClose = __webpack_require__("2a62");
  3933. // call something on iterator step with safe closing on error
  3934. module.exports = function (iterator, fn, value, ENTRIES) {
  3935. try {
  3936. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  3937. // 7.4.6 IteratorClose(iterator, completion)
  3938. } catch (error) {
  3939. iteratorClose(iterator);
  3940. throw error;
  3941. }
  3942. };
  3943. /***/ }),
  3944. /***/ "9bf2":
  3945. /***/ (function(module, exports, __webpack_require__) {
  3946. var DESCRIPTORS = __webpack_require__("83ab");
  3947. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  3948. var anObject = __webpack_require__("825a");
  3949. var toPrimitive = __webpack_require__("c04e");
  3950. var nativeDefineProperty = Object.defineProperty;
  3951. // `Object.defineProperty` method
  3952. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  3953. exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  3954. anObject(O);
  3955. P = toPrimitive(P, true);
  3956. anObject(Attributes);
  3957. if (IE8_DOM_DEFINE) try {
  3958. return nativeDefineProperty(O, P, Attributes);
  3959. } catch (error) { /* empty */ }
  3960. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  3961. if ('value' in Attributes) O[P] = Attributes.value;
  3962. return O;
  3963. };
  3964. /***/ }),
  3965. /***/ "9ed3":
  3966. /***/ (function(module, exports, __webpack_require__) {
  3967. "use strict";
  3968. var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
  3969. var create = __webpack_require__("7c73");
  3970. var createPropertyDescriptor = __webpack_require__("5c6c");
  3971. var setToStringTag = __webpack_require__("d44e");
  3972. var Iterators = __webpack_require__("3f8c");
  3973. var returnThis = function () { return this; };
  3974. module.exports = function (IteratorConstructor, NAME, next) {
  3975. var TO_STRING_TAG = NAME + ' Iterator';
  3976. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  3977. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  3978. Iterators[TO_STRING_TAG] = returnThis;
  3979. return IteratorConstructor;
  3980. };
  3981. /***/ }),
  3982. /***/ "9f7f":
  3983. /***/ (function(module, exports, __webpack_require__) {
  3984. "use strict";
  3985. var fails = __webpack_require__("d039");
  3986. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  3987. // so we use an intermediate function.
  3988. function RE(s, f) {
  3989. return RegExp(s, f);
  3990. }
  3991. exports.UNSUPPORTED_Y = fails(function () {
  3992. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  3993. var re = RE('a', 'y');
  3994. re.lastIndex = 2;
  3995. return re.exec('abcd') != null;
  3996. });
  3997. exports.BROKEN_CARET = fails(function () {
  3998. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  3999. var re = RE('^r', 'gy');
  4000. re.lastIndex = 2;
  4001. return re.exec('str') != null;
  4002. });
  4003. /***/ }),
  4004. /***/ "a15b":
  4005. /***/ (function(module, exports, __webpack_require__) {
  4006. "use strict";
  4007. var $ = __webpack_require__("23e7");
  4008. var IndexedObject = __webpack_require__("44ad");
  4009. var toIndexedObject = __webpack_require__("fc6a");
  4010. var arrayMethodIsStrict = __webpack_require__("a640");
  4011. var nativeJoin = [].join;
  4012. var ES3_STRINGS = IndexedObject != Object;
  4013. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  4014. // `Array.prototype.join` method
  4015. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  4016. $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  4017. join: function join(separator) {
  4018. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  4019. }
  4020. });
  4021. /***/ }),
  4022. /***/ "a434":
  4023. /***/ (function(module, exports, __webpack_require__) {
  4024. "use strict";
  4025. var $ = __webpack_require__("23e7");
  4026. var toAbsoluteIndex = __webpack_require__("23cb");
  4027. var toInteger = __webpack_require__("a691");
  4028. var toLength = __webpack_require__("50c4");
  4029. var toObject = __webpack_require__("7b0b");
  4030. var arraySpeciesCreate = __webpack_require__("65f0");
  4031. var createProperty = __webpack_require__("8418");
  4032. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  4033. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4034. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  4035. var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
  4036. var max = Math.max;
  4037. var min = Math.min;
  4038. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  4039. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  4040. // `Array.prototype.splice` method
  4041. // https://tc39.github.io/ecma262/#sec-array.prototype.splice
  4042. // with adding support of @@species
  4043. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  4044. splice: function splice(start, deleteCount /* , ...items */) {
  4045. var O = toObject(this);
  4046. var len = toLength(O.length);
  4047. var actualStart = toAbsoluteIndex(start, len);
  4048. var argumentsLength = arguments.length;
  4049. var insertCount, actualDeleteCount, A, k, from, to;
  4050. if (argumentsLength === 0) {
  4051. insertCount = actualDeleteCount = 0;
  4052. } else if (argumentsLength === 1) {
  4053. insertCount = 0;
  4054. actualDeleteCount = len - actualStart;
  4055. } else {
  4056. insertCount = argumentsLength - 2;
  4057. actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
  4058. }
  4059. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  4060. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  4061. }
  4062. A = arraySpeciesCreate(O, actualDeleteCount);
  4063. for (k = 0; k < actualDeleteCount; k++) {
  4064. from = actualStart + k;
  4065. if (from in O) createProperty(A, k, O[from]);
  4066. }
  4067. A.length = actualDeleteCount;
  4068. if (insertCount < actualDeleteCount) {
  4069. for (k = actualStart; k < len - actualDeleteCount; k++) {
  4070. from = k + actualDeleteCount;
  4071. to = k + insertCount;
  4072. if (from in O) O[to] = O[from];
  4073. else delete O[to];
  4074. }
  4075. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  4076. } else if (insertCount > actualDeleteCount) {
  4077. for (k = len - actualDeleteCount; k > actualStart; k--) {
  4078. from = k + actualDeleteCount - 1;
  4079. to = k + insertCount - 1;
  4080. if (from in O) O[to] = O[from];
  4081. else delete O[to];
  4082. }
  4083. }
  4084. for (k = 0; k < insertCount; k++) {
  4085. O[k + actualStart] = arguments[k + 2];
  4086. }
  4087. O.length = len - actualDeleteCount + insertCount;
  4088. return A;
  4089. }
  4090. });
  4091. /***/ }),
  4092. /***/ "a4d3":
  4093. /***/ (function(module, exports, __webpack_require__) {
  4094. "use strict";
  4095. var $ = __webpack_require__("23e7");
  4096. var global = __webpack_require__("da84");
  4097. var getBuiltIn = __webpack_require__("d066");
  4098. var IS_PURE = __webpack_require__("c430");
  4099. var DESCRIPTORS = __webpack_require__("83ab");
  4100. var NATIVE_SYMBOL = __webpack_require__("4930");
  4101. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4102. var fails = __webpack_require__("d039");
  4103. var has = __webpack_require__("5135");
  4104. var isArray = __webpack_require__("e8b5");
  4105. var isObject = __webpack_require__("861d");
  4106. var anObject = __webpack_require__("825a");
  4107. var toObject = __webpack_require__("7b0b");
  4108. var toIndexedObject = __webpack_require__("fc6a");
  4109. var toPrimitive = __webpack_require__("c04e");
  4110. var createPropertyDescriptor = __webpack_require__("5c6c");
  4111. var nativeObjectCreate = __webpack_require__("7c73");
  4112. var objectKeys = __webpack_require__("df75");
  4113. var getOwnPropertyNamesModule = __webpack_require__("241c");
  4114. var getOwnPropertyNamesExternal = __webpack_require__("057f");
  4115. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  4116. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  4117. var definePropertyModule = __webpack_require__("9bf2");
  4118. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  4119. var createNonEnumerableProperty = __webpack_require__("9112");
  4120. var redefine = __webpack_require__("6eeb");
  4121. var shared = __webpack_require__("5692");
  4122. var sharedKey = __webpack_require__("f772");
  4123. var hiddenKeys = __webpack_require__("d012");
  4124. var uid = __webpack_require__("90e3");
  4125. var wellKnownSymbol = __webpack_require__("b622");
  4126. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  4127. var defineWellKnownSymbol = __webpack_require__("746f");
  4128. var setToStringTag = __webpack_require__("d44e");
  4129. var InternalStateModule = __webpack_require__("69f3");
  4130. var $forEach = __webpack_require__("b727").forEach;
  4131. var HIDDEN = sharedKey('hidden');
  4132. var SYMBOL = 'Symbol';
  4133. var PROTOTYPE = 'prototype';
  4134. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  4135. var setInternalState = InternalStateModule.set;
  4136. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  4137. var ObjectPrototype = Object[PROTOTYPE];
  4138. var $Symbol = global.Symbol;
  4139. var $stringify = getBuiltIn('JSON', 'stringify');
  4140. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  4141. var nativeDefineProperty = definePropertyModule.f;
  4142. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  4143. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  4144. var AllSymbols = shared('symbols');
  4145. var ObjectPrototypeSymbols = shared('op-symbols');
  4146. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  4147. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  4148. var WellKnownSymbolsStore = shared('wks');
  4149. var QObject = global.QObject;
  4150. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  4151. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  4152. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  4153. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  4154. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  4155. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  4156. })).a != 7;
  4157. }) ? function (O, P, Attributes) {
  4158. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  4159. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  4160. nativeDefineProperty(O, P, Attributes);
  4161. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  4162. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  4163. }
  4164. } : nativeDefineProperty;
  4165. var wrap = function (tag, description) {
  4166. var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
  4167. setInternalState(symbol, {
  4168. type: SYMBOL,
  4169. tag: tag,
  4170. description: description
  4171. });
  4172. if (!DESCRIPTORS) symbol.description = description;
  4173. return symbol;
  4174. };
  4175. var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
  4176. return typeof it == 'symbol';
  4177. } : function (it) {
  4178. return Object(it) instanceof $Symbol;
  4179. };
  4180. var $defineProperty = function defineProperty(O, P, Attributes) {
  4181. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  4182. anObject(O);
  4183. var key = toPrimitive(P, true);
  4184. anObject(Attributes);
  4185. if (has(AllSymbols, key)) {
  4186. if (!Attributes.enumerable) {
  4187. if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  4188. O[HIDDEN][key] = true;
  4189. } else {
  4190. if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  4191. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  4192. } return setSymbolDescriptor(O, key, Attributes);
  4193. } return nativeDefineProperty(O, key, Attributes);
  4194. };
  4195. var $defineProperties = function defineProperties(O, Properties) {
  4196. anObject(O);
  4197. var properties = toIndexedObject(Properties);
  4198. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  4199. $forEach(keys, function (key) {
  4200. if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  4201. });
  4202. return O;
  4203. };
  4204. var $create = function create(O, Properties) {
  4205. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  4206. };
  4207. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  4208. var P = toPrimitive(V, true);
  4209. var enumerable = nativePropertyIsEnumerable.call(this, P);
  4210. if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
  4211. return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  4212. };
  4213. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  4214. var it = toIndexedObject(O);
  4215. var key = toPrimitive(P, true);
  4216. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  4217. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  4218. if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
  4219. descriptor.enumerable = true;
  4220. }
  4221. return descriptor;
  4222. };
  4223. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  4224. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  4225. var result = [];
  4226. $forEach(names, function (key) {
  4227. if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
  4228. });
  4229. return result;
  4230. };
  4231. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  4232. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  4233. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  4234. var result = [];
  4235. $forEach(names, function (key) {
  4236. if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
  4237. result.push(AllSymbols[key]);
  4238. }
  4239. });
  4240. return result;
  4241. };
  4242. // `Symbol` constructor
  4243. // https://tc39.github.io/ecma262/#sec-symbol-constructor
  4244. if (!NATIVE_SYMBOL) {
  4245. $Symbol = function Symbol() {
  4246. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  4247. var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
  4248. var tag = uid(description);
  4249. var setter = function (value) {
  4250. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  4251. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  4252. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  4253. };
  4254. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  4255. return wrap(tag, description);
  4256. };
  4257. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  4258. return getInternalState(this).tag;
  4259. });
  4260. redefine($Symbol, 'withoutSetter', function (description) {
  4261. return wrap(uid(description), description);
  4262. });
  4263. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  4264. definePropertyModule.f = $defineProperty;
  4265. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  4266. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  4267. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  4268. wrappedWellKnownSymbolModule.f = function (name) {
  4269. return wrap(wellKnownSymbol(name), name);
  4270. };
  4271. if (DESCRIPTORS) {
  4272. // https://github.com/tc39/proposal-Symbol-description
  4273. nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
  4274. configurable: true,
  4275. get: function description() {
  4276. return getInternalState(this).description;
  4277. }
  4278. });
  4279. if (!IS_PURE) {
  4280. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  4281. }
  4282. }
  4283. }
  4284. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  4285. Symbol: $Symbol
  4286. });
  4287. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  4288. defineWellKnownSymbol(name);
  4289. });
  4290. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  4291. // `Symbol.for` method
  4292. // https://tc39.github.io/ecma262/#sec-symbol.for
  4293. 'for': function (key) {
  4294. var string = String(key);
  4295. if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  4296. var symbol = $Symbol(string);
  4297. StringToSymbolRegistry[string] = symbol;
  4298. SymbolToStringRegistry[symbol] = string;
  4299. return symbol;
  4300. },
  4301. // `Symbol.keyFor` method
  4302. // https://tc39.github.io/ecma262/#sec-symbol.keyfor
  4303. keyFor: function keyFor(sym) {
  4304. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  4305. if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  4306. },
  4307. useSetter: function () { USE_SETTER = true; },
  4308. useSimple: function () { USE_SETTER = false; }
  4309. });
  4310. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  4311. // `Object.create` method
  4312. // https://tc39.github.io/ecma262/#sec-object.create
  4313. create: $create,
  4314. // `Object.defineProperty` method
  4315. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  4316. defineProperty: $defineProperty,
  4317. // `Object.defineProperties` method
  4318. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  4319. defineProperties: $defineProperties,
  4320. // `Object.getOwnPropertyDescriptor` method
  4321. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  4322. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  4323. });
  4324. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  4325. // `Object.getOwnPropertyNames` method
  4326. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  4327. getOwnPropertyNames: $getOwnPropertyNames,
  4328. // `Object.getOwnPropertySymbols` method
  4329. // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
  4330. getOwnPropertySymbols: $getOwnPropertySymbols
  4331. });
  4332. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  4333. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  4334. $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
  4335. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  4336. return getOwnPropertySymbolsModule.f(toObject(it));
  4337. }
  4338. });
  4339. // `JSON.stringify` method behavior with symbols
  4340. // https://tc39.github.io/ecma262/#sec-json.stringify
  4341. if ($stringify) {
  4342. var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
  4343. var symbol = $Symbol();
  4344. // MS Edge converts symbol values to JSON as {}
  4345. return $stringify([symbol]) != '[null]'
  4346. // WebKit converts symbol values to JSON as null
  4347. || $stringify({ a: symbol }) != '{}'
  4348. // V8 throws on boxed symbols
  4349. || $stringify(Object(symbol)) != '{}';
  4350. });
  4351. $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
  4352. // eslint-disable-next-line no-unused-vars
  4353. stringify: function stringify(it, replacer, space) {
  4354. var args = [it];
  4355. var index = 1;
  4356. var $replacer;
  4357. while (arguments.length > index) args.push(arguments[index++]);
  4358. $replacer = replacer;
  4359. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  4360. if (!isArray(replacer)) replacer = function (key, value) {
  4361. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  4362. if (!isSymbol(value)) return value;
  4363. };
  4364. args[1] = replacer;
  4365. return $stringify.apply(null, args);
  4366. }
  4367. });
  4368. }
  4369. // `Symbol.prototype[@@toPrimitive]` method
  4370. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
  4371. if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
  4372. createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  4373. }
  4374. // `Symbol.prototype[@@toStringTag]` property
  4375. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
  4376. setToStringTag($Symbol, SYMBOL);
  4377. hiddenKeys[HIDDEN] = true;
  4378. /***/ }),
  4379. /***/ "a623":
  4380. /***/ (function(module, exports, __webpack_require__) {
  4381. "use strict";
  4382. var $ = __webpack_require__("23e7");
  4383. var $every = __webpack_require__("b727").every;
  4384. var arrayMethodIsStrict = __webpack_require__("a640");
  4385. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4386. var STRICT_METHOD = arrayMethodIsStrict('every');
  4387. var USES_TO_LENGTH = arrayMethodUsesToLength('every');
  4388. // `Array.prototype.every` method
  4389. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  4390. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
  4391. every: function every(callbackfn /* , thisArg */) {
  4392. return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  4393. }
  4394. });
  4395. /***/ }),
  4396. /***/ "a630":
  4397. /***/ (function(module, exports, __webpack_require__) {
  4398. var $ = __webpack_require__("23e7");
  4399. var from = __webpack_require__("4df4");
  4400. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  4401. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
  4402. Array.from(iterable);
  4403. });
  4404. // `Array.from` method
  4405. // https://tc39.github.io/ecma262/#sec-array.from
  4406. $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
  4407. from: from
  4408. });
  4409. /***/ }),
  4410. /***/ "a640":
  4411. /***/ (function(module, exports, __webpack_require__) {
  4412. "use strict";
  4413. var fails = __webpack_require__("d039");
  4414. module.exports = function (METHOD_NAME, argument) {
  4415. var method = [][METHOD_NAME];
  4416. return !!method && fails(function () {
  4417. // eslint-disable-next-line no-useless-call,no-throw-literal
  4418. method.call(null, argument || function () { throw 1; }, 1);
  4419. });
  4420. };
  4421. /***/ }),
  4422. /***/ "a691":
  4423. /***/ (function(module, exports) {
  4424. var ceil = Math.ceil;
  4425. var floor = Math.floor;
  4426. // `ToInteger` abstract operation
  4427. // https://tc39.github.io/ecma262/#sec-tointeger
  4428. module.exports = function (argument) {
  4429. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  4430. };
  4431. /***/ }),
  4432. /***/ "a9e3":
  4433. /***/ (function(module, exports, __webpack_require__) {
  4434. "use strict";
  4435. var DESCRIPTORS = __webpack_require__("83ab");
  4436. var global = __webpack_require__("da84");
  4437. var isForced = __webpack_require__("94ca");
  4438. var redefine = __webpack_require__("6eeb");
  4439. var has = __webpack_require__("5135");
  4440. var classof = __webpack_require__("c6b6");
  4441. var inheritIfRequired = __webpack_require__("7156");
  4442. var toPrimitive = __webpack_require__("c04e");
  4443. var fails = __webpack_require__("d039");
  4444. var create = __webpack_require__("7c73");
  4445. var getOwnPropertyNames = __webpack_require__("241c").f;
  4446. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  4447. var defineProperty = __webpack_require__("9bf2").f;
  4448. var trim = __webpack_require__("58a8").trim;
  4449. var NUMBER = 'Number';
  4450. var NativeNumber = global[NUMBER];
  4451. var NumberPrototype = NativeNumber.prototype;
  4452. // Opera ~12 has broken Object#toString
  4453. var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
  4454. // `ToNumber` abstract operation
  4455. // https://tc39.github.io/ecma262/#sec-tonumber
  4456. var toNumber = function (argument) {
  4457. var it = toPrimitive(argument, false);
  4458. var first, third, radix, maxCode, digits, length, index, code;
  4459. if (typeof it == 'string' && it.length > 2) {
  4460. it = trim(it);
  4461. first = it.charCodeAt(0);
  4462. if (first === 43 || first === 45) {
  4463. third = it.charCodeAt(2);
  4464. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  4465. } else if (first === 48) {
  4466. switch (it.charCodeAt(1)) {
  4467. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  4468. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  4469. default: return +it;
  4470. }
  4471. digits = it.slice(2);
  4472. length = digits.length;
  4473. for (index = 0; index < length; index++) {
  4474. code = digits.charCodeAt(index);
  4475. // parseInt parses a string to a first unavailable symbol
  4476. // but ToNumber should return NaN if a string contains unavailable symbols
  4477. if (code < 48 || code > maxCode) return NaN;
  4478. } return parseInt(digits, radix);
  4479. }
  4480. } return +it;
  4481. };
  4482. // `Number` constructor
  4483. // https://tc39.github.io/ecma262/#sec-number-constructor
  4484. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  4485. var NumberWrapper = function Number(value) {
  4486. var it = arguments.length < 1 ? 0 : value;
  4487. var dummy = this;
  4488. return dummy instanceof NumberWrapper
  4489. // check on 1..constructor(foo) case
  4490. && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
  4491. ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
  4492. };
  4493. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  4494. // ES3:
  4495. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  4496. // ES2015 (in case, if modules with ES2015 Number statics required before):
  4497. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  4498. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
  4499. // ESNext
  4500. 'fromString,range'
  4501. ).split(','), j = 0, key; keys.length > j; j++) {
  4502. if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
  4503. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  4504. }
  4505. }
  4506. NumberWrapper.prototype = NumberPrototype;
  4507. NumberPrototype.constructor = NumberWrapper;
  4508. redefine(global, NUMBER, NumberWrapper);
  4509. }
  4510. /***/ }),
  4511. /***/ "ab13":
  4512. /***/ (function(module, exports, __webpack_require__) {
  4513. var wellKnownSymbol = __webpack_require__("b622");
  4514. var MATCH = wellKnownSymbol('match');
  4515. module.exports = function (METHOD_NAME) {
  4516. var regexp = /./;
  4517. try {
  4518. '/./'[METHOD_NAME](regexp);
  4519. } catch (error1) {
  4520. try {
  4521. regexp[MATCH] = false;
  4522. return '/./'[METHOD_NAME](regexp);
  4523. } catch (error2) { /* empty */ }
  4524. } return false;
  4525. };
  4526. /***/ }),
  4527. /***/ "ac1f":
  4528. /***/ (function(module, exports, __webpack_require__) {
  4529. "use strict";
  4530. var $ = __webpack_require__("23e7");
  4531. var exec = __webpack_require__("9263");
  4532. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  4533. exec: exec
  4534. });
  4535. /***/ }),
  4536. /***/ "ad6d":
  4537. /***/ (function(module, exports, __webpack_require__) {
  4538. "use strict";
  4539. var anObject = __webpack_require__("825a");
  4540. // `RegExp.prototype.flags` getter implementation
  4541. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  4542. module.exports = function () {
  4543. var that = anObject(this);
  4544. var result = '';
  4545. if (that.global) result += 'g';
  4546. if (that.ignoreCase) result += 'i';
  4547. if (that.multiline) result += 'm';
  4548. if (that.dotAll) result += 's';
  4549. if (that.unicode) result += 'u';
  4550. if (that.sticky) result += 'y';
  4551. return result;
  4552. };
  4553. /***/ }),
  4554. /***/ "ae40":
  4555. /***/ (function(module, exports, __webpack_require__) {
  4556. var DESCRIPTORS = __webpack_require__("83ab");
  4557. var fails = __webpack_require__("d039");
  4558. var has = __webpack_require__("5135");
  4559. var defineProperty = Object.defineProperty;
  4560. var cache = {};
  4561. var thrower = function (it) { throw it; };
  4562. module.exports = function (METHOD_NAME, options) {
  4563. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  4564. if (!options) options = {};
  4565. var method = [][METHOD_NAME];
  4566. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  4567. var argument0 = has(options, 0) ? options[0] : thrower;
  4568. var argument1 = has(options, 1) ? options[1] : undefined;
  4569. return cache[METHOD_NAME] = !!method && !fails(function () {
  4570. if (ACCESSORS && !DESCRIPTORS) return true;
  4571. var O = { length: -1 };
  4572. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  4573. else O[1] = 1;
  4574. method.call(O, argument0, argument1);
  4575. });
  4576. };
  4577. /***/ }),
  4578. /***/ "ae93":
  4579. /***/ (function(module, exports, __webpack_require__) {
  4580. "use strict";
  4581. var getPrototypeOf = __webpack_require__("e163");
  4582. var createNonEnumerableProperty = __webpack_require__("9112");
  4583. var has = __webpack_require__("5135");
  4584. var wellKnownSymbol = __webpack_require__("b622");
  4585. var IS_PURE = __webpack_require__("c430");
  4586. var ITERATOR = wellKnownSymbol('iterator');
  4587. var BUGGY_SAFARI_ITERATORS = false;
  4588. var returnThis = function () { return this; };
  4589. // `%IteratorPrototype%` object
  4590. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  4591. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  4592. if ([].keys) {
  4593. arrayIterator = [].keys();
  4594. // Safari 8 has buggy iterators w/o `next`
  4595. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  4596. else {
  4597. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  4598. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  4599. }
  4600. }
  4601. if (IteratorPrototype == undefined) IteratorPrototype = {};
  4602. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  4603. if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
  4604. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  4605. }
  4606. module.exports = {
  4607. IteratorPrototype: IteratorPrototype,
  4608. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  4609. };
  4610. /***/ }),
  4611. /***/ "af03":
  4612. /***/ (function(module, exports, __webpack_require__) {
  4613. var fails = __webpack_require__("d039");
  4614. // check the existence of a method, lowercase
  4615. // of a tag and escaping quotes in arguments
  4616. module.exports = function (METHOD_NAME) {
  4617. return fails(function () {
  4618. var test = ''[METHOD_NAME]('"');
  4619. return test !== test.toLowerCase() || test.split('"').length > 3;
  4620. });
  4621. };
  4622. /***/ }),
  4623. /***/ "b041":
  4624. /***/ (function(module, exports, __webpack_require__) {
  4625. "use strict";
  4626. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  4627. var classof = __webpack_require__("f5df");
  4628. // `Object.prototype.toString` method implementation
  4629. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  4630. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  4631. return '[object ' + classof(this) + ']';
  4632. };
  4633. /***/ }),
  4634. /***/ "b0c0":
  4635. /***/ (function(module, exports, __webpack_require__) {
  4636. var DESCRIPTORS = __webpack_require__("83ab");
  4637. var defineProperty = __webpack_require__("9bf2").f;
  4638. var FunctionPrototype = Function.prototype;
  4639. var FunctionPrototypeToString = FunctionPrototype.toString;
  4640. var nameRE = /^\s*function ([^ (]*)/;
  4641. var NAME = 'name';
  4642. // Function instances `.name` property
  4643. // https://tc39.github.io/ecma262/#sec-function-instances-name
  4644. if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
  4645. defineProperty(FunctionPrototype, NAME, {
  4646. configurable: true,
  4647. get: function () {
  4648. try {
  4649. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  4650. } catch (error) {
  4651. return '';
  4652. }
  4653. }
  4654. });
  4655. }
  4656. /***/ }),
  4657. /***/ "b622":
  4658. /***/ (function(module, exports, __webpack_require__) {
  4659. var global = __webpack_require__("da84");
  4660. var shared = __webpack_require__("5692");
  4661. var has = __webpack_require__("5135");
  4662. var uid = __webpack_require__("90e3");
  4663. var NATIVE_SYMBOL = __webpack_require__("4930");
  4664. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4665. var WellKnownSymbolsStore = shared('wks');
  4666. var Symbol = global.Symbol;
  4667. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  4668. module.exports = function (name) {
  4669. if (!has(WellKnownSymbolsStore, name)) {
  4670. if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
  4671. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  4672. } return WellKnownSymbolsStore[name];
  4673. };
  4674. /***/ }),
  4675. /***/ "b64b":
  4676. /***/ (function(module, exports, __webpack_require__) {
  4677. var $ = __webpack_require__("23e7");
  4678. var toObject = __webpack_require__("7b0b");
  4679. var nativeKeys = __webpack_require__("df75");
  4680. var fails = __webpack_require__("d039");
  4681. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  4682. // `Object.keys` method
  4683. // https://tc39.github.io/ecma262/#sec-object.keys
  4684. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  4685. keys: function keys(it) {
  4686. return nativeKeys(toObject(it));
  4687. }
  4688. });
  4689. /***/ }),
  4690. /***/ "b680":
  4691. /***/ (function(module, exports, __webpack_require__) {
  4692. "use strict";
  4693. var $ = __webpack_require__("23e7");
  4694. var toInteger = __webpack_require__("a691");
  4695. var thisNumberValue = __webpack_require__("408a");
  4696. var repeat = __webpack_require__("1148");
  4697. var fails = __webpack_require__("d039");
  4698. var nativeToFixed = 1.0.toFixed;
  4699. var floor = Math.floor;
  4700. var pow = function (x, n, acc) {
  4701. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  4702. };
  4703. var log = function (x) {
  4704. var n = 0;
  4705. var x2 = x;
  4706. while (x2 >= 4096) {
  4707. n += 12;
  4708. x2 /= 4096;
  4709. }
  4710. while (x2 >= 2) {
  4711. n += 1;
  4712. x2 /= 2;
  4713. } return n;
  4714. };
  4715. var FORCED = nativeToFixed && (
  4716. 0.00008.toFixed(3) !== '0.000' ||
  4717. 0.9.toFixed(0) !== '1' ||
  4718. 1.255.toFixed(2) !== '1.25' ||
  4719. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  4720. ) || !fails(function () {
  4721. // V8 ~ Android 4.3-
  4722. nativeToFixed.call({});
  4723. });
  4724. // `Number.prototype.toFixed` method
  4725. // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
  4726. $({ target: 'Number', proto: true, forced: FORCED }, {
  4727. // eslint-disable-next-line max-statements
  4728. toFixed: function toFixed(fractionDigits) {
  4729. var number = thisNumberValue(this);
  4730. var fractDigits = toInteger(fractionDigits);
  4731. var data = [0, 0, 0, 0, 0, 0];
  4732. var sign = '';
  4733. var result = '0';
  4734. var e, z, j, k;
  4735. var multiply = function (n, c) {
  4736. var index = -1;
  4737. var c2 = c;
  4738. while (++index < 6) {
  4739. c2 += n * data[index];
  4740. data[index] = c2 % 1e7;
  4741. c2 = floor(c2 / 1e7);
  4742. }
  4743. };
  4744. var divide = function (n) {
  4745. var index = 6;
  4746. var c = 0;
  4747. while (--index >= 0) {
  4748. c += data[index];
  4749. data[index] = floor(c / n);
  4750. c = (c % n) * 1e7;
  4751. }
  4752. };
  4753. var dataToString = function () {
  4754. var index = 6;
  4755. var s = '';
  4756. while (--index >= 0) {
  4757. if (s !== '' || index === 0 || data[index] !== 0) {
  4758. var t = String(data[index]);
  4759. s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
  4760. }
  4761. } return s;
  4762. };
  4763. if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
  4764. // eslint-disable-next-line no-self-compare
  4765. if (number != number) return 'NaN';
  4766. if (number <= -1e21 || number >= 1e21) return String(number);
  4767. if (number < 0) {
  4768. sign = '-';
  4769. number = -number;
  4770. }
  4771. if (number > 1e-21) {
  4772. e = log(number * pow(2, 69, 1)) - 69;
  4773. z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
  4774. z *= 0x10000000000000;
  4775. e = 52 - e;
  4776. if (e > 0) {
  4777. multiply(0, z);
  4778. j = fractDigits;
  4779. while (j >= 7) {
  4780. multiply(1e7, 0);
  4781. j -= 7;
  4782. }
  4783. multiply(pow(10, j, 1), 0);
  4784. j = e - 1;
  4785. while (j >= 23) {
  4786. divide(1 << 23);
  4787. j -= 23;
  4788. }
  4789. divide(1 << j);
  4790. multiply(1, 1);
  4791. divide(2);
  4792. result = dataToString();
  4793. } else {
  4794. multiply(0, z);
  4795. multiply(1 << -e, 0);
  4796. result = dataToString() + repeat.call('0', fractDigits);
  4797. }
  4798. }
  4799. if (fractDigits > 0) {
  4800. k = result.length;
  4801. result = sign + (k <= fractDigits
  4802. ? '0.' + repeat.call('0', fractDigits - k) + result
  4803. : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
  4804. } else {
  4805. result = sign + result;
  4806. } return result;
  4807. }
  4808. });
  4809. /***/ }),
  4810. /***/ "b727":
  4811. /***/ (function(module, exports, __webpack_require__) {
  4812. var bind = __webpack_require__("0366");
  4813. var IndexedObject = __webpack_require__("44ad");
  4814. var toObject = __webpack_require__("7b0b");
  4815. var toLength = __webpack_require__("50c4");
  4816. var arraySpeciesCreate = __webpack_require__("65f0");
  4817. var push = [].push;
  4818. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  4819. var createMethod = function (TYPE) {
  4820. var IS_MAP = TYPE == 1;
  4821. var IS_FILTER = TYPE == 2;
  4822. var IS_SOME = TYPE == 3;
  4823. var IS_EVERY = TYPE == 4;
  4824. var IS_FIND_INDEX = TYPE == 6;
  4825. var IS_FILTER_OUT = TYPE == 7;
  4826. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  4827. return function ($this, callbackfn, that, specificCreate) {
  4828. var O = toObject($this);
  4829. var self = IndexedObject(O);
  4830. var boundFunction = bind(callbackfn, that, 3);
  4831. var length = toLength(self.length);
  4832. var index = 0;
  4833. var create = specificCreate || arraySpeciesCreate;
  4834. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  4835. var value, result;
  4836. for (;length > index; index++) if (NO_HOLES || index in self) {
  4837. value = self[index];
  4838. result = boundFunction(value, index, O);
  4839. if (TYPE) {
  4840. if (IS_MAP) target[index] = result; // map
  4841. else if (result) switch (TYPE) {
  4842. case 3: return true; // some
  4843. case 5: return value; // find
  4844. case 6: return index; // findIndex
  4845. case 2: push.call(target, value); // filter
  4846. } else switch (TYPE) {
  4847. case 4: return false; // every
  4848. case 7: push.call(target, value); // filterOut
  4849. }
  4850. }
  4851. }
  4852. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  4853. };
  4854. };
  4855. module.exports = {
  4856. // `Array.prototype.forEach` method
  4857. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  4858. forEach: createMethod(0),
  4859. // `Array.prototype.map` method
  4860. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  4861. map: createMethod(1),
  4862. // `Array.prototype.filter` method
  4863. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  4864. filter: createMethod(2),
  4865. // `Array.prototype.some` method
  4866. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  4867. some: createMethod(3),
  4868. // `Array.prototype.every` method
  4869. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  4870. every: createMethod(4),
  4871. // `Array.prototype.find` method
  4872. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  4873. find: createMethod(5),
  4874. // `Array.prototype.findIndex` method
  4875. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  4876. findIndex: createMethod(6),
  4877. // `Array.prototype.filterOut` method
  4878. // https://github.com/tc39/proposal-array-filtering
  4879. filterOut: createMethod(7)
  4880. };
  4881. /***/ }),
  4882. /***/ "baa5":
  4883. /***/ (function(module, exports, __webpack_require__) {
  4884. var $ = __webpack_require__("23e7");
  4885. var lastIndexOf = __webpack_require__("e58c");
  4886. // `Array.prototype.lastIndexOf` method
  4887. // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
  4888. $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
  4889. lastIndexOf: lastIndexOf
  4890. });
  4891. /***/ }),
  4892. /***/ "bb2f":
  4893. /***/ (function(module, exports, __webpack_require__) {
  4894. var fails = __webpack_require__("d039");
  4895. module.exports = !fails(function () {
  4896. return Object.isExtensible(Object.preventExtensions({}));
  4897. });
  4898. /***/ }),
  4899. /***/ "c04e":
  4900. /***/ (function(module, exports, __webpack_require__) {
  4901. var isObject = __webpack_require__("861d");
  4902. // `ToPrimitive` abstract operation
  4903. // https://tc39.github.io/ecma262/#sec-toprimitive
  4904. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  4905. // and the second argument - flag - preferred type is a string
  4906. module.exports = function (input, PREFERRED_STRING) {
  4907. if (!isObject(input)) return input;
  4908. var fn, val;
  4909. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  4910. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  4911. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  4912. throw TypeError("Can't convert object to primitive value");
  4913. };
  4914. /***/ }),
  4915. /***/ "c430":
  4916. /***/ (function(module, exports) {
  4917. module.exports = false;
  4918. /***/ }),
  4919. /***/ "c6b6":
  4920. /***/ (function(module, exports) {
  4921. var toString = {}.toString;
  4922. module.exports = function (it) {
  4923. return toString.call(it).slice(8, -1);
  4924. };
  4925. /***/ }),
  4926. /***/ "c6cd":
  4927. /***/ (function(module, exports, __webpack_require__) {
  4928. var global = __webpack_require__("da84");
  4929. var setGlobal = __webpack_require__("ce4e");
  4930. var SHARED = '__core-js_shared__';
  4931. var store = global[SHARED] || setGlobal(SHARED, {});
  4932. module.exports = store;
  4933. /***/ }),
  4934. /***/ "c7cd":
  4935. /***/ (function(module, exports, __webpack_require__) {
  4936. "use strict";
  4937. var $ = __webpack_require__("23e7");
  4938. var createHTML = __webpack_require__("857a");
  4939. var forcedStringHTMLMethod = __webpack_require__("af03");
  4940. // `String.prototype.fixed` method
  4941. // https://tc39.github.io/ecma262/#sec-string.prototype.fixed
  4942. $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
  4943. fixed: function fixed() {
  4944. return createHTML(this, 'tt', '', '');
  4945. }
  4946. });
  4947. /***/ }),
  4948. /***/ "c8ba":
  4949. /***/ (function(module, exports) {
  4950. var g;
  4951. // This works in non-strict mode
  4952. g = (function() {
  4953. return this;
  4954. })();
  4955. try {
  4956. // This works if eval is allowed (see CSP)
  4957. g = g || new Function("return this")();
  4958. } catch (e) {
  4959. // This works if the window reference is available
  4960. if (typeof window === "object") g = window;
  4961. }
  4962. // g can still be undefined, but nothing to do about it...
  4963. // We return undefined, instead of nothing here, so it's
  4964. // easier to handle this case. if(!global) { ...}
  4965. module.exports = g;
  4966. /***/ }),
  4967. /***/ "c8d2":
  4968. /***/ (function(module, exports, __webpack_require__) {
  4969. var fails = __webpack_require__("d039");
  4970. var whitespaces = __webpack_require__("5899");
  4971. var non = '\u200B\u0085\u180E';
  4972. // check that a method works with the correct list
  4973. // of whitespaces and has a correct name
  4974. module.exports = function (METHOD_NAME) {
  4975. return fails(function () {
  4976. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  4977. });
  4978. };
  4979. /***/ }),
  4980. /***/ "c975":
  4981. /***/ (function(module, exports, __webpack_require__) {
  4982. "use strict";
  4983. var $ = __webpack_require__("23e7");
  4984. var $indexOf = __webpack_require__("4d64").indexOf;
  4985. var arrayMethodIsStrict = __webpack_require__("a640");
  4986. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4987. var nativeIndexOf = [].indexOf;
  4988. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  4989. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  4990. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  4991. // `Array.prototype.indexOf` method
  4992. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  4993. $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
  4994. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  4995. return NEGATIVE_ZERO
  4996. // convert -0 to +0
  4997. ? nativeIndexOf.apply(this, arguments) || 0
  4998. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  4999. }
  5000. });
  5001. /***/ }),
  5002. /***/ "ca84":
  5003. /***/ (function(module, exports, __webpack_require__) {
  5004. var has = __webpack_require__("5135");
  5005. var toIndexedObject = __webpack_require__("fc6a");
  5006. var indexOf = __webpack_require__("4d64").indexOf;
  5007. var hiddenKeys = __webpack_require__("d012");
  5008. module.exports = function (object, names) {
  5009. var O = toIndexedObject(object);
  5010. var i = 0;
  5011. var result = [];
  5012. var key;
  5013. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  5014. // Don't enum bug & hidden keys
  5015. while (names.length > i) if (has(O, key = names[i++])) {
  5016. ~indexOf(result, key) || result.push(key);
  5017. }
  5018. return result;
  5019. };
  5020. /***/ }),
  5021. /***/ "caad":
  5022. /***/ (function(module, exports, __webpack_require__) {
  5023. "use strict";
  5024. var $ = __webpack_require__("23e7");
  5025. var $includes = __webpack_require__("4d64").includes;
  5026. var addToUnscopables = __webpack_require__("44d2");
  5027. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5028. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  5029. // `Array.prototype.includes` method
  5030. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  5031. $({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
  5032. includes: function includes(el /* , fromIndex = 0 */) {
  5033. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5034. }
  5035. });
  5036. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  5037. addToUnscopables('includes');
  5038. /***/ }),
  5039. /***/ "cc12":
  5040. /***/ (function(module, exports, __webpack_require__) {
  5041. var global = __webpack_require__("da84");
  5042. var isObject = __webpack_require__("861d");
  5043. var document = global.document;
  5044. // typeof document.createElement is 'object' in old IE
  5045. var EXISTS = isObject(document) && isObject(document.createElement);
  5046. module.exports = function (it) {
  5047. return EXISTS ? document.createElement(it) : {};
  5048. };
  5049. /***/ }),
  5050. /***/ "ce4e":
  5051. /***/ (function(module, exports, __webpack_require__) {
  5052. var global = __webpack_require__("da84");
  5053. var createNonEnumerableProperty = __webpack_require__("9112");
  5054. module.exports = function (key, value) {
  5055. try {
  5056. createNonEnumerableProperty(global, key, value);
  5057. } catch (error) {
  5058. global[key] = value;
  5059. } return value;
  5060. };
  5061. /***/ }),
  5062. /***/ "d012":
  5063. /***/ (function(module, exports) {
  5064. module.exports = {};
  5065. /***/ }),
  5066. /***/ "d039":
  5067. /***/ (function(module, exports) {
  5068. module.exports = function (exec) {
  5069. try {
  5070. return !!exec();
  5071. } catch (error) {
  5072. return true;
  5073. }
  5074. };
  5075. /***/ }),
  5076. /***/ "d066":
  5077. /***/ (function(module, exports, __webpack_require__) {
  5078. var path = __webpack_require__("428f");
  5079. var global = __webpack_require__("da84");
  5080. var aFunction = function (variable) {
  5081. return typeof variable == 'function' ? variable : undefined;
  5082. };
  5083. module.exports = function (namespace, method) {
  5084. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  5085. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  5086. };
  5087. /***/ }),
  5088. /***/ "d1e7":
  5089. /***/ (function(module, exports, __webpack_require__) {
  5090. "use strict";
  5091. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  5092. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5093. // Nashorn ~ JDK8 bug
  5094. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  5095. // `Object.prototype.propertyIsEnumerable` method implementation
  5096. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  5097. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  5098. var descriptor = getOwnPropertyDescriptor(this, V);
  5099. return !!descriptor && descriptor.enumerable;
  5100. } : nativePropertyIsEnumerable;
  5101. /***/ }),
  5102. /***/ "d28b":
  5103. /***/ (function(module, exports, __webpack_require__) {
  5104. var defineWellKnownSymbol = __webpack_require__("746f");
  5105. // `Symbol.iterator` well-known symbol
  5106. // https://tc39.github.io/ecma262/#sec-symbol.iterator
  5107. defineWellKnownSymbol('iterator');
  5108. /***/ }),
  5109. /***/ "d2bb":
  5110. /***/ (function(module, exports, __webpack_require__) {
  5111. var anObject = __webpack_require__("825a");
  5112. var aPossiblePrototype = __webpack_require__("3bbe");
  5113. // `Object.setPrototypeOf` method
  5114. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  5115. // Works with __proto__ only. Old v8 can't work with null proto objects.
  5116. /* eslint-disable no-proto */
  5117. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  5118. var CORRECT_SETTER = false;
  5119. var test = {};
  5120. var setter;
  5121. try {
  5122. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  5123. setter.call(test, []);
  5124. CORRECT_SETTER = test instanceof Array;
  5125. } catch (error) { /* empty */ }
  5126. return function setPrototypeOf(O, proto) {
  5127. anObject(O);
  5128. aPossiblePrototype(proto);
  5129. if (CORRECT_SETTER) setter.call(O, proto);
  5130. else O.__proto__ = proto;
  5131. return O;
  5132. };
  5133. }() : undefined);
  5134. /***/ }),
  5135. /***/ "d3b7":
  5136. /***/ (function(module, exports, __webpack_require__) {
  5137. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5138. var redefine = __webpack_require__("6eeb");
  5139. var toString = __webpack_require__("b041");
  5140. // `Object.prototype.toString` method
  5141. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  5142. if (!TO_STRING_TAG_SUPPORT) {
  5143. redefine(Object.prototype, 'toString', toString, { unsafe: true });
  5144. }
  5145. /***/ }),
  5146. /***/ "d44e":
  5147. /***/ (function(module, exports, __webpack_require__) {
  5148. var defineProperty = __webpack_require__("9bf2").f;
  5149. var has = __webpack_require__("5135");
  5150. var wellKnownSymbol = __webpack_require__("b622");
  5151. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5152. module.exports = function (it, TAG, STATIC) {
  5153. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  5154. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  5155. }
  5156. };
  5157. /***/ }),
  5158. /***/ "d58f":
  5159. /***/ (function(module, exports, __webpack_require__) {
  5160. var aFunction = __webpack_require__("1c0b");
  5161. var toObject = __webpack_require__("7b0b");
  5162. var IndexedObject = __webpack_require__("44ad");
  5163. var toLength = __webpack_require__("50c4");
  5164. // `Array.prototype.{ reduce, reduceRight }` methods implementation
  5165. var createMethod = function (IS_RIGHT) {
  5166. return function (that, callbackfn, argumentsLength, memo) {
  5167. aFunction(callbackfn);
  5168. var O = toObject(that);
  5169. var self = IndexedObject(O);
  5170. var length = toLength(O.length);
  5171. var index = IS_RIGHT ? length - 1 : 0;
  5172. var i = IS_RIGHT ? -1 : 1;
  5173. if (argumentsLength < 2) while (true) {
  5174. if (index in self) {
  5175. memo = self[index];
  5176. index += i;
  5177. break;
  5178. }
  5179. index += i;
  5180. if (IS_RIGHT ? index < 0 : length <= index) {
  5181. throw TypeError('Reduce of empty array with no initial value');
  5182. }
  5183. }
  5184. for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
  5185. memo = callbackfn(memo, self[index], index, O);
  5186. }
  5187. return memo;
  5188. };
  5189. };
  5190. module.exports = {
  5191. // `Array.prototype.reduce` method
  5192. // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
  5193. left: createMethod(false),
  5194. // `Array.prototype.reduceRight` method
  5195. // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
  5196. right: createMethod(true)
  5197. };
  5198. /***/ }),
  5199. /***/ "d784":
  5200. /***/ (function(module, exports, __webpack_require__) {
  5201. "use strict";
  5202. // TODO: Remove from `core-js@4` since it's moved to entry points
  5203. __webpack_require__("ac1f");
  5204. var redefine = __webpack_require__("6eeb");
  5205. var fails = __webpack_require__("d039");
  5206. var wellKnownSymbol = __webpack_require__("b622");
  5207. var regexpExec = __webpack_require__("9263");
  5208. var createNonEnumerableProperty = __webpack_require__("9112");
  5209. var SPECIES = wellKnownSymbol('species');
  5210. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  5211. // #replace needs built-in support for named groups.
  5212. // #match works fine because it just return the exec results, even if it has
  5213. // a "grops" property.
  5214. var re = /./;
  5215. re.exec = function () {
  5216. var result = [];
  5217. result.groups = { a: '7' };
  5218. return result;
  5219. };
  5220. return ''.replace(re, '$<a>') !== '7';
  5221. });
  5222. // IE <= 11 replaces $0 with the whole match, as if it was $&
  5223. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  5224. var REPLACE_KEEPS_$0 = (function () {
  5225. return 'a'.replace(/./, '$0') === '$0';
  5226. })();
  5227. var REPLACE = wellKnownSymbol('replace');
  5228. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  5229. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  5230. if (/./[REPLACE]) {
  5231. return /./[REPLACE]('a', '$0') === '';
  5232. }
  5233. return false;
  5234. })();
  5235. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  5236. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  5237. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  5238. var re = /(?:)/;
  5239. var originalExec = re.exec;
  5240. re.exec = function () { return originalExec.apply(this, arguments); };
  5241. var result = 'ab'.split(re);
  5242. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  5243. });
  5244. module.exports = function (KEY, length, exec, sham) {
  5245. var SYMBOL = wellKnownSymbol(KEY);
  5246. var DELEGATES_TO_SYMBOL = !fails(function () {
  5247. // String methods call symbol-named RegEp methods
  5248. var O = {};
  5249. O[SYMBOL] = function () { return 7; };
  5250. return ''[KEY](O) != 7;
  5251. });
  5252. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  5253. // Symbol-named RegExp methods call .exec
  5254. var execCalled = false;
  5255. var re = /a/;
  5256. if (KEY === 'split') {
  5257. // We can't use real regex here since it causes deoptimization
  5258. // and serious performance degradation in V8
  5259. // https://github.com/zloirock/core-js/issues/306
  5260. re = {};
  5261. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  5262. // a new one. We need to return the patched regex when creating the new one.
  5263. re.constructor = {};
  5264. re.constructor[SPECIES] = function () { return re; };
  5265. re.flags = '';
  5266. re[SYMBOL] = /./[SYMBOL];
  5267. }
  5268. re.exec = function () { execCalled = true; return null; };
  5269. re[SYMBOL]('');
  5270. return !execCalled;
  5271. });
  5272. if (
  5273. !DELEGATES_TO_SYMBOL ||
  5274. !DELEGATES_TO_EXEC ||
  5275. (KEY === 'replace' && !(
  5276. REPLACE_SUPPORTS_NAMED_GROUPS &&
  5277. REPLACE_KEEPS_$0 &&
  5278. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5279. )) ||
  5280. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  5281. ) {
  5282. var nativeRegExpMethod = /./[SYMBOL];
  5283. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  5284. if (regexp.exec === regexpExec) {
  5285. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  5286. // The native String method already delegates to @@method (this
  5287. // polyfilled function), leasing to infinite recursion.
  5288. // We avoid it by directly calling the native @@method method.
  5289. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  5290. }
  5291. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  5292. }
  5293. return { done: false };
  5294. }, {
  5295. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  5296. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5297. });
  5298. var stringMethod = methods[0];
  5299. var regexMethod = methods[1];
  5300. redefine(String.prototype, KEY, stringMethod);
  5301. redefine(RegExp.prototype, SYMBOL, length == 2
  5302. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  5303. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  5304. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  5305. // 21.2.5.6 RegExp.prototype[@@match](string)
  5306. // 21.2.5.9 RegExp.prototype[@@search](string)
  5307. : function (string) { return regexMethod.call(string, this); }
  5308. );
  5309. }
  5310. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  5311. };
  5312. /***/ }),
  5313. /***/ "d81d":
  5314. /***/ (function(module, exports, __webpack_require__) {
  5315. "use strict";
  5316. var $ = __webpack_require__("23e7");
  5317. var $map = __webpack_require__("b727").map;
  5318. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  5319. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5320. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  5321. // FF49- issue
  5322. var USES_TO_LENGTH = arrayMethodUsesToLength('map');
  5323. // `Array.prototype.map` method
  5324. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  5325. // with adding support of @@species
  5326. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  5327. map: function map(callbackfn /* , thisArg */) {
  5328. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5329. }
  5330. });
  5331. /***/ }),
  5332. /***/ "da84":
  5333. /***/ (function(module, exports, __webpack_require__) {
  5334. /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
  5335. return it && it.Math == Math && it;
  5336. };
  5337. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  5338. module.exports =
  5339. // eslint-disable-next-line no-undef
  5340. check(typeof globalThis == 'object' && globalThis) ||
  5341. check(typeof window == 'object' && window) ||
  5342. check(typeof self == 'object' && self) ||
  5343. check(typeof global == 'object' && global) ||
  5344. // eslint-disable-next-line no-new-func
  5345. (function () { return this; })() || Function('return this')();
  5346. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
  5347. /***/ }),
  5348. /***/ "dbb4":
  5349. /***/ (function(module, exports, __webpack_require__) {
  5350. var $ = __webpack_require__("23e7");
  5351. var DESCRIPTORS = __webpack_require__("83ab");
  5352. var ownKeys = __webpack_require__("56ef");
  5353. var toIndexedObject = __webpack_require__("fc6a");
  5354. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  5355. var createProperty = __webpack_require__("8418");
  5356. // `Object.getOwnPropertyDescriptors` method
  5357. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  5358. $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
  5359. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  5360. var O = toIndexedObject(object);
  5361. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  5362. var keys = ownKeys(O);
  5363. var result = {};
  5364. var index = 0;
  5365. var key, descriptor;
  5366. while (keys.length > index) {
  5367. descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
  5368. if (descriptor !== undefined) createProperty(result, key, descriptor);
  5369. }
  5370. return result;
  5371. }
  5372. });
  5373. /***/ }),
  5374. /***/ "ddb0":
  5375. /***/ (function(module, exports, __webpack_require__) {
  5376. var global = __webpack_require__("da84");
  5377. var DOMIterables = __webpack_require__("fdbc");
  5378. var ArrayIteratorMethods = __webpack_require__("e260");
  5379. var createNonEnumerableProperty = __webpack_require__("9112");
  5380. var wellKnownSymbol = __webpack_require__("b622");
  5381. var ITERATOR = wellKnownSymbol('iterator');
  5382. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5383. var ArrayValues = ArrayIteratorMethods.values;
  5384. for (var COLLECTION_NAME in DOMIterables) {
  5385. var Collection = global[COLLECTION_NAME];
  5386. var CollectionPrototype = Collection && Collection.prototype;
  5387. if (CollectionPrototype) {
  5388. // some Chrome versions have non-configurable methods on DOMTokenList
  5389. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  5390. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  5391. } catch (error) {
  5392. CollectionPrototype[ITERATOR] = ArrayValues;
  5393. }
  5394. if (!CollectionPrototype[TO_STRING_TAG]) {
  5395. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  5396. }
  5397. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  5398. // some Chrome versions have non-configurable methods on DOMTokenList
  5399. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  5400. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  5401. } catch (error) {
  5402. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  5403. }
  5404. }
  5405. }
  5406. }
  5407. /***/ }),
  5408. /***/ "df75":
  5409. /***/ (function(module, exports, __webpack_require__) {
  5410. var internalObjectKeys = __webpack_require__("ca84");
  5411. var enumBugKeys = __webpack_require__("7839");
  5412. // `Object.keys` method
  5413. // https://tc39.github.io/ecma262/#sec-object.keys
  5414. module.exports = Object.keys || function keys(O) {
  5415. return internalObjectKeys(O, enumBugKeys);
  5416. };
  5417. /***/ }),
  5418. /***/ "e01a":
  5419. /***/ (function(module, exports, __webpack_require__) {
  5420. "use strict";
  5421. // `Symbol.prototype.description` getter
  5422. // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
  5423. var $ = __webpack_require__("23e7");
  5424. var DESCRIPTORS = __webpack_require__("83ab");
  5425. var global = __webpack_require__("da84");
  5426. var has = __webpack_require__("5135");
  5427. var isObject = __webpack_require__("861d");
  5428. var defineProperty = __webpack_require__("9bf2").f;
  5429. var copyConstructorProperties = __webpack_require__("e893");
  5430. var NativeSymbol = global.Symbol;
  5431. if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  5432. // Safari 12 bug
  5433. NativeSymbol().description !== undefined
  5434. )) {
  5435. var EmptyStringDescriptionStore = {};
  5436. // wrap Symbol constructor for correct work with undefined description
  5437. var SymbolWrapper = function Symbol() {
  5438. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  5439. var result = this instanceof SymbolWrapper
  5440. ? new NativeSymbol(description)
  5441. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  5442. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  5443. if (description === '') EmptyStringDescriptionStore[result] = true;
  5444. return result;
  5445. };
  5446. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  5447. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  5448. symbolPrototype.constructor = SymbolWrapper;
  5449. var symbolToString = symbolPrototype.toString;
  5450. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  5451. var regexp = /^Symbol\((.*)\)[^)]+$/;
  5452. defineProperty(symbolPrototype, 'description', {
  5453. configurable: true,
  5454. get: function description() {
  5455. var symbol = isObject(this) ? this.valueOf() : this;
  5456. var string = symbolToString.call(symbol);
  5457. if (has(EmptyStringDescriptionStore, symbol)) return '';
  5458. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  5459. return desc === '' ? undefined : desc;
  5460. }
  5461. });
  5462. $({ global: true, forced: true }, {
  5463. Symbol: SymbolWrapper
  5464. });
  5465. }
  5466. /***/ }),
  5467. /***/ "e163":
  5468. /***/ (function(module, exports, __webpack_require__) {
  5469. var has = __webpack_require__("5135");
  5470. var toObject = __webpack_require__("7b0b");
  5471. var sharedKey = __webpack_require__("f772");
  5472. var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
  5473. var IE_PROTO = sharedKey('IE_PROTO');
  5474. var ObjectPrototype = Object.prototype;
  5475. // `Object.getPrototypeOf` method
  5476. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  5477. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  5478. O = toObject(O);
  5479. if (has(O, IE_PROTO)) return O[IE_PROTO];
  5480. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  5481. return O.constructor.prototype;
  5482. } return O instanceof Object ? ObjectPrototype : null;
  5483. };
  5484. /***/ }),
  5485. /***/ "e177":
  5486. /***/ (function(module, exports, __webpack_require__) {
  5487. var fails = __webpack_require__("d039");
  5488. module.exports = !fails(function () {
  5489. function F() { /* empty */ }
  5490. F.prototype.constructor = null;
  5491. return Object.getPrototypeOf(new F()) !== F.prototype;
  5492. });
  5493. /***/ }),
  5494. /***/ "e260":
  5495. /***/ (function(module, exports, __webpack_require__) {
  5496. "use strict";
  5497. var toIndexedObject = __webpack_require__("fc6a");
  5498. var addToUnscopables = __webpack_require__("44d2");
  5499. var Iterators = __webpack_require__("3f8c");
  5500. var InternalStateModule = __webpack_require__("69f3");
  5501. var defineIterator = __webpack_require__("7dd0");
  5502. var ARRAY_ITERATOR = 'Array Iterator';
  5503. var setInternalState = InternalStateModule.set;
  5504. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  5505. // `Array.prototype.entries` method
  5506. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  5507. // `Array.prototype.keys` method
  5508. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  5509. // `Array.prototype.values` method
  5510. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  5511. // `Array.prototype[@@iterator]` method
  5512. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  5513. // `CreateArrayIterator` internal method
  5514. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  5515. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  5516. setInternalState(this, {
  5517. type: ARRAY_ITERATOR,
  5518. target: toIndexedObject(iterated), // target
  5519. index: 0, // next index
  5520. kind: kind // kind
  5521. });
  5522. // `%ArrayIteratorPrototype%.next` method
  5523. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  5524. }, function () {
  5525. var state = getInternalState(this);
  5526. var target = state.target;
  5527. var kind = state.kind;
  5528. var index = state.index++;
  5529. if (!target || index >= target.length) {
  5530. state.target = undefined;
  5531. return { value: undefined, done: true };
  5532. }
  5533. if (kind == 'keys') return { value: index, done: false };
  5534. if (kind == 'values') return { value: target[index], done: false };
  5535. return { value: [index, target[index]], done: false };
  5536. }, 'values');
  5537. // argumentsList[@@iterator] is %ArrayProto_values%
  5538. // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
  5539. // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
  5540. Iterators.Arguments = Iterators.Array;
  5541. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  5542. addToUnscopables('keys');
  5543. addToUnscopables('values');
  5544. addToUnscopables('entries');
  5545. /***/ }),
  5546. /***/ "e2cc":
  5547. /***/ (function(module, exports, __webpack_require__) {
  5548. var redefine = __webpack_require__("6eeb");
  5549. module.exports = function (target, src, options) {
  5550. for (var key in src) redefine(target, key, src[key], options);
  5551. return target;
  5552. };
  5553. /***/ }),
  5554. /***/ "e439":
  5555. /***/ (function(module, exports, __webpack_require__) {
  5556. var $ = __webpack_require__("23e7");
  5557. var fails = __webpack_require__("d039");
  5558. var toIndexedObject = __webpack_require__("fc6a");
  5559. var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
  5560. var DESCRIPTORS = __webpack_require__("83ab");
  5561. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
  5562. var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
  5563. // `Object.getOwnPropertyDescriptor` method
  5564. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  5565. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  5566. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  5567. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  5568. }
  5569. });
  5570. /***/ }),
  5571. /***/ "e538":
  5572. /***/ (function(module, exports, __webpack_require__) {
  5573. var wellKnownSymbol = __webpack_require__("b622");
  5574. exports.f = wellKnownSymbol;
  5575. /***/ }),
  5576. /***/ "e58c":
  5577. /***/ (function(module, exports, __webpack_require__) {
  5578. "use strict";
  5579. var toIndexedObject = __webpack_require__("fc6a");
  5580. var toInteger = __webpack_require__("a691");
  5581. var toLength = __webpack_require__("50c4");
  5582. var arrayMethodIsStrict = __webpack_require__("a640");
  5583. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5584. var min = Math.min;
  5585. var nativeLastIndexOf = [].lastIndexOf;
  5586. var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
  5587. var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
  5588. // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
  5589. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  5590. var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
  5591. // `Array.prototype.lastIndexOf` method implementation
  5592. // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
  5593. module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  5594. // convert -0 to +0
  5595. if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
  5596. var O = toIndexedObject(this);
  5597. var length = toLength(O.length);
  5598. var index = length - 1;
  5599. if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
  5600. if (index < 0) index = length + index;
  5601. for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
  5602. return -1;
  5603. } : nativeLastIndexOf;
  5604. /***/ }),
  5605. /***/ "e893":
  5606. /***/ (function(module, exports, __webpack_require__) {
  5607. var has = __webpack_require__("5135");
  5608. var ownKeys = __webpack_require__("56ef");
  5609. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  5610. var definePropertyModule = __webpack_require__("9bf2");
  5611. module.exports = function (target, source) {
  5612. var keys = ownKeys(source);
  5613. var defineProperty = definePropertyModule.f;
  5614. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  5615. for (var i = 0; i < keys.length; i++) {
  5616. var key = keys[i];
  5617. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  5618. }
  5619. };
  5620. /***/ }),
  5621. /***/ "e8b5":
  5622. /***/ (function(module, exports, __webpack_require__) {
  5623. var classof = __webpack_require__("c6b6");
  5624. // `IsArray` abstract operation
  5625. // https://tc39.github.io/ecma262/#sec-isarray
  5626. module.exports = Array.isArray || function isArray(arg) {
  5627. return classof(arg) == 'Array';
  5628. };
  5629. /***/ }),
  5630. /***/ "e95a":
  5631. /***/ (function(module, exports, __webpack_require__) {
  5632. var wellKnownSymbol = __webpack_require__("b622");
  5633. var Iterators = __webpack_require__("3f8c");
  5634. var ITERATOR = wellKnownSymbol('iterator');
  5635. var ArrayPrototype = Array.prototype;
  5636. // check on default Array iterator
  5637. module.exports = function (it) {
  5638. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  5639. };
  5640. /***/ }),
  5641. /***/ "f183":
  5642. /***/ (function(module, exports, __webpack_require__) {
  5643. var hiddenKeys = __webpack_require__("d012");
  5644. var isObject = __webpack_require__("861d");
  5645. var has = __webpack_require__("5135");
  5646. var defineProperty = __webpack_require__("9bf2").f;
  5647. var uid = __webpack_require__("90e3");
  5648. var FREEZING = __webpack_require__("bb2f");
  5649. var METADATA = uid('meta');
  5650. var id = 0;
  5651. var isExtensible = Object.isExtensible || function () {
  5652. return true;
  5653. };
  5654. var setMetadata = function (it) {
  5655. defineProperty(it, METADATA, { value: {
  5656. objectID: 'O' + ++id, // object ID
  5657. weakData: {} // weak collections IDs
  5658. } });
  5659. };
  5660. var fastKey = function (it, create) {
  5661. // return a primitive with prefix
  5662. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  5663. if (!has(it, METADATA)) {
  5664. // can't set metadata to uncaught frozen object
  5665. if (!isExtensible(it)) return 'F';
  5666. // not necessary to add metadata
  5667. if (!create) return 'E';
  5668. // add missing metadata
  5669. setMetadata(it);
  5670. // return object ID
  5671. } return it[METADATA].objectID;
  5672. };
  5673. var getWeakData = function (it, create) {
  5674. if (!has(it, METADATA)) {
  5675. // can't set metadata to uncaught frozen object
  5676. if (!isExtensible(it)) return true;
  5677. // not necessary to add metadata
  5678. if (!create) return false;
  5679. // add missing metadata
  5680. setMetadata(it);
  5681. // return the store of weak collections IDs
  5682. } return it[METADATA].weakData;
  5683. };
  5684. // add metadata on freeze-family methods calling
  5685. var onFreeze = function (it) {
  5686. if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
  5687. return it;
  5688. };
  5689. var meta = module.exports = {
  5690. REQUIRED: false,
  5691. fastKey: fastKey,
  5692. getWeakData: getWeakData,
  5693. onFreeze: onFreeze
  5694. };
  5695. hiddenKeys[METADATA] = true;
  5696. /***/ }),
  5697. /***/ "f5df":
  5698. /***/ (function(module, exports, __webpack_require__) {
  5699. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5700. var classofRaw = __webpack_require__("c6b6");
  5701. var wellKnownSymbol = __webpack_require__("b622");
  5702. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5703. // ES3 wrong here
  5704. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  5705. // fallback for IE11 Script Access Denied error
  5706. var tryGet = function (it, key) {
  5707. try {
  5708. return it[key];
  5709. } catch (error) { /* empty */ }
  5710. };
  5711. // getting tag from ES6+ `Object.prototype.toString`
  5712. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  5713. var O, tag, result;
  5714. return it === undefined ? 'Undefined' : it === null ? 'Null'
  5715. // @@toStringTag case
  5716. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  5717. // builtinTag case
  5718. : CORRECT_ARGUMENTS ? classofRaw(O)
  5719. // ES3 arguments fallback
  5720. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  5721. };
  5722. /***/ }),
  5723. /***/ "f772":
  5724. /***/ (function(module, exports, __webpack_require__) {
  5725. var shared = __webpack_require__("5692");
  5726. var uid = __webpack_require__("90e3");
  5727. var keys = shared('keys');
  5728. module.exports = function (key) {
  5729. return keys[key] || (keys[key] = uid(key));
  5730. };
  5731. /***/ }),
  5732. /***/ "fb15":
  5733. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5734. "use strict";
  5735. // ESM COMPAT FLAG
  5736. __webpack_require__.r(__webpack_exports__);
  5737. // EXPORTS
  5738. __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
  5739. __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
  5740. __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Header; });
  5741. __webpack_require__.d(__webpack_exports__, "Body", function() { return /* reexport */ Body; });
  5742. __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
  5743. __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
  5744. __webpack_require__.d(__webpack_exports__, "Loading", function() { return /* reexport */ Loading; });
  5745. __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid; });
  5746. __webpack_require__.d(__webpack_exports__, "Menu", function() { return /* reexport */ Menu; });
  5747. __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ Toolbar; });
  5748. __webpack_require__.d(__webpack_exports__, "Pager", function() { return /* reexport */ Pager; });
  5749. __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return /* reexport */ Checkbox; });
  5750. __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
  5751. __webpack_require__.d(__webpack_exports__, "Input", function() { return /* reexport */ Input; });
  5752. __webpack_require__.d(__webpack_exports__, "Textarea", function() { return /* reexport */ Textarea; });
  5753. __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ Button; });
  5754. __webpack_require__.d(__webpack_exports__, "ModalController", function() { return /* reexport */ ModalController; });
  5755. __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
  5756. __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ Tooltip; });
  5757. __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; });
  5758. __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
  5759. __webpack_require__.d(__webpack_exports__, "Switch", function() { return /* reexport */ Switch; });
  5760. __webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
  5761. __webpack_require__.d(__webpack_exports__, "Pulldown", function() { return /* reexport */ Pulldown; });
  5762. __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
  5763. __webpack_require__.d(__webpack_exports__, "Export", function() { return /* reexport */ Export; });
  5764. __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return /* reexport */ Keyboard; });
  5765. __webpack_require__.d(__webpack_exports__, "Validator", function() { return /* reexport */ Validator; });
  5766. __webpack_require__.d(__webpack_exports__, "Resize", function() { return /* reexport */ Resize; });
  5767. __webpack_require__.d(__webpack_exports__, "Table", function() { return /* reexport */ Table; });
  5768. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  5769. // This file is imported into lib/wc client bundles.
  5770. if (typeof window !== 'undefined') {
  5771. var currentScript = window.document.currentScript
  5772. if (true) {
  5773. var getCurrentScript = __webpack_require__("8875")
  5774. currentScript = getCurrentScript()
  5775. // for backward compatibility, because previously we directly included the polyfill
  5776. if (!('currentScript' in document)) {
  5777. Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
  5778. }
  5779. }
  5780. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
  5781. if (src) {
  5782. __webpack_require__.p = src[1] // eslint-disable-line
  5783. }
  5784. }
  5785. // Indicate to webpack that this file can be concatenated
  5786. /* harmony default export */ var setPublicPath = (null);
  5787. // EXTERNAL MODULE: ./styles/index.scss
  5788. var styles = __webpack_require__("1a97");
  5789. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
  5790. var es_array_map = __webpack_require__("d81d");
  5791. // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils/ctor","commonjs2":"xe-utils/ctor","amd":"xe-utils"}
  5792. var ctor_amd_xe_utils_ = __webpack_require__("7fd6");
  5793. var ctor_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(ctor_amd_xe_utils_);
  5794. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
  5795. var es_array_index_of = __webpack_require__("c975");
  5796. // CONCATENATED MODULE: ./packages/conf/index.js
  5797. var iconPrefix = 'vxe-icon--';
  5798. var GlobalConfig = {
  5799. // size: null, // 全局尺寸
  5800. zIndex: 999,
  5801. // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
  5802. version: 0,
  5803. // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
  5804. // resizeInterval: 500,
  5805. emptyCell: ' ',
  5806. table: {
  5807. fit: true,
  5808. showHeader: true,
  5809. animat: true,
  5810. delayHover: 250,
  5811. // keepSource: false,
  5812. // cloak: false,
  5813. // showOverflow: null,
  5814. // showHeaderOverflow: null,
  5815. // showFooterOverflow: null,
  5816. // resizeInterval: 500,
  5817. // size: null,
  5818. // zIndex: null,
  5819. // resizable: false,
  5820. // autoResize: false,
  5821. // stripe: false,
  5822. // border: false,
  5823. // round: false,
  5824. // emptyRender: {
  5825. // name: ''
  5826. // },
  5827. // radioConfig: {
  5828. // trigger: 'default'
  5829. // },
  5830. // checkboxConfig: {
  5831. // trigger: 'default'
  5832. // },
  5833. // tooltipConfig: {
  5834. // theme: 'dark',
  5835. // enterable: false
  5836. // },
  5837. validConfig: {
  5838. showMessage: true,
  5839. message: 'default'
  5840. },
  5841. // menuConfig: {
  5842. // visibleMethod () {}
  5843. // },
  5844. // customConfig: {
  5845. // storage: false,
  5846. // checkMethod () {}
  5847. // },
  5848. // rowId: '_XID', // 行数据的唯一主键字段名
  5849. sortConfig: {
  5850. // remote: false,
  5851. // trigger: 'default',
  5852. // orders: ['asc', 'desc', null],
  5853. // sortMethod: null,
  5854. showIcon: true
  5855. },
  5856. filterConfig: {
  5857. // remote: false,
  5858. // filterMethod: null,
  5859. showIcon: true
  5860. },
  5861. treeConfig: {
  5862. children: 'children',
  5863. hasChild: 'hasChild',
  5864. indent: 20,
  5865. showIcon: true
  5866. },
  5867. keyboardConfig: {
  5868. isChecked: true
  5869. },
  5870. expandConfig: {
  5871. // trigger: 'default',
  5872. showIcon: true
  5873. },
  5874. editConfig: {
  5875. // mode: 'cell',
  5876. showIcon: true,
  5877. showAsterisk: true
  5878. },
  5879. importConfig: {
  5880. modes: ['insert', 'covering']
  5881. },
  5882. exportConfig: {
  5883. // isPrint: false,
  5884. modes: ['current', 'selected']
  5885. },
  5886. mouseConfig: {
  5887. extension: true
  5888. },
  5889. areaConfig: {
  5890. selectCellByHeader: true
  5891. },
  5892. clipConfig: {
  5893. isCopy: true,
  5894. isCut: true,
  5895. isPaste: true
  5896. },
  5897. fnrConfig: {
  5898. isFind: true,
  5899. isReplace: true
  5900. },
  5901. scrollX: {
  5902. enabled: true,
  5903. gt: 60 // oSize: 0,
  5904. // rSize: 0
  5905. // vSize: 0
  5906. },
  5907. scrollY: {
  5908. enabled: true,
  5909. gt: 100 // oSize: 0,
  5910. // rSize: 0
  5911. // vSize: 0,
  5912. // rHeight: 0
  5913. }
  5914. },
  5915. export: {
  5916. types: {}
  5917. },
  5918. icon: {
  5919. // table
  5920. TABLE_SORT_ASC: iconPrefix + 'caret-top',
  5921. TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
  5922. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  5923. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  5924. TABLE_EDIT: iconPrefix + 'edit-outline',
  5925. TABLE_HELP: iconPrefix + 'question',
  5926. TABLE_TREE_LOADED: iconPrefix + 'refresh roll',
  5927. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  5928. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  5929. TABLE_EXPAND_LOADED: iconPrefix + 'refresh roll',
  5930. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  5931. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  5932. // button
  5933. BUTTON_DROPDOWN: iconPrefix + 'arrow-bottom',
  5934. BUTTON_LOADING: iconPrefix + 'refresh roll',
  5935. // select
  5936. SELECT_LOADED: iconPrefix + 'refresh roll',
  5937. SELECT_OPEN: iconPrefix + 'caret-bottom rotate180',
  5938. SELECT_CLOSE: iconPrefix + 'caret-bottom',
  5939. // pager
  5940. PAGER_JUMP_PREV: iconPrefix + 'd-arrow-left',
  5941. PAGER_JUMP_NEXT: iconPrefix + 'd-arrow-right',
  5942. PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
  5943. PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
  5944. PAGER_JUMP_MORE: iconPrefix + 'more',
  5945. // input
  5946. INPUT_CLEAR: iconPrefix + 'close',
  5947. INPUT_PWD: iconPrefix + 'eye-slash',
  5948. INPUT_SHOW_PWD: iconPrefix + 'eye',
  5949. INPUT_PREV_NUM: iconPrefix + 'caret-top',
  5950. INPUT_NEXT_NUM: iconPrefix + 'caret-bottom',
  5951. INPUT_DATE: iconPrefix + 'calendar',
  5952. INPUT_SEARCH: iconPrefix + 'search',
  5953. // modal
  5954. MODAL_ZOOM_IN: iconPrefix + 'square',
  5955. MODAL_ZOOM_OUT: iconPrefix + 'zoomout',
  5956. MODAL_CLOSE: iconPrefix + 'close',
  5957. MODAL_INFO: iconPrefix + 'info',
  5958. MODAL_SUCCESS: iconPrefix + 'success',
  5959. MODAL_WARNING: iconPrefix + 'warning',
  5960. MODAL_ERROR: iconPrefix + 'error',
  5961. MODAL_QUESTION: iconPrefix + 'question',
  5962. MODAL_LOADING: iconPrefix + 'refresh roll',
  5963. // toolbar
  5964. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'refresh',
  5965. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'refresh roll',
  5966. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  5967. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  5968. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  5969. TOOLBAR_TOOLS_ZOOM_IN: iconPrefix + 'zoomin',
  5970. TOOLBAR_TOOLS_ZOOM_OUT: iconPrefix + 'zoomout',
  5971. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'menu',
  5972. // form
  5973. FORM_PREFIX: iconPrefix + 'info',
  5974. FORM_SUFFIX: iconPrefix + 'info',
  5975. FORM_FOLDING: iconPrefix + 'arrow-top rotate180',
  5976. FORM_UNFOLDING: iconPrefix + 'arrow-top'
  5977. },
  5978. grid: {
  5979. // size: null,
  5980. // zoomConfig: {
  5981. // escRestore: true
  5982. // },
  5983. formConfig: {
  5984. enabled: true
  5985. },
  5986. pagerConfig: {
  5987. enabled: true // perfect: false
  5988. },
  5989. toolbarConfig: {
  5990. enabled: true // perfect: false
  5991. },
  5992. proxyConfig: {
  5993. enabled: true,
  5994. autoLoad: true,
  5995. message: true,
  5996. props: {
  5997. list: null,
  5998. result: 'result',
  5999. total: 'page.total',
  6000. message: 'message'
  6001. } // beforeItem: null,
  6002. // beforeColumn: null,
  6003. // beforeQuery: null,
  6004. // afterQuery: null,
  6005. // beforeDelete: null,
  6006. // afterDelete: null,
  6007. // beforeSave: null,
  6008. // afterSave: null
  6009. }
  6010. },
  6011. tooltip: {
  6012. // size: null,
  6013. trigger: 'hover',
  6014. theme: 'dark',
  6015. leaveDelay: 300
  6016. },
  6017. pager: {// size: null,
  6018. // autoHidden: false,
  6019. // perfect: true,
  6020. // pageSize: 10,
  6021. // pagerCount: 7,
  6022. // pageSizes: [10, 15, 20, 50, 100],
  6023. // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
  6024. },
  6025. form: {
  6026. // preventSubmit: false,
  6027. validConfig: {
  6028. showMessage: true,
  6029. autoPos: true
  6030. },
  6031. // size: null,
  6032. // colon: false,
  6033. titleAsterisk: true
  6034. },
  6035. input: {
  6036. // size: null,
  6037. // transfer: false
  6038. // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
  6039. // labelFormat: '',
  6040. // valueFormat: '',
  6041. minDate: new Date(1900, 0, 1),
  6042. maxDate: new Date(2100, 0, 1),
  6043. startDay: 1,
  6044. selectDay: 1,
  6045. digits: 2,
  6046. controls: true
  6047. },
  6048. textarea: {// size: null,
  6049. // autosize: {
  6050. // minRows: 1,
  6051. // maxRows: 10
  6052. // }
  6053. },
  6054. select: {
  6055. // size: null,
  6056. // transfer: false,
  6057. multiCharOverflow: 8
  6058. },
  6059. toolbar: {// size: null,
  6060. // import: {
  6061. // mode: 'covering'
  6062. // },
  6063. // export: {
  6064. // types: ['csv', 'html', 'xml', 'txt']
  6065. // },
  6066. // custom: {
  6067. // isFooter: true
  6068. // },
  6069. // buttons: []
  6070. },
  6071. button: {// size: null,
  6072. // transfer: false
  6073. },
  6074. radio: {// size: null
  6075. },
  6076. checkbox: {// size: null
  6077. },
  6078. switch: {// size: null
  6079. },
  6080. modal: {
  6081. // size: null,
  6082. top: 15,
  6083. showHeader: true,
  6084. minWidth: 340,
  6085. minHeight: 140,
  6086. lockView: true,
  6087. mask: true,
  6088. duration: 3000,
  6089. marginSize: 0,
  6090. dblclickZoom: true,
  6091. showTitleOverflow: true,
  6092. animat: true,
  6093. showClose: true,
  6094. // storage: false,
  6095. storageKey: 'VXE_MODAL_POSITION'
  6096. },
  6097. list: {
  6098. // size: null,
  6099. scrollY: {
  6100. enabled: true,
  6101. gt: 100 // oSize: 0,
  6102. // rSize: 0
  6103. // vSize: 0,
  6104. // rHeight: 0
  6105. }
  6106. },
  6107. i18n: function i18n(key) {
  6108. return key;
  6109. }
  6110. };
  6111. /* harmony default export */ var conf = (GlobalConfig);
  6112. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
  6113. var es_object_to_string = __webpack_require__("d3b7");
  6114. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
  6115. var es_regexp_exec = __webpack_require__("ac1f");
  6116. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
  6117. var es_regexp_to_string = __webpack_require__("25f0");
  6118. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
  6119. var es_string_replace = __webpack_require__("5319");
  6120. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
  6121. var es_string_split = __webpack_require__("1276");
  6122. // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
  6123. function toType(type) {
  6124. return ctor_amd_xe_utils_default.a.toString(type).replace('_', '').toLowerCase();
  6125. }
  6126. var eventTypes = 'created,mounted,activated,beforeDestroy,destroyed,event.clearActived,event.clearFilter,event.clearAreas,event.showMenu,event.keydown,event.export,event.import'.split(',').map(toType);
  6127. var storeMap = {};
  6128. var interceptor = {
  6129. mixin: function mixin(map) {
  6130. ctor_amd_xe_utils_default.a.each(map, function (evntFn, type) {
  6131. return interceptor.add(type, evntFn);
  6132. });
  6133. return interceptor;
  6134. },
  6135. get: function get(type) {
  6136. return storeMap[toType(type)] || [];
  6137. },
  6138. add: function add(type, evntFn) {
  6139. type = toType(type);
  6140. if (evntFn && eventTypes.indexOf(type) > -1) {
  6141. var eList = storeMap[type];
  6142. if (!eList) {
  6143. eList = storeMap[type] = [];
  6144. }
  6145. eList.push(evntFn);
  6146. }
  6147. return interceptor;
  6148. },
  6149. delete: function _delete(type, evntFn) {
  6150. var eList = storeMap[toType(type)];
  6151. if (eList) {
  6152. ctor_amd_xe_utils_default.a.remove(eList, function (fn) {
  6153. return fn === evntFn;
  6154. });
  6155. }
  6156. return interceptor;
  6157. }
  6158. };
  6159. /* harmony default export */ var src_interceptor = (interceptor);
  6160. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
  6161. var es_array_concat = __webpack_require__("99af");
  6162. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
  6163. var es_array_find = __webpack_require__("7db0");
  6164. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
  6165. var es_array_join = __webpack_require__("a15b");
  6166. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
  6167. var es_function_name = __webpack_require__("b0c0");
  6168. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
  6169. var es_number_to_fixed = __webpack_require__("b680");
  6170. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.for-each.js
  6171. var es_array_for_each = __webpack_require__("4160");
  6172. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.last-index-of.js
  6173. var es_array_last_index_of = __webpack_require__("baa5");
  6174. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
  6175. var es_array_splice = __webpack_require__("a434");
  6176. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
  6177. var es_string_fixed = __webpack_require__("c7cd");
  6178. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
  6179. var web_dom_collections_for_each = __webpack_require__("159b");
  6180. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  6181. function _arrayLikeToArray(arr, len) {
  6182. if (len == null || len > arr.length) len = arr.length;
  6183. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  6184. arr2[i] = arr[i];
  6185. }
  6186. return arr2;
  6187. }
  6188. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  6189. function _arrayWithoutHoles(arr) {
  6190. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  6191. }
  6192. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
  6193. var es_symbol = __webpack_require__("a4d3");
  6194. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
  6195. var es_symbol_description = __webpack_require__("e01a");
  6196. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
  6197. var es_symbol_iterator = __webpack_require__("d28b");
  6198. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
  6199. var es_array_from = __webpack_require__("a630");
  6200. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
  6201. var es_string_iterator = __webpack_require__("3ca3");
  6202. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
  6203. var web_dom_collections_iterator = __webpack_require__("ddb0");
  6204. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  6205. function _iterableToArray(iter) {
  6206. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  6207. }
  6208. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
  6209. var es_array_slice = __webpack_require__("fb6a");
  6210. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
  6211. function _unsupportedIterableToArray(o, minLen) {
  6212. if (!o) return;
  6213. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  6214. var n = Object.prototype.toString.call(o).slice(8, -1);
  6215. if (n === "Object" && o.constructor) n = o.constructor.name;
  6216. if (n === "Map" || n === "Set") return Array.from(o);
  6217. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  6218. }
  6219. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  6220. function _nonIterableSpread() {
  6221. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  6222. }
  6223. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  6224. function _toConsumableArray(arr) {
  6225. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  6226. }
  6227. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  6228. function _classCallCheck(instance, Constructor) {
  6229. if (!(instance instanceof Constructor)) {
  6230. throw new TypeError("Cannot call a class as a function");
  6231. }
  6232. }
  6233. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  6234. function _defineProperties(target, props) {
  6235. for (var i = 0; i < props.length; i++) {
  6236. var descriptor = props[i];
  6237. descriptor.enumerable = descriptor.enumerable || false;
  6238. descriptor.configurable = true;
  6239. if ("value" in descriptor) descriptor.writable = true;
  6240. Object.defineProperty(target, descriptor.key, descriptor);
  6241. }
  6242. }
  6243. function _createClass(Constructor, protoProps, staticProps) {
  6244. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  6245. if (staticProps) _defineProperties(Constructor, staticProps);
  6246. return Constructor;
  6247. }
  6248. // CONCATENATED MODULE: ./packages/v-x-e-table/src/store.js
  6249. /**
  6250. * 创建数据仓库
  6251. */
  6252. var store_Store = /*#__PURE__*/function () {
  6253. function Store() {
  6254. _classCallCheck(this, Store);
  6255. this.store = {};
  6256. }
  6257. _createClass(Store, [{
  6258. key: "mixin",
  6259. value: function mixin(map) {
  6260. Object.assign(this.store, map);
  6261. return Store;
  6262. }
  6263. }, {
  6264. key: "get",
  6265. value: function get(type) {
  6266. return this.store[type];
  6267. }
  6268. }, {
  6269. key: "add",
  6270. value: function add(type, render) {
  6271. this.store[type] = render;
  6272. return Store;
  6273. }
  6274. }, {
  6275. key: "delete",
  6276. value: function _delete(type) {
  6277. delete this.store[type];
  6278. return Store;
  6279. }
  6280. }]);
  6281. return Store;
  6282. }();
  6283. /* harmony default export */ var store = (store_Store);
  6284. // CONCATENATED MODULE: ./packages/v-x-e-table/src/formats.js
  6285. var formats = new store();
  6286. /* harmony default export */ var src_formats = (formats);
  6287. // CONCATENATED MODULE: ./packages/tools/src/utils.js
  6288. var zindexIndex = 0;
  6289. var lastZindex = 1;
  6290. function getColFuncWidth(isExists) {
  6291. var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
  6292. return isExists ? defaultWidth : 0;
  6293. }
  6294. var utils_ColumnInfo = /*#__PURE__*/function () {
  6295. /* eslint-disable @typescript-eslint/no-use-before-define */
  6296. function ColumnInfo($xetable, _vm) {
  6297. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  6298. renderHeader = _ref.renderHeader,
  6299. renderCell = _ref.renderCell,
  6300. renderFooter = _ref.renderFooter,
  6301. renderData = _ref.renderData;
  6302. _classCallCheck(this, ColumnInfo);
  6303. var $xegrid = $xetable.$xegrid;
  6304. var proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
  6305. var formatter = _vm.formatter;
  6306. var visible = ctor_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
  6307. if (_vm.cellRender && _vm.editRender) {
  6308. UtilTools.warn('vxe.error.errConflicts', ['column.cell-render', 'column.edit-render']);
  6309. } // 在 v3.0 中废弃 editRender.type
  6310. if (_vm.editRender && _vm.editRender.type === 'visible') {
  6311. UtilTools.warn('vxe.error.delProp', ['column.edit-render.type', 'column.cell-render']);
  6312. } // 在 v3.0 中废弃 prop
  6313. if (_vm.prop) {
  6314. UtilTools.warn('vxe.error.delProp', ['column.prop', 'column.field']);
  6315. } // 在 v3.0 中废弃 label
  6316. if (_vm.label) {
  6317. UtilTools.warn('vxe.error.delProp', ['column.label', 'column.title']);
  6318. } // 在 v3.0 中废弃 class
  6319. if (_vm.class) {
  6320. UtilTools.warn('vxe.error.delProp', ['column.class', 'column.className']);
  6321. } // 在 v3.0 中废弃 type=index
  6322. if (_vm.type === 'index') {
  6323. UtilTools.warn('vxe.error.delProp', ['column.type=index', 'column.type=seq']);
  6324. } else if (_vm.type === 'selection') {
  6325. // 在 v3.0 中废弃 type=selection
  6326. UtilTools.warn('vxe.error.delProp', ['column.type=selection', 'column.type=checkbox']);
  6327. } else if (_vm.type === 'expand') {
  6328. if ($xetable.treeConfig && $xetable.treeOpts.line) {
  6329. UtilTools.error('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
  6330. }
  6331. if (_vm.slots && !_vm.slots.content && _vm.slots.default) {
  6332. UtilTools.error('vxe.error.expandContent');
  6333. }
  6334. } // 在 v3.0 中 cellRender 只能是对象类型
  6335. if (ctor_amd_xe_utils_default.a.isBoolean(_vm.cellRender) || _vm.cellRender && !ctor_amd_xe_utils_default.a.isObject(_vm.cellRender)) {
  6336. UtilTools.warn('vxe.error.errProp', ["column.cell-render=".concat(_vm.cellRender), 'column.cell-render={}']);
  6337. } // 在 v3.0 中 editRender 只能是对象类型
  6338. if (ctor_amd_xe_utils_default.a.isBoolean(_vm.editRender) || _vm.editRender && !ctor_amd_xe_utils_default.a.isObject(_vm.editRender)) {
  6339. UtilTools.warn('vxe.error.errProp', ["column.edit-render=".concat(_vm.editRender), 'column.edit-render={}']);
  6340. } // 在 v3.0 中废弃 remoteSort
  6341. if (_vm.remoteSort) {
  6342. UtilTools.warn('vxe.error.delProp', ['column.remote-sort', 'sort-config.remote']);
  6343. } // 在 v3.0 中废弃 sortMethod
  6344. if (_vm.sortMethod) {
  6345. UtilTools.warn('vxe.error.delProp', ['column.sort-method', 'sort-config.sortMethod']);
  6346. } // 在 v3.0 中 sortBy 只能是字符串
  6347. if (_vm.sortBy && !ctor_amd_xe_utils_default.a.isString(_vm.sortBy)) {
  6348. UtilTools.warn('vxe.error.errProp', ["column.sort-by=".concat(JSON.stringify(_vm.sortBy)), "column.sort-by=\"".concat(_vm.sortBy[0], "\"")]);
  6349. }
  6350. if (formatter) {
  6351. if (ctor_amd_xe_utils_default.a.isString(formatter)) {
  6352. var globalFunc = src_formats.get(formatter);
  6353. if (!globalFunc && ctor_amd_xe_utils_default.a[formatter]) {
  6354. globalFunc = ctor_amd_xe_utils_default.a[formatter]; // 在 v3.0 中废弃挂载格式化方式
  6355. UtilTools.warn('vxe.error.errFormat', [formatter]);
  6356. }
  6357. if (!ctor_amd_xe_utils_default.a.isFunction(globalFunc)) {
  6358. UtilTools.error('vxe.error.notFunc', [formatter]);
  6359. }
  6360. } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
  6361. var _globalFunc = src_formats.get(formatter[0]);
  6362. if (!_globalFunc && ctor_amd_xe_utils_default.a[formatter[0]]) {
  6363. _globalFunc = ctor_amd_xe_utils_default.a[formatter[0]]; // 在 v3.0 中废弃挂载格式化方式
  6364. UtilTools.warn('vxe.error.errFormat', [formatter[0]]);
  6365. }
  6366. if (!ctor_amd_xe_utils_default.a.isFunction(_globalFunc)) {
  6367. UtilTools.error('vxe.error.notFunc', [formatter[0]]);
  6368. }
  6369. }
  6370. }
  6371. Object.assign(this, {
  6372. // 基本属性
  6373. type: _vm.type,
  6374. // 在 v3.0 中废弃 prop
  6375. prop: _vm.prop,
  6376. property: _vm.field || _vm.prop,
  6377. title: _vm.title,
  6378. // 在 v3.0 中废弃 label
  6379. label: _vm.label,
  6380. width: _vm.width,
  6381. minWidth: _vm.minWidth,
  6382. resizable: _vm.resizable,
  6383. fixed: _vm.fixed,
  6384. align: _vm.align,
  6385. headerAlign: _vm.headerAlign,
  6386. footerAlign: _vm.footerAlign,
  6387. showOverflow: _vm.showOverflow,
  6388. showHeaderOverflow: _vm.showHeaderOverflow,
  6389. showFooterOverflow: _vm.showFooterOverflow,
  6390. className: _vm.class || _vm.className,
  6391. headerClassName: _vm.headerClassName,
  6392. footerClassName: _vm.footerClassName,
  6393. indexMethod: _vm.indexMethod,
  6394. seqMethod: _vm.seqMethod,
  6395. formatter: formatter,
  6396. sortable: _vm.sortable,
  6397. sortBy: _vm.sortBy,
  6398. sortType: _vm.sortType,
  6399. sortMethod: _vm.sortMethod,
  6400. remoteSort: _vm.remoteSort,
  6401. filters: UtilTools.getFilters(_vm.filters),
  6402. filterMultiple: ctor_amd_xe_utils_default.a.isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
  6403. filterMethod: _vm.filterMethod,
  6404. filterResetMethod: _vm.filterResetMethod,
  6405. filterRecoverMethod: _vm.filterRecoverMethod,
  6406. filterRender: _vm.filterRender,
  6407. treeNode: _vm.treeNode,
  6408. cellType: _vm.cellType,
  6409. cellRender: _vm.cellRender,
  6410. editRender: _vm.editRender,
  6411. contentRender: _vm.contentRender,
  6412. exportMethod: _vm.exportMethod,
  6413. footerExportMethod: _vm.footerExportMethod,
  6414. titleHelp: _vm.titleHelp,
  6415. // 自定义参数
  6416. params: _vm.params,
  6417. // 渲染属性
  6418. id: _vm.colId || ctor_amd_xe_utils_default.a.uniqueId('col_'),
  6419. parentId: null,
  6420. visible: visible,
  6421. // 内部属性(一旦被使用,将导致不可升级版本)
  6422. halfVisible: false,
  6423. defaultVisible: visible,
  6424. checked: false,
  6425. halfChecked: false,
  6426. disabled: false,
  6427. level: 1,
  6428. rowSpan: 1,
  6429. colSpan: 1,
  6430. order: null,
  6431. sortTime: 0,
  6432. renderWidth: 0,
  6433. renderHeight: 0,
  6434. resizeWidth: 0,
  6435. renderLeft: 0,
  6436. renderArgs: [],
  6437. // 渲染参数可用于扩展
  6438. model: {},
  6439. renderHeader: renderHeader || _vm.renderHeader,
  6440. renderCell: renderCell || _vm.renderCell,
  6441. renderFooter: renderFooter || _vm.renderFooter,
  6442. renderData: renderData,
  6443. // 单元格插槽,只对 grid 有效
  6444. slots: _vm.slots,
  6445. _own: _vm
  6446. });
  6447. if (proxyOpts && proxyOpts.beforeColumn) {
  6448. proxyOpts.beforeColumn({
  6449. $grid: $xegrid,
  6450. column: this
  6451. });
  6452. }
  6453. }
  6454. _createClass(ColumnInfo, [{
  6455. key: "getTitle",
  6456. value: function getTitle() {
  6457. // 在 v3.0 中废弃 label、type=index
  6458. return UtilTools.getFuncText(this.title || this.label || (this.type === 'seq' || this.type === 'index' ? conf.i18n('vxe.table.seqTitle') : ''));
  6459. }
  6460. }, {
  6461. key: "getKey",
  6462. value: function getKey() {
  6463. return this.property || (this.type ? "type=".concat(this.type) : null);
  6464. }
  6465. }, {
  6466. key: "getMinWidth",
  6467. value: function getMinWidth() {
  6468. var type = this.type,
  6469. filters = this.filters,
  6470. sortable = this.sortable,
  6471. remoteSort = this.remoteSort,
  6472. sortOpts = this.sortOpts,
  6473. editRender = this.editRender,
  6474. editOpts = this.editOpts,
  6475. titleHelp = this.titleHelp;
  6476. return 40 + getColFuncWidth(type === 'checkbox' || type === 'selection', 18) + getColFuncWidth(titleHelp, 18) + getColFuncWidth(filters) + getColFuncWidth((sortable || remoteSort) && sortOpts.showIcon) + getColFuncWidth(editRender && editOpts.showIcon, 32);
  6477. }
  6478. }, {
  6479. key: "update",
  6480. value: function update(name, value) {
  6481. // 不支持双向的属性
  6482. if (name !== 'filters') {
  6483. this[name] = value;
  6484. if (name === 'field') {
  6485. this.property = value;
  6486. }
  6487. }
  6488. }
  6489. }, {
  6490. key: "own",
  6491. get: function get() {
  6492. console.warn('[vxe-table] This is an internal attribute "column.own". Please pay attention to locking the version number to avoid errors caused by upgrade.');
  6493. return this._own;
  6494. }
  6495. }]);
  6496. return ColumnInfo;
  6497. }();
  6498. function outLog(type) {
  6499. return function (message, params) {
  6500. var msg = UtilTools.getLog(message, params);
  6501. console[type](msg);
  6502. return msg;
  6503. };
  6504. }
  6505. var UtilTools = {
  6506. warn: outLog('warn'),
  6507. error: outLog('error'),
  6508. getLog: function getLog(message, args) {
  6509. return "[vxe-table] ".concat(conf.i18n(message, args));
  6510. },
  6511. getFuncText: function getFuncText(content) {
  6512. return ctor_amd_xe_utils_default.a.isFunction(content) ? content() : conf.translate ? conf.translate(content) : content;
  6513. },
  6514. nextZIndex: function nextZIndex() {
  6515. lastZindex = conf.zIndex + zindexIndex++;
  6516. return lastZindex;
  6517. },
  6518. getLastZIndex: function getLastZIndex() {
  6519. return lastZindex;
  6520. },
  6521. // 行主键 key
  6522. getRowkey: function getRowkey($xetable) {
  6523. return $xetable.rowId || '_XID';
  6524. },
  6525. // 行主键 value
  6526. getRowid: function getRowid($xetable, row) {
  6527. var rowId = ctor_amd_xe_utils_default.a.get(row, UtilTools.getRowkey($xetable));
  6528. return ctor_amd_xe_utils_default.a.eqNull(rowId) ? '' : encodeURIComponent(rowId);
  6529. },
  6530. // 获取所有的列,排除分组
  6531. getColumnList: function getColumnList(columns) {
  6532. var result = [];
  6533. columns.forEach(function (column) {
  6534. result.push.apply(result, _toConsumableArray(column.children && column.children.length ? UtilTools.getColumnList(column.children) : [column]));
  6535. });
  6536. return result;
  6537. },
  6538. getClass: function getClass(property, params) {
  6539. return property ? ctor_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
  6540. },
  6541. getFilters: function getFilters(filters) {
  6542. if (filters && ctor_amd_xe_utils_default.a.isArray(filters)) {
  6543. return filters.map(function (_ref2) {
  6544. var label = _ref2.label,
  6545. value = _ref2.value,
  6546. data = _ref2.data,
  6547. resetValue = _ref2.resetValue,
  6548. checked = _ref2.checked;
  6549. return {
  6550. label: label,
  6551. value: value,
  6552. data: data,
  6553. resetValue: resetValue,
  6554. checked: !!checked,
  6555. _checked: !!checked
  6556. };
  6557. });
  6558. }
  6559. return filters;
  6560. },
  6561. formatText: function formatText(value, placeholder) {
  6562. return '' + (value === '' || value === null || value === undefined ? placeholder ? conf.emptyCell : '' : value);
  6563. },
  6564. getCellValue: function getCellValue(row, column) {
  6565. return ctor_amd_xe_utils_default.a.get(row, column.property);
  6566. },
  6567. setCellValue: function setCellValue(row, column, value) {
  6568. return ctor_amd_xe_utils_default.a.set(row, column.property, value);
  6569. },
  6570. isColumn: function isColumn(column) {
  6571. return column instanceof utils_ColumnInfo;
  6572. },
  6573. getColumnConfig: function getColumnConfig($xetable, _vm, options) {
  6574. return UtilTools.isColumn(_vm) ? _vm : new utils_ColumnInfo($xetable, _vm, options);
  6575. },
  6576. // 组装列配置
  6577. assemColumn: function assemColumn(_vm) {
  6578. var $el = _vm.$el,
  6579. $xetable = _vm.$xetable,
  6580. $xecolumn = _vm.$xecolumn,
  6581. columnConfig = _vm.columnConfig;
  6582. var groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
  6583. columnConfig.slots = _vm.$scopedSlots;
  6584. if (groupConfig) {
  6585. if ($xecolumn.$options._componentTag === 'vxe-table-column') {
  6586. UtilTools.warn('vxe.error.groupTag', ["<vxe-table-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-table-column title=".concat($xecolumn.title, " ...>")]);
  6587. } else if ($xecolumn.$options._componentTag === 'vxe-column') {
  6588. UtilTools.warn('vxe.error.groupTag', ["<vxe-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-column title=".concat($xecolumn.title, " ...>")]);
  6589. }
  6590. if (!groupConfig.children) {
  6591. groupConfig.children = [];
  6592. }
  6593. groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
  6594. } else {
  6595. $xetable.collectColumn.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
  6596. }
  6597. },
  6598. // 销毁列
  6599. destroyColumn: function destroyColumn(_vm) {
  6600. var $xetable = _vm.$xetable,
  6601. columnConfig = _vm.columnConfig;
  6602. var matchObj = ctor_amd_xe_utils_default.a.findTree($xetable.collectColumn, function (column) {
  6603. return column === columnConfig;
  6604. });
  6605. if (matchObj) {
  6606. matchObj.items.splice(matchObj.index, 1);
  6607. }
  6608. },
  6609. hasChildrenList: function hasChildrenList(item) {
  6610. return item && item.children && item.children.length > 0;
  6611. },
  6612. getColMinWidth: function getColMinWidth(params) {
  6613. var $table = params.$table,
  6614. column = params.column;
  6615. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  6616. resizableOpts = $table.resizableOpts,
  6617. sortOpts = $table.sortOpts,
  6618. filterOpts = $table.filterOpts,
  6619. editOpts = $table.editOpts;
  6620. var type = column.type,
  6621. showHeaderOverflow = column.showHeaderOverflow,
  6622. filters = column.filters,
  6623. sortable = column.sortable,
  6624. remoteSort = column.remoteSort,
  6625. titleHelp = column.titleHelp,
  6626. editRender = column.editRender;
  6627. var minWidth = resizableOpts.minWidth;
  6628. if (minWidth) {
  6629. var customMinWidth = ctor_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
  6630. if (customMinWidth !== 'auto') {
  6631. return Math.max(1, ctor_amd_xe_utils_default.a.toNumber(customMinWidth));
  6632. }
  6633. }
  6634. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  6635. var showEllipsis = headOverflow === 'ellipsis';
  6636. var showTitle = headOverflow === 'title';
  6637. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  6638. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  6639. var colMinWidth = 40;
  6640. if (hasEllipsis) {
  6641. colMinWidth += getColFuncWidth(type === 'checkbox' || type === 'selection', 18) + getColFuncWidth(titleHelp, 18) + getColFuncWidth(filters && filterOpts.showIcon) + getColFuncWidth((sortable || remoteSort) && sortOpts.showIcon) + getColFuncWidth(UtilTools.isEnableConf(editRender) && editOpts.showIcon, 32);
  6642. }
  6643. return colMinWidth;
  6644. },
  6645. parseFile: function parseFile(file) {
  6646. var name = file.name;
  6647. var tIndex = ctor_amd_xe_utils_default.a.lastIndexOf(name, '.');
  6648. var type = name.substring(tIndex + 1, name.length);
  6649. var filename = name.substring(0, tIndex);
  6650. return {
  6651. filename: filename,
  6652. type: type
  6653. };
  6654. },
  6655. isNumVal: function isNumVal(num) {
  6656. return !isNaN(parseFloat('' + num));
  6657. },
  6658. isEnableConf: function isEnableConf(conf) {
  6659. return conf && conf.enabled !== false;
  6660. },
  6661. /**
  6662. * 判断值为:'' | null | undefined 时都属于空值
  6663. */
  6664. eqEmptyValue: function eqEmptyValue(cellValue) {
  6665. return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
  6666. }
  6667. };
  6668. /* harmony default export */ var utils = (UtilTools);
  6669. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
  6670. var es_regexp_constructor = __webpack_require__("4d63");
  6671. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
  6672. var es_string_match = __webpack_require__("466d");
  6673. // CONCATENATED MODULE: ./packages/tools/src/dom.js
  6674. var browse = ctor_amd_xe_utils_default.a.browse();
  6675. var htmlElem = browse.isDoc ? document.querySelector('html') : 0;
  6676. var dom_bodyElem = browse.isDoc ? document.body : 0;
  6677. var reClsMap = {};
  6678. function getClsRE(cls) {
  6679. if (!reClsMap[cls]) {
  6680. reClsMap[cls] = new RegExp("(?:^|\\s)".concat(cls, "(?!\\S)"), 'g');
  6681. }
  6682. return reClsMap[cls];
  6683. }
  6684. function getNodeOffset(elem, container, rest) {
  6685. if (elem) {
  6686. var parentElem = elem.parentNode;
  6687. rest.top += elem.offsetTop;
  6688. rest.left += elem.offsetLeft;
  6689. if (parentElem && parentElem !== htmlElem && parentElem !== dom_bodyElem) {
  6690. rest.top -= parentElem.scrollTop;
  6691. rest.left -= parentElem.scrollLeft;
  6692. }
  6693. if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
  6694. return getNodeOffset(elem.offsetParent, container, rest);
  6695. }
  6696. }
  6697. return rest;
  6698. }
  6699. var DomTools = {
  6700. browse: browse,
  6701. isPx: function isPx(val) {
  6702. return val && /^\d+(px)?$/.test(val);
  6703. },
  6704. isScale: function isScale(val) {
  6705. return val && /^\d+%$/.test(val);
  6706. },
  6707. hasClass: function hasClass(elem, cls) {
  6708. return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
  6709. },
  6710. removeClass: function removeClass(elem, cls) {
  6711. if (elem && DomTools.hasClass(elem, cls)) {
  6712. elem.className = elem.className.replace(getClsRE(cls), '');
  6713. }
  6714. },
  6715. addClass: function addClass(elem, cls) {
  6716. if (elem && !DomTools.hasClass(elem, cls)) {
  6717. DomTools.removeClass(elem, cls);
  6718. elem.className = "".concat(elem.className, " ").concat(cls);
  6719. }
  6720. },
  6721. updateCellTitle: function updateCellTitle(overflowElem, column) {
  6722. var content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
  6723. if (overflowElem.getAttribute('title') !== content) {
  6724. overflowElem.setAttribute('title', content);
  6725. }
  6726. },
  6727. rowToVisible: function rowToVisible($xetable, row) {
  6728. var bodyElem = $xetable.$refs.tableBody.$el;
  6729. var trElem = bodyElem.querySelector("[data-rowid=\"".concat(utils.getRowid($xetable, row), "\"]"));
  6730. if (trElem) {
  6731. var bodyHeight = bodyElem.clientHeight;
  6732. var bodySrcollTop = bodyElem.scrollTop;
  6733. var trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
  6734. var trHeight = trElem.clientHeight; // 检测行是否在可视区中
  6735. if (trOffsetTop < bodySrcollTop || trOffsetTop > bodySrcollTop + bodyHeight) {
  6736. // 向上定位
  6737. return $xetable.scrollTo(null, trOffsetTop);
  6738. } else if (trOffsetTop + trHeight >= bodyHeight + bodySrcollTop) {
  6739. // 向下定位
  6740. return $xetable.scrollTo(null, bodySrcollTop + trHeight);
  6741. }
  6742. } else {
  6743. // 如果是虚拟渲染跨行滚动
  6744. if ($xetable.scrollYLoad) {
  6745. return $xetable.scrollTo(null, ($xetable.afterFullData.indexOf(row) - 1) * $xetable.scrollYStore.rowHeight);
  6746. }
  6747. }
  6748. return Promise.resolve();
  6749. },
  6750. colToVisible: function colToVisible($xetable, column) {
  6751. var bodyElem = $xetable.$refs.tableBody.$el;
  6752. var tdElem = bodyElem.querySelector(".".concat(column.id));
  6753. if (tdElem) {
  6754. var bodyWidth = bodyElem.clientWidth;
  6755. var bodySrcollLeft = bodyElem.scrollLeft;
  6756. var tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
  6757. var tdWidth = tdElem.clientWidth; // 检测行是否在可视区中
  6758. if (tdOffsetLeft < bodySrcollLeft || tdOffsetLeft > bodySrcollLeft + bodyWidth) {
  6759. // 向左定位
  6760. return $xetable.scrollTo(tdOffsetLeft);
  6761. } else if (tdOffsetLeft + tdWidth >= bodyWidth + bodySrcollLeft) {
  6762. // 向右定位
  6763. return $xetable.scrollTo(bodySrcollLeft + tdWidth);
  6764. }
  6765. } else {
  6766. // 如果是虚拟渲染跨行滚动
  6767. if ($xetable.scrollXLoad) {
  6768. var visibleColumn = $xetable.visibleColumn;
  6769. var scrollLeft = 0;
  6770. for (var index = 0; index < visibleColumn.length; index++) {
  6771. if (visibleColumn[index] === column) {
  6772. break;
  6773. }
  6774. scrollLeft += visibleColumn[index].renderWidth;
  6775. }
  6776. return $xetable.scrollTo(scrollLeft);
  6777. }
  6778. }
  6779. return Promise.resolve();
  6780. },
  6781. getDomNode: function getDomNode() {
  6782. var documentElement = document.documentElement;
  6783. var bodyElem = document.body;
  6784. return {
  6785. scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
  6786. scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
  6787. visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
  6788. visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
  6789. };
  6790. },
  6791. /**
  6792. * 检查触发源是否属于目标节点
  6793. */
  6794. getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
  6795. var targetElem;
  6796. var target = evnt.target;
  6797. while (target && target.nodeType && target !== document) {
  6798. if (queryCls && DomTools.hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
  6799. targetElem = target;
  6800. } else if (target === container) {
  6801. return {
  6802. flag: queryCls ? !!targetElem : true,
  6803. container: container,
  6804. targetElem: targetElem
  6805. };
  6806. }
  6807. target = target.parentNode;
  6808. }
  6809. return {
  6810. flag: false
  6811. };
  6812. },
  6813. /**
  6814. * 获取元素相对于 document 的位置
  6815. */
  6816. getOffsetPos: function getOffsetPos(elem, container) {
  6817. return getNodeOffset(elem, container, {
  6818. left: 0,
  6819. top: 0
  6820. });
  6821. },
  6822. getAbsolutePos: function getAbsolutePos(elem) {
  6823. var bounding = elem.getBoundingClientRect();
  6824. var boundingTop = bounding.top;
  6825. var boundingLeft = bounding.left;
  6826. var _DomTools$getDomNode = DomTools.getDomNode(),
  6827. scrollTop = _DomTools$getDomNode.scrollTop,
  6828. scrollLeft = _DomTools$getDomNode.scrollLeft,
  6829. visibleHeight = _DomTools$getDomNode.visibleHeight,
  6830. visibleWidth = _DomTools$getDomNode.visibleWidth;
  6831. return {
  6832. boundingTop: boundingTop,
  6833. top: scrollTop + boundingTop,
  6834. boundingLeft: boundingLeft,
  6835. left: scrollLeft + boundingLeft,
  6836. visibleHeight: visibleHeight,
  6837. visibleWidth: visibleWidth
  6838. };
  6839. },
  6840. /**
  6841. * 获取单元格节点索引
  6842. */
  6843. getCellNodeIndex: function getCellNodeIndex(cell) {
  6844. var trElem = cell.parentNode;
  6845. var columnIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
  6846. var rowIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.parentNode.children, trElem);
  6847. return {
  6848. columnIndex: columnIndex,
  6849. rowIndex: rowIndex
  6850. };
  6851. },
  6852. /**
  6853. * 获取选中单元格矩阵范围
  6854. */
  6855. getRowNodes: function getRowNodes(trList, cellNode, targetCellNode) {
  6856. var startColIndex = cellNode.columnIndex;
  6857. var startRowIndex = cellNode.rowIndex;
  6858. var targetColIndex = targetCellNode.columnIndex;
  6859. var targetRowIndex = targetCellNode.rowIndex;
  6860. var rows = [];
  6861. for (var rowIndex = Math.min(startRowIndex, targetRowIndex), rowLen = Math.max(startRowIndex, targetRowIndex); rowIndex <= rowLen; rowIndex++) {
  6862. var cells = [];
  6863. var trElem = trList[rowIndex];
  6864. for (var colIndex = Math.min(startColIndex, targetColIndex), colLen = Math.max(startColIndex, targetColIndex); colIndex <= colLen; colIndex++) {
  6865. var tdElem = trElem.children[colIndex];
  6866. cells.push(tdElem);
  6867. }
  6868. rows.push(cells);
  6869. }
  6870. return rows;
  6871. },
  6872. getCellIndexs: function getCellIndexs(cell) {
  6873. var trElem = cell.parentNode;
  6874. var rowid = trElem.getAttribute('data-rowid');
  6875. var columnIndex = [].indexOf.call(trElem.children, cell);
  6876. var rowIndex = [].indexOf.call(trElem.parentNode.children, trElem);
  6877. return {
  6878. rowid: rowid,
  6879. rowIndex: rowIndex,
  6880. columnIndex: columnIndex
  6881. };
  6882. },
  6883. toView: function toView(elem) {
  6884. var scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
  6885. var scrollIntoView = 'scrollIntoView';
  6886. if (elem) {
  6887. if (elem[scrollIntoViewIfNeeded]) {
  6888. elem[scrollIntoViewIfNeeded]();
  6889. } else if (elem[scrollIntoView]) {
  6890. elem[scrollIntoView]();
  6891. }
  6892. }
  6893. },
  6894. triggerEvent: function triggerEvent(targetElem, type) {
  6895. var evnt;
  6896. if (typeof Event === 'function') {
  6897. evnt = new Event(type);
  6898. } else {
  6899. evnt = document.createEvent('Event');
  6900. evnt.initEvent(type, true, true);
  6901. }
  6902. targetElem.dispatchEvent(evnt);
  6903. },
  6904. calcHeight: function calcHeight($xetable, key) {
  6905. var val = $xetable[key];
  6906. var num = 0;
  6907. if (val) {
  6908. if (val === 'auto') {
  6909. num = $xetable.parentHeight;
  6910. } else {
  6911. if (DomTools.isScale(val)) {
  6912. num = Math.floor(parseInt(val) / 100 * $xetable.parentHeight);
  6913. } else {
  6914. num = ctor_amd_xe_utils_default.a.toNumber(val);
  6915. }
  6916. num -= $xetable.getExcludeHeight();
  6917. }
  6918. }
  6919. return num;
  6920. }
  6921. };
  6922. /* harmony default export */ var dom = (DomTools);
  6923. // CONCATENATED MODULE: ./packages/tools/src/event.js
  6924. // 监听全局事件
  6925. var event_browse = dom.browse;
  6926. var wheelName = event_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  6927. var eventStore = [];
  6928. var GlobalEvent = {
  6929. on: function on(comp, type, cb) {
  6930. if (cb) {
  6931. eventStore.push({
  6932. comp: comp,
  6933. type: type,
  6934. cb: cb
  6935. });
  6936. }
  6937. },
  6938. off: function off(comp, type) {
  6939. ctor_amd_xe_utils_default.a.remove(eventStore, function (item) {
  6940. return item.comp === comp && item.type === type;
  6941. });
  6942. },
  6943. trigger: function trigger(evnt) {
  6944. var isWheel = evnt.type === wheelName;
  6945. eventStore.forEach(function (_ref) {
  6946. var comp = _ref.comp,
  6947. type = _ref.type,
  6948. cb = _ref.cb;
  6949. if (type === evnt.type || isWheel && type === 'mousewheel') {
  6950. cb.call(comp, evnt);
  6951. }
  6952. });
  6953. },
  6954. eqKeypad: function eqKeypad(evnt, keyVal) {
  6955. var key = evnt.key;
  6956. if (keyVal.toLowerCase() === key.toLowerCase()) {
  6957. return true;
  6958. }
  6959. return false;
  6960. }
  6961. };
  6962. if (event_browse.isDoc) {
  6963. if (!event_browse.msie) {
  6964. document.addEventListener('copy', GlobalEvent.trigger, false);
  6965. document.addEventListener('cut', GlobalEvent.trigger, false);
  6966. document.addEventListener('paste', GlobalEvent.trigger, false);
  6967. }
  6968. document.addEventListener('keydown', GlobalEvent.trigger, false);
  6969. document.addEventListener('contextmenu', GlobalEvent.trigger, false);
  6970. window.addEventListener('mousedown', GlobalEvent.trigger, false);
  6971. window.addEventListener('blur', GlobalEvent.trigger, false);
  6972. window.addEventListener('resize', GlobalEvent.trigger, false);
  6973. window.addEventListener(wheelName, ctor_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
  6974. leading: true,
  6975. trailing: false
  6976. }), false);
  6977. }
  6978. /* harmony default export */ var src_event = (GlobalEvent);
  6979. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.some.js
  6980. var es_array_some = __webpack_require__("45fc");
  6981. // CONCATENATED MODULE: ./packages/tools/src/resize.js
  6982. /**
  6983. * 监听 resize 事件
  6984. * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
  6985. */
  6986. var resizeTimeout;
  6987. var resize_eventStore = [];
  6988. var defaultInterval = 500;
  6989. function eventHandle() {
  6990. if (resize_eventStore.length) {
  6991. resize_eventStore.forEach(function (item) {
  6992. item.tarList.forEach(function (observer) {
  6993. var target = observer.target,
  6994. width = observer.width,
  6995. heighe = observer.heighe;
  6996. var clientWidth = target.clientWidth;
  6997. var clientHeight = target.clientHeight;
  6998. var rWidth = clientWidth && width !== clientWidth;
  6999. var rHeight = clientHeight && heighe !== clientHeight;
  7000. if (rWidth || rHeight) {
  7001. observer.width = clientWidth;
  7002. observer.heighe = clientHeight;
  7003. requestAnimationFrame(item.callback);
  7004. }
  7005. });
  7006. });
  7007. /* eslint-disable @typescript-eslint/no-use-before-define */
  7008. eventListener();
  7009. }
  7010. }
  7011. function eventListener() {
  7012. clearTimeout(resizeTimeout);
  7013. resizeTimeout = setTimeout(eventHandle, conf.resizeInterval || defaultInterval);
  7014. }
  7015. var resize_ResizeObserverPolyfill = /*#__PURE__*/function () {
  7016. function ResizeObserverPolyfill(callback) {
  7017. _classCallCheck(this, ResizeObserverPolyfill);
  7018. this.tarList = [];
  7019. this.callback = callback;
  7020. }
  7021. _createClass(ResizeObserverPolyfill, [{
  7022. key: "observe",
  7023. value: function observe(target) {
  7024. var _this = this;
  7025. if (target) {
  7026. if (!this.tarList.some(function (observer) {
  7027. return observer.target === target;
  7028. })) {
  7029. this.tarList.push({
  7030. target: target,
  7031. width: target.clientWidth,
  7032. heighe: target.clientHeight
  7033. });
  7034. }
  7035. if (!resize_eventStore.length) {
  7036. eventListener();
  7037. }
  7038. if (!resize_eventStore.some(function (item) {
  7039. return item === _this;
  7040. })) {
  7041. resize_eventStore.push(this);
  7042. }
  7043. }
  7044. }
  7045. }, {
  7046. key: "unobserve",
  7047. value: function unobserve(target) {
  7048. ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7049. return item.tarList.some(function (observer) {
  7050. return observer.target === target;
  7051. });
  7052. });
  7053. }
  7054. }, {
  7055. key: "disconnect",
  7056. value: function disconnect() {
  7057. var _this2 = this;
  7058. ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7059. return item === _this2;
  7060. });
  7061. }
  7062. }]);
  7063. return ResizeObserverPolyfill;
  7064. }();
  7065. var ResizeEvent = dom.browse.isDoc ? window.ResizeObserver || resize_ResizeObserverPolyfill : resize_ResizeObserverPolyfill;
  7066. /* harmony default export */ var src_resize = (ResizeEvent);
  7067. // CONCATENATED MODULE: ./packages/tools/index.js
  7068. /* harmony default export */ var tools = ({
  7069. UtilTools: utils,
  7070. DomTools: dom,
  7071. GlobalEvent: src_event,
  7072. ResizeEvent: src_resize
  7073. });
  7074. // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
  7075. var inputEventTypes = ['input', 'textarea', '$input', '$textarea'];
  7076. var defaultCompProps = {
  7077. transfer: true
  7078. };
  7079. function isEmptyValue(cellValue) {
  7080. return cellValue === null || cellValue === undefined || cellValue === '';
  7081. }
  7082. function getChangeEvent(renderOpts) {
  7083. return inputEventTypes.indexOf(renderOpts.name) > -1 ? 'input' : 'change';
  7084. }
  7085. function parseDate(value, props) {
  7086. return value && props.valueFormat ? ctor_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
  7087. }
  7088. function getFormatDate(value, props, defaultFormat) {
  7089. var _props$dateConfig = props.dateConfig,
  7090. dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
  7091. return ctor_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
  7092. }
  7093. function getLabelFormatDate(value, props) {
  7094. return getFormatDate(value, props, conf.i18n("vxe.input.date.labelFormat.".concat(props.type)));
  7095. }
  7096. function getDefaultComponentName(_ref) {
  7097. var name = _ref.name;
  7098. return "vxe-".concat(name.replace('$', ''));
  7099. }
  7100. function handleConfirmFilter(params, checked, option) {
  7101. var $panel = params.$panel;
  7102. $panel.changeOption({}, checked, option);
  7103. }
  7104. function getNativeAttrs(_ref2) {
  7105. var name = _ref2.name,
  7106. attrs = _ref2.attrs;
  7107. if (name === 'input') {
  7108. attrs = Object.assign({
  7109. type: 'text'
  7110. }, attrs);
  7111. }
  7112. return attrs;
  7113. }
  7114. function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
  7115. var vSize = params.$table.vSize;
  7116. return ctor_amd_xe_utils_default.a.assign(vSize ? {
  7117. size: vSize
  7118. } : {}, defaultCompProps, defaultProps, renderOpts.props, {
  7119. value: value
  7120. });
  7121. }
  7122. function getItemProps(renderOpts, params, value, defaultProps) {
  7123. var vSize = params.$form.vSize;
  7124. return ctor_amd_xe_utils_default.a.assign(vSize ? {
  7125. size: vSize
  7126. } : {}, defaultCompProps, defaultProps, renderOpts.props, {
  7127. value: value
  7128. });
  7129. }
  7130. function getCellLabelVNs(h, renderOpts, params, cellLabel) {
  7131. var placeholder = renderOpts.placeholder;
  7132. return [h('span', {
  7133. class: 'vxe-cell--label'
  7134. }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
  7135. class: 'vxe-cell--placeholder'
  7136. }, UtilTools.formatText(UtilTools.getFuncText(placeholder), 1))] : UtilTools.formatText(cellLabel, 1))];
  7137. }
  7138. function getNativeOns(renderOpts, params) {
  7139. var nativeEvents = renderOpts.nativeEvents;
  7140. var nativeOns = {};
  7141. ctor_amd_xe_utils_default.a.objectEach(nativeEvents, function (func, key) {
  7142. nativeOns[key] = function () {
  7143. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  7144. args[_key] = arguments[_key];
  7145. }
  7146. func.apply(void 0, [params].concat(args));
  7147. };
  7148. });
  7149. return nativeOns;
  7150. }
  7151. function getOns(renderOpts, params, inputFunc, changeFunc) {
  7152. var events = renderOpts.events;
  7153. var modelEvent = 'input';
  7154. var changeEvent = getChangeEvent(renderOpts);
  7155. var isSameEvent = changeEvent === modelEvent;
  7156. var ons = {};
  7157. ctor_amd_xe_utils_default.a.objectEach(events, function (func, key) {
  7158. ons[key] = function () {
  7159. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  7160. args[_key2] = arguments[_key2];
  7161. }
  7162. func.apply(void 0, [params].concat(args));
  7163. };
  7164. });
  7165. if (inputFunc) {
  7166. ons[modelEvent] = function (targetEvnt) {
  7167. inputFunc(targetEvnt);
  7168. if (events && events[modelEvent]) {
  7169. events[modelEvent](params, targetEvnt);
  7170. }
  7171. if (isSameEvent && changeFunc) {
  7172. changeFunc(targetEvnt);
  7173. }
  7174. };
  7175. }
  7176. if (!isSameEvent && changeFunc) {
  7177. ons[changeEvent] = function () {
  7178. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  7179. args[_key3] = arguments[_key3];
  7180. }
  7181. changeFunc.apply(void 0, args);
  7182. if (events && events[changeEvent]) {
  7183. events[changeEvent].apply(events, [params].concat(args));
  7184. }
  7185. };
  7186. }
  7187. return ons;
  7188. }
  7189. function getEditOns(renderOpts, params) {
  7190. var $table = params.$table,
  7191. row = params.row,
  7192. column = params.column;
  7193. return getOns(renderOpts, params, function (value) {
  7194. // 处理 model 值双向绑定
  7195. ctor_amd_xe_utils_default.a.set(row, column.property, value);
  7196. }, function () {
  7197. // 处理 change 事件相关逻辑
  7198. $table.updateStatus(params);
  7199. });
  7200. }
  7201. function getFilterOns(renderOpts, params, option) {
  7202. return getOns(renderOpts, params, function (value) {
  7203. // 处理 model 值双向绑定
  7204. option.data = value;
  7205. }, function () {
  7206. handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
  7207. });
  7208. }
  7209. function getItemOns(renderOpts, params) {
  7210. var $form = params.$form,
  7211. data = params.data,
  7212. property = params.property;
  7213. return getOns(renderOpts, params, function (value) {
  7214. // 处理 model 值双向绑定
  7215. ctor_amd_xe_utils_default.a.set(data, property, value);
  7216. }, function () {
  7217. // 处理 change 事件相关逻辑
  7218. $form.updateStatus(params);
  7219. });
  7220. }
  7221. function isSyncCell(renderOpts, params) {
  7222. // 在 v3.0 中废弃 editRender.type
  7223. return renderOpts.immediate || renderOpts.type === 'visible' || params.$type === 'cell';
  7224. }
  7225. function getNativeEditOns(renderOpts, params) {
  7226. var $table = params.$table,
  7227. row = params.row,
  7228. column = params.column;
  7229. var model = column.model;
  7230. return getOns(renderOpts, params, function (evnt) {
  7231. // 处理 model 值双向绑定
  7232. var cellValue = evnt.target.value;
  7233. if (isSyncCell(renderOpts, params)) {
  7234. UtilTools.setCellValue(row, column, cellValue);
  7235. } else {
  7236. model.update = true;
  7237. model.value = cellValue;
  7238. }
  7239. }, function (evnt) {
  7240. // 处理 change 事件相关逻辑
  7241. var cellValue = evnt.target.value;
  7242. $table.updateStatus(params, cellValue);
  7243. });
  7244. }
  7245. function getNativeFilterOns(renderOpts, params, option) {
  7246. return getOns(renderOpts, params, function (evnt) {
  7247. // 处理 model 值双向绑定
  7248. option.data = evnt.target.value;
  7249. }, function () {
  7250. handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
  7251. });
  7252. }
  7253. function getNativeItemOns(renderOpts, params) {
  7254. var $form = params.$form,
  7255. data = params.data,
  7256. property = params.property;
  7257. return getOns(renderOpts, params, function (evnt) {
  7258. // 处理 model 值双向绑定
  7259. var itemValue = evnt.target.value;
  7260. ctor_amd_xe_utils_default.a.set(data, property, itemValue);
  7261. }, function () {
  7262. // 处理 change 事件相关逻辑
  7263. $form.updateStatus(params);
  7264. });
  7265. }
  7266. /**
  7267. * 单元格可编辑渲染-原生的标签
  7268. * input、textarea、select
  7269. */
  7270. function nativeEditRender(h, renderOpts, params) {
  7271. var row = params.row,
  7272. column = params.column;
  7273. var name = renderOpts.name;
  7274. var attrs = getNativeAttrs(renderOpts);
  7275. var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7276. return [h(name, {
  7277. class: "vxe-default-".concat(name),
  7278. attrs: attrs,
  7279. domProps: {
  7280. value: cellValue
  7281. },
  7282. on: getNativeEditOns(renderOpts, params)
  7283. })];
  7284. }
  7285. function defaultEditRender(h, renderOpts, params) {
  7286. var row = params.row,
  7287. column = params.column;
  7288. var cellValue = UtilTools.getCellValue(row, column);
  7289. return [h(getDefaultComponentName(renderOpts), {
  7290. props: getCellEditFilterProps(renderOpts, params, cellValue),
  7291. on: getEditOns(renderOpts, params),
  7292. nativeOn: getNativeOns(renderOpts, params)
  7293. })];
  7294. }
  7295. function defaultButtonEditRender(h, renderOpts, params) {
  7296. return [h('vxe-button', {
  7297. props: getCellEditFilterProps(renderOpts, params),
  7298. on: getOns(renderOpts, params),
  7299. nativeOn: getNativeOns(renderOpts, params)
  7300. })];
  7301. }
  7302. function defaultButtonsEditRender(h, renderOpts, params) {
  7303. return renderOpts.children.map(function (childRenderOpts) {
  7304. return defaultButtonEditRender(h, childRenderOpts, params)[0];
  7305. });
  7306. }
  7307. function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
  7308. var optionGroups = renderOpts.optionGroups,
  7309. _renderOpts$optionGro = renderOpts.optionGroupProps,
  7310. optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
  7311. var groupOptions = optionGroupProps.options || 'options';
  7312. var groupLabel = optionGroupProps.label || 'label';
  7313. return optionGroups.map(function (group, gIndex) {
  7314. return h('optgroup', {
  7315. key: gIndex,
  7316. domProps: {
  7317. label: group[groupLabel]
  7318. }
  7319. }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
  7320. });
  7321. }
  7322. /**
  7323. * 渲染原生的 option 标签
  7324. */
  7325. function renderNativeOptions(h, options, renderOpts, params) {
  7326. var _renderOpts$optionPro = renderOpts.optionProps,
  7327. optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
  7328. var row = params.row,
  7329. column = params.column;
  7330. var labelProp = optionProps.label || 'label';
  7331. var valueProp = optionProps.value || 'value';
  7332. var disabledProp = optionProps.disabled || 'disabled';
  7333. var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7334. return options.map(function (option, oIndex) {
  7335. return h('option', {
  7336. key: oIndex,
  7337. attrs: {
  7338. value: option[valueProp],
  7339. disabled: option[disabledProp]
  7340. },
  7341. domProps: {
  7342. /* eslint-disable eqeqeq */
  7343. selected: option[valueProp] == cellValue
  7344. }
  7345. }, option[labelProp]);
  7346. });
  7347. }
  7348. function nativeFilterRender(h, renderOpts, params) {
  7349. var column = params.column;
  7350. var name = renderOpts.name;
  7351. var attrs = getNativeAttrs(renderOpts);
  7352. return column.filters.map(function (option, oIndex) {
  7353. return h(name, {
  7354. key: oIndex,
  7355. class: "vxe-default-".concat(name),
  7356. attrs: attrs,
  7357. domProps: {
  7358. value: option.data
  7359. },
  7360. on: getNativeFilterOns(renderOpts, params, option)
  7361. });
  7362. });
  7363. }
  7364. function defaultFilterRender(h, renderOpts, params) {
  7365. var column = params.column;
  7366. return column.filters.map(function (option, oIndex) {
  7367. var optionValue = option.data;
  7368. return h(getDefaultComponentName(renderOpts), {
  7369. key: oIndex,
  7370. props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
  7371. on: getFilterOns(renderOpts, params, option)
  7372. });
  7373. });
  7374. }
  7375. function handleFilterMethod(_ref3) {
  7376. var option = _ref3.option,
  7377. row = _ref3.row,
  7378. column = _ref3.column;
  7379. var data = option.data;
  7380. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7381. /* eslint-disable eqeqeq */
  7382. return cellValue == data;
  7383. }
  7384. function nativeSelectEditRender(h, renderOpts, params) {
  7385. return [h('select', {
  7386. class: 'vxe-default-select',
  7387. attrs: getNativeAttrs(renderOpts),
  7388. on: getNativeEditOns(renderOpts, params)
  7389. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
  7390. }
  7391. function defaultSelectEditRender(h, renderOpts, params) {
  7392. var row = params.row,
  7393. column = params.column;
  7394. var options = renderOpts.options,
  7395. optionProps = renderOpts.optionProps,
  7396. optionGroups = renderOpts.optionGroups,
  7397. optionGroupProps = renderOpts.optionGroupProps;
  7398. var cellValue = UtilTools.getCellValue(row, column);
  7399. return [h(getDefaultComponentName(renderOpts), {
  7400. props: getCellEditFilterProps(renderOpts, params, cellValue, {
  7401. options: options,
  7402. optionProps: optionProps,
  7403. optionGroups: optionGroups,
  7404. optionGroupProps: optionGroupProps
  7405. }),
  7406. on: getEditOns(renderOpts, params)
  7407. })];
  7408. }
  7409. function getSelectCellValue(renderOpts, _ref4) {
  7410. var row = _ref4.row,
  7411. column = _ref4.column;
  7412. var _renderOpts$props = renderOpts.props,
  7413. props = _renderOpts$props === void 0 ? {} : _renderOpts$props,
  7414. options = renderOpts.options,
  7415. optionGroups = renderOpts.optionGroups,
  7416. _renderOpts$optionPro2 = renderOpts.optionProps,
  7417. optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
  7418. _renderOpts$optionGro2 = renderOpts.optionGroupProps,
  7419. optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
  7420. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7421. var selectItem;
  7422. var labelProp = optionProps.label || 'label';
  7423. var valueProp = optionProps.value || 'value';
  7424. if (!isEmptyValue(cellValue)) {
  7425. return ctor_amd_xe_utils_default.a.map(props.multiple ? cellValue : [cellValue], optionGroups ? function (value) {
  7426. var groupOptions = optionGroupProps.options || 'options';
  7427. for (var index = 0; index < optionGroups.length; index++) {
  7428. /* eslint-disable eqeqeq */
  7429. selectItem = ctor_amd_xe_utils_default.a.find(optionGroups[index][groupOptions], function (item) {
  7430. return item[valueProp] == value;
  7431. });
  7432. if (selectItem) {
  7433. break;
  7434. }
  7435. }
  7436. return selectItem ? selectItem[labelProp] : value;
  7437. } : function (value) {
  7438. /* eslint-disable eqeqeq */
  7439. selectItem = ctor_amd_xe_utils_default.a.find(options, function (item) {
  7440. return item[valueProp] == value;
  7441. });
  7442. return selectItem ? selectItem[labelProp] : value;
  7443. }).join(', ');
  7444. }
  7445. return null;
  7446. }
  7447. /**
  7448. * 渲染表单-项
  7449. * 用于渲染原生的标签
  7450. */
  7451. function nativeItemRender(h, renderOpts, params) {
  7452. var data = params.data,
  7453. property = params.property;
  7454. var name = renderOpts.name;
  7455. var attrs = getNativeAttrs(renderOpts);
  7456. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7457. return [h(name, {
  7458. class: "vxe-default-".concat(name),
  7459. attrs: attrs,
  7460. domProps: attrs && name === 'input' && (attrs.type === 'submit' || attrs.type === 'reset') ? null : {
  7461. value: itemValue
  7462. },
  7463. on: getNativeItemOns(renderOpts, params)
  7464. })];
  7465. }
  7466. function defaultItemRender(h, renderOpts, params) {
  7467. var data = params.data,
  7468. property = params.property;
  7469. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7470. return [h(getDefaultComponentName(renderOpts), {
  7471. props: getItemProps(renderOpts, params, itemValue),
  7472. on: getItemOns(renderOpts, params),
  7473. nativeOn: getNativeOns(renderOpts, params)
  7474. })];
  7475. }
  7476. function defaultButtonItemRender(h, renderOpts, params) {
  7477. return [h('vxe-button', {
  7478. props: getItemProps(renderOpts, params),
  7479. on: getOns(renderOpts, params),
  7480. nativeOn: getNativeOns(renderOpts, params)
  7481. })];
  7482. }
  7483. function defaultButtonsItemRender(h, renderOpts, params) {
  7484. return renderOpts.children.map(function (childRenderOpts) {
  7485. return defaultButtonItemRender(h, childRenderOpts, params)[0];
  7486. });
  7487. }
  7488. /**
  7489. * 渲染原生的 select 标签
  7490. */
  7491. function renderNativeFormOptions(h, options, renderOpts, params) {
  7492. var data = params.data,
  7493. property = params.property;
  7494. var _renderOpts$optionPro3 = renderOpts.optionProps,
  7495. optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
  7496. var labelProp = optionProps.label || 'label';
  7497. var valueProp = optionProps.value || 'value';
  7498. var disabledProp = optionProps.disabled || 'disabled';
  7499. var cellValue = ctor_amd_xe_utils_default.a.get(data, property);
  7500. return options.map(function (item, oIndex) {
  7501. return h('option', {
  7502. key: oIndex,
  7503. attrs: {
  7504. value: item[valueProp],
  7505. disabled: item[disabledProp]
  7506. },
  7507. domProps: {
  7508. /* eslint-disable eqeqeq */
  7509. selected: item[valueProp] == cellValue
  7510. }
  7511. }, item[labelProp]);
  7512. });
  7513. }
  7514. function handleExportSelectMethod(params) {
  7515. var row = params.row,
  7516. column = params.column,
  7517. options = params.options;
  7518. return options.original ? UtilTools.getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
  7519. }
  7520. /**
  7521. * 渲染表单-项中
  7522. * 单选框和复选框
  7523. */
  7524. function defaultFormItemRadioAndCheckboxRender(h, renderOpts, params) {
  7525. var options = renderOpts.options,
  7526. _renderOpts$optionPro4 = renderOpts.optionProps,
  7527. optionProps = _renderOpts$optionPro4 === void 0 ? {} : _renderOpts$optionPro4;
  7528. var data = params.data,
  7529. property = params.property;
  7530. var labelProp = optionProps.label || 'label';
  7531. var valueProp = optionProps.value || 'value';
  7532. var disabledProp = optionProps.disabled || 'disabled';
  7533. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7534. var name = getDefaultComponentName(renderOpts); // 如果是分组
  7535. if (options) {
  7536. return [h("".concat(name, "-group"), {
  7537. props: getItemProps(renderOpts, params, itemValue),
  7538. on: getItemOns(renderOpts, params),
  7539. nativeOn: getNativeOns(renderOpts, params)
  7540. }, options.map(function (item, index) {
  7541. return h(name, {
  7542. key: index,
  7543. props: {
  7544. label: item[valueProp],
  7545. content: item[labelProp],
  7546. disabled: item[disabledProp]
  7547. }
  7548. });
  7549. }))];
  7550. }
  7551. return [h(name, {
  7552. props: getItemProps(renderOpts, params, itemValue),
  7553. on: getItemOns(renderOpts, params),
  7554. nativeOn: getNativeOns(renderOpts, params)
  7555. })];
  7556. }
  7557. /**
  7558. * 内置的组件渲染
  7559. */
  7560. var renderMap = {
  7561. input: {
  7562. autofocus: 'input',
  7563. renderEdit: nativeEditRender,
  7564. renderDefault: nativeEditRender,
  7565. renderFilter: nativeFilterRender,
  7566. filterMethod: handleFilterMethod,
  7567. renderItemContent: nativeItemRender
  7568. },
  7569. textarea: {
  7570. autofocus: 'textarea',
  7571. renderEdit: nativeEditRender,
  7572. renderItemContent: nativeItemRender
  7573. },
  7574. select: {
  7575. renderEdit: nativeSelectEditRender,
  7576. renderDefault: nativeSelectEditRender,
  7577. renderCell: function renderCell(h, renderOpts, params) {
  7578. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  7579. },
  7580. renderFilter: function renderFilter(h, renderOpts, params) {
  7581. var column = params.column;
  7582. return column.filters.map(function (option, oIndex) {
  7583. return h('select', {
  7584. key: oIndex,
  7585. class: 'vxe-default-select',
  7586. attrs: getNativeAttrs(renderOpts),
  7587. on: getNativeFilterOns(renderOpts, params, option)
  7588. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params));
  7589. });
  7590. },
  7591. filterMethod: handleFilterMethod,
  7592. renderItemContent: function renderItemContent(h, renderOpts, params) {
  7593. return [h('select', {
  7594. class: 'vxe-default-select',
  7595. attrs: getNativeAttrs(renderOpts),
  7596. on: getNativeItemOns(renderOpts, params)
  7597. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeFormOptions) : renderNativeFormOptions(h, renderOpts.options, renderOpts, params))];
  7598. },
  7599. cellExportMethod: handleExportSelectMethod
  7600. },
  7601. $input: {
  7602. autofocus: '.vxe-input--inner',
  7603. renderEdit: defaultEditRender,
  7604. renderCell: function renderCell(h, renderOpts, params) {
  7605. var _renderOpts$props2 = renderOpts.props,
  7606. props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
  7607. var row = params.row,
  7608. column = params.column;
  7609. var digits = props.digits || conf.input.digits;
  7610. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7611. if (cellValue) {
  7612. switch (props.type) {
  7613. case 'date':
  7614. case 'week':
  7615. case 'month':
  7616. case 'year':
  7617. cellValue = getLabelFormatDate(cellValue, props);
  7618. break;
  7619. case 'float':
  7620. cellValue = ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(cellValue, digits), digits);
  7621. break;
  7622. }
  7623. }
  7624. return getCellLabelVNs(h, renderOpts, params, cellValue);
  7625. },
  7626. renderDefault: defaultEditRender,
  7627. renderFilter: defaultFilterRender,
  7628. filterMethod: handleFilterMethod,
  7629. renderItemContent: defaultItemRender
  7630. },
  7631. $textarea: {
  7632. autofocus: '.vxe-textarea--inner',
  7633. renderItemContent: defaultItemRender
  7634. },
  7635. $button: {
  7636. renderDefault: defaultButtonEditRender,
  7637. renderItemContent: defaultButtonItemRender
  7638. },
  7639. $buttons: {
  7640. renderDefault: defaultButtonsEditRender,
  7641. renderItemContent: defaultButtonsItemRender
  7642. },
  7643. $select: {
  7644. autofocus: '.vxe-input--inner',
  7645. renderEdit: defaultSelectEditRender,
  7646. renderDefault: defaultSelectEditRender,
  7647. renderCell: function renderCell(h, renderOpts, params) {
  7648. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  7649. },
  7650. renderFilter: function renderFilter(h, renderOpts, params) {
  7651. var column = params.column;
  7652. var options = renderOpts.options,
  7653. optionProps = renderOpts.optionProps,
  7654. optionGroups = renderOpts.optionGroups,
  7655. optionGroupProps = renderOpts.optionGroupProps;
  7656. var nativeOn = getNativeOns(renderOpts, params);
  7657. return column.filters.map(function (option, oIndex) {
  7658. var optionValue = option.data;
  7659. return h(getDefaultComponentName(renderOpts), {
  7660. key: oIndex,
  7661. props: getCellEditFilterProps(renderOpts, params, optionValue, {
  7662. options: options,
  7663. optionProps: optionProps,
  7664. optionGroups: optionGroups,
  7665. optionGroupProps: optionGroupProps
  7666. }),
  7667. on: getFilterOns(renderOpts, params, option),
  7668. nativeOn: nativeOn
  7669. });
  7670. });
  7671. },
  7672. filterMethod: handleFilterMethod,
  7673. renderItemContent: function renderItemContent(h, renderOpts, params) {
  7674. var data = params.data,
  7675. property = params.property;
  7676. var options = renderOpts.options,
  7677. optionProps = renderOpts.optionProps,
  7678. optionGroups = renderOpts.optionGroups,
  7679. optionGroupProps = renderOpts.optionGroupProps;
  7680. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7681. return [h(getDefaultComponentName(renderOpts), {
  7682. props: getItemProps(renderOpts, params, itemValue, {
  7683. options: options,
  7684. optionProps: optionProps,
  7685. optionGroups: optionGroups,
  7686. optionGroupProps: optionGroupProps
  7687. }),
  7688. on: getItemOns(renderOpts, params),
  7689. nativeOn: getNativeOns(renderOpts, params)
  7690. })];
  7691. },
  7692. cellExportMethod: handleExportSelectMethod
  7693. },
  7694. $radio: {
  7695. autofocus: '.vxe-radio--input',
  7696. renderItemContent: defaultFormItemRadioAndCheckboxRender
  7697. },
  7698. $checkbox: {
  7699. autofocus: '.vxe-checkbox--input',
  7700. renderItemContent: defaultFormItemRadioAndCheckboxRender
  7701. },
  7702. $switch: {
  7703. autofocus: '.vxe-switch--button',
  7704. renderEdit: defaultEditRender,
  7705. renderDefault: defaultEditRender,
  7706. renderItemContent: defaultItemRender
  7707. }
  7708. };
  7709. /**
  7710. * 全局渲染器
  7711. */
  7712. var renderer = {
  7713. mixin: function mixin(map) {
  7714. ctor_amd_xe_utils_default.a.each(map, function (options, name) {
  7715. return renderer.add(name, options);
  7716. });
  7717. return renderer;
  7718. },
  7719. get: function get(name) {
  7720. return renderMap[name] || null;
  7721. },
  7722. add: function add(name, options) {
  7723. if (name && options) {
  7724. var renders = renderMap[name];
  7725. if (renders) {
  7726. Object.assign(renders, options);
  7727. } else {
  7728. renderMap[name] = options;
  7729. }
  7730. }
  7731. return renderer;
  7732. },
  7733. delete: function _delete(name) {
  7734. delete renderMap[name];
  7735. return renderer;
  7736. }
  7737. };
  7738. /* harmony default export */ var src_renderer = (renderer);
  7739. // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
  7740. var commands = new store();
  7741. /* harmony default export */ var src_commands = (commands);
  7742. // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
  7743. var menus = new store();
  7744. /* harmony default export */ var src_menus = (menus);
  7745. // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
  7746. /**
  7747. * 全局参数设置
  7748. */
  7749. function setup() {
  7750. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7751. // 在 v3.0 中废弃 setup.menu
  7752. if (options.menu && !(options.menuConfig || options.contextMenu)) {
  7753. options.contextMenu = options.menu;
  7754. options.menuConfig = options.menu;
  7755. console.warn('[vxe-table] parameter "menu" has been replaced by "menuConfig"');
  7756. }
  7757. return ctor_amd_xe_utils_default.a.merge(conf, options);
  7758. }
  7759. /* harmony default export */ var src_setup = (setup);
  7760. // CONCATENATED MODULE: ./packages/v-x-e-table/index.js
  7761. var installedPlugins = [];
  7762. function use(Plugin, options) {
  7763. /* eslint-disable @typescript-eslint/no-use-before-define */
  7764. if (Plugin && Plugin.install) {
  7765. if (installedPlugins.indexOf(Plugin) === -1) {
  7766. Plugin.install(VXETable, options);
  7767. installedPlugins.push(Plugin);
  7768. }
  7769. }
  7770. return VXETable;
  7771. }
  7772. /**
  7773. * 检测模块的安装顺序是否正确
  7774. */
  7775. function reg(key) {
  7776. /* eslint-disable @typescript-eslint/no-use-before-define */
  7777. if (VXETable.Table) {
  7778. UtilTools.error('vxe.error.useErr', [key]);
  7779. }
  7780. VXETable["_".concat(key)] = 1;
  7781. }
  7782. function _t(key, args) {
  7783. return key ? ctor_amd_xe_utils_default.a.toValueString(conf.translate ? conf.translate(key, args) : key) : '';
  7784. }
  7785. var VXETable = {
  7786. t: function t(key, args) {
  7787. return conf.i18n(key, args);
  7788. },
  7789. _t: _t,
  7790. v: 'v2',
  7791. reg: reg,
  7792. use: use,
  7793. types: {},
  7794. setup: src_setup,
  7795. interceptor: src_interceptor,
  7796. renderer: src_renderer,
  7797. commands: src_commands,
  7798. formats: src_formats,
  7799. menus: src_menus
  7800. }; // v3.0 中废弃 buttons
  7801. Object.defineProperty(VXETable, 'buttons', {
  7802. get: function get() {
  7803. UtilTools.warn('vxe.error.delProp', ['buttons', 'commands']);
  7804. return src_commands;
  7805. }
  7806. });
  7807. /**
  7808. * 获取当前的 zIndex
  7809. */
  7810. Object.defineProperty(VXETable, 'zIndex', {
  7811. get: UtilTools.getLastZIndex
  7812. });
  7813. /**
  7814. * 获取下一个 zIndex
  7815. */
  7816. Object.defineProperty(VXETable, 'nextZIndex', {
  7817. get: UtilTools.nextZIndex
  7818. });
  7819. function getExportOrImpotType(types, flag) {
  7820. var rest = [];
  7821. ctor_amd_xe_utils_default.a.objectEach(types, function (val, type) {
  7822. if (val === 0 || val === flag) {
  7823. rest.push(type);
  7824. }
  7825. });
  7826. return rest;
  7827. }
  7828. /**
  7829. * 获取所有导出类型
  7830. */
  7831. Object.defineProperty(VXETable, 'exportTypes', {
  7832. get: function get() {
  7833. return getExportOrImpotType(conf.export.types, 1);
  7834. }
  7835. });
  7836. /**
  7837. * 获取所有导入类型
  7838. */
  7839. Object.defineProperty(VXETable, 'importTypes', {
  7840. get: function get() {
  7841. return getExportOrImpotType(conf.export.types, 2);
  7842. }
  7843. });
  7844. /* harmony default export */ var v_x_e_table = (VXETable);
  7845. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.every.js
  7846. var es_array_every = __webpack_require__("a623");
  7847. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
  7848. var es_map = __webpack_require__("4ec9");
  7849. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
  7850. var es_number_constructor = __webpack_require__("a9e3");
  7851. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
  7852. function _defineProperty(obj, key, value) {
  7853. if (key in obj) {
  7854. Object.defineProperty(obj, key, {
  7855. value: value,
  7856. enumerable: true,
  7857. configurable: true,
  7858. writable: true
  7859. });
  7860. } else {
  7861. obj[key] = value;
  7862. }
  7863. return obj;
  7864. }
  7865. // CONCATENATED MODULE: ./packages/body/src/body.js
  7866. var cellType = 'body'; // 滚动、拖动过程中不需要触发
  7867. function isOperateMouse($xetable) {
  7868. // 在 v3.0 中废弃 optimization.delayHover
  7869. return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
  7870. }
  7871. function countTreeExpand(prevRow, params) {
  7872. var $table = params.$table;
  7873. var rowChildren = prevRow[$table.treeOpts.children];
  7874. var count = 1;
  7875. if ($table.isTreeExpandByRow(prevRow)) {
  7876. for (var index = 0; index < rowChildren.length; index++) {
  7877. count += countTreeExpand(rowChildren[index], params);
  7878. }
  7879. }
  7880. return count;
  7881. }
  7882. function getOffsetSize($xetable) {
  7883. switch ($xetable.vSize) {
  7884. case 'mini':
  7885. return 3;
  7886. case 'small':
  7887. return 2;
  7888. case 'medium':
  7889. return 1;
  7890. }
  7891. return 0;
  7892. }
  7893. function calcTreeLine(params, items) {
  7894. var $table = params.$table,
  7895. $rowIndex = params.$rowIndex;
  7896. var expandSize = 1;
  7897. if ($rowIndex) {
  7898. expandSize = countTreeExpand(items[$rowIndex - 1], params);
  7899. }
  7900. return $table.rowHeight * expandSize - ($rowIndex ? 1 : 12 - getOffsetSize($table));
  7901. }
  7902. function renderLine(h, _vm, $xetable, rowLevel, items, params) {
  7903. var column = params.column;
  7904. var treeOpts = $xetable.treeOpts,
  7905. treeConfig = $xetable.treeConfig;
  7906. return column.slots && column.slots.line ? column.slots.line.call($xetable, params, h) : column.treeNode && treeConfig && treeOpts.line ? [h('div', {
  7907. class: 'vxe-tree--line-wrapper'
  7908. }, [h('div', {
  7909. class: 'vxe-tree--line',
  7910. style: {
  7911. height: "".concat(calcTreeLine(params, items), "px"),
  7912. left: "".concat(rowLevel * treeOpts.indent + (rowLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
  7913. }
  7914. })])] : [];
  7915. }
  7916. function renderBorder(h, type) {
  7917. return h('div', {
  7918. class: "vxe-table-".concat(type, "ed-borders"),
  7919. ref: "".concat(type, "Borders")
  7920. }, [h('span', {
  7921. class: 'vxe-table-border-top',
  7922. ref: "".concat(type, "Top")
  7923. }), h('span', {
  7924. class: 'vxe-table-border-right',
  7925. ref: "".concat(type, "Right")
  7926. }), h('span', {
  7927. class: 'vxe-table-border-bottom',
  7928. ref: "".concat(type, "Bottom")
  7929. }), h('span', {
  7930. class: 'vxe-table-border-left',
  7931. ref: "".concat(type, "Left")
  7932. })]);
  7933. }
  7934. function mergeMethod(mergeList, _rowIndex, _columnIndex) {
  7935. for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
  7936. var _mergeList$mIndex = mergeList[mIndex],
  7937. mergeRowIndex = _mergeList$mIndex.row,
  7938. mergeColIndex = _mergeList$mIndex.col,
  7939. mergeRowspan = _mergeList$mIndex.rowspan,
  7940. mergeColspan = _mergeList$mIndex.colspan;
  7941. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  7942. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  7943. return {
  7944. rowspan: mergeRowspan,
  7945. colspan: mergeColspan
  7946. };
  7947. }
  7948. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  7949. return {
  7950. rowspan: 0,
  7951. colspan: 0
  7952. };
  7953. }
  7954. }
  7955. }
  7956. }
  7957. /**
  7958. * 渲染列
  7959. */
  7960. function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
  7961. var _ref2;
  7962. var _e = $xetable._e,
  7963. tableListeners = $xetable.$listeners,
  7964. afterFullData = $xetable.afterFullData,
  7965. tableData = $xetable.tableData,
  7966. height = $xetable.height,
  7967. columnKey = $xetable.columnKey,
  7968. overflowX = $xetable.overflowX,
  7969. scrollXLoad = $xetable.scrollXLoad,
  7970. scrollYLoad = $xetable.scrollYLoad,
  7971. highlightCurrentRow = $xetable.highlightCurrentRow,
  7972. allColumnOverflow = $xetable.showOverflow,
  7973. allAlign = $xetable.align,
  7974. currentColumn = $xetable.currentColumn,
  7975. cellClassName = $xetable.cellClassName,
  7976. cellStyle = $xetable.cellStyle,
  7977. mergeList = $xetable.mergeList,
  7978. spanMethod = $xetable.spanMethod,
  7979. radioOpts = $xetable.radioOpts,
  7980. checkboxOpts = $xetable.checkboxOpts,
  7981. expandOpts = $xetable.expandOpts,
  7982. treeOpts = $xetable.treeOpts,
  7983. tooltipOpts = $xetable.tooltipOpts,
  7984. mouseConfig = $xetable.mouseConfig,
  7985. editConfig = $xetable.editConfig,
  7986. editOpts = $xetable.editOpts,
  7987. editRules = $xetable.editRules,
  7988. validOpts = $xetable.validOpts,
  7989. editStore = $xetable.editStore,
  7990. validStore = $xetable.validStore;
  7991. var cellRender = column.cellRender,
  7992. editRender = column.editRender,
  7993. align = column.align,
  7994. showOverflow = column.showOverflow,
  7995. className = column.className,
  7996. treeNode = column.treeNode;
  7997. var actived = editStore.actived;
  7998. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  7999. var columnIndex = $xetable.getColumnIndex(column);
  8000. var _columnIndex = $xetable.getVTColumnIndex(column);
  8001. var isEdit = UtilTools.isEnableConf(editRender);
  8002. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
  8003. var cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8004. var showEllipsis = cellOverflow === 'ellipsis';
  8005. var showTitle = cellOverflow === 'title';
  8006. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  8007. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  8008. var isDirty;
  8009. var tdOns = {};
  8010. var cellAlign = align || allAlign;
  8011. var hasValidError = validStore.row === row && validStore.column === column;
  8012. var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
  8013. var attrs = {
  8014. 'data-colid': column.id
  8015. };
  8016. var bindMouseenter = tableListeners['cell-mouseenter'];
  8017. var bindMouseleave = tableListeners['cell-mouseleave'];
  8018. var triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
  8019. var params = {
  8020. $table: $xetable,
  8021. $seq: $seq,
  8022. seq: seq,
  8023. rowid: rowid,
  8024. row: row,
  8025. rowIndex: rowIndex,
  8026. $rowIndex: $rowIndex,
  8027. _rowIndex: _rowIndex,
  8028. column: column,
  8029. columnIndex: columnIndex,
  8030. $columnIndex: $columnIndex,
  8031. _columnIndex: _columnIndex,
  8032. fixed: fixedType,
  8033. type: cellType,
  8034. isHidden: fixedHiddenColumn,
  8035. level: rowLevel,
  8036. visibleData: afterFullData,
  8037. data: tableData,
  8038. items: items
  8039. }; // 虚拟滚动不支持动态高度
  8040. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  8041. showEllipsis = hasEllipsis = true;
  8042. } // hover 进入事件
  8043. if (showTitle || showTooltip || showAllTip || bindMouseenter) {
  8044. tdOns.mouseenter = function (evnt) {
  8045. if (isOperateMouse($xetable)) {
  8046. return;
  8047. }
  8048. if (showTitle) {
  8049. DomTools.updateCellTitle(evnt.currentTarget, column);
  8050. } else if (showTooltip || showAllTip) {
  8051. // 如果配置了显示 tooltip
  8052. $xetable.triggerBodyTooltipEvent(evnt, params);
  8053. }
  8054. if (bindMouseenter) {
  8055. $xetable.emitEvent('cell-mouseenter', Object.assign({
  8056. cell: evnt.currentTarget
  8057. }, params), evnt);
  8058. }
  8059. };
  8060. } // hover 退出事件
  8061. if (showTooltip || showAllTip || bindMouseleave) {
  8062. tdOns.mouseleave = function (evnt) {
  8063. if (isOperateMouse($xetable)) {
  8064. return;
  8065. }
  8066. if (showTooltip || showAllTip) {
  8067. $xetable.handleTargetLeaveEvent(evnt);
  8068. }
  8069. if (bindMouseleave) {
  8070. $xetable.emitEvent('cell-mouseleave', Object.assign({
  8071. cell: evnt.currentTarget
  8072. }, params), evnt);
  8073. }
  8074. };
  8075. } // 按下事件处理
  8076. if (checkboxOpts.range || mouseConfig) {
  8077. tdOns.mousedown = function (evnt) {
  8078. $xetable.triggerCellMousedownEvent(evnt, params);
  8079. };
  8080. } // 点击事件处理
  8081. if (highlightCurrentRow || mouseConfig || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || // 在 v3.0 中废弃 type=selection
  8082. checkboxOpts.trigger === 'row' || (column.type === 'checkbox' || column.type === 'selection') && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
  8083. tdOns.click = function (evnt) {
  8084. $xetable.triggerCellClickEvent(evnt, params);
  8085. };
  8086. } // 双击事件处理
  8087. if (triggerDblclick || tableListeners['cell-dblclick']) {
  8088. tdOns.dblclick = function (evnt) {
  8089. $xetable.triggerCellDBLClickEvent(evnt, params);
  8090. };
  8091. } // 合并行或列
  8092. if (mergeList.length) {
  8093. var spanRest = mergeMethod(mergeList, _rowIndex, _columnIndex);
  8094. if (spanRest) {
  8095. var rowspan = spanRest.rowspan,
  8096. colspan = spanRest.colspan;
  8097. if (!rowspan || !colspan) {
  8098. return null;
  8099. }
  8100. if (rowspan > 1) {
  8101. attrs.rowspan = rowspan;
  8102. }
  8103. if (colspan > 1) {
  8104. attrs.colspan = colspan;
  8105. }
  8106. }
  8107. } else if (spanMethod) {
  8108. // 自定义合并行或列的方法
  8109. var _ref = spanMethod(params) || {},
  8110. _ref$rowspan = _ref.rowspan,
  8111. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  8112. _ref$colspan = _ref.colspan,
  8113. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  8114. if (!_rowspan || !_colspan) {
  8115. return null;
  8116. }
  8117. if (_rowspan > 1) {
  8118. attrs.rowspan = _rowspan;
  8119. }
  8120. if (_colspan > 1) {
  8121. attrs.colspan = _colspan;
  8122. }
  8123. } // 如果被合并不可隐藏
  8124. if (fixedHiddenColumn && mergeList) {
  8125. if (attrs.colspan > 1 || attrs.rowspan > 1) {
  8126. fixedHiddenColumn = false;
  8127. }
  8128. } // 如果编辑列开启显示状态
  8129. if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
  8130. isDirty = $xetable.isUpdateByRow(row, column.property);
  8131. }
  8132. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  8133. return h('td', {
  8134. class: ['vxe-body--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(cellAlign), cellAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === columns.length - 1), _defineProperty(_ref2, 'col--tree-node', treeNode), _defineProperty(_ref2, 'col--edit', isEdit), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--dirty', isDirty), _defineProperty(_ref2, 'col--actived', editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row')), _defineProperty(_ref2, 'col--valid-error', hasValidError), _defineProperty(_ref2, 'col--current', currentColumn === column), _ref2), UtilTools.getClass(className, params), UtilTools.getClass(cellClassName, params)],
  8135. key: columnKey ? column.id : $columnIndex,
  8136. attrs: attrs,
  8137. style: cellStyle ? ctor_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null,
  8138. on: tdOns
  8139. }, allColumnOverflow && fixedHiddenColumn ? [h('div', {
  8140. class: ['vxe-cell', {
  8141. 'c--title': showTitle,
  8142. 'c--tooltip': showTooltip,
  8143. 'c--ellipsis': showEllipsis
  8144. }]
  8145. })] : renderLine(h, _vm, $xetable, rowLevel, items, params).concat([h('div', {
  8146. class: ['vxe-cell', {
  8147. 'c--title': showTitle,
  8148. 'c--tooltip': showTooltip,
  8149. 'c--ellipsis': showEllipsis
  8150. }],
  8151. attrs: {
  8152. title: showTitle ? $xetable.getCellLabel(row, column) : null
  8153. }
  8154. }, column.renderCell(h, params)), showValidTip ? hasValidError ? h('div', {
  8155. class: 'vxe-cell--valid',
  8156. style: validStore.rule && validStore.rule.maxWidth ? {
  8157. width: "".concat(validStore.rule.maxWidth, "px")
  8158. } : null
  8159. }, [h('span', {
  8160. class: 'vxe-cell--valid-msg'
  8161. }, validStore.content)]) : _e() : null]));
  8162. }
  8163. function renderRows(h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tableColumn) {
  8164. var stripe = $xetable.stripe,
  8165. rowKey = $xetable.rowKey,
  8166. highlightHoverRow = $xetable.highlightHoverRow,
  8167. rowClassName = $xetable.rowClassName,
  8168. rowStyle = $xetable.rowStyle,
  8169. allColumnOverflow = $xetable.showOverflow,
  8170. treeConfig = $xetable.treeConfig,
  8171. treeOpts = $xetable.treeOpts,
  8172. treeExpandeds = $xetable.treeExpandeds,
  8173. scrollYLoad = $xetable.scrollYLoad,
  8174. scrollYStore = $xetable.scrollYStore,
  8175. editStore = $xetable.editStore,
  8176. rowExpandeds = $xetable.rowExpandeds,
  8177. radioOpts = $xetable.radioOpts,
  8178. checkboxOpts = $xetable.checkboxOpts,
  8179. expandColumn = $xetable.expandColumn;
  8180. var rows = [];
  8181. tableData.forEach(function (row, $rowIndex) {
  8182. var trOn = {};
  8183. var rowIndex = $rowIndex;
  8184. var seq = rowIndex + 1;
  8185. if (scrollYLoad) {
  8186. seq += scrollYStore.startIndex;
  8187. }
  8188. var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
  8189. rowIndex = $xetable.getRowIndex(row); // 事件绑定
  8190. if (highlightHoverRow) {
  8191. trOn.mouseenter = function (evnt) {
  8192. if (isOperateMouse($xetable)) {
  8193. return;
  8194. }
  8195. $xetable.triggerHoverEvent(evnt, {
  8196. row: row,
  8197. rowIndex: rowIndex
  8198. });
  8199. };
  8200. trOn.mouseleave = function () {
  8201. if (isOperateMouse($xetable)) {
  8202. return;
  8203. }
  8204. $xetable.clearHoverRow();
  8205. };
  8206. }
  8207. var rowid = UtilTools.getRowid($xetable, row);
  8208. var params = {
  8209. $table: $xetable,
  8210. $seq: $seq,
  8211. seq: seq,
  8212. rowid: rowid,
  8213. fixed: fixedType,
  8214. type: cellType,
  8215. level: rowLevel,
  8216. row: row,
  8217. rowIndex: rowIndex,
  8218. $rowIndex: $rowIndex
  8219. };
  8220. rows.push(h('tr', {
  8221. class: ['vxe-body--row', {
  8222. 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
  8223. 'is--new': editStore.insertList.indexOf(row) > -1,
  8224. 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
  8225. 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
  8226. }, rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
  8227. attrs: {
  8228. 'data-rowid': rowid
  8229. },
  8230. style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
  8231. key: rowKey || treeConfig ? rowid : $rowIndex,
  8232. on: trOn
  8233. }, tableColumn.map(function (column, $columnIndex) {
  8234. return renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
  8235. }))); // 如果行被展开了
  8236. if (expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1) {
  8237. var expandColumnIndex = $xetable.getColumnIndex(expandColumn);
  8238. var cellStyle;
  8239. if (treeConfig) {
  8240. cellStyle = {
  8241. paddingLeft: "".concat(rowLevel * treeOpts.indent + 30, "px")
  8242. };
  8243. }
  8244. var showOverflow = expandColumn.showOverflow;
  8245. var hasEllipsis = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8246. var expandParams = {
  8247. $table: $xetable,
  8248. $seq: $seq,
  8249. seq: seq,
  8250. column: expandColumn,
  8251. columnIndex: expandColumnIndex,
  8252. fixed: fixedType,
  8253. type: cellType,
  8254. level: rowLevel,
  8255. row: row,
  8256. rowIndex: rowIndex,
  8257. $rowIndex: $rowIndex
  8258. };
  8259. rows.push(h('tr', {
  8260. class: 'vxe-body--expanded-row',
  8261. key: "expand_".concat(rowid),
  8262. style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
  8263. on: trOn
  8264. }, [h('td', {
  8265. class: ['vxe-body--expanded-column', {
  8266. 'fixed--hidden': fixedType,
  8267. 'col--ellipsis': hasEllipsis
  8268. }],
  8269. attrs: {
  8270. colspan: tableColumn.length
  8271. }
  8272. }, [h('div', {
  8273. class: 'vxe-body--expanded-cell',
  8274. style: cellStyle
  8275. }, [expandColumn.renderData(h, expandParams)])])]));
  8276. } // 如果是树形表格
  8277. if (treeConfig && treeExpandeds.length) {
  8278. var rowChildren = row[treeOpts.children];
  8279. if (rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1) {
  8280. rows.push.apply(rows, _toConsumableArray(renderRows(h, _vm, $xetable, $seq ? "".concat($seq, ".").concat(seq) : "".concat(seq), rowLevel + 1, fixedType, rowChildren, tableColumn)));
  8281. }
  8282. }
  8283. });
  8284. return rows;
  8285. }
  8286. /**
  8287. * 同步滚动条
  8288. * scroll 方式:可以使固定列与内容保持一致的滚动效果,实现相对麻烦
  8289. * mousewheel 方式:对于同步滚动效果就略差了,左右滚动,内容跟随即可
  8290. * css3 translate 方式:对于同步滚动效果会有产生卡顿感觉,虽然可以利用硬件加速,渲染性能略优,但失去table布局能力
  8291. */
  8292. var scrollProcessTimeout;
  8293. function syncBodyScroll(scrollTop, elem1, elem2) {
  8294. if (elem1 || elem2) {
  8295. if (elem1) {
  8296. elem1.onscroll = null;
  8297. elem1.scrollTop = scrollTop;
  8298. }
  8299. if (elem2) {
  8300. elem2.onscroll = null;
  8301. elem2.scrollTop = scrollTop;
  8302. }
  8303. clearTimeout(scrollProcessTimeout);
  8304. scrollProcessTimeout = setTimeout(function () {
  8305. if (elem1) {
  8306. elem1.onscroll = elem1._onscroll;
  8307. }
  8308. if (elem2) {
  8309. elem2.onscroll = elem2._onscroll;
  8310. }
  8311. }, 300);
  8312. }
  8313. }
  8314. /* harmony default export */ var src_body = ({
  8315. name: 'VxeTableBody',
  8316. props: {
  8317. tableData: Array,
  8318. tableColumn: Array,
  8319. visibleColumn: Array,
  8320. fixedColumn: Array,
  8321. size: String,
  8322. fixedType: String,
  8323. isGroup: Boolean
  8324. },
  8325. mounted: function mounted() {
  8326. var $xetable = this.$parent,
  8327. $el = this.$el,
  8328. $refs = this.$refs,
  8329. fixedType = this.fixedType;
  8330. var elemStore = $xetable.elemStore;
  8331. var prefix = "".concat(fixedType || 'main', "-body-");
  8332. elemStore["".concat(prefix, "wrapper")] = $el;
  8333. elemStore["".concat(prefix, "table")] = $refs.table;
  8334. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  8335. elemStore["".concat(prefix, "list")] = $refs.tbody;
  8336. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  8337. elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
  8338. elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
  8339. this.$el.onscroll = this.scrollEvent;
  8340. this.$el._onscroll = this.scrollEvent;
  8341. },
  8342. beforeDestroy: function beforeDestroy() {
  8343. this.$el._onscroll = null;
  8344. this.$el.onscroll = null;
  8345. },
  8346. render: function render(h) {
  8347. var _e = this._e,
  8348. $xetable = this.$parent,
  8349. fixedColumn = this.fixedColumn,
  8350. fixedType = this.fixedType;
  8351. var $scopedSlots = $xetable.$scopedSlots,
  8352. tId = $xetable.tId,
  8353. tableData = $xetable.tableData,
  8354. tableColumn = $xetable.tableColumn,
  8355. allColumnOverflow = $xetable.showOverflow,
  8356. mergeList = $xetable.mergeList,
  8357. spanMethod = $xetable.spanMethod,
  8358. scrollXLoad = $xetable.scrollXLoad,
  8359. mouseConfig = $xetable.mouseConfig,
  8360. mouseOpts = $xetable.mouseOpts,
  8361. emptyRender = $xetable.emptyRender,
  8362. emptyOpts = $xetable.emptyOpts,
  8363. keyboardConfig = $xetable.keyboardConfig,
  8364. keyboardOpts = $xetable.keyboardOpts; // 在 v3.0 中废弃 mouse-config.checked
  8365. var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是固定列与设置了超出隐藏
  8366. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
  8367. if (fixedType && allColumnOverflow) {
  8368. tableColumn = fixedColumn;
  8369. } else if (scrollXLoad) {
  8370. if (fixedType) {
  8371. tableColumn = fixedColumn;
  8372. }
  8373. }
  8374. }
  8375. var emptyContent;
  8376. if ($scopedSlots.empty) {
  8377. emptyContent = $scopedSlots.empty.call(this, {
  8378. $table: $xetable
  8379. }, h);
  8380. } else {
  8381. var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  8382. if (compConf && compConf.renderEmpty) {
  8383. emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
  8384. $table: $xetable
  8385. }, {
  8386. $table: $xetable
  8387. });
  8388. } else {
  8389. emptyContent = $xetable.emptyText || conf.i18n('vxe.table.emptyText');
  8390. }
  8391. }
  8392. return h('div', {
  8393. class: ['vxe-table--body-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  8394. attrs: {
  8395. 'data-tid': tId
  8396. }
  8397. }, [fixedType ? _e() : h('div', {
  8398. class: 'vxe-body--x-space',
  8399. ref: 'xSpace'
  8400. }), h('div', {
  8401. class: 'vxe-body--y-space',
  8402. ref: 'ySpace'
  8403. }), h('table', {
  8404. class: 'vxe-table--body',
  8405. attrs: {
  8406. 'data-tid': tId,
  8407. cellspacing: 0,
  8408. cellpadding: 0,
  8409. border: 0
  8410. },
  8411. ref: 'table'
  8412. }, [
  8413. /**
  8414. * 列宽
  8415. */
  8416. h('colgroup', {
  8417. ref: 'colgroup'
  8418. }, tableColumn.map(function (column, columnIndex) {
  8419. return h('col', {
  8420. attrs: {
  8421. name: column.id
  8422. },
  8423. key: columnIndex
  8424. });
  8425. })),
  8426. /**
  8427. * 内容
  8428. */
  8429. h('tbody', {
  8430. ref: 'tbody'
  8431. }, renderRows(h, this, $xetable, '', 0, fixedType, tableData, tableColumn))]),
  8432. /**
  8433. * 选中边框线
  8434. */
  8435. !fixedType && (isMouseChecked || keyboardOpts.isCut) ? h('div', {
  8436. class: 'vxe-table--borders'
  8437. }, [isMouseChecked ? renderBorder(h, 'check') : null, keyboardOpts.isCut ? renderBorder(h, 'copy') : null]) : null, h('div', {
  8438. class: 'vxe-table--checkbox-range'
  8439. }), mouseConfig && mouseOpts.area ? h('div', {
  8440. class: 'vxe-table--cell-area'
  8441. }, [h('span', {
  8442. class: 'vxe-table--cell-main-area'
  8443. }, mouseOpts.extension ? [h('span', {
  8444. class: 'vxe-table--cell-main-area-btn',
  8445. on: {
  8446. mousedown: function mousedown(evnt) {
  8447. $xetable.triggerCellExtendMousedownEvent(evnt, {
  8448. $table: $xetable,
  8449. fixed: fixedType,
  8450. type: cellType
  8451. });
  8452. }
  8453. }
  8454. })] : null), h('span', {
  8455. class: 'vxe-table--cell-copy-area'
  8456. }), h('span', {
  8457. class: 'vxe-table--cell-extend-area'
  8458. }), h('span', {
  8459. class: 'vxe-table--cell-multi-area'
  8460. }), h('span', {
  8461. class: 'vxe-table--cell-active-area'
  8462. })]) : null, !fixedType ? h('div', {
  8463. class: 'vxe-table--empty-block',
  8464. ref: 'emptyBlock'
  8465. }, [h('div', {
  8466. class: 'vxe-table--empty-content'
  8467. }, emptyContent)]) : null]);
  8468. },
  8469. methods: {
  8470. /**
  8471. * 滚动处理
  8472. * 如果存在列固定左侧,同步更新滚动状态
  8473. * 如果存在列固定右侧,同步更新滚动状态
  8474. */
  8475. scrollEvent: function scrollEvent(evnt) {
  8476. var $el = this.$el,
  8477. $xetable = this.$parent,
  8478. fixedType = this.fixedType;
  8479. var $refs = $xetable.$refs,
  8480. highlightHoverRow = $xetable.highlightHoverRow,
  8481. scrollXLoad = $xetable.scrollXLoad,
  8482. scrollYLoad = $xetable.scrollYLoad,
  8483. lastScrollTop = $xetable.lastScrollTop,
  8484. lastScrollLeft = $xetable.lastScrollLeft;
  8485. var tableHeader = $refs.tableHeader,
  8486. tableBody = $refs.tableBody,
  8487. leftBody = $refs.leftBody,
  8488. rightBody = $refs.rightBody,
  8489. tableFooter = $refs.tableFooter,
  8490. validTip = $refs.validTip;
  8491. var headerElem = tableHeader ? tableHeader.$el : null;
  8492. var footerElem = tableFooter ? tableFooter.$el : null;
  8493. var bodyElem = tableBody.$el;
  8494. var leftElem = leftBody ? leftBody.$el : null;
  8495. var rightElem = rightBody ? rightBody.$el : null;
  8496. var scrollTop = $el.scrollTop;
  8497. var scrollLeft = bodyElem.scrollLeft;
  8498. var isX = scrollLeft !== lastScrollLeft;
  8499. var isY = scrollTop !== lastScrollTop;
  8500. $xetable.lastScrollTop = scrollTop;
  8501. $xetable.lastScrollLeft = scrollLeft;
  8502. $xetable.lastScrollTime = Date.now();
  8503. if (highlightHoverRow) {
  8504. $xetable.clearHoverRow();
  8505. }
  8506. if (leftElem && fixedType === 'left') {
  8507. scrollTop = leftElem.scrollTop;
  8508. syncBodyScroll(scrollTop, bodyElem, rightElem);
  8509. } else if (rightElem && fixedType === 'right') {
  8510. scrollTop = rightElem.scrollTop;
  8511. syncBodyScroll(scrollTop, bodyElem, leftElem);
  8512. } else {
  8513. if (isX) {
  8514. if (headerElem) {
  8515. headerElem.scrollLeft = bodyElem.scrollLeft;
  8516. }
  8517. if (footerElem) {
  8518. footerElem.scrollLeft = bodyElem.scrollLeft;
  8519. }
  8520. }
  8521. if (leftElem || rightElem) {
  8522. $xetable.checkScrolling();
  8523. if (isY) {
  8524. syncBodyScroll(scrollTop, leftElem, rightElem);
  8525. }
  8526. }
  8527. }
  8528. if (scrollXLoad && isX) {
  8529. $xetable.triggerScrollXEvent(evnt);
  8530. if (headerElem && scrollLeft + bodyElem.clientWidth >= bodyElem.scrollWidth - 80) {
  8531. // 修复拖动滚动条时可能存在不同步问题
  8532. this.$nextTick(function () {
  8533. if (bodyElem.scrollLeft !== headerElem.scrollLeft) {
  8534. headerElem.scrollLeft = bodyElem.scrollLeft;
  8535. }
  8536. });
  8537. }
  8538. }
  8539. if (scrollYLoad && isY) {
  8540. $xetable.triggerScrollYEvent(evnt);
  8541. }
  8542. if (isX && validTip && validTip.visible) {
  8543. validTip.updatePlacement();
  8544. }
  8545. $xetable.emitEvent('scroll', {
  8546. type: cellType,
  8547. fixed: fixedType,
  8548. scrollTop: scrollTop,
  8549. scrollLeft: scrollLeft,
  8550. isX: isX,
  8551. isY: isY
  8552. }, evnt);
  8553. }
  8554. }
  8555. });
  8556. // CONCATENATED MODULE: ./packages/body/index.js
  8557. src_body.install = function (Vue) {
  8558. Vue.component(src_body.name, src_body);
  8559. };
  8560. var Body = src_body;
  8561. /* harmony default export */ var packages_body = (src_body);
  8562. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
  8563. var es_array_filter = __webpack_require__("4de4");
  8564. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
  8565. var es_array_reduce = __webpack_require__("13d5");
  8566. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
  8567. var es_object_keys = __webpack_require__("b64b");
  8568. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
  8569. var es_string_trim = __webpack_require__("498a");
  8570. // CONCATENATED MODULE: ./packages/cell/src/cell.js
  8571. function renderHelpIcon(h, params) {
  8572. var $table = params.$table,
  8573. column = params.column;
  8574. var titleHelp = column.titleHelp;
  8575. return titleHelp ? [h('i', {
  8576. class: ['vxe-cell-help-icon', titleHelp.icon || conf.icon.TABLE_HELP],
  8577. on: {
  8578. mouseenter: function mouseenter(evnt) {
  8579. $table.triggerHeaderHelpEvent(evnt, params);
  8580. },
  8581. mouseleave: function mouseleave(evnt) {
  8582. $table.handleTargetLeaveEvent(evnt);
  8583. }
  8584. }
  8585. })] : [];
  8586. }
  8587. function renderTitleContent(h, params, content) {
  8588. var $table = params.$table,
  8589. column = params.column;
  8590. var showHeaderOverflow = column.showHeaderOverflow;
  8591. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  8592. tooltipOpts = $table.tooltipOpts;
  8593. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  8594. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  8595. var showTitle = headOverflow === 'title';
  8596. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  8597. var ons = {};
  8598. if (showTitle || showTooltip || showAllTip) {
  8599. ons.mouseenter = function (evnt) {
  8600. if ($table._isResize) {
  8601. return;
  8602. }
  8603. if (showTitle) {
  8604. DomTools.updateCellTitle(evnt.currentTarget, column);
  8605. } else if (showTooltip || showAllTip) {
  8606. $table.triggerHeaderTooltipEvent(evnt, params);
  8607. }
  8608. };
  8609. }
  8610. if (showTooltip || showAllTip) {
  8611. ons.mouseleave = function (evnt) {
  8612. if ($table._isResize) {
  8613. return;
  8614. }
  8615. if (showTooltip || showAllTip) {
  8616. $table.handleTargetLeaveEvent(evnt);
  8617. }
  8618. };
  8619. }
  8620. return [h('span', {
  8621. class: 'vxe-cell--title',
  8622. on: ons
  8623. }, content)];
  8624. }
  8625. function getFooterContent(h, params) {
  8626. var $table = params.$table,
  8627. column = params.column,
  8628. _columnIndex = params._columnIndex,
  8629. items = params.items;
  8630. var slots = column.slots,
  8631. editRender = column.editRender,
  8632. cellRender = column.cellRender;
  8633. var renderOpts = editRender || cellRender;
  8634. if (slots && slots.footer) {
  8635. return slots.footer.call($table, params, h);
  8636. }
  8637. if (renderOpts) {
  8638. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8639. if (compConf && compConf.renderFooter) {
  8640. return compConf.renderFooter.call($table, h, renderOpts, params, {
  8641. $grid: $table.$xegrid,
  8642. $excel: $table.$parent,
  8643. $table: $table
  8644. });
  8645. }
  8646. }
  8647. return [UtilTools.formatText(items[_columnIndex], 1)];
  8648. }
  8649. function getDefaultCellLabel(params) {
  8650. var $table = params.$table,
  8651. row = params.row,
  8652. column = params.column;
  8653. return UtilTools.formatText($table.getCellLabel(row, column), 1);
  8654. }
  8655. var Cell = {
  8656. createColumn: function createColumn($xetable, _vm) {
  8657. var type = _vm.type,
  8658. sortable = _vm.sortable,
  8659. remoteSort = _vm.remoteSort,
  8660. filters = _vm.filters,
  8661. editRender = _vm.editRender,
  8662. treeNode = _vm.treeNode;
  8663. var editConfig = $xetable.editConfig,
  8664. editOpts = $xetable.editOpts,
  8665. checkboxOpts = $xetable.checkboxOpts;
  8666. var renMaps = {
  8667. renderHeader: this.renderDefaultHeader,
  8668. renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
  8669. renderFooter: this.renderDefaultFooter
  8670. };
  8671. switch (type) {
  8672. case 'seq':
  8673. case 'index':
  8674. renMaps.renderHeader = this.renderIndexHeader;
  8675. renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderIndexCell;
  8676. break;
  8677. case 'radio':
  8678. renMaps.renderHeader = this.renderRadioHeader;
  8679. renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
  8680. break;
  8681. // 在 v3.0 中废弃 type=selection
  8682. case 'checkbox':
  8683. case 'selection':
  8684. renMaps.renderHeader = this.renderSelectionHeader;
  8685. renMaps.renderCell = checkboxOpts.checkField ? treeNode ? this.renderTreeSelectionCellByProp : this.renderSelectionCellByProp : treeNode ? this.renderTreeSelectionCell : this.renderSelectionCell;
  8686. break;
  8687. case 'expand':
  8688. renMaps.renderCell = this.renderExpandCell;
  8689. renMaps.renderData = this.renderExpandData;
  8690. break;
  8691. case 'html':
  8692. renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
  8693. if (filters && (sortable || remoteSort)) {
  8694. renMaps.renderHeader = this.renderSortAndFilterHeader;
  8695. } else if (sortable || remoteSort) {
  8696. renMaps.renderHeader = this.renderSortHeader;
  8697. } else if (filters) {
  8698. renMaps.renderHeader = this.renderFilterHeader;
  8699. }
  8700. break;
  8701. default:
  8702. if (editConfig && editRender) {
  8703. renMaps.renderHeader = this.renderEditHeader;
  8704. renMaps.renderCell = editOpts.mode === 'cell' ? treeNode ? this.renderTreeCellEdit : this.renderCellEdit : treeNode ? this.renderTreeRowEdit : this.renderRowEdit;
  8705. } else if (filters && (sortable || remoteSort)) {
  8706. renMaps.renderHeader = this.renderSortAndFilterHeader;
  8707. } else if (sortable || remoteSort) {
  8708. renMaps.renderHeader = this.renderSortHeader;
  8709. } else if (filters) {
  8710. renMaps.renderHeader = this.renderFilterHeader;
  8711. }
  8712. }
  8713. return UtilTools.getColumnConfig($xetable, _vm, renMaps);
  8714. },
  8715. /**
  8716. * 单元格
  8717. */
  8718. renderHeaderTitle: function renderHeaderTitle(h, params) {
  8719. var $table = params.$table,
  8720. column = params.column;
  8721. var slots = column.slots,
  8722. editRender = column.editRender,
  8723. cellRender = column.cellRender;
  8724. var renderOpts = editRender || cellRender;
  8725. if (slots && slots.header) {
  8726. return renderTitleContent(h, params, slots.header.call($table, params, h));
  8727. }
  8728. if (renderOpts) {
  8729. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8730. if (compConf && compConf.renderHeader) {
  8731. return renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params, {
  8732. $grid: $table.$xegrid,
  8733. $excel: $table.$parent,
  8734. $table: $table
  8735. }));
  8736. }
  8737. }
  8738. return renderTitleContent(h, params, UtilTools.formatText(column.getTitle(), 1));
  8739. },
  8740. renderDefaultHeader: function renderDefaultHeader(h, params) {
  8741. return renderHelpIcon(h, params).concat(Cell.renderHeaderTitle(h, params));
  8742. },
  8743. renderDefaultCell: function renderDefaultCell(h, params) {
  8744. var $table = params.$table,
  8745. row = params.row,
  8746. column = params.column;
  8747. var slots = column.slots,
  8748. editRender = column.editRender,
  8749. cellRender = column.cellRender;
  8750. var renderOpts = editRender || cellRender;
  8751. if (slots && slots.default) {
  8752. return slots.default.call($table, params, h);
  8753. }
  8754. if (renderOpts) {
  8755. var funName = editRender ? 'renderCell' : 'renderDefault';
  8756. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8757. if (compConf && compConf[funName]) {
  8758. return compConf[funName].call($table, h, renderOpts, Object.assign({
  8759. $type: editRender ? 'edit' : 'cell',
  8760. isEdit: !!editRender
  8761. }, params), {
  8762. $type: editRender ? 'edit' : 'cell',
  8763. $grid: $table.$xegrid,
  8764. $excel: $table.$parent,
  8765. $table: $table
  8766. });
  8767. }
  8768. }
  8769. var cellValue = $table.getCellLabel(row, column);
  8770. var cellPlaceholder = editRender ? editRender.placeholder : '';
  8771. return [h('span', {
  8772. class: 'vxe-cell--label'
  8773. }, editRender && (cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue)) ? [// 如果设置占位符
  8774. h('span', {
  8775. class: 'vxe-cell--placeholder'
  8776. }, UtilTools.formatText(UtilTools.getFuncText(cellPlaceholder), 1))] : UtilTools.formatText(cellValue, 1))];
  8777. },
  8778. renderTreeCell: function renderTreeCell(h, params) {
  8779. return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
  8780. },
  8781. renderDefaultFooter: function renderDefaultFooter(h, params) {
  8782. return [h('span', {
  8783. class: 'vxe-cell--item'
  8784. }, getFooterContent(h, params))];
  8785. },
  8786. /**
  8787. * 树节点
  8788. */
  8789. renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
  8790. var $table = params.$table,
  8791. isHidden = params.isHidden;
  8792. var treeOpts = $table.treeOpts,
  8793. treeExpandeds = $table.treeExpandeds,
  8794. treeLazyLoadeds = $table.treeLazyLoadeds;
  8795. var row = params.row,
  8796. column = params.column,
  8797. level = params.level;
  8798. var slots = column.slots;
  8799. var children = treeOpts.children,
  8800. hasChild = treeOpts.hasChild,
  8801. indent = treeOpts.indent,
  8802. lazy = treeOpts.lazy,
  8803. trigger = treeOpts.trigger,
  8804. iconLoaded = treeOpts.iconLoaded,
  8805. showIcon = treeOpts.showIcon,
  8806. iconOpen = treeOpts.iconOpen,
  8807. iconClose = treeOpts.iconClose;
  8808. var rowChilds = row[children];
  8809. var hasLazyChilds = false;
  8810. var isAceived = false;
  8811. var isLazyLoaded = false;
  8812. var on = {};
  8813. if (slots && slots.icon) {
  8814. return slots.icon.call($table, params, h, cellVNodes);
  8815. }
  8816. if (!isHidden) {
  8817. isAceived = treeExpandeds.indexOf(row) > -1;
  8818. if (lazy) {
  8819. isLazyLoaded = treeLazyLoadeds.indexOf(row) > -1;
  8820. hasLazyChilds = row[hasChild];
  8821. }
  8822. }
  8823. if (!trigger || trigger === 'default') {
  8824. on.click = function (evnt) {
  8825. return $table.triggerTreeExpandEvent(evnt, params);
  8826. };
  8827. }
  8828. return [h('div', {
  8829. class: ['vxe-cell--tree-node', {
  8830. 'is--active': isAceived
  8831. }],
  8832. style: {
  8833. paddingLeft: "".concat(level * indent, "px")
  8834. }
  8835. }, [showIcon && (rowChilds && rowChilds.length || hasLazyChilds) ? [h('div', {
  8836. class: 'vxe-tree--btn-wrapper',
  8837. on: on
  8838. }, [h('i', {
  8839. class: ['vxe-tree--node-btn', isLazyLoaded ? iconLoaded || conf.icon.TABLE_TREE_LOADED : isAceived ? iconOpen || conf.icon.TABLE_TREE_OPEN : iconClose || conf.icon.TABLE_TREE_CLOSE]
  8840. })])] : null, h('div', {
  8841. class: 'vxe-tree-cell'
  8842. }, cellVNodes)])];
  8843. },
  8844. /**
  8845. * 索引
  8846. */
  8847. renderIndexHeader: function renderIndexHeader(h, params) {
  8848. var $table = params.$table,
  8849. column = params.column;
  8850. var slots = column.slots;
  8851. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : UtilTools.formatText(column.getTitle(), 1));
  8852. },
  8853. renderIndexCell: function renderIndexCell(h, params) {
  8854. var $table = params.$table,
  8855. column = params.column;
  8856. var seqOpts = $table.seqOpts,
  8857. startIndex = $table.startIndex;
  8858. var slots = column.slots;
  8859. if (slots && slots.default) {
  8860. return slots.default.call($table, params, h);
  8861. }
  8862. var $seq = params.$seq,
  8863. seq = params.seq,
  8864. level = params.level; // 在 v3.0 中废弃 startIndex、indexMethod
  8865. var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
  8866. return [UtilTools.formatText(seqMethod ? seqMethod(params) : level ? "".concat($seq, ".").concat(seq) : (seqOpts.startIndex || startIndex) + seq, 1)];
  8867. },
  8868. renderTreeIndexCell: function renderTreeIndexCell(h, params) {
  8869. return Cell.renderTreeIcon(h, params, Cell.renderIndexCell(h, params));
  8870. },
  8871. /**
  8872. * 单选
  8873. */
  8874. renderRadioHeader: function renderRadioHeader(h, params) {
  8875. var $table = params.$table,
  8876. column = params.column;
  8877. var slots = column.slots; // 在 v3.0 中废弃 label
  8878. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
  8879. class: 'vxe-radio--label'
  8880. }, UtilTools.formatText(column.getTitle(), 1))]);
  8881. },
  8882. renderRadioCell: function renderRadioCell(h, params) {
  8883. var $table = params.$table,
  8884. column = params.column,
  8885. isHidden = params.isHidden;
  8886. var radioOpts = $table.radioOpts,
  8887. selectRow = $table.selectRow;
  8888. var slots = column.slots;
  8889. var labelField = radioOpts.labelField,
  8890. checkMethod = radioOpts.checkMethod;
  8891. var row = params.row;
  8892. var isChecked = row === selectRow;
  8893. var isDisabled = !!checkMethod;
  8894. var on;
  8895. if (!isHidden) {
  8896. on = {
  8897. click: function click(evnt) {
  8898. if (!isDisabled) {
  8899. $table.triggerRadioRowEvent(evnt, params);
  8900. }
  8901. }
  8902. };
  8903. if (checkMethod) {
  8904. isDisabled = !checkMethod(params);
  8905. }
  8906. }
  8907. return [h('span', {
  8908. class: ['vxe-cell--radio', {
  8909. 'is--checked': isChecked,
  8910. 'is--disabled': isDisabled
  8911. }],
  8912. on: on
  8913. }, [h('span', {
  8914. class: 'vxe-radio--icon vxe-radio--checked-icon'
  8915. }), h('span', {
  8916. class: 'vxe-radio--icon vxe-radio--unchecked-icon'
  8917. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  8918. class: 'vxe-radio--label'
  8919. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  8920. },
  8921. renderTreeRadioCell: function renderTreeRadioCell(h, params) {
  8922. return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
  8923. },
  8924. /**
  8925. * 多选
  8926. */
  8927. renderSelectionHeader: function renderSelectionHeader(h, params) {
  8928. var $table = params.$table,
  8929. column = params.column,
  8930. isHidden = params.isHidden;
  8931. var isIndeterminate = $table.isIndeterminate,
  8932. isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
  8933. var slots = column.slots,
  8934. title = column.title,
  8935. label = column.label;
  8936. var checkboxOpts = $table.checkboxOpts; // 在 v3.0 中废弃 label
  8937. var headerTitle = title || label;
  8938. var isChecked = false;
  8939. var on;
  8940. if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
  8941. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
  8942. class: 'vxe-checkbox--label'
  8943. }, headerTitle)]);
  8944. }
  8945. if (!isHidden) {
  8946. isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected;
  8947. on = {
  8948. click: function click(evnt) {
  8949. if (!isAllCheckboxDisabled) {
  8950. $table.triggerCheckAllEvent(evnt, !isChecked);
  8951. }
  8952. }
  8953. };
  8954. }
  8955. return renderTitleContent(h, params, [h('span', {
  8956. class: ['vxe-cell--checkbox', {
  8957. 'is--checked': isChecked,
  8958. 'is--disabled': isAllCheckboxDisabled,
  8959. 'is--indeterminate': isIndeterminate
  8960. }],
  8961. attrs: {
  8962. title: conf.i18n('vxe.table.allTitle')
  8963. },
  8964. on: on
  8965. }, [h('span', {
  8966. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  8967. }), h('span', {
  8968. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  8969. }), h('span', {
  8970. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  8971. })].concat(slots && slots.header ? slots.header.call($table, params, h) : headerTitle ? [h('span', {
  8972. class: 'vxe-checkbox--label'
  8973. }, headerTitle)] : []))]);
  8974. },
  8975. renderSelectionCell: function renderSelectionCell(h, params) {
  8976. var $table = params.$table,
  8977. row = params.row,
  8978. column = params.column,
  8979. isHidden = params.isHidden;
  8980. var treeConfig = $table.treeConfig,
  8981. treeIndeterminates = $table.treeIndeterminates;
  8982. var _$table$checkboxOpts = $table.checkboxOpts,
  8983. labelField = _$table$checkboxOpts.labelField,
  8984. checkMethod = _$table$checkboxOpts.checkMethod;
  8985. var slots = column.slots;
  8986. var indeterminate = false;
  8987. var isChecked = false;
  8988. var isDisabled = !!checkMethod;
  8989. var on;
  8990. if (!isHidden) {
  8991. isChecked = $table.selection.indexOf(row) > -1;
  8992. on = {
  8993. click: function click(evnt) {
  8994. if (!isDisabled) {
  8995. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  8996. }
  8997. }
  8998. };
  8999. if (checkMethod) {
  9000. isDisabled = !checkMethod(params);
  9001. }
  9002. if (treeConfig) {
  9003. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9004. }
  9005. }
  9006. return [h('span', {
  9007. class: ['vxe-cell--checkbox', {
  9008. 'is--checked': isChecked,
  9009. 'is--disabled': isDisabled,
  9010. 'is--indeterminate': indeterminate
  9011. }],
  9012. on: on
  9013. }, [h('span', {
  9014. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9015. }), h('span', {
  9016. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9017. }), h('span', {
  9018. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9019. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  9020. class: 'vxe-checkbox--label'
  9021. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9022. },
  9023. renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
  9024. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCell(h, params));
  9025. },
  9026. renderSelectionCellByProp: function renderSelectionCellByProp(h, params) {
  9027. var $table = params.$table,
  9028. row = params.row,
  9029. column = params.column,
  9030. isHidden = params.isHidden;
  9031. var treeConfig = $table.treeConfig,
  9032. treeIndeterminates = $table.treeIndeterminates;
  9033. var _$table$checkboxOpts2 = $table.checkboxOpts,
  9034. labelField = _$table$checkboxOpts2.labelField,
  9035. property = _$table$checkboxOpts2.checkField,
  9036. halfField = _$table$checkboxOpts2.halfField,
  9037. checkMethod = _$table$checkboxOpts2.checkMethod;
  9038. var slots = column.slots;
  9039. var indeterminate = false;
  9040. var isChecked = false;
  9041. var isDisabled = !!checkMethod;
  9042. var on;
  9043. if (!isHidden) {
  9044. isChecked = ctor_amd_xe_utils_default.a.get(row, property);
  9045. on = {
  9046. click: function click(evnt) {
  9047. if (!isDisabled) {
  9048. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  9049. }
  9050. }
  9051. };
  9052. if (checkMethod) {
  9053. isDisabled = !checkMethod(params);
  9054. }
  9055. if (treeConfig) {
  9056. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9057. }
  9058. }
  9059. return [h('span', {
  9060. class: ['vxe-cell--checkbox', {
  9061. 'is--checked': isChecked,
  9062. 'is--disabled': isDisabled,
  9063. 'is--indeterminate': halfField && !isChecked ? row[halfField] : indeterminate
  9064. }],
  9065. on: on
  9066. }, [h('span', {
  9067. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9068. }), h('span', {
  9069. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9070. }), h('span', {
  9071. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9072. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  9073. class: 'vxe-checkbox--label'
  9074. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9075. },
  9076. renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
  9077. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCellByProp(h, params));
  9078. },
  9079. /**
  9080. * 展开行
  9081. */
  9082. renderExpandCell: function renderExpandCell(h, params) {
  9083. var $table = params.$table,
  9084. isHidden = params.isHidden,
  9085. row = params.row,
  9086. column = params.column;
  9087. var expandOpts = $table.expandOpts,
  9088. rowExpandeds = $table.rowExpandeds,
  9089. expandLazyLoadeds = $table.expandLazyLoadeds;
  9090. var lazy = expandOpts.lazy,
  9091. labelField = expandOpts.labelField,
  9092. iconLoaded = expandOpts.iconLoaded,
  9093. showIcon = expandOpts.showIcon,
  9094. iconOpen = expandOpts.iconOpen,
  9095. iconClose = expandOpts.iconClose,
  9096. visibleMethod = expandOpts.visibleMethod;
  9097. var slots = column.slots;
  9098. var isAceived = false;
  9099. var isLazyLoaded = false;
  9100. if (slots && slots.icon) {
  9101. return slots.icon.call($table, params, h);
  9102. }
  9103. if (!isHidden) {
  9104. isAceived = rowExpandeds.indexOf(params.row) > -1;
  9105. if (lazy) {
  9106. isLazyLoaded = expandLazyLoadeds.indexOf(row) > -1;
  9107. }
  9108. }
  9109. return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
  9110. class: ['vxe-table--expanded', {
  9111. 'is--active': isAceived
  9112. }],
  9113. on: {
  9114. click: function click(evnt) {
  9115. $table.triggerRowExpandEvent(evnt, params);
  9116. }
  9117. }
  9118. }, [h('i', {
  9119. class: ['vxe-table--expand-btn', isLazyLoaded ? iconLoaded || conf.icon.TABLE_EXPAND_LOADED : isAceived ? iconOpen || conf.icon.TABLE_EXPAND_OPEN : iconClose || conf.icon.TABLE_EXPAND_CLOSE]
  9120. })]) : null, slots && slots.default || labelField ? h('span', {
  9121. class: 'vxe-table--expand-label'
  9122. }, slots.default ? slots.default.call($table, params, h) : ctor_amd_xe_utils_default.a.get(row, labelField)) : null];
  9123. },
  9124. renderExpandData: function renderExpandData(h, params) {
  9125. var $table = params.$table,
  9126. column = params.column;
  9127. var slots = column.slots,
  9128. contentRender = column.contentRender;
  9129. if (slots) {
  9130. if (slots.content) {
  9131. return slots.content.call($table, params, h);
  9132. } // 在 v3.0 中严格支持 content
  9133. if (slots.default) {
  9134. return slots.default.call($table, params, h);
  9135. }
  9136. }
  9137. if (contentRender) {
  9138. var compConf = v_x_e_table.renderer.get(contentRender.name);
  9139. if (compConf && compConf.renderExpand) {
  9140. return compConf.renderExpand.call($table, h, contentRender, params, {
  9141. $grid: $table.$xegrid,
  9142. $table: $table
  9143. });
  9144. }
  9145. }
  9146. return [];
  9147. },
  9148. /**
  9149. * HTML 标签
  9150. */
  9151. renderHTMLCell: function renderHTMLCell(h, params) {
  9152. var $table = params.$table,
  9153. column = params.column;
  9154. var slots = column.slots;
  9155. if (slots && slots.default) {
  9156. return slots.default.call($table, params, h);
  9157. }
  9158. return [h('span', {
  9159. class: 'vxe-cell--html',
  9160. domProps: {
  9161. innerHTML: getDefaultCellLabel(params)
  9162. }
  9163. })];
  9164. },
  9165. renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
  9166. return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
  9167. },
  9168. /**
  9169. * 排序和筛选
  9170. */
  9171. renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
  9172. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
  9173. },
  9174. /**
  9175. * 排序
  9176. */
  9177. renderSortHeader: function renderSortHeader(h, params) {
  9178. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
  9179. },
  9180. renderSortIcon: function renderSortIcon(h, params) {
  9181. var $table = params.$table,
  9182. column = params.column;
  9183. var _$table$sortOpts = $table.sortOpts,
  9184. showIcon = _$table$sortOpts.showIcon,
  9185. iconAsc = _$table$sortOpts.iconAsc,
  9186. iconDesc = _$table$sortOpts.iconDesc;
  9187. return showIcon ? [h('span', {
  9188. class: 'vxe-cell--sort'
  9189. }, [h('i', {
  9190. class: ['vxe-sort--asc-btn', iconAsc || conf.icon.TABLE_SORT_ASC, {
  9191. 'sort--active': column.order === 'asc'
  9192. }],
  9193. attrs: {
  9194. title: conf.i18n('vxe.table.sortAsc')
  9195. },
  9196. on: {
  9197. click: function click(evnt) {
  9198. $table.triggerSortEvent(evnt, column, 'asc');
  9199. }
  9200. }
  9201. }), h('i', {
  9202. class: ['vxe-sort--desc-btn', iconDesc || conf.icon.TABLE_SORT_DESC, {
  9203. 'sort--active': column.order === 'desc'
  9204. }],
  9205. attrs: {
  9206. title: conf.i18n('vxe.table.sortDesc')
  9207. },
  9208. on: {
  9209. click: function click(evnt) {
  9210. $table.triggerSortEvent(evnt, column, 'desc');
  9211. }
  9212. }
  9213. })])] : [];
  9214. },
  9215. /**
  9216. * 筛选
  9217. */
  9218. renderFilterHeader: function renderFilterHeader(h, params) {
  9219. return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
  9220. },
  9221. renderFilterIcon: function renderFilterIcon(h, params) {
  9222. var $table = params.$table,
  9223. column = params.column,
  9224. hasFilter = params.hasFilter;
  9225. var filterStore = $table.filterStore,
  9226. filterOpts = $table.filterOpts;
  9227. var showIcon = filterOpts.showIcon,
  9228. iconNone = filterOpts.iconNone,
  9229. iconMatch = filterOpts.iconMatch;
  9230. return showIcon ? [h('span', {
  9231. class: ['vxe-cell--filter', {
  9232. 'is--active': filterStore.visible && filterStore.column === column
  9233. }]
  9234. }, [h('i', {
  9235. class: ['vxe-filter--btn', hasFilter ? iconMatch || conf.icon.TABLE_FILTER_MATCH : iconNone || conf.icon.TABLE_FILTER_NONE],
  9236. attrs: {
  9237. title: conf.i18n('vxe.table.filter')
  9238. },
  9239. on: {
  9240. click: function click(evnt) {
  9241. $table.triggerFilterEvent(evnt, params.column, params);
  9242. }
  9243. }
  9244. })])] : [];
  9245. },
  9246. /**
  9247. * 可编辑
  9248. */
  9249. renderEditHeader: function renderEditHeader(h, params) {
  9250. var $table = params.$table,
  9251. column = params.column;
  9252. var editRules = $table.editRules,
  9253. editOpts = $table.editOpts;
  9254. var sortable = column.sortable,
  9255. remoteSort = column.remoteSort,
  9256. editRender = column.editRender,
  9257. filters = column.filters;
  9258. var isRequired;
  9259. if (editRules) {
  9260. var columnRules = ctor_amd_xe_utils_default.a.get(editRules, params.column.property);
  9261. if (columnRules) {
  9262. isRequired = columnRules.some(function (rule) {
  9263. return rule.required;
  9264. });
  9265. }
  9266. }
  9267. return [isRequired && editOpts.showAsterisk ? h('i', {
  9268. class: 'vxe-cell--required-icon'
  9269. }) : null, UtilTools.isEnableConf(editRender) && editOpts.showIcon ? h('i', {
  9270. class: ['vxe-cell--edit-icon', editOpts.icon || conf.icon.TABLE_EDIT]
  9271. }) : null].concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
  9272. },
  9273. // 行格编辑模式
  9274. renderRowEdit: function renderRowEdit(h, params) {
  9275. var $table = params.$table,
  9276. column = params.column;
  9277. var editRender = column.editRender;
  9278. var actived = $table.editStore.actived;
  9279. return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row);
  9280. },
  9281. renderTreeRowEdit: function renderTreeRowEdit(h, params) {
  9282. return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
  9283. },
  9284. // 单元格编辑模式
  9285. renderCellEdit: function renderCellEdit(h, params) {
  9286. var $table = params.$table,
  9287. column = params.column;
  9288. var editRender = column.editRender;
  9289. var actived = $table.editStore.actived;
  9290. return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
  9291. },
  9292. renderTreeCellEdit: function renderTreeCellEdit(h, params) {
  9293. return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
  9294. },
  9295. runRenderer: function runRenderer(h, params, _vm, isEdit) {
  9296. var $table = params.$table,
  9297. column = params.column;
  9298. var slots = column.slots,
  9299. editRender = column.editRender,
  9300. formatter = column.formatter;
  9301. var compConf = v_x_e_table.renderer.get(editRender.name);
  9302. if (editRender.type === 'visible' || isEdit) {
  9303. if (slots && slots.edit) {
  9304. return slots.edit.call($table, params, h);
  9305. }
  9306. return compConf && compConf.renderEdit ? compConf.renderEdit.call($table, h, editRender, Object.assign({
  9307. $type: 'edit',
  9308. isEdit: true
  9309. }, params), {
  9310. $type: 'edit',
  9311. $grid: $table.$xegrid,
  9312. $excel: $table.$parent,
  9313. $table: $table
  9314. }) : [];
  9315. }
  9316. if (slots && slots.default) {
  9317. return slots.default.call($table, params, h);
  9318. }
  9319. if (formatter) {
  9320. return [h('span', {
  9321. class: 'vxe-cell--label'
  9322. }, [getDefaultCellLabel(params)])];
  9323. }
  9324. return Cell.renderDefaultCell.call(_vm, h, params);
  9325. }
  9326. };
  9327. /* harmony default export */ var src_cell = (Cell);
  9328. // CONCATENATED MODULE: ./packages/cell/index.js
  9329. /* harmony default export */ var packages_cell = (src_cell);
  9330. // CONCATENATED MODULE: ./packages/table/src/methods.js
  9331. var methods_getRowid = UtilTools.getRowid,
  9332. getRowkey = UtilTools.getRowkey,
  9333. methods_setCellValue = UtilTools.setCellValue,
  9334. hasChildrenList = UtilTools.hasChildrenList;
  9335. var methods_browse = DomTools.browse,
  9336. methods_calcHeight = DomTools.calcHeight,
  9337. hasClass = DomTools.hasClass,
  9338. addClass = DomTools.addClass,
  9339. removeClass = DomTools.removeClass,
  9340. getEventTargetNode = DomTools.getEventTargetNode;
  9341. var isWebkit = methods_browse['-webkit'] && !methods_browse.edge;
  9342. var debounceScrollYDuration = methods_browse.msie ? 40 : 20;
  9343. var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
  9344. var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
  9345. /**
  9346. * 生成行的唯一主键
  9347. */
  9348. function getRowUniqueId() {
  9349. return ctor_amd_xe_utils_default.a.uniqueId('row_');
  9350. }
  9351. function eqCellNull(cellValue) {
  9352. return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
  9353. }
  9354. function eqCellValue(row1, row2, field) {
  9355. var val1 = ctor_amd_xe_utils_default.a.get(row1, field);
  9356. var val2 = ctor_amd_xe_utils_default.a.get(row2, field);
  9357. if (eqCellNull(val1) && eqCellNull(val2)) {
  9358. return true;
  9359. }
  9360. if (ctor_amd_xe_utils_default.a.isString(val1) || ctor_amd_xe_utils_default.a.isNumber(val1)) {
  9361. /* eslint-disable eqeqeq */
  9362. return val1 == val2;
  9363. }
  9364. return ctor_amd_xe_utils_default.a.isEqual(val1, val2);
  9365. }
  9366. function getNextSortOrder(_vm, column) {
  9367. var orders = _vm.sortOpts.orders;
  9368. var currOrder = column.order || null;
  9369. var oIndex = orders.indexOf(currOrder) + 1;
  9370. return orders[oIndex < orders.length ? oIndex : 0];
  9371. }
  9372. function getCustomStorageMap(key) {
  9373. var version = conf.version;
  9374. var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  9375. return rest && rest._v === version ? rest : {
  9376. _v: version
  9377. };
  9378. }
  9379. function getRecoverRow(_vm, list) {
  9380. var fullAllDataRowMap = _vm.fullAllDataRowMap;
  9381. return list.filter(function (row) {
  9382. return fullAllDataRowMap.has(row);
  9383. });
  9384. }
  9385. function handleReserveRow(_vm, reserveRowMap) {
  9386. var fullDataRowIdData = _vm.fullDataRowIdData;
  9387. var reserveList = [];
  9388. ctor_amd_xe_utils_default.a.each(reserveRowMap, function (item, rowid) {
  9389. if (fullDataRowIdData[rowid] && reserveList.indexOf(fullDataRowIdData[rowid].row) === -1) {
  9390. reserveList.push(fullDataRowIdData[rowid].row);
  9391. }
  9392. });
  9393. return reserveList;
  9394. }
  9395. function setMerges(_vm, merges, mList, rowList) {
  9396. if (merges) {
  9397. var treeConfig = _vm.treeConfig,
  9398. visibleColumn = _vm.visibleColumn;
  9399. if (treeConfig) {
  9400. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-footer-items']));
  9401. }
  9402. if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
  9403. merges = [merges];
  9404. }
  9405. merges.forEach(function (item) {
  9406. var row = item.row,
  9407. col = item.col,
  9408. rowspan = item.rowspan,
  9409. colspan = item.colspan;
  9410. if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
  9411. row = rowList[row];
  9412. }
  9413. if (ctor_amd_xe_utils_default.a.isNumber(col)) {
  9414. col = visibleColumn[col];
  9415. }
  9416. if ((rowList ? row : ctor_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
  9417. rowspan = ctor_amd_xe_utils_default.a.toNumber(rowspan) || 1;
  9418. colspan = ctor_amd_xe_utils_default.a.toNumber(colspan) || 1;
  9419. if (rowspan > 1 || colspan > 1) {
  9420. var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  9421. return item._row === row && item._col === col;
  9422. });
  9423. var mergeItem = mList[mcIndex];
  9424. if (mergeItem) {
  9425. mergeItem.rowspan = rowspan;
  9426. mergeItem.colspan = colspan;
  9427. mergeItem._rowspan = rowspan;
  9428. mergeItem._colspan = colspan;
  9429. } else {
  9430. var mergeRowIndex = rowList ? rowList.indexOf(row) : row;
  9431. var mergeColIndex = visibleColumn.indexOf(col);
  9432. mList.push({
  9433. row: mergeRowIndex,
  9434. col: mergeColIndex,
  9435. rowspan: rowspan,
  9436. colspan: colspan,
  9437. _row: row,
  9438. _col: col,
  9439. _rowspan: rowspan,
  9440. _colspan: colspan
  9441. });
  9442. }
  9443. }
  9444. }
  9445. });
  9446. }
  9447. }
  9448. function removeMerges(_vm, merges, mList, rowList) {
  9449. var rest = [];
  9450. if (merges) {
  9451. var treeConfig = _vm.treeConfig,
  9452. visibleColumn = _vm.visibleColumn;
  9453. if (treeConfig) {
  9454. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-cells']));
  9455. }
  9456. if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
  9457. merges = [merges];
  9458. }
  9459. merges.forEach(function (item) {
  9460. var row = item.row,
  9461. col = item.col;
  9462. if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
  9463. row = rowList[row];
  9464. }
  9465. if (ctor_amd_xe_utils_default.a.isNumber(col)) {
  9466. col = visibleColumn[col];
  9467. }
  9468. var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  9469. return item._row === row && item._col === col;
  9470. });
  9471. if (mcIndex > -1) {
  9472. var rItems = mList.splice(mcIndex, 1);
  9473. rest.push(rItems[0]);
  9474. }
  9475. });
  9476. }
  9477. return rest;
  9478. }
  9479. function getOrderField(_vm, column) {
  9480. var sortBy = column.sortBy,
  9481. sortType = column.sortType;
  9482. if (sortBy && ctor_amd_xe_utils_default.a.isArray(sortBy)) {
  9483. return sortBy;
  9484. }
  9485. return function (row) {
  9486. var cellValue;
  9487. if (sortBy) {
  9488. cellValue = ctor_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
  9489. row: row,
  9490. column: column
  9491. }) : ctor_amd_xe_utils_default.a.get(row, sortBy);
  9492. } else {
  9493. cellValue = _vm.getCellLabel(row, column);
  9494. }
  9495. if (!sortType || sortType === 'auto') {
  9496. return isNaN(cellValue) ? cellValue : ctor_amd_xe_utils_default.a.toNumber(cellValue);
  9497. } else if (sortType === 'number') {
  9498. return ctor_amd_xe_utils_default.a.toNumber(cellValue);
  9499. } else if (sortType === 'string') {
  9500. return ctor_amd_xe_utils_default.a.toValueString(cellValue);
  9501. }
  9502. return cellValue;
  9503. };
  9504. }
  9505. var Methods = {
  9506. /**
  9507. * 获取父容器元素
  9508. */
  9509. getParentElem: function getParentElem() {
  9510. return this.$xegrid ? this.$xegrid.$el.parentNode : this.$el.parentNode;
  9511. },
  9512. /**
  9513. * 获取父容器的高度
  9514. */
  9515. getParentHeight: function getParentHeight() {
  9516. return this.$xegrid ? this.$xegrid.getParentHeight() : this.getParentElem().clientHeight;
  9517. },
  9518. /**
  9519. * 获取需要排除的高度
  9520. * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
  9521. * 如果存在表尾合计滚动条,则需要排除滚动条高度
  9522. */
  9523. getExcludeHeight: function getExcludeHeight() {
  9524. return this.$xegrid ? this.$xegrid.getExcludeHeight() : 0;
  9525. },
  9526. /**
  9527. * 重置表格的一切数据状态
  9528. */
  9529. clearAll: function clearAll() {
  9530. this.inited = false;
  9531. this.clearSort();
  9532. this.clearCurrentRow();
  9533. this.clearCurrentColumn();
  9534. this.clearRadioRow();
  9535. this.clearRadioReserve();
  9536. this.clearCheckboxRow();
  9537. this.clearCheckboxReserve();
  9538. this.clearRowExpand();
  9539. this.clearRowExpandReserve();
  9540. this.clearTreeExpand();
  9541. this.clearTreeExpandReserve();
  9542. if (v_x_e_table._edit) {
  9543. this.clearActived();
  9544. }
  9545. if (v_x_e_table._filter) {
  9546. this.clearFilter();
  9547. }
  9548. if (this.keyboardConfig || this.mouseConfig) {
  9549. this.clearIndexChecked();
  9550. this.clearHeaderChecked();
  9551. this.clearChecked();
  9552. this.clearSelected();
  9553. this.clearCopyed();
  9554. }
  9555. if (this.mouseConfig) {
  9556. this.clearCellAreas();
  9557. this.clearCopyCellArea();
  9558. }
  9559. return this.clearScroll();
  9560. },
  9561. refreshData: function refreshData() {
  9562. UtilTools.warn('vxe.error.delFunc', ['refreshData', 'syncData']);
  9563. return this.syncData();
  9564. },
  9565. /**
  9566. * 同步 data 数据
  9567. * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
  9568. * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
  9569. */
  9570. syncData: function syncData() {
  9571. var _this = this;
  9572. return this.$nextTick().then(function () {
  9573. _this.tableData = [];
  9574. return _this.$nextTick().then(function () {
  9575. return _this.loadTableData(_this.tableFullData);
  9576. });
  9577. });
  9578. },
  9579. /**
  9580. * 手动处理数据
  9581. * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
  9582. */
  9583. updateData: function updateData() {
  9584. return this.handleTableData(true).then(this.updateFooter).then(this.recalculate);
  9585. },
  9586. handleTableData: function handleTableData(force) {
  9587. var scrollYLoad = this.scrollYLoad,
  9588. scrollYStore = this.scrollYStore;
  9589. var fullData = force ? this.updateAfterFullData() : this.afterFullData;
  9590. this.tableData = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
  9591. return this.$nextTick();
  9592. },
  9593. /**
  9594. * 加载表格数据
  9595. * @param {Array} datas 数据
  9596. */
  9597. loadTableData: function loadTableData(datas) {
  9598. var _this2 = this;
  9599. var keepSource = this.keepSource,
  9600. treeConfig = this.treeConfig,
  9601. editStore = this.editStore,
  9602. sYOpts = this.sYOpts,
  9603. scrollYStore = this.scrollYStore;
  9604. var tableFullData = datas ? datas.slice(0) : [];
  9605. var scrollYLoad = !treeConfig && sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  9606. scrollYStore.startIndex = 0;
  9607. scrollYStore.visibleIndex = 0;
  9608. scrollYStore.renderSize = 1;
  9609. editStore.insertList = [];
  9610. editStore.removeList = []; // 全量数据
  9611. this.tableFullData = tableFullData; // 缓存数据
  9612. this.updateCache(true); // 原始数据
  9613. this.tableSynchData = datas;
  9614. if (keepSource) {
  9615. this.tableSourceData = ctor_amd_xe_utils_default.a.clone(tableFullData, true);
  9616. }
  9617. this.scrollYLoad = scrollYLoad;
  9618. if (scrollYLoad) {
  9619. if (!(this.height || this.maxHeight)) {
  9620. UtilTools.error('vxe.error.reqProp', ['height | max-height']);
  9621. }
  9622. if (!this.showOverflow) {
  9623. UtilTools.warn('vxe.error.reqProp', ['show-overflow']);
  9624. }
  9625. if (this.spanMethod) {
  9626. UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
  9627. }
  9628. }
  9629. this.clearMergeCells();
  9630. this.clearMergeFooterItems();
  9631. this.handleTableData(true);
  9632. this.updateFooter();
  9633. return this.computeScrollLoad().then(function () {
  9634. // 是否加载了数据
  9635. _this2.isLoadData = true;
  9636. _this2.computeRowHeight();
  9637. _this2.handleReserveStatus();
  9638. _this2.checkSelectionStatus();
  9639. return _this2.$nextTick().then(_this2.recalculate).then(_this2.refreshScroll);
  9640. });
  9641. },
  9642. /**
  9643. * 重新加载数据,不会清空表格状态
  9644. * @param {Array} datas 数据
  9645. */
  9646. loadData: function loadData(datas) {
  9647. this.inited = true;
  9648. return this.loadTableData(datas).then(this.recalculate);
  9649. },
  9650. /**
  9651. * 重新加载数据,会清空表格状态
  9652. * @param {Array} datas 数据
  9653. */
  9654. reloadData: function reloadData(datas) {
  9655. var _this3 = this;
  9656. return this.clearAll().then(function () {
  9657. _this3.inited = true;
  9658. return _this3.loadTableData(datas);
  9659. }).then(this.handleDefaults);
  9660. },
  9661. /**
  9662. * 局部加载行数据并恢复到初始状态
  9663. * 对于行数据需要局部更改的场景中可能会用到
  9664. * @param {Row} row 行对象
  9665. * @param {Object} record 新数据
  9666. * @param {String} field 字段名
  9667. */
  9668. reloadRow: function reloadRow(row, record, field) {
  9669. var tableSourceData = this.tableSourceData,
  9670. tableData = this.tableData; // 在 v3 中必须要开启 keep-source
  9671. if (!this.keepSource) {
  9672. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  9673. return this.$nextTick();
  9674. }
  9675. var rowIndex = this.getRowIndex(row);
  9676. var oRow = tableSourceData[rowIndex];
  9677. if (oRow && row) {
  9678. if (field) {
  9679. ctor_amd_xe_utils_default.a.set(oRow, field, ctor_amd_xe_utils_default.a.get(record || row, field));
  9680. } else {
  9681. if (record) {
  9682. tableSourceData[rowIndex] = record;
  9683. ctor_amd_xe_utils_default.a.clear(row, undefined);
  9684. Object.assign(row, this.defineField(Object.assign({}, record)));
  9685. this.updateCache(true);
  9686. } else {
  9687. ctor_amd_xe_utils_default.a.destructuring(oRow, ctor_amd_xe_utils_default.a.clone(row, true));
  9688. }
  9689. }
  9690. }
  9691. this.tableData = tableData.slice(0);
  9692. return this.$nextTick();
  9693. },
  9694. /**
  9695. * 加载列配置
  9696. * 对于表格列需要重载、局部递增场景下可能会用到
  9697. * @param {ColumnInfo} columns 列配置
  9698. */
  9699. loadColumn: function loadColumn(columns) {
  9700. var _this4 = this;
  9701. this.collectColumn = ctor_amd_xe_utils_default.a.mapTree(columns, function (column) {
  9702. return packages_cell.createColumn(_this4, column);
  9703. });
  9704. return this.$nextTick();
  9705. },
  9706. /**
  9707. * 加载列配置并恢复到初始状态
  9708. * 对于表格列需要重载、局部递增场景下可能会用到
  9709. * @param {ColumnInfo} columns 列配置
  9710. */
  9711. reloadColumn: function reloadColumn(columns) {
  9712. var _this5 = this;
  9713. return this.clearAll().then(function () {
  9714. return _this5.loadColumn(columns);
  9715. });
  9716. },
  9717. /**
  9718. * 更新数据行的 Map
  9719. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  9720. */
  9721. updateCache: function updateCache(source) {
  9722. var _this6 = this;
  9723. var treeConfig = this.treeConfig,
  9724. treeOpts = this.treeOpts,
  9725. tableFullData = this.tableFullData,
  9726. fullDataRowMap = this.fullDataRowMap,
  9727. fullAllDataRowMap = this.fullAllDataRowMap;
  9728. var fullDataRowIdData = this.fullDataRowIdData,
  9729. fullAllDataRowIdData = this.fullAllDataRowIdData;
  9730. var rowkey = getRowkey(this);
  9731. var isLazy = treeConfig && treeOpts.lazy;
  9732. var handleCache = function handleCache(row, index, items, path, parent) {
  9733. var rowid = methods_getRowid(_this6, row);
  9734. if (UtilTools.eqEmptyValue(rowid)) {
  9735. rowid = getRowUniqueId();
  9736. ctor_amd_xe_utils_default.a.set(row, rowkey, rowid);
  9737. }
  9738. if (isLazy && row[treeOpts.hasChild] && ctor_amd_xe_utils_default.a.isUndefined(row[treeOpts.children])) {
  9739. row[treeOpts.children] = null;
  9740. }
  9741. var rest = {
  9742. row: row,
  9743. rowid: rowid,
  9744. index: treeConfig && parent ? -1 : index,
  9745. items: items,
  9746. parent: parent
  9747. };
  9748. if (source) {
  9749. fullDataRowIdData[rowid] = rest;
  9750. fullDataRowMap.set(row, rest);
  9751. }
  9752. fullAllDataRowIdData[rowid] = rest;
  9753. fullAllDataRowMap.set(row, rest);
  9754. };
  9755. if (source) {
  9756. fullDataRowIdData = this.fullDataRowIdData = {};
  9757. fullDataRowMap.clear();
  9758. }
  9759. fullAllDataRowIdData = this.fullAllDataRowIdData = {};
  9760. fullAllDataRowMap.clear();
  9761. if (treeConfig) {
  9762. ctor_amd_xe_utils_default.a.eachTree(tableFullData, handleCache, treeOpts);
  9763. } else {
  9764. tableFullData.forEach(handleCache);
  9765. }
  9766. },
  9767. loadChildren: function loadChildren(row, childRecords) {
  9768. var _this7 = this;
  9769. return this.createData(childRecords).then(function (rows) {
  9770. var keepSource = _this7.keepSource,
  9771. tableSourceData = _this7.tableSourceData,
  9772. treeOpts = _this7.treeOpts,
  9773. fullDataRowIdData = _this7.fullDataRowIdData,
  9774. fullDataRowMap = _this7.fullDataRowMap,
  9775. fullAllDataRowMap = _this7.fullAllDataRowMap,
  9776. fullAllDataRowIdData = _this7.fullAllDataRowIdData;
  9777. var children = treeOpts.children;
  9778. if (keepSource) {
  9779. var rowid = methods_getRowid(_this7, row);
  9780. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  9781. return rowid === methods_getRowid(_this7, item);
  9782. }, treeOpts);
  9783. if (matchObj) {
  9784. matchObj.item[children] = ctor_amd_xe_utils_default.a.clone(rows, true);
  9785. }
  9786. }
  9787. ctor_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent) {
  9788. var rowid = methods_getRowid(_this7, childRow);
  9789. var rest = {
  9790. row: childRow,
  9791. rowid: rowid,
  9792. index: -1,
  9793. items: items,
  9794. parent: parent
  9795. };
  9796. fullDataRowIdData[rowid] = rest;
  9797. fullDataRowMap.set(childRow, rest);
  9798. fullAllDataRowIdData[rowid] = rest;
  9799. fullAllDataRowMap.set(childRow, rest);
  9800. }, treeOpts);
  9801. row[children] = rows;
  9802. return rows;
  9803. });
  9804. },
  9805. /**
  9806. * 更新数据列的 Map
  9807. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  9808. */
  9809. cacheColumnMap: function cacheColumnMap() {
  9810. var isGroup = this.isGroup,
  9811. tableFullColumn = this.tableFullColumn,
  9812. collectColumn = this.collectColumn,
  9813. fullColumnMap = this.fullColumnMap;
  9814. var fullColumnIdData = this.fullColumnIdData = {};
  9815. var fullColumnFieldData = this.fullColumnFieldData = {};
  9816. var expandColumn;
  9817. var treeNodeColumn;
  9818. var checkboxColumn;
  9819. var radioColumn;
  9820. var hasFixed;
  9821. var handleFunc = function handleFunc(column, index, items, path, parent) {
  9822. var colid = column.id,
  9823. property = column.property,
  9824. fixed = column.fixed,
  9825. type = column.type,
  9826. treeNode = column.treeNode;
  9827. var rest = {
  9828. column: column,
  9829. colid: colid,
  9830. index: index,
  9831. items: items,
  9832. parent: parent
  9833. };
  9834. if (property) {
  9835. if (fullColumnFieldData[property]) {
  9836. UtilTools.warn('vxe.error.colRepet', ['field', property]);
  9837. }
  9838. fullColumnFieldData[property] = rest;
  9839. }
  9840. if (!hasFixed && fixed) {
  9841. hasFixed = fixed;
  9842. }
  9843. if (treeNode) {
  9844. if (treeNodeColumn) {
  9845. UtilTools.warn('vxe.error.colRepet', ['tree-node', treeNode]);
  9846. }
  9847. if (!treeNodeColumn) {
  9848. treeNodeColumn = column;
  9849. }
  9850. } else if (type === 'expand') {
  9851. if (expandColumn) {
  9852. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9853. }
  9854. if (!expandColumn) {
  9855. expandColumn = column;
  9856. }
  9857. }
  9858. if (type === 'checkbox') {
  9859. if (checkboxColumn) {
  9860. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9861. }
  9862. if (!checkboxColumn) {
  9863. checkboxColumn = column;
  9864. }
  9865. } else if (type === 'radio') {
  9866. if (radioColumn) {
  9867. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9868. }
  9869. if (!radioColumn) {
  9870. radioColumn = column;
  9871. }
  9872. }
  9873. if (fullColumnIdData[colid]) {
  9874. UtilTools.error('vxe.error.colRepet', ['colId', colid]);
  9875. }
  9876. fullColumnIdData[colid] = rest;
  9877. fullColumnMap.set(column, rest);
  9878. };
  9879. fullColumnMap.clear();
  9880. if (isGroup) {
  9881. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent, nodes) {
  9882. column.level = nodes.length;
  9883. handleFunc(column, index, items, path, parent);
  9884. });
  9885. } else {
  9886. tableFullColumn.forEach(handleFunc);
  9887. }
  9888. if (expandColumn && hasFixed) {
  9889. UtilTools.warn('vxe.error.errConflicts', ['column.fixed', 'column.type=expand']);
  9890. }
  9891. if (expandColumn && this.mouseOpts.area) {
  9892. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
  9893. }
  9894. this.treeNodeColumn = treeNodeColumn;
  9895. this.expandColumn = expandColumn;
  9896. },
  9897. /**
  9898. * 根据 tr 元素获取对应的 row 信息
  9899. * @param {Element} tr 元素
  9900. */
  9901. getRowNode: function getRowNode(tr) {
  9902. if (tr) {
  9903. var fullAllDataRowIdData = this.fullAllDataRowIdData;
  9904. var rowid = tr.getAttribute('data-rowid');
  9905. var rest = fullAllDataRowIdData[rowid];
  9906. if (rest) {
  9907. return {
  9908. rowid: rest.rowid,
  9909. item: rest.row,
  9910. index: rest.index,
  9911. items: rest.items,
  9912. parent: rest.parent
  9913. };
  9914. }
  9915. }
  9916. return null;
  9917. },
  9918. /**
  9919. * 根据 th/td 元素获取对应的 column 信息
  9920. * @param {Element} cell 元素
  9921. */
  9922. getColumnNode: function getColumnNode(cell) {
  9923. if (cell) {
  9924. var fullColumnIdData = this.fullColumnIdData;
  9925. var colid = cell.getAttribute('data-colid');
  9926. var rest = fullColumnIdData[colid];
  9927. if (rest) {
  9928. return {
  9929. colid: rest.colid,
  9930. item: rest.column,
  9931. index: rest.index,
  9932. items: rest.items,
  9933. parent: rest.parent
  9934. };
  9935. }
  9936. }
  9937. return null;
  9938. },
  9939. /**
  9940. * 根据 row 获取相对于 data 中的索引
  9941. * @param {Row} row 行对象
  9942. */
  9943. getRowIndex: function getRowIndex(row) {
  9944. return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1;
  9945. },
  9946. /**
  9947. * 根据 row 获取相对于当前数据中的索引
  9948. * @param {Row} row 行对象
  9949. */
  9950. getVTRowIndex: function getVTRowIndex(row) {
  9951. return this.afterFullData.indexOf(row);
  9952. },
  9953. // 在 v3 中废弃
  9954. _getRowIndex: function _getRowIndex(row) {
  9955. UtilTools.warn('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
  9956. return this.getVTRowIndex(row);
  9957. },
  9958. /**
  9959. * 根据 row 获取渲染中的虚拟索引
  9960. * @param {Row} row 行对象
  9961. */
  9962. getVMRowIndex: function getVMRowIndex(row) {
  9963. return this.tableData.indexOf(row);
  9964. },
  9965. // 在 v3 中废弃
  9966. $getRowIndex: function $getRowIndex(row) {
  9967. UtilTools.warn('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
  9968. return this.getVMRowIndex(row);
  9969. },
  9970. /**
  9971. * 根据 column 获取相对于 columns 中的索引
  9972. * @param {ColumnInfo} column 列配置
  9973. */
  9974. getColumnIndex: function getColumnIndex(column) {
  9975. return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1;
  9976. },
  9977. /**
  9978. * 根据 column 获取相对于当前表格列中的索引
  9979. * @param {ColumnInfo} column 列配置
  9980. */
  9981. getVTColumnIndex: function getVTColumnIndex(column) {
  9982. return this.visibleColumn.indexOf(column);
  9983. },
  9984. // 在 v3 中废弃
  9985. _getColumnIndex: function _getColumnIndex(column) {
  9986. UtilTools.warn('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
  9987. return this.getVTColumnIndex(column);
  9988. },
  9989. /**
  9990. * 根据 column 获取渲染中的虚拟索引
  9991. * @param {ColumnInfo} column 列配置
  9992. */
  9993. getVMColumnIndex: function getVMColumnIndex(column) {
  9994. return this.tableColumn.indexOf(column);
  9995. },
  9996. // 在 v3 中废弃
  9997. $getColumnIndex: function $getColumnIndex(column) {
  9998. UtilTools.warn('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
  9999. return this.getVMColumnIndex(column);
  10000. },
  10001. /**
  10002. * 判断是否为索引列
  10003. * @param {ColumnInfo} column 列配置
  10004. */
  10005. isSeqColumn: function isSeqColumn(column) {
  10006. return column && (column.type === 'seq' || column.type === 'index');
  10007. },
  10008. /**
  10009. * 定义行数据中的列属性,如果不存在则定义
  10010. * @param {Row} record 行数据
  10011. */
  10012. defineField: function defineField(record) {
  10013. var radioOpts = this.radioOpts,
  10014. checkboxOpts = this.checkboxOpts,
  10015. treeConfig = this.treeConfig,
  10016. treeOpts = this.treeOpts,
  10017. expandOpts = this.expandOpts;
  10018. var rowkey = getRowkey(this);
  10019. this.visibleColumn.forEach(function (_ref) {
  10020. var property = _ref.property,
  10021. editRender = _ref.editRender;
  10022. if (property && !ctor_amd_xe_utils_default.a.has(record, property)) {
  10023. ctor_amd_xe_utils_default.a.set(record, property, editRender && !ctor_amd_xe_utils_default.a.isUndefined(editRender.defaultValue) ? editRender.defaultValue : null);
  10024. }
  10025. });
  10026. var ohterFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
  10027. ohterFields.forEach(function (key) {
  10028. if (key && UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, key))) {
  10029. ctor_amd_xe_utils_default.a.set(record, key, null);
  10030. }
  10031. });
  10032. if (treeConfig && treeOpts.lazy && ctor_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
  10033. record[treeOpts.children] = null;
  10034. } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
  10035. if (UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, rowkey))) {
  10036. ctor_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
  10037. }
  10038. return record;
  10039. },
  10040. /**
  10041. * 创建 data 对象
  10042. * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
  10043. * @param {Array} records 新数据
  10044. */
  10045. createData: function createData(records) {
  10046. var _this8 = this;
  10047. var treeConfig = this.treeConfig,
  10048. treeOpts = this.treeOpts;
  10049. var handleRrecord = function handleRrecord(record) {
  10050. return _this8.defineField(Object.assign({}, record));
  10051. };
  10052. var rows = treeConfig ? ctor_amd_xe_utils_default.a.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
  10053. return this.$nextTick().then(function () {
  10054. return rows;
  10055. });
  10056. },
  10057. /**
  10058. * 创建 Row|Rows 对象
  10059. * 对于某些特殊场景需要对数据进行手动插入时可能会用到
  10060. * @param {Array/Object} records 新数据
  10061. */
  10062. createRow: function createRow(records) {
  10063. var _this9 = this;
  10064. var isArr = ctor_amd_xe_utils_default.a.isArray(records);
  10065. if (!isArr) {
  10066. records = [records];
  10067. }
  10068. return this.$nextTick().then(function () {
  10069. return _this9.createData(records).then(function (rows) {
  10070. return isArr ? rows : rows[0];
  10071. });
  10072. });
  10073. },
  10074. revert: function revert() {
  10075. UtilTools.warn('vxe.error.delFunc', ['revert', 'revertData']);
  10076. return this.revertData.apply(this, arguments);
  10077. },
  10078. /**
  10079. * 还原数据
  10080. * 如果不传任何参数,则还原整个表格
  10081. * 如果传 row 则还原一行
  10082. * 如果传 rows 则还原多行
  10083. * 如果还额外传了 field 则还原指定的单元格数据
  10084. */
  10085. revertData: function revertData(rows, field) {
  10086. var _this10 = this;
  10087. var tableSourceData = this.tableSourceData,
  10088. treeConfig = this.treeConfig; // 在 v3 中必须要开启 keep-source
  10089. if (!this.keepSource) {
  10090. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  10091. return this.$nextTick();
  10092. }
  10093. var targetRows = rows;
  10094. if (rows) {
  10095. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  10096. targetRows = [rows];
  10097. }
  10098. } else {
  10099. targetRows = ctor_amd_xe_utils_default.a.toArray(this.getUpdateRecords());
  10100. }
  10101. if (targetRows.length) {
  10102. targetRows.forEach(function (row) {
  10103. if (!_this10.isInsertByRow(row)) {
  10104. var rowIndex = _this10.getRowIndex(row);
  10105. if (treeConfig && rowIndex === -1) {
  10106. throw new Error(UtilTools.getLog('vxe.error.noTree', ['revertData']));
  10107. }
  10108. var oRow = tableSourceData[rowIndex];
  10109. if (oRow && row) {
  10110. if (field) {
  10111. ctor_amd_xe_utils_default.a.set(row, field, ctor_amd_xe_utils_default.a.clone(ctor_amd_xe_utils_default.a.get(oRow, field), true));
  10112. } else {
  10113. ctor_amd_xe_utils_default.a.destructuring(row, ctor_amd_xe_utils_default.a.clone(oRow, true));
  10114. }
  10115. }
  10116. }
  10117. });
  10118. }
  10119. if (rows) {
  10120. return this.$nextTick();
  10121. }
  10122. return this.reloadData(tableSourceData);
  10123. },
  10124. /**
  10125. * 清空单元格内容
  10126. * 如果不创参数,则清空整个表格内容
  10127. * 如果传 row 则清空一行内容
  10128. * 如果传 rows 则清空多行内容
  10129. * 如果还额外传了 field 则清空指定单元格内容
  10130. * @param {Array/Row} rows 行数据
  10131. * @param {String} field 字段名
  10132. */
  10133. clearData: function clearData(rows, field) {
  10134. var tableFullData = this.tableFullData,
  10135. visibleColumn = this.visibleColumn;
  10136. if (!arguments.length) {
  10137. rows = tableFullData;
  10138. } else if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
  10139. rows = [rows];
  10140. }
  10141. if (field) {
  10142. rows.forEach(function (row) {
  10143. return ctor_amd_xe_utils_default.a.set(row, field, null);
  10144. });
  10145. } else {
  10146. rows.forEach(function (row) {
  10147. visibleColumn.forEach(function (column) {
  10148. if (column.property) {
  10149. methods_setCellValue(row, column, null);
  10150. }
  10151. });
  10152. });
  10153. }
  10154. return this.$nextTick();
  10155. },
  10156. /**
  10157. * 检查是否为临时行数据
  10158. * @param {Row} row 行对象
  10159. */
  10160. isInsertByRow: function isInsertByRow(row) {
  10161. return this.editStore.insertList.indexOf(row) > -1;
  10162. },
  10163. // 在 v3.0 中废弃 hasRowChange
  10164. hasRowChange: function hasRowChange(row, field) {
  10165. UtilTools.warn('vxe.error.delFunc', ['hasRowChange', 'isUpdateByRow']);
  10166. return this.isUpdateByRow(row, field);
  10167. },
  10168. /**
  10169. * 检查行或列数据是否发生改变
  10170. * @param {Row} row 行对象
  10171. * @param {String} field 字段名
  10172. */
  10173. isUpdateByRow: function isUpdateByRow(row, field) {
  10174. var _this11 = this;
  10175. var visibleColumn = this.visibleColumn,
  10176. keepSource = this.keepSource,
  10177. treeConfig = this.treeConfig,
  10178. treeOpts = this.treeOpts,
  10179. tableSourceData = this.tableSourceData,
  10180. fullDataRowIdData = this.fullDataRowIdData;
  10181. if (keepSource) {
  10182. var oRow, property;
  10183. var rowid = methods_getRowid(this, row); // 新增的数据不需要检测
  10184. if (!fullDataRowIdData[rowid]) {
  10185. return false;
  10186. }
  10187. if (treeConfig) {
  10188. var children = treeOpts.children;
  10189. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  10190. return rowid === methods_getRowid(_this11, item);
  10191. }, treeOpts);
  10192. row = Object.assign({}, row, _defineProperty({}, children, null));
  10193. if (matchObj) {
  10194. oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
  10195. }
  10196. } else {
  10197. var oRowIndex = fullDataRowIdData[rowid].index;
  10198. oRow = tableSourceData[oRowIndex];
  10199. }
  10200. if (oRow) {
  10201. if (arguments.length > 1) {
  10202. return !eqCellValue(oRow, row, field);
  10203. }
  10204. for (var index = 0, len = visibleColumn.length; index < len; index++) {
  10205. property = visibleColumn[index].property;
  10206. if (property && !eqCellValue(oRow, row, property)) {
  10207. return true;
  10208. }
  10209. }
  10210. }
  10211. }
  10212. return false;
  10213. },
  10214. /**
  10215. * 获取表格的可视列,也可以指定索引获取列
  10216. * @param {Number} columnIndex 索引
  10217. */
  10218. getColumns: function getColumns(columnIndex) {
  10219. var columns = this.visibleColumn;
  10220. return arguments.length ? columns[columnIndex] : columns.slice(0);
  10221. },
  10222. /**
  10223. * 根据列的唯一主键获取列
  10224. * @param {String} colid 列主键
  10225. */
  10226. getColumnById: function getColumnById(colid) {
  10227. var fullColumnIdData = this.fullColumnIdData;
  10228. return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
  10229. },
  10230. /**
  10231. * 根据列的字段名获取列
  10232. * @param {String} field 字段名
  10233. */
  10234. getColumnByField: function getColumnByField(field) {
  10235. var fullColumnFieldData = this.fullColumnFieldData;
  10236. return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
  10237. },
  10238. /**
  10239. * 获取当前表格的列
  10240. * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
  10241. */
  10242. getTableColumn: function getTableColumn() {
  10243. return {
  10244. collectColumn: this.collectColumn.slice(0),
  10245. fullColumn: this.tableFullColumn.slice(0),
  10246. visibleColumn: this.visibleColumn.slice(0),
  10247. tableColumn: this.tableColumn.slice(0)
  10248. };
  10249. },
  10250. // 在 v3.0 中废弃 getRecords
  10251. getRecords: function getRecords() {
  10252. UtilTools.warn('vxe.error.delFunc', ['getRecords', 'getData']);
  10253. return this.getData.apply(this, arguments);
  10254. },
  10255. /**
  10256. * 获取数据,和 data 的行为一致,也可以指定索引获取数据
  10257. */
  10258. getData: function getData(rowIndex) {
  10259. var tableSynchData = this.data || this.tableSynchData;
  10260. return arguments.length ? tableSynchData[rowIndex] : tableSynchData.slice(0);
  10261. },
  10262. // 在 v3.0 中废弃 getAllRecords
  10263. getAllRecords: function getAllRecords() {
  10264. UtilTools.warn('vxe.error.delFunc', ['getAllRecords', 'getRecordset']);
  10265. return this.getRecordset();
  10266. },
  10267. // 在 v3.0 中废弃 getSelectRecords
  10268. getSelectRecords: function getSelectRecords() {
  10269. UtilTools.warn('vxe.error.delFunc', ['getSelectRecords', 'getCheckboxRecords']);
  10270. return this.getCheckboxRecords();
  10271. },
  10272. /**
  10273. * 用于多选行,获取已选中的数据
  10274. */
  10275. getCheckboxRecords: function getCheckboxRecords() {
  10276. var tableFullData = this.tableFullData,
  10277. treeConfig = this.treeConfig,
  10278. treeOpts = this.treeOpts,
  10279. checkboxOpts = this.checkboxOpts;
  10280. var property = checkboxOpts.checkField;
  10281. var rowList = [];
  10282. if (property) {
  10283. if (treeConfig) {
  10284. rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10285. return ctor_amd_xe_utils_default.a.get(row, property);
  10286. }, treeOpts);
  10287. } else {
  10288. rowList = tableFullData.filter(function (row) {
  10289. return ctor_amd_xe_utils_default.a.get(row, property);
  10290. });
  10291. }
  10292. } else {
  10293. var selection = this.selection;
  10294. if (treeConfig) {
  10295. rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10296. return selection.indexOf(row) > -1;
  10297. }, treeOpts);
  10298. } else {
  10299. rowList = tableFullData.filter(function (row) {
  10300. return selection.indexOf(row) > -1;
  10301. });
  10302. }
  10303. }
  10304. return rowList;
  10305. },
  10306. /**
  10307. * 获取处理后全量的表格数据
  10308. * 如果存在筛选条件,继续处理
  10309. */
  10310. updateAfterFullData: function updateAfterFullData() {
  10311. var _this12 = this;
  10312. var tableFullColumn = this.tableFullColumn,
  10313. tableFullData = this.tableFullData,
  10314. remoteSort = this.remoteSort,
  10315. remoteFilter = this.remoteFilter,
  10316. filterOpts = this.filterOpts,
  10317. sortOpts = this.sortOpts;
  10318. var tableData = tableFullData.slice(0);
  10319. var column = ctor_amd_xe_utils_default.a.find(tableFullColumn, function (column) {
  10320. return column.order;
  10321. });
  10322. var filterColumns = [];
  10323. var orderColumns = [];
  10324. tableFullColumn.forEach(function (column) {
  10325. if (column.filters && column.filters.length) {
  10326. var valueList = [];
  10327. var itemList = [];
  10328. column.filters.forEach(function (item) {
  10329. if (item.checked) {
  10330. itemList.push(item);
  10331. valueList.push(item.value);
  10332. }
  10333. });
  10334. filterColumns.push({
  10335. column: column,
  10336. valueList: valueList,
  10337. itemList: itemList
  10338. });
  10339. }
  10340. if (column.sortable && column.order) {
  10341. orderColumns.push({
  10342. column: column,
  10343. sortBy: column.sortBy,
  10344. property: column.property,
  10345. order: column.order
  10346. });
  10347. }
  10348. });
  10349. if (filterColumns.length) {
  10350. tableData = tableData.filter(function (row) {
  10351. return filterColumns.every(function (_ref2) {
  10352. var column = _ref2.column,
  10353. valueList = _ref2.valueList,
  10354. itemList = _ref2.itemList;
  10355. if (valueList.length && !(filterOpts.remote || remoteFilter)) {
  10356. var filterRender = column.filterRender,
  10357. property = column.property;
  10358. var filterMethod = column.filterMethod;
  10359. var allFilterMethod = filterOpts.filterMethod;
  10360. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  10361. var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
  10362. var defaultFilterMethod = compConf ? compConf.defaultFilterMethod : null;
  10363. var cellValue = UtilTools.getCellValue(row, column);
  10364. if (filterMethod) {
  10365. return itemList.some(function (item) {
  10366. return filterMethod({
  10367. value: item.value,
  10368. option: item,
  10369. cellValue: cellValue,
  10370. row: row,
  10371. column: column,
  10372. $table: _this12
  10373. });
  10374. });
  10375. } else if (compFilterMethod) {
  10376. return itemList.some(function (item) {
  10377. return compFilterMethod({
  10378. value: item.value,
  10379. option: item,
  10380. cellValue: cellValue,
  10381. row: row,
  10382. column: column,
  10383. $table: _this12
  10384. });
  10385. });
  10386. } else if (allFilterMethod) {
  10387. return allFilterMethod({
  10388. options: itemList,
  10389. values: valueList,
  10390. cellValue: cellValue,
  10391. row: row,
  10392. column: column
  10393. });
  10394. } else if (defaultFilterMethod) {
  10395. return itemList.some(function (item) {
  10396. return defaultFilterMethod({
  10397. value: item.value,
  10398. option: item,
  10399. cellValue: cellValue,
  10400. row: row,
  10401. column: column,
  10402. $table: _this12
  10403. });
  10404. });
  10405. }
  10406. return valueList.indexOf(ctor_amd_xe_utils_default.a.get(row, property)) > -1;
  10407. }
  10408. return true;
  10409. });
  10410. });
  10411. }
  10412. if (column && column.order) {
  10413. var allSortMethod = sortOpts.sortMethod || this.sortMethod;
  10414. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote || remoteSort;
  10415. if (!isRemote) {
  10416. if (allSortMethod) {
  10417. tableData = allSortMethod({
  10418. data: tableData,
  10419. column: column,
  10420. property: column.property,
  10421. order: column.order,
  10422. sortList: orderColumns,
  10423. $table: this
  10424. }) || tableData;
  10425. } else {
  10426. var rest = column.sortMethod ? tableData.sort(column.sortMethod) : ctor_amd_xe_utils_default.a.orderBy(tableData, getOrderField(this, column));
  10427. tableData = column.order === 'desc' ? rest.reverse() : rest;
  10428. }
  10429. }
  10430. }
  10431. this.afterFullData = tableData;
  10432. return tableData;
  10433. },
  10434. /**
  10435. * 根据行的唯一主键获取行
  10436. * @param {String/Number} rowid 行主键
  10437. */
  10438. getRowById: function getRowById(rowid) {
  10439. var fullDataRowIdData = this.fullDataRowIdData;
  10440. return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
  10441. },
  10442. /**
  10443. * 根据行获取行的唯一主键
  10444. * @param {Row} row 行对象
  10445. */
  10446. getRowid: function getRowid(row) {
  10447. var fullAllDataRowMap = this.fullAllDataRowMap;
  10448. return fullAllDataRowMap.has(row) ? fullAllDataRowMap.get(row).rowid : null;
  10449. },
  10450. /**
  10451. * 获取处理后的表格数据
  10452. * 如果存在筛选条件,继续处理
  10453. * 如果存在排序,继续处理
  10454. */
  10455. getTableData: function getTableData() {
  10456. var tableFullData = this.tableFullData,
  10457. afterFullData = this.afterFullData,
  10458. tableData = this.tableData,
  10459. footerTableData = this.footerTableData;
  10460. return {
  10461. fullData: tableFullData.slice(0),
  10462. visibleData: afterFullData.slice(0),
  10463. tableData: tableData.slice(0),
  10464. footerData: footerTableData.slice(0)
  10465. };
  10466. },
  10467. /**
  10468. * 默认行为只允许执行一次
  10469. */
  10470. handleDefaults: function handleDefaults() {
  10471. var _this13 = this;
  10472. // 在 v3.0 中废弃 selectConfig
  10473. var checkboxConfig = this.checkboxConfig || this.selectConfig;
  10474. if (checkboxConfig) {
  10475. this.handleDefaultSelectionChecked();
  10476. }
  10477. if (this.radioConfig) {
  10478. this.handleDefaultRadioChecked();
  10479. }
  10480. if (this.sortConfig) {
  10481. this.handleDefaultSort();
  10482. }
  10483. if (this.expandConfig) {
  10484. this.handleDefaultRowExpand();
  10485. }
  10486. if (this.treeConfig) {
  10487. this.handleDefaultTreeExpand();
  10488. }
  10489. if (this.mergeCells) {
  10490. this.handleDefaultMergeCells();
  10491. }
  10492. if (this.mergeFooterItems) {
  10493. this.handleDefaultMergeFooterItems();
  10494. }
  10495. this.$nextTick(function () {
  10496. return setTimeout(_this13.recalculate);
  10497. });
  10498. },
  10499. /**
  10500. * 动态列处理
  10501. */
  10502. mergeCustomColumn: function mergeCustomColumn(customColumns) {
  10503. var tableFullColumn = this.tableFullColumn;
  10504. this.isUpdateCustoms = true;
  10505. if (customColumns.length) {
  10506. tableFullColumn.forEach(function (column) {
  10507. // 在 v3.0 中废弃 prop
  10508. var item = ctor_amd_xe_utils_default.a.find(customColumns, function (item) {
  10509. return column.property && (item.field || item.prop) === column.property;
  10510. });
  10511. if (item) {
  10512. if (ctor_amd_xe_utils_default.a.isNumber(item.resizeWidth)) {
  10513. column.resizeWidth = item.resizeWidth;
  10514. }
  10515. if (ctor_amd_xe_utils_default.a.isBoolean(item.visible)) {
  10516. column.visible = item.visible;
  10517. }
  10518. }
  10519. });
  10520. }
  10521. this.emitEvent('update:customs', tableFullColumn);
  10522. },
  10523. /**
  10524. * 手动重置列的所有操作,还原到初始状态
  10525. * 如果已关联工具栏,则会同步更新
  10526. */
  10527. resetAll: function resetAll() {
  10528. UtilTools.warn('vxe.error.delFunc', ['resetAll', 'resetColumn']);
  10529. this.resetColumn(true);
  10530. },
  10531. /**
  10532. * 隐藏指定列
  10533. * @param {ColumnInfo} column 列配置
  10534. */
  10535. hideColumn: function hideColumn(column) {
  10536. column.visible = false;
  10537. return this.handleCustom();
  10538. },
  10539. /**
  10540. * 显示指定列
  10541. * @param {ColumnInfo} column 列配置
  10542. */
  10543. showColumn: function showColumn(column) {
  10544. column.visible = true;
  10545. return this.handleCustom();
  10546. },
  10547. /**
  10548. * 手动重置列的显示隐藏、列宽拖动的状态;
  10549. * 如果为 true 则重置所有状态
  10550. * 如果已关联工具栏,则会同步更新
  10551. */
  10552. resetColumn: function resetColumn(options) {
  10553. var customOpts = this.customOpts;
  10554. var checkMethod = customOpts.checkMethod;
  10555. var opts = Object.assign({
  10556. visible: true,
  10557. resizable: options === true
  10558. }, options);
  10559. this.tableFullColumn.forEach(function (column) {
  10560. if (opts.resizable) {
  10561. column.resizeWidth = 0;
  10562. }
  10563. if (!checkMethod || checkMethod({
  10564. column: column
  10565. })) {
  10566. column.visible = column.defaultVisible;
  10567. }
  10568. });
  10569. if (opts.resizable) {
  10570. this.saveCustomResizable(true);
  10571. }
  10572. return this.handleCustom();
  10573. },
  10574. handleCustom: function handleCustom() {
  10575. this.saveCustomVisible();
  10576. this.analyColumnWidth();
  10577. return this.refreshColumn();
  10578. },
  10579. resetResizable: function resetResizable() {
  10580. UtilTools.warn('vxe.error.delFunc', ['resetResizable', 'resetColumn']);
  10581. return this.resetColumn();
  10582. },
  10583. /**
  10584. * 已废弃的方法
  10585. */
  10586. reloadCustoms: function reloadCustoms(customColumns) {
  10587. var _this14 = this;
  10588. UtilTools.warn('vxe.error.delFunc', ['reloadCustoms', 'column.visible & refreshColumn']);
  10589. return this.$nextTick().then(function () {
  10590. _this14.mergeCustomColumn(customColumns);
  10591. return _this14.refreshColumn().then(function () {
  10592. return _this14.tableFullColumn;
  10593. });
  10594. });
  10595. },
  10596. /**
  10597. * 还原自定义列操作状态
  10598. */
  10599. restoreCustomStorage: function restoreCustomStorage() {
  10600. var $toolbar = this.$toolbar,
  10601. collectColumn = this.collectColumn,
  10602. customConfig = this.customConfig,
  10603. customOpts = this.customOpts;
  10604. var storage = customOpts.storage;
  10605. var isAllStorage = customOpts.storage === true;
  10606. var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage;
  10607. var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10608. if ((customConfig || $toolbar) && (isResizable || isVisible)) {
  10609. // 在 v3.0 中废弃 toolbar.id
  10610. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10611. var customMap = {};
  10612. if (!id) {
  10613. UtilTools.error('vxe.error.reqProp', ['id']);
  10614. return;
  10615. }
  10616. if (isResizable) {
  10617. var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
  10618. if (columnWidthStorage) {
  10619. ctor_amd_xe_utils_default.a.each(columnWidthStorage, function (resizeWidth, field) {
  10620. customMap[field] = {
  10621. field: field,
  10622. resizeWidth: resizeWidth
  10623. };
  10624. });
  10625. }
  10626. }
  10627. if (isVisible) {
  10628. var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
  10629. if (columnVisibleStorage) {
  10630. var colVisibles = columnVisibleStorage.split('|');
  10631. var colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
  10632. var colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
  10633. colHides.forEach(function (field) {
  10634. if (customMap[field]) {
  10635. customMap[field].visible = false;
  10636. } else {
  10637. customMap[field] = {
  10638. field: field,
  10639. visible: false
  10640. };
  10641. }
  10642. });
  10643. colShows.forEach(function (field) {
  10644. if (customMap[field]) {
  10645. customMap[field].visible = true;
  10646. } else {
  10647. customMap[field] = {
  10648. field: field,
  10649. visible: true
  10650. };
  10651. }
  10652. });
  10653. }
  10654. }
  10655. var keyMap = {};
  10656. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10657. var colKey = column.getKey();
  10658. if (colKey) {
  10659. keyMap[colKey] = column;
  10660. }
  10661. });
  10662. ctor_amd_xe_utils_default.a.each(customMap, function (_ref3, field) {
  10663. var visible = _ref3.visible,
  10664. resizeWidth = _ref3.resizeWidth;
  10665. var column = keyMap[field];
  10666. if (column) {
  10667. if (ctor_amd_xe_utils_default.a.isNumber(resizeWidth)) {
  10668. column.resizeWidth = resizeWidth;
  10669. }
  10670. if (ctor_amd_xe_utils_default.a.isBoolean(visible)) {
  10671. column.visible = visible;
  10672. }
  10673. }
  10674. });
  10675. }
  10676. },
  10677. saveCustomVisible: function saveCustomVisible() {
  10678. var $toolbar = this.$toolbar,
  10679. collectColumn = this.collectColumn,
  10680. customConfig = this.customConfig,
  10681. customOpts = this.customOpts;
  10682. var checkMethod = customOpts.checkMethod,
  10683. storage = customOpts.storage;
  10684. var isAllStorage = customOpts.storage === true;
  10685. var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10686. if ((customConfig || $toolbar) && isVisible) {
  10687. // 在 v3.0 中废弃 toolbar.id
  10688. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10689. var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
  10690. var colHides = [];
  10691. var colShows = [];
  10692. if (!id) {
  10693. UtilTools.error('vxe.error.reqProp', ['id']);
  10694. return;
  10695. }
  10696. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10697. if (!checkMethod || checkMethod({
  10698. column: column
  10699. })) {
  10700. if (!column.visible && column.defaultVisible) {
  10701. var colKey = column.getKey();
  10702. if (colKey) {
  10703. colHides.push(colKey);
  10704. }
  10705. } else if (column.visible && !column.defaultVisible) {
  10706. var _colKey = column.getKey();
  10707. if (_colKey) {
  10708. colShows.push(_colKey);
  10709. }
  10710. }
  10711. }
  10712. });
  10713. columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined;
  10714. localStorage.setItem(visibleStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
  10715. }
  10716. },
  10717. saveCustomResizable: function saveCustomResizable(isReset) {
  10718. var $toolbar = this.$toolbar,
  10719. collectColumn = this.collectColumn,
  10720. customConfig = this.customConfig,
  10721. customOpts = this.customOpts;
  10722. var storage = customOpts.storage;
  10723. var isAllStorage = customOpts.storage === true;
  10724. var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10725. if ((customConfig || $toolbar) && isResizable) {
  10726. // 在 v3.0 中废弃 toolbar.id
  10727. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10728. var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
  10729. var columnWidthStorage;
  10730. if (!id) {
  10731. UtilTools.error('vxe.error.reqProp', ['id']);
  10732. return;
  10733. }
  10734. if (!isReset) {
  10735. columnWidthStorage = ctor_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
  10736. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10737. if (column.resizeWidth) {
  10738. var colKey = column.getKey();
  10739. if (colKey) {
  10740. columnWidthStorage[colKey] = column.renderWidth;
  10741. }
  10742. }
  10743. });
  10744. }
  10745. columnWidthStorageMap[id] = ctor_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
  10746. localStorage.setItem(resizableStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
  10747. }
  10748. },
  10749. /**
  10750. * 刷新列信息
  10751. * 将固定的列左边、右边分别靠边
  10752. */
  10753. refreshColumn: function refreshColumn() {
  10754. var _this15 = this;
  10755. var leftList = [];
  10756. var centerList = [];
  10757. var rightList = [];
  10758. var collectColumn = this.collectColumn,
  10759. tableFullColumn = this.tableFullColumn,
  10760. isGroup = this.isGroup,
  10761. columnStore = this.columnStore,
  10762. sXOpts = this.sXOpts,
  10763. scrollXStore = this.scrollXStore; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
  10764. if (isGroup) {
  10765. var leftGroupList = [];
  10766. var centerGroupList = [];
  10767. var rightGroupList = [];
  10768. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent) {
  10769. var isColGroup = hasChildrenList(column); // 如果是分组,必须按组设置固定列,不允许给子列设置固定
  10770. if (parent && parent.fixed) {
  10771. column.fixed = parent.fixed;
  10772. }
  10773. if (parent && column.fixed !== parent.fixed) {
  10774. UtilTools.error('vxe.error.groupFixed');
  10775. }
  10776. if (isColGroup) {
  10777. column.visible = !!ctor_amd_xe_utils_default.a.findTree(column.children, function (subColumn) {
  10778. return hasChildrenList(subColumn) ? null : subColumn.visible;
  10779. });
  10780. } else if (column.visible) {
  10781. if (column.fixed === 'left') {
  10782. leftList.push(column);
  10783. } else if (column.fixed === 'right') {
  10784. rightList.push(column);
  10785. } else {
  10786. centerList.push(column);
  10787. }
  10788. }
  10789. });
  10790. collectColumn.forEach(function (column) {
  10791. if (column.visible) {
  10792. if (column.fixed === 'left') {
  10793. leftGroupList.push(column);
  10794. } else if (column.fixed === 'right') {
  10795. rightGroupList.push(column);
  10796. } else {
  10797. centerGroupList.push(column);
  10798. }
  10799. }
  10800. });
  10801. this.tableGroupColumn = leftGroupList.concat(centerGroupList).concat(rightGroupList);
  10802. } else {
  10803. // 重新分配列
  10804. tableFullColumn.forEach(function (column) {
  10805. if (column.visible) {
  10806. if (column.fixed === 'left') {
  10807. leftList.push(column);
  10808. } else if (column.fixed === 'right') {
  10809. rightList.push(column);
  10810. } else {
  10811. centerList.push(column);
  10812. }
  10813. }
  10814. });
  10815. }
  10816. var visibleColumn = leftList.concat(centerList).concat(rightList);
  10817. var tableColumn = visibleColumn;
  10818. var scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
  10819. Object.assign(columnStore, {
  10820. leftList: leftList,
  10821. centerList: centerList,
  10822. rightList: rightList
  10823. });
  10824. if (scrollXLoad && isGroup) {
  10825. scrollXLoad = false;
  10826. UtilTools.warn('vxe.error.scrollXNotGroup');
  10827. }
  10828. if (scrollXLoad) {
  10829. if (this.showHeader && !this.showHeaderOverflow) {
  10830. UtilTools.warn('vxe.error.reqProp', ['show-header-overflow']);
  10831. }
  10832. if (this.showFooter && !this.showFooterOverflow) {
  10833. UtilTools.warn('vxe.error.reqProp', ['show-footer-overflow']);
  10834. }
  10835. if (this.spanMethod) {
  10836. UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
  10837. }
  10838. if (this.footerSpanMethod) {
  10839. UtilTools.warn('vxe.error.scrollErrProp', ['footer-span-method']);
  10840. }
  10841. Object.assign(scrollXStore, {
  10842. startIndex: 0,
  10843. visibleIndex: 0
  10844. });
  10845. tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
  10846. } // 如果列被显示/隐藏,则清除合并状态
  10847. // 如果列被设置为固定,则清除合并状态
  10848. if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
  10849. return column === visibleColumn[index];
  10850. })) {
  10851. this.clearMergeCells();
  10852. this.clearMergeFooterItems();
  10853. }
  10854. this.scrollXLoad = scrollXLoad;
  10855. this.tableColumn = tableColumn;
  10856. this.visibleColumn = visibleColumn;
  10857. return this.$nextTick().then(function () {
  10858. _this15.updateFooter();
  10859. return _this15.recalculate(true);
  10860. }).then(function () {
  10861. _this15.updateCellAreas();
  10862. return _this15.$nextTick().then(function () {
  10863. return _this15.recalculate();
  10864. });
  10865. });
  10866. },
  10867. /**
  10868. * 指定列宽的列进行拆分
  10869. */
  10870. analyColumnWidth: function analyColumnWidth() {
  10871. var columnWidth = this.columnWidth,
  10872. columnMinWidth = this.columnMinWidth,
  10873. columnOpts = this.columnOpts; // 在 v3.0 中废弃 columnWidth
  10874. var defaultWidth = columnOpts.width || columnWidth; // 在 v3.0 中废弃 columnMinWidth
  10875. var defaultMinWidth = columnOpts.minWidth || columnMinWidth;
  10876. var resizeList = [];
  10877. var pxList = [];
  10878. var pxMinList = [];
  10879. var scaleList = [];
  10880. var scaleMinList = [];
  10881. var autoList = [];
  10882. this.tableFullColumn.forEach(function (column) {
  10883. if (defaultWidth && !column.width) {
  10884. column.width = defaultWidth;
  10885. }
  10886. if (defaultMinWidth && !column.minWidth) {
  10887. column.minWidth = defaultMinWidth;
  10888. }
  10889. if (column.visible) {
  10890. if (column.resizeWidth) {
  10891. resizeList.push(column);
  10892. } else if (DomTools.isPx(column.width)) {
  10893. pxList.push(column);
  10894. } else if (DomTools.isScale(column.width)) {
  10895. scaleList.push(column);
  10896. } else if (DomTools.isPx(column.minWidth)) {
  10897. pxMinList.push(column);
  10898. } else if (DomTools.isScale(column.minWidth)) {
  10899. scaleMinList.push(column);
  10900. } else {
  10901. autoList.push(column);
  10902. }
  10903. }
  10904. });
  10905. Object.assign(this.columnStore, {
  10906. resizeList: resizeList,
  10907. pxList: pxList,
  10908. pxMinList: pxMinList,
  10909. scaleList: scaleList,
  10910. scaleMinList: scaleMinList,
  10911. autoList: autoList
  10912. });
  10913. },
  10914. /**
  10915. * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
  10916. */
  10917. refreshScroll: function refreshScroll() {
  10918. var _this16 = this;
  10919. var lastScrollLeft = this.lastScrollLeft,
  10920. lastScrollTop = this.lastScrollTop;
  10921. return this.clearScroll().then(function () {
  10922. if (lastScrollLeft || lastScrollTop) {
  10923. // 重置最后滚动状态
  10924. _this16.lastScrollLeft = 0;
  10925. _this16.lastScrollTop = 0; // 还原滚动状态
  10926. return _this16.scrollTo(lastScrollLeft, lastScrollTop);
  10927. }
  10928. });
  10929. },
  10930. /**
  10931. * 计算单元格列宽,动态分配可用剩余空间
  10932. * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
  10933. */
  10934. recalculate: function recalculate(refull) {
  10935. var _this17 = this;
  10936. var $refs = this.$refs;
  10937. var tableBody = $refs.tableBody,
  10938. tableHeader = $refs.tableHeader,
  10939. tableFooter = $refs.tableFooter;
  10940. var bodyElem = tableBody ? tableBody.$el : null;
  10941. var headerElem = tableHeader ? tableHeader.$el : null;
  10942. var footerElem = tableFooter ? tableFooter.$el : null;
  10943. if (bodyElem) {
  10944. this.autoCellWidth(headerElem, bodyElem, footerElem);
  10945. if (refull === true) {
  10946. // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
  10947. return this.computeScrollLoad().then(function () {
  10948. _this17.autoCellWidth(headerElem, bodyElem, footerElem);
  10949. _this17.computeScrollLoad();
  10950. });
  10951. }
  10952. }
  10953. return this.computeScrollLoad();
  10954. },
  10955. /**
  10956. * 列宽算法
  10957. * 支持 px、%、固定 混合分配
  10958. * 支持动态列表调整分配
  10959. * 支持自动分配偏移量
  10960. * @param {Element} headerElem
  10961. * @param {Element} bodyElem
  10962. * @param {Element} footerElem
  10963. * @param {Number} bodyWidth
  10964. */
  10965. autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) {
  10966. var tableWidth = 0;
  10967. var minCellWidth = 40; // 列宽最少限制 40px
  10968. var bodyWidth = bodyElem.clientWidth;
  10969. var remainWidth = bodyWidth;
  10970. var meanWidth = remainWidth / 100;
  10971. var fit = this.fit,
  10972. columnStore = this.columnStore;
  10973. var resizeList = columnStore.resizeList,
  10974. pxMinList = columnStore.pxMinList,
  10975. pxList = columnStore.pxList,
  10976. scaleList = columnStore.scaleList,
  10977. scaleMinList = columnStore.scaleMinList,
  10978. autoList = columnStore.autoList; // 最小宽
  10979. pxMinList.forEach(function (column) {
  10980. var minWidth = parseInt(column.minWidth);
  10981. tableWidth += minWidth;
  10982. column.renderWidth = minWidth;
  10983. }); // 最小百分比
  10984. scaleMinList.forEach(function (column) {
  10985. var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth);
  10986. tableWidth += scaleWidth;
  10987. column.renderWidth = scaleWidth;
  10988. }); // 固定百分比
  10989. scaleList.forEach(function (column) {
  10990. var scaleWidth = Math.floor(parseInt(column.width) * meanWidth);
  10991. tableWidth += scaleWidth;
  10992. column.renderWidth = scaleWidth;
  10993. }); // 固定宽
  10994. pxList.forEach(function (column) {
  10995. var width = parseInt(column.width);
  10996. tableWidth += width;
  10997. column.renderWidth = width;
  10998. }); // 调整了列宽
  10999. resizeList.forEach(function (column) {
  11000. var width = parseInt(column.resizeWidth);
  11001. tableWidth += width;
  11002. column.renderWidth = width;
  11003. });
  11004. remainWidth -= tableWidth;
  11005. meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0;
  11006. if (fit) {
  11007. if (remainWidth > 0) {
  11008. scaleMinList.concat(pxMinList).forEach(function (column) {
  11009. tableWidth += meanWidth;
  11010. column.renderWidth += meanWidth;
  11011. });
  11012. }
  11013. } else {
  11014. meanWidth = minCellWidth;
  11015. } // 自适应
  11016. autoList.forEach(function (column) {
  11017. var width = Math.max(meanWidth, minCellWidth);
  11018. column.renderWidth = width;
  11019. tableWidth += width;
  11020. });
  11021. if (fit) {
  11022. /**
  11023. * 偏移量算法
  11024. * 如果所有列足够放的情况下,从最后动态列开始分配
  11025. */
  11026. var dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoList);
  11027. var dynamicSize = dynamicList.length - 1;
  11028. if (dynamicSize > 0) {
  11029. var odiffer = bodyWidth - tableWidth;
  11030. if (odiffer > 0) {
  11031. while (odiffer > 0 && dynamicSize >= 0) {
  11032. odiffer--;
  11033. dynamicList[dynamicSize--].renderWidth++;
  11034. }
  11035. tableWidth = bodyWidth;
  11036. }
  11037. }
  11038. }
  11039. var tableHeight = bodyElem.offsetHeight;
  11040. var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight;
  11041. this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyWidth : 0;
  11042. this.overflowY = overflowY;
  11043. this.tableWidth = tableWidth;
  11044. this.tableHeight = tableHeight;
  11045. if (headerElem) {
  11046. this.headerHeight = headerElem.clientHeight; // 检测是否同步滚动
  11047. if (headerElem.scrollLeft !== bodyElem.scrollLeft) {
  11048. headerElem.scrollLeft = bodyElem.scrollLeft;
  11049. }
  11050. } else {
  11051. this.headerHeight = 0;
  11052. }
  11053. if (footerElem) {
  11054. var footerHeight = footerElem.offsetHeight;
  11055. this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0);
  11056. this.overflowX = tableWidth > footerElem.clientWidth;
  11057. this.footerHeight = footerHeight;
  11058. } else {
  11059. this.footerHeight = 0;
  11060. this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0);
  11061. this.overflowX = tableWidth > bodyWidth;
  11062. }
  11063. this.customHeight = methods_calcHeight(this, 'height');
  11064. this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
  11065. this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
  11066. if (this.overflowX) {
  11067. this.checkScrolling();
  11068. }
  11069. },
  11070. updateStyle: function updateStyle() {
  11071. var _this18 = this;
  11072. var $refs = this.$refs,
  11073. isGroup = this.isGroup,
  11074. fullColumnIdData = this.fullColumnIdData,
  11075. tableColumn = this.tableColumn,
  11076. customHeight = this.customHeight,
  11077. customMaxHeight = this.customMaxHeight,
  11078. border = this.border,
  11079. headerHeight = this.headerHeight,
  11080. showFooter = this.showFooter,
  11081. allColumnOverflow = this.showOverflow,
  11082. allColumnHeaderOverflow = this.showHeaderOverflow,
  11083. allColumnFooterOverflow = this.showFooterOverflow,
  11084. footerHeight = this.footerHeight,
  11085. tableHeight = this.tableHeight,
  11086. tableWidth = this.tableWidth,
  11087. scrollbarHeight = this.scrollbarHeight,
  11088. scrollbarWidth = this.scrollbarWidth,
  11089. scrollXLoad = this.scrollXLoad,
  11090. scrollYLoad = this.scrollYLoad,
  11091. cellOffsetWidth = this.cellOffsetWidth,
  11092. columnStore = this.columnStore,
  11093. elemStore = this.elemStore,
  11094. editStore = this.editStore,
  11095. currentRow = this.currentRow,
  11096. mouseConfig = this.mouseConfig;
  11097. var containerList = ['main', 'left', 'right'];
  11098. var emptyPlaceholderElem = $refs.emptyPlaceholder;
  11099. var bodyWrapperElem = elemStore['main-body-wrapper'];
  11100. if (emptyPlaceholderElem) {
  11101. emptyPlaceholderElem.style.top = "".concat(headerHeight, "px");
  11102. emptyPlaceholderElem.style.height = bodyWrapperElem ? "".concat(bodyWrapperElem.offsetHeight - scrollbarHeight, "px") : '';
  11103. }
  11104. if (customHeight > 0) {
  11105. if (showFooter) {
  11106. customHeight += scrollbarHeight;
  11107. }
  11108. }
  11109. containerList.forEach(function (name, index) {
  11110. var fixedType = index > 0 ? name : '';
  11111. var layoutList = ['header', 'body', 'footer'];
  11112. var fixedColumn = columnStore["".concat(fixedType, "List")];
  11113. var fixedWrapperElem = $refs["".concat(fixedType, "Container")];
  11114. layoutList.forEach(function (layout) {
  11115. var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")];
  11116. var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")];
  11117. if (layout === 'header') {
  11118. // 表头体样式处理
  11119. // 横向滚动渲染
  11120. var tWidth = tableWidth;
  11121. if (scrollXLoad) {
  11122. if (fixedType) {
  11123. tableColumn = fixedColumn;
  11124. }
  11125. tWidth = tableColumn.reduce(function (previous, column) {
  11126. return previous + column.renderWidth;
  11127. }, 0);
  11128. }
  11129. if (tableElem) {
  11130. tableElem.style.width = tWidth ? "".concat(tWidth + scrollbarWidth, "px") : ''; // 修复 IE 中高度无法自适应问题
  11131. if (methods_browse.msie) {
  11132. ctor_amd_xe_utils_default.a.arrayEach(tableElem.querySelectorAll('.vxe-resizable'), function (resizeElem) {
  11133. resizeElem.style.height = "".concat(resizeElem.parentNode.offsetHeight, "px");
  11134. });
  11135. }
  11136. }
  11137. var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")];
  11138. if (repairElem) {
  11139. repairElem.style.width = "".concat(tableWidth, "px");
  11140. }
  11141. var listElem = elemStore["".concat(name, "-").concat(layout, "-list")];
  11142. if (isGroup && listElem) {
  11143. // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
  11144. // thElem.style.width = `${scrollbarWidth}px`
  11145. // })
  11146. ctor_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
  11147. var colNode = _this18.getColumnNode(thElem);
  11148. if (colNode) {
  11149. var column = colNode.item;
  11150. var showHeaderOverflow = column.showHeaderOverflow;
  11151. var cellOverflow = ctor_amd_xe_utils_default.a.isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
  11152. var showEllipsis = cellOverflow === 'ellipsis';
  11153. var showTitle = cellOverflow === 'title';
  11154. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11155. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11156. var childWidth = 0;
  11157. var countChild = 0;
  11158. if (hasEllipsis) {
  11159. ctor_amd_xe_utils_default.a.eachTree(column.children, function (item) {
  11160. if (!item.children || !column.children.length) {
  11161. countChild++;
  11162. }
  11163. childWidth += item.renderWidth;
  11164. });
  11165. }
  11166. thElem.style.width = hasEllipsis ? "".concat(childWidth - countChild - (border ? 2 : 0), "px") : '';
  11167. }
  11168. });
  11169. }
  11170. } else if (layout === 'body') {
  11171. var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
  11172. if (wrapperElem) {
  11173. if (customMaxHeight > 0) {
  11174. wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
  11175. } else {
  11176. if (customHeight > 0) {
  11177. wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
  11178. } else {
  11179. wrapperElem.style.height = '';
  11180. }
  11181. }
  11182. } // 如果是固定列
  11183. if (fixedWrapperElem) {
  11184. var isRightFixed = fixedType === 'right';
  11185. var _fixedColumn = columnStore["".concat(fixedType, "List")];
  11186. if (wrapperElem) {
  11187. wrapperElem.style.top = "".concat(headerHeight, "px");
  11188. }
  11189. fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px");
  11190. fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) {
  11191. return previous + column.renderWidth;
  11192. }, isRightFixed ? scrollbarWidth : 0), "px");
  11193. }
  11194. var _tWidth = tableWidth; // 如果是固定列与设置了超出隐藏
  11195. if (fixedType && allColumnOverflow) {
  11196. tableColumn = fixedColumn;
  11197. _tWidth = tableColumn.reduce(function (previous, column) {
  11198. return previous + column.renderWidth;
  11199. }, 0);
  11200. } else if (scrollXLoad) {
  11201. if (fixedType) {
  11202. tableColumn = fixedColumn;
  11203. }
  11204. _tWidth = tableColumn.reduce(function (previous, column) {
  11205. return previous + column.renderWidth;
  11206. }, 0);
  11207. }
  11208. if (tableElem) {
  11209. tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : ''; // 兼容性处理
  11210. tableElem.style.paddingRight = scrollbarWidth && fixedType && (methods_browse['-moz'] || methods_browse.safari) ? "".concat(scrollbarWidth, "px") : '';
  11211. }
  11212. if (emptyBlockElem) {
  11213. emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : '';
  11214. }
  11215. } else if (layout === 'footer') {
  11216. // 如果是使用优化模式
  11217. var _tWidth2 = tableWidth;
  11218. if (fixedType && allColumnOverflow) {
  11219. tableColumn = fixedColumn;
  11220. _tWidth2 = tableColumn.reduce(function (previous, column) {
  11221. return previous + column.renderWidth;
  11222. }, 0);
  11223. } else if (scrollXLoad) {
  11224. if (fixedType) {
  11225. tableColumn = fixedColumn;
  11226. }
  11227. _tWidth2 = tableColumn.reduce(function (previous, column) {
  11228. return previous + column.renderWidth;
  11229. }, 0);
  11230. }
  11231. if (wrapperElem) {
  11232. // 如果是固定列
  11233. if (fixedWrapperElem) {
  11234. wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
  11235. }
  11236. wrapperElem.style.marginTop = "".concat(-scrollbarHeight, "px");
  11237. }
  11238. if (tableElem) {
  11239. tableElem.style.width = _tWidth2 ? "".concat(_tWidth2 + scrollbarWidth, "px") : '';
  11240. } // const listElem = elemStore[`${name}-${layout}-list`]
  11241. // if (listElem) {
  11242. // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
  11243. // thElem.style.width = `${scrollbarWidth}px`
  11244. // })
  11245. // }
  11246. }
  11247. var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
  11248. if (colgroupElem) {
  11249. ctor_amd_xe_utils_default.a.arrayEach(colgroupElem.children, function (colElem) {
  11250. var colid = colElem.getAttribute('name');
  11251. if (colid === 'col_gutter') {
  11252. colElem.style.width = "".concat(scrollbarWidth, "px");
  11253. }
  11254. if (fullColumnIdData[colid]) {
  11255. var column = fullColumnIdData[colid].column;
  11256. var showHeaderOverflow = column.showHeaderOverflow,
  11257. showFooterOverflow = column.showFooterOverflow,
  11258. showOverflow = column.showOverflow;
  11259. var cellOverflow;
  11260. colElem.style.width = "".concat(column.renderWidth, "px");
  11261. if (layout === 'header') {
  11262. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  11263. } else if (layout === 'footer') {
  11264. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  11265. } else {
  11266. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  11267. }
  11268. var showEllipsis = cellOverflow === 'ellipsis';
  11269. var showTitle = cellOverflow === 'title';
  11270. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11271. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11272. var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; // 滚动的渲染不支持动态行高
  11273. if (layout === 'header' || layout === 'footer') {
  11274. if (scrollXLoad && !hasEllipsis) {
  11275. hasEllipsis = true;
  11276. }
  11277. } else {
  11278. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  11279. hasEllipsis = true;
  11280. }
  11281. }
  11282. if (_listElem) {
  11283. ctor_amd_xe_utils_default.a.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (elem) {
  11284. var colspan = parseInt(elem.getAttribute('colspan') || 1);
  11285. var cellElem = elem.querySelector('.vxe-cell');
  11286. var colWidth = column.renderWidth;
  11287. if (cellElem) {
  11288. if (colspan > 1) {
  11289. var columnIndex = _this18.getColumnIndex(column);
  11290. for (var _index = 1; _index < colspan; _index++) {
  11291. var nextColumn = _this18.getColumns(columnIndex + _index);
  11292. if (nextColumn) {
  11293. colWidth += nextColumn.renderWidth;
  11294. }
  11295. }
  11296. }
  11297. cellElem.style.width = hasEllipsis ? "".concat(colWidth - cellOffsetWidth * colspan, "px") : '';
  11298. }
  11299. });
  11300. }
  11301. }
  11302. });
  11303. }
  11304. });
  11305. });
  11306. if (currentRow) {
  11307. this.setCurrentRow(currentRow);
  11308. }
  11309. if (mouseConfig && mouseConfig.selected && editStore.selected.row && editStore.selected.column) {
  11310. this.addColSdCls();
  11311. }
  11312. return this.$nextTick();
  11313. },
  11314. /**
  11315. * 处理固定列的显示状态
  11316. */
  11317. checkScrolling: function checkScrolling() {
  11318. var _this$$refs = this.$refs,
  11319. tableBody = _this$$refs.tableBody,
  11320. leftContainer = _this$$refs.leftContainer,
  11321. rightContainer = _this$$refs.rightContainer;
  11322. var bodyElem = tableBody ? tableBody.$el : null;
  11323. if (bodyElem) {
  11324. if (leftContainer) {
  11325. DomTools[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle');
  11326. }
  11327. if (rightContainer) {
  11328. DomTools[bodyElem.clientWidth < bodyElem.scrollWidth - Math.ceil(bodyElem.scrollLeft) ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle');
  11329. }
  11330. }
  11331. },
  11332. preventEvent: function preventEvent(evnt, type, args, next, end) {
  11333. var _this19 = this;
  11334. var evntList = v_x_e_table.interceptor.get(type);
  11335. var rest;
  11336. if (!evntList.some(function (func) {
  11337. return func(Object.assign({
  11338. $grid: _this19.$xegrid,
  11339. $table: _this19,
  11340. $event: evnt
  11341. }, args), evnt, _this19) === false;
  11342. })) {
  11343. if (next) {
  11344. rest = next();
  11345. }
  11346. }
  11347. if (end) {
  11348. end();
  11349. }
  11350. return rest;
  11351. },
  11352. /**
  11353. * 全局按下事件处理
  11354. */
  11355. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  11356. var _this20 = this;
  11357. var $el = this.$el,
  11358. $refs = this.$refs,
  11359. $xegrid = this.$xegrid,
  11360. $toolbar = this.$toolbar,
  11361. mouseConfig = this.mouseConfig,
  11362. mouseOpts = this.mouseOpts,
  11363. editStore = this.editStore,
  11364. ctxMenuStore = this.ctxMenuStore,
  11365. editOpts = this.editOpts,
  11366. filterStore = this.filterStore,
  11367. getRowNode = this.getRowNode;
  11368. var actived = editStore.actived;
  11369. var filterWrapper = $refs.filterWrapper,
  11370. validTip = $refs.validTip; // 在 v3.0 中废弃 mouse-config.checked
  11371. var isMouseChecked = mouseConfig && mouseOpts.checked;
  11372. if (filterWrapper) {
  11373. if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {// 如果点击了筛选按钮
  11374. } else if (getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器
  11375. } else {
  11376. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11377. this.preventEvent(evnt, 'event.clearFilter', filterStore.args, this.closeFilter);
  11378. }
  11379. }
  11380. } // 如果已激活了编辑状态
  11381. if (actived.row) {
  11382. if (!(editOpts.autoClear === false)) {
  11383. // 如果是激活状态,点击了单元格之外
  11384. var cell = actived.args.cell;
  11385. if (!cell || !getEventTargetNode(evnt, cell).flag) {
  11386. if (validTip && getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框
  11387. } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
  11388. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11389. // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
  11390. this.preventEvent(evnt, 'event.clearActived', actived.args, function () {
  11391. var isClearActived;
  11392. if (editOpts.mode === 'row') {
  11393. var rowNode = getEventTargetNode(evnt, $el, 'vxe-body--row'); // row 方式,如果点击了不同行
  11394. isClearActived = rowNode.flag ? getRowNode(rowNode.targetElem).item !== actived.args.row : false;
  11395. } else {
  11396. // cell 方式,如果是非编辑列
  11397. isClearActived = !getEventTargetNode(evnt, $el, 'col--edit').flag;
  11398. }
  11399. if (!isClearActived) {
  11400. isClearActived = getEventTargetNode(evnt, $el, 'vxe-header--row').flag;
  11401. }
  11402. if (!isClearActived) {
  11403. isClearActived = getEventTargetNode(evnt, $el, 'vxe-footer--row').flag;
  11404. } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
  11405. if (!isClearActived && _this20.height && !_this20.overflowY) {
  11406. var bodyWrapperElem = evnt.target;
  11407. if (hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
  11408. isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
  11409. }
  11410. }
  11411. if (isClearActived || // 如果点击了当前表格之外
  11412. !getEventTargetNode(evnt, $el).flag) {
  11413. // this.triggerValidate('blur').then(a => {
  11414. // 保证 input 的 change 事件能先触发之后再清除
  11415. setTimeout(function () {
  11416. return _this20.clearActived(evnt);
  11417. }); // }).catch(e => e)
  11418. }
  11419. });
  11420. }
  11421. }
  11422. }
  11423. }
  11424. } else if (mouseConfig) {
  11425. if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !getEventTargetNode(evnt, $refs.tableWrapper).flag && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
  11426. if (isMouseChecked) {
  11427. this.clearIndexChecked();
  11428. this.clearHeaderChecked();
  11429. this.clearChecked();
  11430. }
  11431. this.clearSelected();
  11432. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
  11433. this.preventEvent(evnt, 'event.clearAreas', {}, function () {
  11434. _this20.clearCellAreas();
  11435. _this20.clearCopyCellArea();
  11436. });
  11437. }
  11438. }
  11439. } // 如果配置了快捷菜单且,点击了其他地方则关闭
  11440. if (ctxMenuStore.visible && this.$refs.ctxWrapper && !getEventTargetNode(evnt, this.$refs.ctxWrapper.$el).flag) {
  11441. this.closeMenu();
  11442. } // 最后激活的表格
  11443. this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
  11444. },
  11445. /**
  11446. * 窗口失焦事件处理
  11447. */
  11448. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  11449. this.closeFilter();
  11450. this.closeMenu();
  11451. },
  11452. /**
  11453. * 全局滚动事件
  11454. */
  11455. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent() {
  11456. this.closeTooltip();
  11457. this.closeMenu();
  11458. },
  11459. /**
  11460. * 全局键盘事件
  11461. */
  11462. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  11463. var _this21 = this;
  11464. // 该行为只对当前激活的表格有效
  11465. if (this.isActivated) {
  11466. this.preventEvent(evnt, 'event.keydown', null, function () {
  11467. var filterStore = _this21.filterStore,
  11468. isCtxMenu = _this21.isCtxMenu,
  11469. ctxMenuStore = _this21.ctxMenuStore,
  11470. editStore = _this21.editStore,
  11471. editOpts = _this21.editOpts,
  11472. editConfig = _this21.editConfig,
  11473. mouseConfig = _this21.mouseConfig,
  11474. mouseOpts = _this21.mouseOpts,
  11475. keyboardConfig = _this21.keyboardConfig,
  11476. keyboardOpts = _this21.keyboardOpts,
  11477. treeConfig = _this21.treeConfig,
  11478. treeOpts = _this21.treeOpts,
  11479. highlightCurrentRow = _this21.highlightCurrentRow,
  11480. currentRow = _this21.currentRow,
  11481. bodyCtxMenu = _this21.bodyCtxMenu;
  11482. var selected = editStore.selected,
  11483. actived = editStore.actived;
  11484. var keyCode = evnt.keyCode;
  11485. var isBack = keyCode === 8;
  11486. var isTab = keyCode === 9;
  11487. var isEnter = keyCode === 13;
  11488. var isEsc = keyCode === 27;
  11489. var isSpacebar = keyCode === 32;
  11490. var isLeftArrow = keyCode === 37;
  11491. var isUpArrow = keyCode === 38;
  11492. var isRightArrow = keyCode === 39;
  11493. var isDwArrow = keyCode === 40;
  11494. var isDel = keyCode === 46;
  11495. var isA = keyCode === 65;
  11496. var isF2 = keyCode === 113;
  11497. var isContextMenu = keyCode === 93;
  11498. var hasMetaKey = evnt.metaKey;
  11499. var hasCtrlKey = evnt.ctrlKey;
  11500. var hasShiftKey = evnt.shiftKey;
  11501. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  11502. var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
  11503. var isEditStatus = editConfig && actived.column && actived.row;
  11504. var params;
  11505. if (filterStore.visible) {
  11506. if (isEsc) {
  11507. _this21.closeFilter();
  11508. }
  11509. return;
  11510. }
  11511. if (operCtxMenu) {
  11512. // 如果配置了右键菜单; 支持方向键操作、回车
  11513. evnt.preventDefault();
  11514. if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
  11515. _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
  11516. } else {
  11517. _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this21.ctxMenuList);
  11518. }
  11519. } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this21.handleKeyboardEvent) {
  11520. _this21.handleKeyboardEvent(evnt);
  11521. } else if (isSpacebar && keyboardConfig && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'selection' || selected.column.type === 'radio')) {
  11522. // 在 v3.0 中废弃 type=selection
  11523. // 空格键支持选中复选框
  11524. evnt.preventDefault(); // 在 v3.0 中废弃 type=selection
  11525. if (selected.column.type === 'checkbox' || selected.column.type === 'selection') {
  11526. _this21.handleToggleCheckRowEvent(evnt, selected.args);
  11527. } else {
  11528. _this21.triggerRadioRowEvent(evnt, selected.args);
  11529. }
  11530. } else if (isEsc) {
  11531. // 如果按下了 Esc 键,关闭快捷菜单、筛选
  11532. _this21.closeMenu();
  11533. _this21.closeFilter(); // 如果是激活编辑状态,则取消编辑
  11534. if (actived.row) {
  11535. params = actived.args;
  11536. _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  11537. if (mouseConfig && mouseOpts.selected) {
  11538. _this21.$nextTick(function () {
  11539. return _this21.handleSelected(params, evnt);
  11540. });
  11541. }
  11542. }
  11543. } else if (isF2) {
  11544. if (!isEditStatus) {
  11545. // 如果按下了 F2 键
  11546. if (selected.row && selected.column) {
  11547. evnt.preventDefault();
  11548. _this21.handleActived(selected.args, evnt);
  11549. }
  11550. }
  11551. } else if (isContextMenu) {
  11552. // 如果按下上下文键
  11553. _this21._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
  11554. clearTimeout(_this21.keyCtxTimeout);
  11555. _this21.keyCtxTimeout = setTimeout(function () {
  11556. _this21._keyCtx = false;
  11557. }, 1000);
  11558. } else if (isEnter && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
  11559. // 退出选中
  11560. if (hasCtrlKey) {
  11561. // 如果是激活编辑状态,则取消编辑
  11562. if (actived.row) {
  11563. params = actived.args;
  11564. _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  11565. if (mouseConfig && mouseOpts.selected) {
  11566. _this21.$nextTick(function () {
  11567. return _this21.handleSelected(params, evnt);
  11568. });
  11569. }
  11570. }
  11571. } else {
  11572. // 如果是激活状态,退则出到上一行/下一行
  11573. if (selected.row || actived.row) {
  11574. var targetArgs = selected.row ? selected.args : actived.args;
  11575. if (hasShiftKey) {
  11576. if (keyboardOpts.enterToTab) {
  11577. _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
  11578. } else {
  11579. _this21.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
  11580. }
  11581. } else {
  11582. if (keyboardOpts.enterToTab) {
  11583. _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
  11584. } else {
  11585. _this21.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
  11586. }
  11587. }
  11588. } else if (treeConfig && highlightCurrentRow && currentRow) {
  11589. // 如果是树形表格当前行回车移动到子节点
  11590. var childrens = currentRow[treeOpts.children];
  11591. if (childrens && childrens.length) {
  11592. evnt.preventDefault();
  11593. var targetRow = childrens[0];
  11594. params = {
  11595. $table: _this21,
  11596. row: targetRow
  11597. };
  11598. _this21.setTreeExpand(currentRow, true).then(function () {
  11599. return _this21.scrollToRow(targetRow);
  11600. }).then(function () {
  11601. return _this21.triggerCurrentRowEvent(evnt, params);
  11602. });
  11603. }
  11604. }
  11605. }
  11606. } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
  11607. if (!isEditStatus) {
  11608. // 如果按下了方向键
  11609. if (selected.row && selected.column) {
  11610. _this21.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
  11611. } else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
  11612. // 当前行按键上下移动
  11613. _this21.moveCurrentRow(isUpArrow, isDwArrow, evnt);
  11614. }
  11615. }
  11616. } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
  11617. // 如果按下了 Tab 键切换
  11618. if (selected.row || selected.column) {
  11619. _this21.moveTabSelected(selected.args, hasShiftKey, evnt);
  11620. } else if (actived.row || actived.column) {
  11621. _this21.moveTabSelected(actived.args, hasShiftKey, evnt);
  11622. }
  11623. } else if (keyboardConfig && (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
  11624. if (!isEditStatus) {
  11625. var delMethod = keyboardOpts.delMethod,
  11626. backMethod = keyboardOpts.backMethod; // 如果是删除键
  11627. if (keyboardOpts.isDel && (selected.row || selected.column)) {
  11628. if (delMethod) {
  11629. delMethod({
  11630. row: selected.row,
  11631. rowIndex: _this21.getRowIndex(selected.row),
  11632. column: selected.column,
  11633. columnIndex: _this21.getColumnIndex(selected.column),
  11634. $table: _this21
  11635. });
  11636. } else {
  11637. methods_setCellValue(selected.row, selected.column, null);
  11638. }
  11639. if (isBack) {
  11640. if (backMethod) {
  11641. backMethod({
  11642. row: selected.row,
  11643. rowIndex: _this21.getRowIndex(selected.row),
  11644. column: selected.column,
  11645. columnIndex: _this21.getColumnIndex(selected.column),
  11646. $table: _this21
  11647. });
  11648. } else {
  11649. _this21.handleActived(selected.args, evnt);
  11650. }
  11651. } else if (isDel) {
  11652. // 如果按下 del 键,更新表尾数据
  11653. _this21.updateFooter();
  11654. }
  11655. } else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
  11656. // 如果树形表格回退键关闭当前行返回父节点
  11657. var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(_this21.afterFullData, function (item) {
  11658. return item === currentRow;
  11659. }, treeOpts),
  11660. parentRow = _XEUtils$findTree.parent;
  11661. if (parentRow) {
  11662. evnt.preventDefault();
  11663. params = {
  11664. $table: _this21,
  11665. row: parentRow
  11666. };
  11667. _this21.setTreeExpand(parentRow, false).then(function () {
  11668. return _this21.scrollToRow(parentRow);
  11669. }).then(function () {
  11670. return _this21.triggerCurrentRowEvent(evnt, params);
  11671. });
  11672. }
  11673. }
  11674. }
  11675. } else if (keyboardConfig && hasCtrlKey && isA) {
  11676. if (!isEditStatus) {
  11677. // 如果开启复制功能
  11678. if (keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11679. _this21.handleAllChecked(evnt);
  11680. }
  11681. }
  11682. } else if (keyboardConfig && keyboardOpts.isEdit && !hasCtrlKey && !hasMetaKey && (isSpacebar || keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90 || keyCode >= 96 && keyCode <= 111 || keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222)) {
  11683. var editMethod = keyboardOpts.editMethod; // 启用编辑后,空格键功能将失效
  11684. // if (isSpacebar) {
  11685. // evnt.preventDefault()
  11686. // }
  11687. // 如果是按下非功能键之外允许直接编辑
  11688. if (selected.column && selected.row && UtilTools.isEnableConf(selected.column.editRender)) {
  11689. if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
  11690. if (editMethod) {
  11691. editMethod({
  11692. row: selected.row,
  11693. rowIndex: _this21.getRowIndex(selected.row),
  11694. column: selected.column,
  11695. columnIndex: _this21.getColumnIndex(selected.column),
  11696. $table: _this21
  11697. });
  11698. } else {
  11699. methods_setCellValue(selected.row, selected.column, null);
  11700. _this21.handleActived(selected.args, evnt);
  11701. }
  11702. }
  11703. }
  11704. }
  11705. _this21.emitEvent('keydown', {}, evnt);
  11706. });
  11707. }
  11708. },
  11709. handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
  11710. var isActivated = this.isActivated,
  11711. keyboardConfig = this.keyboardConfig,
  11712. keyboardOpts = this.keyboardOpts,
  11713. mouseConfig = this.mouseConfig,
  11714. mouseOpts = this.mouseOpts,
  11715. editStore = this.editStore,
  11716. filterStore = this.filterStore;
  11717. var actived = editStore.actived;
  11718. if (isActivated && !filterStore.visible) {
  11719. if (!(actived.row || actived.column)) {
  11720. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handlePasteCellAreaEvent) {
  11721. this.handlePasteCellAreaEvent(evnt);
  11722. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11723. this.handlePaste(evnt);
  11724. }
  11725. }
  11726. this.emitEvent('paste', {}, evnt);
  11727. }
  11728. },
  11729. handleGlobalCopyEvent: function handleGlobalCopyEvent(evnt) {
  11730. var isActivated = this.isActivated,
  11731. keyboardConfig = this.keyboardConfig,
  11732. keyboardOpts = this.keyboardOpts,
  11733. mouseConfig = this.mouseConfig,
  11734. mouseOpts = this.mouseOpts,
  11735. editStore = this.editStore,
  11736. filterStore = this.filterStore;
  11737. var actived = editStore.actived;
  11738. if (isActivated && !filterStore.visible) {
  11739. if (!(actived.row || actived.column)) {
  11740. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCopyCellAreaEvent) {
  11741. this.handleCopyCellAreaEvent(evnt);
  11742. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11743. this.handleCopyed(false, evnt);
  11744. }
  11745. }
  11746. this.emitEvent('copy', {}, evnt);
  11747. }
  11748. },
  11749. handleGlobalCutEvent: function handleGlobalCutEvent(evnt) {
  11750. var isActivated = this.isActivated,
  11751. keyboardConfig = this.keyboardConfig,
  11752. keyboardOpts = this.keyboardOpts,
  11753. mouseConfig = this.mouseConfig,
  11754. mouseOpts = this.mouseOpts,
  11755. editStore = this.editStore,
  11756. filterStore = this.filterStore;
  11757. var actived = editStore.actived;
  11758. if (isActivated && !filterStore.visible) {
  11759. if (!(actived.row || actived.column)) {
  11760. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCutCellAreaEvent) {
  11761. this.handleCutCellAreaEvent(evnt);
  11762. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11763. this.handleCopyed(true, evnt);
  11764. }
  11765. }
  11766. this.emitEvent('cut', {}, evnt);
  11767. }
  11768. },
  11769. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  11770. this.closeMenu();
  11771. this.recalculate(true);
  11772. this.updateCellAreas();
  11773. },
  11774. handleTooltipLeaveEvent: function handleTooltipLeaveEvent() {
  11775. var _this22 = this;
  11776. var tooltipOpts = this.tooltipOpts;
  11777. setTimeout(function () {
  11778. if (!_this22.tooltipActive) {
  11779. _this22.closeTooltip();
  11780. }
  11781. }, tooltipOpts.leaveDelay);
  11782. },
  11783. handleTargetEnterEvent: function handleTargetEnterEvent() {
  11784. clearTimeout(this.tooltipTimeout);
  11785. this.tooltipActive = true;
  11786. this.closeTooltip();
  11787. },
  11788. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  11789. var _this23 = this;
  11790. var tooltipOpts = this.tooltipOpts;
  11791. this.tooltipActive = false;
  11792. if (tooltipOpts.enterable) {
  11793. this.tooltipTimeout = setTimeout(function () {
  11794. var tooltip = _this23.$refs.tooltip;
  11795. if (tooltip && !tooltip.isHover) {
  11796. _this23.closeTooltip();
  11797. }
  11798. }, tooltipOpts.leaveDelay);
  11799. } else {
  11800. this.closeTooltip();
  11801. }
  11802. },
  11803. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  11804. var column = params.column;
  11805. var titleHelp = column.titleHelp;
  11806. if (titleHelp.content || titleHelp.message) {
  11807. var $refs = this.$refs,
  11808. tooltipStore = this.tooltipStore;
  11809. var tooltip = $refs.tooltip;
  11810. var content = UtilTools.getFuncText(titleHelp.content || titleHelp.message);
  11811. this.handleTargetEnterEvent();
  11812. tooltipStore.visible = true;
  11813. if (tooltip) {
  11814. tooltip.open(evnt.currentTarget, content);
  11815. }
  11816. }
  11817. },
  11818. /**
  11819. * 触发表头 tooltip 事件
  11820. */
  11821. triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) {
  11822. var tooltipStore = this.tooltipStore;
  11823. var column = params.column;
  11824. var titleElem = evnt.currentTarget;
  11825. this.handleTargetEnterEvent();
  11826. if (tooltipStore.column !== column || !tooltipStore.visible) {
  11827. this.handleTooltip(evnt, titleElem, titleElem, null, params);
  11828. }
  11829. },
  11830. /**
  11831. * 触发单元格 tooltip 事件
  11832. */
  11833. triggerBodyTooltipEvent: function triggerBodyTooltipEvent(evnt, params) {
  11834. var editConfig = this.editConfig,
  11835. editOpts = this.editOpts,
  11836. editStore = this.editStore,
  11837. tooltipStore = this.tooltipStore;
  11838. var actived = editStore.actived;
  11839. var row = params.row,
  11840. column = params.column;
  11841. var cell = evnt.currentTarget;
  11842. this.handleTargetEnterEvent();
  11843. if (editConfig) {
  11844. if (editOpts.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) {
  11845. return;
  11846. }
  11847. }
  11848. if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
  11849. var overflowElem;
  11850. var tipElem;
  11851. if (column.treeNode) {
  11852. overflowElem = cell.querySelector('.vxe-tree-cell');
  11853. if (column.type === 'html') {
  11854. tipElem = cell.querySelector('.vxe-cell--html');
  11855. }
  11856. } else {
  11857. tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
  11858. }
  11859. this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
  11860. }
  11861. },
  11862. /**
  11863. * 触发表尾 tooltip 事件
  11864. */
  11865. triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) {
  11866. var tooltipStore = this.tooltipStore;
  11867. var column = params.column;
  11868. var cell = evnt.currentTarget;
  11869. this.handleTargetEnterEvent();
  11870. if (tooltipStore.column !== column || !tooltipStore.visible) {
  11871. this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
  11872. }
  11873. },
  11874. /**
  11875. * 处理显示 tooltip
  11876. * @param {Event} evnt 事件
  11877. * @param {ColumnInfo} column 列配置
  11878. * @param {Row} row 行对象
  11879. */
  11880. handleTooltip: function handleTooltip(evnt, cell, overflowElem, tipElem, params) {
  11881. params.cell = cell;
  11882. var $refs = this.$refs,
  11883. tooltipOpts = this.tooltipOpts,
  11884. tooltipStore = this.tooltipStore;
  11885. var column = params.column,
  11886. row = params.row;
  11887. var showAll = tooltipOpts.showAll,
  11888. enabled = tooltipOpts.enabled,
  11889. contentMethod = tooltipOpts.contentMethod;
  11890. var tooltip = $refs.tooltip;
  11891. var customContent = contentMethod ? contentMethod(params) : null;
  11892. var useCustom = contentMethod && !ctor_amd_xe_utils_default.a.eqNull(customContent);
  11893. var content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
  11894. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  11895. if (content && (showAll || enabled || useCustom || isCellOverflow)) {
  11896. Object.assign(tooltipStore, {
  11897. row: row,
  11898. column: column,
  11899. visible: true
  11900. });
  11901. if (tooltip) {
  11902. tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, UtilTools.formatText(content));
  11903. }
  11904. }
  11905. return this.$nextTick();
  11906. },
  11907. openTooltip: function openTooltip(target, message) {
  11908. var $refs = this.$refs;
  11909. var commTip = $refs.commTip;
  11910. if (commTip) {
  11911. return commTip.open(target, message);
  11912. }
  11913. return this.$nextTick();
  11914. },
  11915. /**
  11916. * 关闭 tooltip
  11917. */
  11918. closeTooltip: function closeTooltip() {
  11919. var tooltip = this.$refs.tooltip;
  11920. var commTip = this.$refs.commTip;
  11921. Object.assign(this.tooltipStore, {
  11922. row: null,
  11923. column: null,
  11924. content: null,
  11925. visible: false
  11926. });
  11927. if (tooltip) {
  11928. tooltip.close();
  11929. }
  11930. if (commTip) {
  11931. commTip.close();
  11932. }
  11933. return this.$nextTick();
  11934. },
  11935. /**
  11936. * 判断列头复选框是否被选中
  11937. */
  11938. isAllCheckboxChecked: function isAllCheckboxChecked() {
  11939. return this.isAllSelected;
  11940. },
  11941. /**
  11942. * 判断列头复选框是否被半选
  11943. */
  11944. isAllCheckboxIndeterminate: function isAllCheckboxIndeterminate() {
  11945. return !this.isAllSelected && this.isIndeterminate;
  11946. },
  11947. isCheckboxIndeterminate: function isCheckboxIndeterminate() {
  11948. UtilTools.warn('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate']);
  11949. return this.isAllCheckboxIndeterminate();
  11950. },
  11951. /**
  11952. * 获取复选框半选状态的行数据
  11953. */
  11954. getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords() {
  11955. var treeConfig = this.treeConfig,
  11956. treeIndeterminates = this.treeIndeterminates;
  11957. if (treeConfig) {
  11958. return treeIndeterminates.slice(0);
  11959. }
  11960. return [];
  11961. },
  11962. /**
  11963. * 处理默认勾选
  11964. */
  11965. handleDefaultSelectionChecked: function handleDefaultSelectionChecked() {
  11966. var fullDataRowIdData = this.fullDataRowIdData,
  11967. checkboxOpts = this.checkboxOpts;
  11968. var checkAll = checkboxOpts.checkAll,
  11969. checkRowKeys = checkboxOpts.checkRowKeys;
  11970. if (checkAll) {
  11971. this.setAllCheckboxRow(true);
  11972. } else if (checkRowKeys) {
  11973. var defSelection = [];
  11974. checkRowKeys.forEach(function (rowid) {
  11975. if (fullDataRowIdData[rowid]) {
  11976. defSelection.push(fullDataRowIdData[rowid].row);
  11977. }
  11978. });
  11979. this.setCheckboxRow(defSelection, true);
  11980. }
  11981. },
  11982. // 在 v3.0 中废弃 setSelection
  11983. setSelection: function setSelection(rows, value) {
  11984. UtilTools.warn('vxe.error.delFunc', ['setSelection', 'setCheckboxRow']);
  11985. return this.setCheckboxRow(rows, value);
  11986. },
  11987. /**
  11988. * 用于多选行,设置行为选中状态,第二个参数为选中与否
  11989. * @param {Array/Row} rows 行数据
  11990. * @param {Boolean} value 是否选中
  11991. */
  11992. setCheckboxRow: function setCheckboxRow(rows, value) {
  11993. var _this24 = this;
  11994. if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
  11995. rows = [rows];
  11996. }
  11997. rows.forEach(function (row) {
  11998. return _this24.handleSelectRow({
  11999. row: row
  12000. }, !!value);
  12001. });
  12002. return this.$nextTick();
  12003. },
  12004. isCheckedByRow: function isCheckedByRow(row) {
  12005. UtilTools.warn('vxe.error.delFunc', ['isCheckedByRow', 'isCheckedByCheckboxRow']);
  12006. return this.isCheckedByCheckboxRow(row);
  12007. },
  12008. isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
  12009. var property = this.checkboxOpts.checkField;
  12010. if (property) {
  12011. return ctor_amd_xe_utils_default.a.get(row, property);
  12012. }
  12013. return this.selection.indexOf(row) > -1;
  12014. },
  12015. /**
  12016. * 多选,行选中事件
  12017. * value 选中true 不选false 不确定-1
  12018. */
  12019. handleSelectRow: function handleSelectRow(_ref4, value) {
  12020. var _this25 = this;
  12021. var row = _ref4.row;
  12022. var selection = this.selection,
  12023. afterFullData = this.afterFullData,
  12024. treeConfig = this.treeConfig,
  12025. treeOpts = this.treeOpts,
  12026. treeIndeterminates = this.treeIndeterminates,
  12027. checkboxOpts = this.checkboxOpts;
  12028. var property = checkboxOpts.checkField,
  12029. checkStrictly = checkboxOpts.checkStrictly,
  12030. checkMethod = checkboxOpts.checkMethod;
  12031. if (property) {
  12032. if (treeConfig && !checkStrictly) {
  12033. if (value === -1) {
  12034. if (treeIndeterminates.indexOf(row) === -1) {
  12035. treeIndeterminates.push(row);
  12036. }
  12037. ctor_amd_xe_utils_default.a.set(row, property, false);
  12038. } else {
  12039. // 更新子节点状态
  12040. ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
  12041. if (row === item || !checkMethod || checkMethod({
  12042. row: item
  12043. })) {
  12044. ctor_amd_xe_utils_default.a.set(item, property, value);
  12045. ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12046. return half === item;
  12047. });
  12048. _this25.handleCheckboxReserveRow(row, value);
  12049. }
  12050. }, treeOpts);
  12051. } // 如果存在父节点,更新父节点状态
  12052. var matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12053. return item === row;
  12054. }, treeOpts);
  12055. if (matchObj && matchObj.parent) {
  12056. var parentStatus;
  12057. var vItems = checkMethod ? matchObj.items.filter(function (item) {
  12058. return checkMethod({
  12059. row: item
  12060. });
  12061. }) : matchObj.items;
  12062. var indeterminatesItem = ctor_amd_xe_utils_default.a.find(matchObj.items, function (item) {
  12063. return treeIndeterminates.indexOf(item) > -1;
  12064. });
  12065. if (indeterminatesItem) {
  12066. parentStatus = -1;
  12067. } else {
  12068. var selectItems = matchObj.items.filter(function (item) {
  12069. return ctor_amd_xe_utils_default.a.get(item, property);
  12070. });
  12071. parentStatus = selectItems.filter(function (item) {
  12072. return vItems.indexOf(item) > -1;
  12073. }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
  12074. }
  12075. return this.handleSelectRow({
  12076. row: matchObj.parent
  12077. }, parentStatus);
  12078. }
  12079. } else {
  12080. if (!checkMethod || checkMethod({
  12081. row: row
  12082. })) {
  12083. ctor_amd_xe_utils_default.a.set(row, property, value);
  12084. this.handleCheckboxReserveRow(row, value);
  12085. }
  12086. }
  12087. } else {
  12088. if (treeConfig && !checkStrictly) {
  12089. if (value === -1) {
  12090. if (treeIndeterminates.indexOf(row) === -1) {
  12091. treeIndeterminates.push(row);
  12092. }
  12093. ctor_amd_xe_utils_default.a.remove(selection, function (item) {
  12094. return item === row;
  12095. });
  12096. } else {
  12097. // 更新子节点状态
  12098. ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
  12099. if (row === item || !checkMethod || checkMethod({
  12100. row: item
  12101. })) {
  12102. if (value) {
  12103. selection.push(item);
  12104. } else {
  12105. ctor_amd_xe_utils_default.a.remove(selection, function (select) {
  12106. return select === item;
  12107. });
  12108. }
  12109. ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12110. return half === item;
  12111. });
  12112. _this25.handleCheckboxReserveRow(row, value);
  12113. }
  12114. }, treeOpts);
  12115. } // 如果存在父节点,更新父节点状态
  12116. var _matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12117. return item === row;
  12118. }, treeOpts);
  12119. if (_matchObj && _matchObj.parent) {
  12120. var _parentStatus;
  12121. var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
  12122. return checkMethod({
  12123. row: item
  12124. });
  12125. }) : _matchObj.items;
  12126. var _indeterminatesItem = ctor_amd_xe_utils_default.a.find(_matchObj.items, function (item) {
  12127. return treeIndeterminates.indexOf(item) > -1;
  12128. });
  12129. if (_indeterminatesItem) {
  12130. _parentStatus = -1;
  12131. } else {
  12132. var _selectItems = _matchObj.items.filter(function (item) {
  12133. return selection.indexOf(item) > -1;
  12134. });
  12135. _parentStatus = _selectItems.filter(function (item) {
  12136. return _vItems.indexOf(item) > -1;
  12137. }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
  12138. }
  12139. return this.handleSelectRow({
  12140. row: _matchObj.parent
  12141. }, _parentStatus);
  12142. }
  12143. } else {
  12144. if (!checkMethod || checkMethod({
  12145. row: row
  12146. })) {
  12147. if (value) {
  12148. if (selection.indexOf(row) === -1) {
  12149. selection.push(row);
  12150. }
  12151. } else {
  12152. ctor_amd_xe_utils_default.a.remove(selection, function (item) {
  12153. return item === row;
  12154. });
  12155. }
  12156. this.handleCheckboxReserveRow(row, value);
  12157. }
  12158. }
  12159. }
  12160. this.checkSelectionStatus();
  12161. },
  12162. handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
  12163. var selection = this.selection,
  12164. checkboxOpts = this.checkboxOpts;
  12165. var property = checkboxOpts.checkField;
  12166. var row = params.row;
  12167. var value = property ? !ctor_amd_xe_utils_default.a.get(row, property) : selection.indexOf(row) === -1;
  12168. if (evnt) {
  12169. this.triggerCheckRowEvent(evnt, params, value);
  12170. } else {
  12171. this.handleSelectRow(params, value);
  12172. }
  12173. },
  12174. triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
  12175. var checkMethod = this.checkboxOpts.checkMethod;
  12176. if (!checkMethod || checkMethod({
  12177. row: params.row
  12178. })) {
  12179. this.handleSelectRow(params, value);
  12180. var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-change
  12181. if (this.$listeners['select-change']) {
  12182. UtilTools.warn('vxe.error.delEvent', ['select-change', 'checkbox-change']);
  12183. this.emitEvent('select-change', Object.assign({
  12184. records: records,
  12185. selection: records,
  12186. reserves: this.getCheckboxReserveRecords(),
  12187. checked: value
  12188. }, params), evnt);
  12189. } else {
  12190. this.emitEvent('checkbox-change', Object.assign({
  12191. records: records,
  12192. selection: records,
  12193. reserves: this.getCheckboxReserveRecords(),
  12194. indeterminates: this.getCheckboxIndeterminateRecords(),
  12195. checked: value
  12196. }, params), evnt);
  12197. }
  12198. }
  12199. },
  12200. // 在 v3.0 中废弃 toggleRowSelection
  12201. toggleRowSelection: function toggleRowSelection(row) {
  12202. UtilTools.warn('vxe.error.delFunc', ['toggleRowSelection', 'toggleCheckboxRow']);
  12203. return this.toggleCheckboxRow(row);
  12204. },
  12205. /**
  12206. * 多选,切换某一行的选中状态
  12207. */
  12208. toggleCheckboxRow: function toggleCheckboxRow(row) {
  12209. this.handleToggleCheckRowEvent(null, {
  12210. row: row
  12211. });
  12212. return this.$nextTick();
  12213. },
  12214. // 在 v3.0 中废弃 setAllSelection
  12215. setAllSelection: function setAllSelection(value) {
  12216. UtilTools.warn('vxe.error.delFunc', ['setAllSelection', 'setAllCheckboxRow']);
  12217. return this.setAllCheckboxRow(value);
  12218. },
  12219. /**
  12220. * 用于多选行,设置所有行的选中状态
  12221. * @param {Boolean} value 是否选中
  12222. */
  12223. setAllCheckboxRow: function setAllCheckboxRow(value) {
  12224. var _this26 = this;
  12225. var afterFullData = this.afterFullData,
  12226. treeConfig = this.treeConfig,
  12227. treeOpts = this.treeOpts,
  12228. selection = this.selection,
  12229. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12230. checkboxOpts = this.checkboxOpts;
  12231. var property = checkboxOpts.checkField,
  12232. reserve = checkboxOpts.reserve,
  12233. checkStrictly = checkboxOpts.checkStrictly,
  12234. checkMethod = checkboxOpts.checkMethod;
  12235. var selectRows = [];
  12236. var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
  12237. return afterFullData.indexOf(row) === -1;
  12238. });
  12239. if (checkStrictly) {
  12240. this.isAllSelected = value;
  12241. } else {
  12242. /**
  12243. * 绑定属性方式(高性能,有污染)
  12244. * 必须在行数据存在对应的属性,否则将不响应
  12245. */
  12246. if (property) {
  12247. var checkValFn = function checkValFn(row) {
  12248. if (!checkMethod || checkMethod({
  12249. row: row
  12250. })) {
  12251. if (value) {
  12252. selectRows.push(row);
  12253. }
  12254. ctor_amd_xe_utils_default.a.set(row, property, value);
  12255. }
  12256. }; // 如果存在选中方法
  12257. // 如果方法成立,则更新值,否则忽略该数据
  12258. if (treeConfig) {
  12259. ctor_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
  12260. } else {
  12261. afterFullData.forEach(checkValFn);
  12262. }
  12263. } else {
  12264. /**
  12265. * 默认方式(低性能,无污染)
  12266. * 无需任何属性,直接绑定
  12267. */
  12268. if (treeConfig) {
  12269. if (value) {
  12270. /**
  12271. * 如果是树勾选
  12272. * 如果方法成立,则添加到临时集合中
  12273. */
  12274. ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12275. if (!checkMethod || checkMethod({
  12276. row: row
  12277. })) {
  12278. selectRows.push(row);
  12279. }
  12280. }, treeOpts);
  12281. } else {
  12282. /**
  12283. * 如果是树取消
  12284. * 如果方法成立,则不添加到临时集合中
  12285. */
  12286. if (checkMethod) {
  12287. ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12288. if (checkMethod({
  12289. row: row
  12290. }) ? 0 : selection.indexOf(row) > -1) {
  12291. selectRows.push(row);
  12292. }
  12293. }, treeOpts);
  12294. }
  12295. }
  12296. } else {
  12297. if (value) {
  12298. /**
  12299. * 如果是行勾选
  12300. * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
  12301. * 如果不存在选中方法,则添加所有数据到临时集合中
  12302. */
  12303. if (checkMethod) {
  12304. selectRows = afterFullData.filter(function (row) {
  12305. return selection.indexOf(row) > -1 || checkMethod({
  12306. row: row
  12307. });
  12308. });
  12309. } else {
  12310. selectRows = afterFullData.slice(0);
  12311. }
  12312. } else {
  12313. /**
  12314. * 如果是行取消
  12315. * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
  12316. * 如果不存在选中方法,无需处理,临时集合默认为空
  12317. */
  12318. if (checkMethod) {
  12319. selectRows = afterFullData.filter(function (row) {
  12320. return checkMethod({
  12321. row: row
  12322. }) ? 0 : selection.indexOf(row) > -1;
  12323. });
  12324. }
  12325. }
  12326. }
  12327. }
  12328. if (reserve) {
  12329. if (value) {
  12330. selectRows.forEach(function (row) {
  12331. checkboxReserveRowMap[methods_getRowid(_this26, row)] = row;
  12332. });
  12333. } else {
  12334. afterFullData.forEach(function (row) {
  12335. return _this26.handleCheckboxReserveRow(row, false);
  12336. });
  12337. }
  12338. }
  12339. this.selection = property ? [] : beforeSelection.concat(selectRows);
  12340. }
  12341. this.treeIndeterminates = [];
  12342. this.checkSelectionStatus();
  12343. },
  12344. checkSelectionStatus: function checkSelectionStatus() {
  12345. var afterFullData = this.afterFullData,
  12346. selection = this.selection,
  12347. treeIndeterminates = this.treeIndeterminates,
  12348. checkboxOpts = this.checkboxOpts,
  12349. treeConfig = this.treeConfig;
  12350. var checkField = checkboxOpts.checkField,
  12351. halfField = checkboxOpts.halfField,
  12352. checkStrictly = checkboxOpts.checkStrictly,
  12353. checkMethod = checkboxOpts.checkMethod;
  12354. if (!checkStrictly) {
  12355. var isAllSelected = false;
  12356. var isIndeterminate = false;
  12357. if (checkField) {
  12358. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12359. return !checkMethod({
  12360. row: row
  12361. }) || ctor_amd_xe_utils_default.a.get(row, checkField);
  12362. } : function (row) {
  12363. return ctor_amd_xe_utils_default.a.get(row, checkField);
  12364. });
  12365. if (treeConfig) {
  12366. if (halfField) {
  12367. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12368. return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
  12369. });
  12370. } else {
  12371. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12372. return ctor_amd_xe_utils_default.a.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
  12373. });
  12374. }
  12375. } else {
  12376. if (halfField) {
  12377. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12378. return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField);
  12379. });
  12380. } else {
  12381. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12382. return ctor_amd_xe_utils_default.a.get(row, checkField);
  12383. });
  12384. }
  12385. }
  12386. } else {
  12387. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12388. return !checkMethod({
  12389. row: row
  12390. }) || selection.indexOf(row) > -1;
  12391. } : function (row) {
  12392. return selection.indexOf(row) > -1;
  12393. });
  12394. if (treeConfig) {
  12395. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12396. return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1;
  12397. });
  12398. } else {
  12399. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12400. return selection.indexOf(row) > -1;
  12401. });
  12402. }
  12403. }
  12404. this.isAllSelected = isAllSelected;
  12405. this.isIndeterminate = isIndeterminate;
  12406. }
  12407. },
  12408. // 还原展开、选中等相关状态
  12409. handleReserveStatus: function handleReserveStatus() {
  12410. var expandColumn = this.expandColumn,
  12411. treeOpts = this.treeOpts,
  12412. treeConfig = this.treeConfig,
  12413. fullDataRowIdData = this.fullDataRowIdData,
  12414. fullAllDataRowMap = this.fullAllDataRowMap,
  12415. currentRow = this.currentRow,
  12416. selectRow = this.selectRow,
  12417. radioReserveRow = this.radioReserveRow,
  12418. radioOpts = this.radioOpts,
  12419. checkboxOpts = this.checkboxOpts,
  12420. selection = this.selection,
  12421. rowExpandeds = this.rowExpandeds,
  12422. treeExpandeds = this.treeExpandeds,
  12423. expandOpts = this.expandOpts; // 单选框
  12424. if (selectRow && !fullAllDataRowMap.has(selectRow)) {
  12425. this.selectRow = null; // 刷新单选行状态
  12426. } // 还原保留选中状态
  12427. if (radioOpts.reserve && radioReserveRow) {
  12428. var rowid = methods_getRowid(this, radioReserveRow);
  12429. if (fullDataRowIdData[rowid]) {
  12430. this.setRadioRow(fullDataRowIdData[rowid].row);
  12431. }
  12432. } // 复选框
  12433. this.selection = getRecoverRow(this, selection); // 刷新多选行状态
  12434. // 还原保留选中状态
  12435. if (checkboxOpts.reserve) {
  12436. this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
  12437. }
  12438. if (currentRow && !fullAllDataRowMap.has(currentRow)) {
  12439. this.currentRow = null; // 刷新当前行状态
  12440. } // 行展开
  12441. this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
  12442. // 还原保留状态
  12443. if (expandColumn && expandOpts.reserve) {
  12444. this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
  12445. } // 树展开
  12446. this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
  12447. if (treeConfig && treeOpts.reserve) {
  12448. this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
  12449. }
  12450. },
  12451. /**
  12452. * 获取单选框保留选中的行
  12453. */
  12454. getRadioReserveRecord: function getRadioReserveRecord() {
  12455. var fullDataRowIdData = this.fullDataRowIdData,
  12456. radioReserveRow = this.radioReserveRow,
  12457. radioOpts = this.radioOpts;
  12458. if (radioOpts.reserve && radioReserveRow) {
  12459. if (!fullDataRowIdData[methods_getRowid(this, radioReserveRow)]) {
  12460. return radioReserveRow;
  12461. }
  12462. }
  12463. return null;
  12464. },
  12465. clearRadioReserve: function clearRadioReserve() {
  12466. this.radioReserveRow = null;
  12467. return this.$nextTick();
  12468. },
  12469. handleRadioReserveRow: function handleRadioReserveRow(row) {
  12470. var radioOpts = this.radioOpts;
  12471. if (radioOpts.reserve) {
  12472. this.radioReserveRow = row;
  12473. }
  12474. },
  12475. // 在 v3.0 中废弃 getSelectReserveRecords
  12476. getSelectReserveRecords: function getSelectReserveRecords() {
  12477. UtilTools.warn('vxe.error.delFunc', ['getSelectReserveRecords', 'getCheckboxReserveRecords']);
  12478. return this.getCheckboxReserveRecords();
  12479. },
  12480. /**
  12481. * 获取保留选中的行
  12482. */
  12483. getCheckboxReserveRecords: function getCheckboxReserveRecords() {
  12484. var fullDataRowIdData = this.fullDataRowIdData,
  12485. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12486. checkboxOpts = this.checkboxOpts;
  12487. var reserveSelection = [];
  12488. if (checkboxOpts.reserve) {
  12489. Object.keys(checkboxReserveRowMap).forEach(function (rowid) {
  12490. if (!fullDataRowIdData[rowid]) {
  12491. reserveSelection.push(checkboxReserveRowMap[rowid]);
  12492. }
  12493. });
  12494. }
  12495. return reserveSelection;
  12496. },
  12497. // 在 v3.0 中废弃 clearSelectReserve
  12498. clearSelectReserve: function clearSelectReserve() {
  12499. UtilTools.warn('vxe.error.delFunc', ['clearSelectReserve', 'clearCheckboxReserve']);
  12500. return this.clearCheckboxReserve();
  12501. },
  12502. clearCheckboxReserve: function clearCheckboxReserve() {
  12503. this.checkboxReserveRowMap = {};
  12504. return this.$nextTick();
  12505. },
  12506. handleCheckboxReserveRow: function handleCheckboxReserveRow(row, checked) {
  12507. var checkboxReserveRowMap = this.checkboxReserveRowMap,
  12508. checkboxOpts = this.checkboxOpts;
  12509. if (checkboxOpts.reserve) {
  12510. var rowid = methods_getRowid(this, row);
  12511. if (checked) {
  12512. checkboxReserveRowMap[rowid] = row;
  12513. } else if (checkboxReserveRowMap[rowid]) {
  12514. delete checkboxReserveRowMap[rowid];
  12515. }
  12516. }
  12517. },
  12518. /**
  12519. * 多选,选中所有事件
  12520. */
  12521. triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
  12522. this.setAllCheckboxRow(value);
  12523. var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-all
  12524. if (this.$listeners['select-all']) {
  12525. UtilTools.warn('vxe.error.delEvent', ['select-all', 'checkbox-all']);
  12526. this.emitEvent('select-all', {
  12527. records: records,
  12528. selection: records,
  12529. reserves: this.getCheckboxReserveRecords(),
  12530. checked: value
  12531. }, evnt);
  12532. } else {
  12533. this.emitEvent('checkbox-all', {
  12534. records: records,
  12535. selection: records,
  12536. reserves: this.getCheckboxReserveRecords(),
  12537. indeterminates: this.getCheckboxIndeterminateRecords(),
  12538. checked: value
  12539. }, evnt);
  12540. }
  12541. },
  12542. // 在 v3.0 中废弃 toggleAllSelection
  12543. toggleAllSelection: function toggleAllSelection() {
  12544. UtilTools.warn('vxe.error.delFunc', ['toggleAllSelection', 'toggleAllCheckboxRow']);
  12545. return this.toggleAllCheckboxRow();
  12546. },
  12547. /**
  12548. * 多选,切换所有行的选中状态
  12549. */
  12550. toggleAllCheckboxRow: function toggleAllCheckboxRow() {
  12551. this.triggerCheckAllEvent(null, !this.isAllSelected);
  12552. return this.$nextTick();
  12553. },
  12554. // 在 v3.0 中废弃 clearSelection
  12555. clearSelection: function clearSelection() {
  12556. UtilTools.warn('vxe.error.delFunc', ['clearSelection', 'clearCheckboxRow']);
  12557. return this.clearCheckboxRow();
  12558. },
  12559. /**
  12560. * 用于多选行,手动清空用户的选择
  12561. * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
  12562. */
  12563. clearCheckboxRow: function clearCheckboxRow() {
  12564. var _this27 = this;
  12565. var tableFullData = this.tableFullData,
  12566. treeConfig = this.treeConfig,
  12567. treeOpts = this.treeOpts,
  12568. checkboxOpts = this.checkboxOpts;
  12569. var property = checkboxOpts.checkField,
  12570. reserve = checkboxOpts.reserve;
  12571. if (property) {
  12572. if (treeConfig) {
  12573. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
  12574. return ctor_amd_xe_utils_default.a.set(item, property, false);
  12575. }, treeOpts);
  12576. } else {
  12577. tableFullData.forEach(function (item) {
  12578. return ctor_amd_xe_utils_default.a.set(item, property, false);
  12579. });
  12580. }
  12581. }
  12582. if (reserve) {
  12583. tableFullData.forEach(function (row) {
  12584. return _this27.handleCheckboxReserveRow(row, false);
  12585. });
  12586. }
  12587. this.isAllSelected = false;
  12588. this.isIndeterminate = false;
  12589. this.selection = [];
  12590. this.treeIndeterminates = [];
  12591. return this.$nextTick();
  12592. },
  12593. /**
  12594. * 处理单选框默认勾选
  12595. */
  12596. handleDefaultRadioChecked: function handleDefaultRadioChecked() {
  12597. var radioOpts = this.radioOpts,
  12598. fullDataRowIdData = this.fullDataRowIdData;
  12599. var rowid = radioOpts.checkRowKey,
  12600. reserve = radioOpts.reserve;
  12601. if (rowid) {
  12602. if (fullDataRowIdData[rowid]) {
  12603. this.setRadioRow(fullDataRowIdData[rowid].row);
  12604. }
  12605. if (reserve) {
  12606. var rowkey = getRowkey(this);
  12607. this.radioReserveRow = _defineProperty({}, rowkey, rowid);
  12608. }
  12609. }
  12610. },
  12611. /**
  12612. * 单选,行选中事件
  12613. */
  12614. triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
  12615. var isChange = this.selectRow !== params.row;
  12616. this.setRadioRow(params.row);
  12617. if (isChange) {
  12618. this.emitEvent('radio-change', params, evnt);
  12619. }
  12620. },
  12621. triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) {
  12622. var isChange = this.currentRow !== params.row;
  12623. this.setCurrentRow(params.row);
  12624. if (isChange) {
  12625. this.emitEvent('current-change', params, evnt);
  12626. }
  12627. },
  12628. /**
  12629. * 用于当前行,设置某一行为高亮状态
  12630. * @param {Row} row 行对象
  12631. */
  12632. setCurrentRow: function setCurrentRow(row) {
  12633. this.clearCurrentRow();
  12634. this.clearCurrentColumn();
  12635. this.currentRow = row;
  12636. if (this.highlightCurrentRow) {
  12637. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(methods_getRowid(this, row), "\"]")), function (elem) {
  12638. return addClass(elem, 'row--current');
  12639. });
  12640. }
  12641. return this.$nextTick();
  12642. },
  12643. isCheckedByRadioRow: function isCheckedByRadioRow(row) {
  12644. return this.selectRow === row;
  12645. },
  12646. /**
  12647. * 用于单选行,设置某一行为选中状态
  12648. * @param {Row} row 行对象
  12649. */
  12650. setRadioRow: function setRadioRow(row) {
  12651. var radioOpts = this.radioOpts;
  12652. var checkMethod = radioOpts.checkMethod;
  12653. if (row && (!checkMethod || checkMethod({
  12654. row: row
  12655. }))) {
  12656. this.selectRow = row;
  12657. this.handleRadioReserveRow(row);
  12658. }
  12659. return this.$nextTick();
  12660. },
  12661. /**
  12662. * 用于当前行,手动清空当前高亮的状态
  12663. */
  12664. clearCurrentRow: function clearCurrentRow() {
  12665. this.currentRow = null;
  12666. this.hoverRow = null;
  12667. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) {
  12668. return removeClass(elem, 'row--current');
  12669. });
  12670. return this.$nextTick();
  12671. },
  12672. /**
  12673. * 用于单选行,手动清空用户的选择
  12674. */
  12675. clearRadioRow: function clearRadioRow() {
  12676. this.selectRow = null;
  12677. return this.$nextTick();
  12678. },
  12679. // 在 v3.0 中废弃 getCurrentRow
  12680. getCurrentRow: function getCurrentRow() {
  12681. UtilTools.warn('vxe.error.delFunc', ['getCurrentRow', 'getCurrentRecord']);
  12682. return this.getCurrentRecord();
  12683. },
  12684. /**
  12685. * 用于当前行,获取当前行的数据
  12686. */
  12687. getCurrentRecord: function getCurrentRecord() {
  12688. return this.highlightCurrentRow ? this.currentRow : null;
  12689. },
  12690. // 在 v3.0 中废弃 getRadioRow
  12691. getRadioRow: function getRadioRow() {
  12692. UtilTools.warn('vxe.error.delFunc', ['getRadioRow', 'getRadioRecord']);
  12693. return this.getRadioRecord();
  12694. },
  12695. /**
  12696. * 用于单选行,获取当已选中的数据
  12697. */
  12698. getRadioRecord: function getRadioRecord() {
  12699. return this.selectRow;
  12700. },
  12701. /**
  12702. * 行 hover 事件
  12703. */
  12704. triggerHoverEvent: function triggerHoverEvent(evnt, _ref5) {
  12705. var row = _ref5.row;
  12706. this.setHoverRow(row);
  12707. },
  12708. setHoverRow: function setHoverRow(row) {
  12709. var rowid = methods_getRowid(this, row);
  12710. this.clearHoverRow();
  12711. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(rowid, "\"]")), function (elem) {
  12712. return addClass(elem, 'row--hover');
  12713. });
  12714. this.hoverRow = row;
  12715. },
  12716. clearHoverRow: function clearHoverRow() {
  12717. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
  12718. return removeClass(elem, 'row--hover');
  12719. });
  12720. this.hoverRow = null;
  12721. },
  12722. triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) {
  12723. var _lastResizeTime = this._lastResizeTime,
  12724. sortOpts = this.sortOpts;
  12725. var column = params.column;
  12726. var cell = evnt.currentTarget;
  12727. var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300;
  12728. var triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  12729. var triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  12730. if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
  12731. this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
  12732. }
  12733. this.emitEvent('header-cell-click', Object.assign({
  12734. triggerResizable: triggerResizable,
  12735. triggerSort: triggerSort,
  12736. triggerFilter: triggerFilter,
  12737. cell: cell
  12738. }, params), evnt);
  12739. if (this.highlightCurrentColumn) {
  12740. return this.setCurrentColumn(column);
  12741. }
  12742. return this.$nextTick();
  12743. },
  12744. triggerHeaderCellDBLClickEvent: function triggerHeaderCellDBLClickEvent(evnt, params) {
  12745. this.emitEvent('header-cell-dblclick', Object.assign({
  12746. cell: evnt.currentTarget
  12747. }, params), evnt);
  12748. },
  12749. getCurrentColumn: function getCurrentColumn() {
  12750. return this.highlightCurrentColumn ? this.currentColumn : null;
  12751. },
  12752. /**
  12753. * 用于当前列,设置某列行为高亮状态
  12754. * @param {ColumnInfo} column 列配置
  12755. */
  12756. setCurrentColumn: function setCurrentColumn(column) {
  12757. this.clearCurrentRow();
  12758. this.clearCurrentColumn();
  12759. this.currentColumn = column;
  12760. return this.$nextTick();
  12761. },
  12762. /**
  12763. * 用于当前列,手动清空当前高亮的状态
  12764. */
  12765. clearCurrentColumn: function clearCurrentColumn() {
  12766. this.currentColumn = null;
  12767. return this.$nextTick();
  12768. },
  12769. checkValidate: function checkValidate(type) {
  12770. if (v_x_e_table._valid) {
  12771. return this.triggerValidate(type);
  12772. }
  12773. return this.$nextTick();
  12774. },
  12775. /**
  12776. * 当单元格发生改变时
  12777. * 如果存在规则,则校验
  12778. */
  12779. handleChangeCell: function handleChangeCell(evnt, params) {
  12780. var _this28 = this;
  12781. this.checkValidate('blur').catch(function (e) {
  12782. return e;
  12783. }).then(function () {
  12784. _this28.handleActived(params, evnt).then(function () {
  12785. return _this28.checkValidate('change');
  12786. }).catch(function (e) {
  12787. return e;
  12788. });
  12789. });
  12790. },
  12791. /**
  12792. * 列点击事件
  12793. * 如果是单击模式,则激活为编辑状态
  12794. * 如果是双击模式,则单击后选中状态
  12795. */
  12796. triggerCellClickEvent: function triggerCellClickEvent(evnt, params) {
  12797. var highlightCurrentRow = this.highlightCurrentRow,
  12798. editStore = this.editStore,
  12799. radioOpts = this.radioOpts,
  12800. expandOpts = this.expandOpts,
  12801. treeOpts = this.treeOpts,
  12802. editConfig = this.editConfig,
  12803. editOpts = this.editOpts,
  12804. checkboxOpts = this.checkboxOpts,
  12805. mouseConfig = this.mouseConfig,
  12806. mouseOpts = this.mouseOpts;
  12807. var actived = editStore.actived;
  12808. var _params = params,
  12809. row = _params.row,
  12810. column = _params.column;
  12811. var type = column.type,
  12812. treeNode = column.treeNode;
  12813. var isRadioType = type === 'radio'; // 在 v3.0 中废弃 selection
  12814. var isCheckboxType = type === 'checkbox' || type === 'selection';
  12815. var isExpandType = type === 'expand';
  12816. var cell = evnt.currentTarget;
  12817. var triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
  12818. var triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
  12819. var triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
  12820. var triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
  12821. params = Object.assign({
  12822. cell: cell,
  12823. triggerRadio: triggerRadio,
  12824. triggerCheckbox: triggerCheckbox,
  12825. triggerTreeNode: triggerTreeNode,
  12826. triggerExpandNode: triggerExpandNode
  12827. }, params); // 在 v3.0 中废弃 mouse-config.checked
  12828. var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是展开行
  12829. if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
  12830. this.triggerRowExpandEvent(evnt, params);
  12831. } // 如果是树形表格
  12832. if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
  12833. this.triggerTreeExpandEvent(evnt, params);
  12834. } // 如果点击了树节点
  12835. if (!triggerTreeNode) {
  12836. if (!triggerExpandNode) {
  12837. // 如果是高亮行
  12838. if (highlightCurrentRow) {
  12839. if (!triggerCheckbox && !triggerRadio) {
  12840. this.triggerCurrentRowEvent(evnt, params);
  12841. }
  12842. } // 如果是单选框
  12843. if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
  12844. this.triggerRadioRowEvent(evnt, params);
  12845. } // 如果是复选框
  12846. if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
  12847. this.handleToggleCheckRowEvent(evnt, params);
  12848. }
  12849. } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
  12850. if (!isMouseChecked) {
  12851. if (editConfig) {
  12852. if (editOpts.trigger === 'manual') {
  12853. if (actived.args && actived.row === row && column !== actived.column) {
  12854. this.handleChangeCell(evnt, params);
  12855. }
  12856. } else if (!actived.args || row !== actived.row || column !== actived.column) {
  12857. if (editOpts.trigger === 'click') {
  12858. this.handleChangeCell(evnt, params);
  12859. } else if (editOpts.trigger === 'dblclick') {
  12860. if (editOpts.mode === 'row' && actived.row === row) {
  12861. this.handleChangeCell(evnt, params);
  12862. }
  12863. }
  12864. }
  12865. }
  12866. }
  12867. }
  12868. this.emitEvent('cell-click', params, evnt);
  12869. },
  12870. /**
  12871. * 列双击点击事件
  12872. * 如果是双击模式,则激活为编辑状态
  12873. */
  12874. triggerCellDBLClickEvent: function triggerCellDBLClickEvent(evnt, params) {
  12875. var _this29 = this;
  12876. var editStore = this.editStore,
  12877. editConfig = this.editConfig,
  12878. editOpts = this.editOpts;
  12879. var actived = editStore.actived;
  12880. var cell = evnt.currentTarget;
  12881. params.cell = cell;
  12882. if (editConfig && editOpts.trigger === 'dblclick') {
  12883. if (!actived.args || evnt.currentTarget !== actived.args.cell) {
  12884. if (editOpts.mode === 'row') {
  12885. this.checkValidate('blur').catch(function (e) {
  12886. return e;
  12887. }).then(function () {
  12888. _this29.handleActived(params, evnt).then(function () {
  12889. return _this29.checkValidate('change');
  12890. }).catch(function (e) {
  12891. return e;
  12892. });
  12893. });
  12894. } else if (editOpts.mode === 'cell') {
  12895. this.handleActived(params, evnt).then(function () {
  12896. return _this29.checkValidate('change');
  12897. }).catch(function (e) {
  12898. return e;
  12899. });
  12900. }
  12901. }
  12902. }
  12903. this.emitEvent('cell-dblclick', params, evnt);
  12904. },
  12905. handleDefaultSort: function handleDefaultSort() {
  12906. var defaultSort = this.sortOpts.defaultSort;
  12907. if (defaultSort) {
  12908. var field = defaultSort.field,
  12909. order = defaultSort.order;
  12910. if (field && order) {
  12911. var column = ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (item) {
  12912. return item.property === field;
  12913. });
  12914. if (column && !column.order) {
  12915. this.sort(field, order);
  12916. }
  12917. }
  12918. }
  12919. },
  12920. /**
  12921. * 点击排序事件
  12922. */
  12923. triggerSortEvent: function triggerSortEvent(evnt, column, order) {
  12924. var property = column.property;
  12925. if (column.sortable || column.remoteSort) {
  12926. if (!order || column.order === order) {
  12927. this.clearSort();
  12928. } else {
  12929. this.sort(property, order);
  12930. }
  12931. var params = {
  12932. column: column,
  12933. property: property,
  12934. order: column.order,
  12935. sortBy: column.sortBy,
  12936. sortList: this.getSortColumns()
  12937. };
  12938. this.emitEvent('sort-change', params, evnt);
  12939. }
  12940. },
  12941. sort: function sort(field, order) {
  12942. var tableFullColumn = this.tableFullColumn,
  12943. sortOpts = this.sortOpts;
  12944. var column = this.getColumnByField(field);
  12945. if (column) {
  12946. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote;
  12947. if (column.sortable || column.remoteSort) {
  12948. if (arguments.length <= 1) {
  12949. order = getNextSortOrder(this, column);
  12950. }
  12951. if (column.order !== order) {
  12952. tableFullColumn.forEach(function (column) {
  12953. column.order = null;
  12954. });
  12955. column.order = order; // 如果是服务端排序,则跳过本地排序处理
  12956. if (!isRemote) {
  12957. this.handleTableData(true);
  12958. }
  12959. }
  12960. return this.$nextTick().then(this.updateStyle);
  12961. }
  12962. }
  12963. return this.$nextTick();
  12964. },
  12965. /**
  12966. * 手动清空排序条件,数据会恢复成未排序的状态
  12967. */
  12968. clearSort: function clearSort() {
  12969. this.tableFullColumn.forEach(function (column) {
  12970. column.order = null;
  12971. });
  12972. return this.handleTableData(true);
  12973. },
  12974. // 在 v3 中废弃
  12975. getSortColumn: function getSortColumn() {
  12976. // UtilTools.warn('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
  12977. return ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (column) {
  12978. return (column.sortable || column.remoteSort) && column.order;
  12979. });
  12980. },
  12981. isSort: function isSort(field) {
  12982. if (field) {
  12983. var column = this.getColumnByField(field);
  12984. return column && (column.sortable || column.remoteSort) && column.order;
  12985. }
  12986. return this.getSortColumns().length > 0;
  12987. },
  12988. getSortColumns: function getSortColumns() {
  12989. var sortList = [];
  12990. this.tableFullColumn.forEach(function (column) {
  12991. var order = column.order;
  12992. if ((column.sortable || column.remoteSort) && order) {
  12993. sortList.push({
  12994. column: column,
  12995. sortBy: column.sortBy,
  12996. property: column.property,
  12997. order: order
  12998. });
  12999. }
  13000. });
  13001. return sortList;
  13002. },
  13003. /**
  13004. * 关闭筛选
  13005. * @param {Event} evnt 事件
  13006. */
  13007. closeFilter: function closeFilter() {
  13008. Object.assign(this.filterStore, {
  13009. isAllSelected: false,
  13010. isIndeterminate: false,
  13011. options: [],
  13012. visible: false
  13013. });
  13014. return this.$nextTick();
  13015. },
  13016. /**
  13017. * 判断指定列是否为筛选状态,如果为空则判断所有列
  13018. * @param {String} fieldOrColumn 字段名或列
  13019. */
  13020. isFilter: function isFilter(fieldOrColumn) {
  13021. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  13022. if (column) {
  13023. return column.filters && column.filters.some(function (option) {
  13024. return option.checked;
  13025. });
  13026. }
  13027. return this.visibleColumn.some(function (column) {
  13028. return column.filters && column.filters.some(function (option) {
  13029. return option.checked;
  13030. });
  13031. });
  13032. },
  13033. /**
  13034. * 判断展开行是否懒加载完成
  13035. * @param {Row} row 行对象
  13036. */
  13037. isRowExpandLoaded: function isRowExpandLoaded(row) {
  13038. var rest = this.fullAllDataRowMap.get(row);
  13039. return rest && rest.expandLoaded;
  13040. },
  13041. clearRowExpandLoaded: function clearRowExpandLoaded(row) {
  13042. var expandOpts = this.expandOpts,
  13043. expandLazyLoadeds = this.expandLazyLoadeds,
  13044. fullAllDataRowMap = this.fullAllDataRowMap;
  13045. var lazy = expandOpts.lazy;
  13046. var rest = fullAllDataRowMap.get(row);
  13047. if (lazy && rest) {
  13048. rest.expandLoaded = false;
  13049. ctor_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
  13050. return row === item;
  13051. });
  13052. }
  13053. return this.$nextTick();
  13054. },
  13055. /**
  13056. * 重新加载展开行的内容
  13057. * @param {Row} row 行对象
  13058. */
  13059. reloadExpandContent: function reloadExpandContent(row) {
  13060. var _this30 = this;
  13061. var expandOpts = this.expandOpts,
  13062. expandLazyLoadeds = this.expandLazyLoadeds;
  13063. var lazy = expandOpts.lazy;
  13064. if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
  13065. this.clearRowExpandLoaded(row).then(function () {
  13066. return _this30.handleAsyncRowExpand(row);
  13067. });
  13068. }
  13069. return this.$nextTick();
  13070. },
  13071. /**
  13072. * 展开行事件
  13073. */
  13074. triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
  13075. var $listeners = this.$listeners,
  13076. expandOpts = this.expandOpts,
  13077. expandLazyLoadeds = this.expandLazyLoadeds,
  13078. column = this.expandColumn;
  13079. var row = params.row;
  13080. var lazy = expandOpts.lazy;
  13081. if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
  13082. var expanded = !this.isExpandByRow(row);
  13083. var columnIndex = this.getColumnIndex(column);
  13084. var $columnIndex = this.getVMColumnIndex(column);
  13085. this.setRowExpand(row, expanded); // 在 v3.0 中废弃 toggle-expand-change
  13086. if ($listeners['toggle-expand-change']) {
  13087. UtilTools.warn('vxe.error.delEvent', ['toggle-expand-change', 'toggle-row-expand']);
  13088. this.emitEvent('toggle-expand-change', {
  13089. expanded: expanded,
  13090. column: column,
  13091. columnIndex: columnIndex,
  13092. $columnIndex: $columnIndex,
  13093. row: row,
  13094. rowIndex: this.getRowIndex(row),
  13095. $rowIndex: this.getVMRowIndex(row)
  13096. }, evnt);
  13097. } else {
  13098. this.emitEvent('toggle-row-expand', {
  13099. expanded: expanded,
  13100. column: column,
  13101. columnIndex: columnIndex,
  13102. $columnIndex: $columnIndex,
  13103. row: row,
  13104. rowIndex: this.getRowIndex(row),
  13105. $rowIndex: this.getVMRowIndex(row)
  13106. }, evnt);
  13107. }
  13108. }
  13109. },
  13110. toggleRowExpansion: function toggleRowExpansion(row) {
  13111. UtilTools.warn('vxe.error.delFunc', ['toggleRowExpansion', 'toggleRowExpand']);
  13112. return this.toggleRowExpand(row);
  13113. },
  13114. /**
  13115. * 切换展开行
  13116. */
  13117. toggleRowExpand: function toggleRowExpand(row) {
  13118. return this.setRowExpand(row, !this.isExpandByRow(row));
  13119. },
  13120. /**
  13121. * 处理默认展开行
  13122. */
  13123. handleDefaultRowExpand: function handleDefaultRowExpand() {
  13124. var expandOpts = this.expandOpts,
  13125. fullDataRowIdData = this.fullDataRowIdData;
  13126. var expandAll = expandOpts.expandAll,
  13127. expandRowKeys = expandOpts.expandRowKeys;
  13128. if (expandAll) {
  13129. this.setAllRowExpand(true);
  13130. } else if (expandRowKeys) {
  13131. var defExpandeds = [];
  13132. expandRowKeys.forEach(function (rowid) {
  13133. if (fullDataRowIdData[rowid]) {
  13134. defExpandeds.push(fullDataRowIdData[rowid].row);
  13135. }
  13136. });
  13137. this.setRowExpand(defExpandeds, true);
  13138. }
  13139. },
  13140. setAllRowExpansion: function setAllRowExpansion(expanded) {
  13141. UtilTools.warn('vxe.error.delFunc', ['setAllRowExpansion', 'setAllRowExpand']);
  13142. return this.setAllRowExpand(expanded);
  13143. },
  13144. /**
  13145. * 设置所有行的展开与否
  13146. * @param {Boolean} expanded 是否展开
  13147. */
  13148. setAllRowExpand: function setAllRowExpand(expanded) {
  13149. return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
  13150. },
  13151. handleAsyncRowExpand: function handleAsyncRowExpand(row) {
  13152. var _this31 = this;
  13153. var rest = this.fullAllDataRowMap.get(row);
  13154. return new Promise(function (resolve) {
  13155. _this31.expandLazyLoadeds.push(row);
  13156. _this31.expandOpts.loadMethod({
  13157. $table: _this31,
  13158. row: row,
  13159. rowIndex: _this31.getRowIndex(row),
  13160. $rowIndex: _this31.getVMRowIndex(row)
  13161. }).catch(function (e) {
  13162. return e;
  13163. }).then(function () {
  13164. rest.expandLoaded = true;
  13165. ctor_amd_xe_utils_default.a.remove(_this31.expandLazyLoadeds, function (item) {
  13166. return item === row;
  13167. });
  13168. _this31.rowExpandeds.push(row);
  13169. resolve(_this31.$nextTick().then(_this31.recalculate));
  13170. });
  13171. });
  13172. },
  13173. setRowExpansion: function setRowExpansion(rows, expanded) {
  13174. UtilTools.warn('vxe.error.delFunc', ['setRowExpansion', 'setRowExpand']);
  13175. return this.setRowExpand(rows, expanded);
  13176. },
  13177. /**
  13178. * 设置展开行,二个参数设置这一行展开与否
  13179. * 支持单行
  13180. * 支持多行
  13181. * @param {Array/Row} rows 行数据
  13182. * @param {Boolean} expanded 是否展开
  13183. */
  13184. setRowExpand: function setRowExpand(rows, expanded) {
  13185. var _this32 = this;
  13186. var fullAllDataRowMap = this.fullAllDataRowMap,
  13187. expandLazyLoadeds = this.expandLazyLoadeds,
  13188. expandOpts = this.expandOpts,
  13189. column = this.expandColumn;
  13190. var rowExpandeds = this.rowExpandeds;
  13191. var reserve = expandOpts.reserve,
  13192. lazy = expandOpts.lazy,
  13193. accordion = expandOpts.accordion,
  13194. toggleMethod = expandOpts.toggleMethod;
  13195. var lazyRests = [];
  13196. var columnIndex = this.getColumnIndex(column);
  13197. var $columnIndex = this.getVMColumnIndex(column);
  13198. if (rows) {
  13199. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  13200. rows = [rows];
  13201. }
  13202. if (accordion) {
  13203. // 只能同时展开一个
  13204. rowExpandeds = [];
  13205. rows = rows.slice(rows.length - 1, rows.length);
  13206. }
  13207. var validRows = toggleMethod ? rows.filter(function (row) {
  13208. return toggleMethod({
  13209. expanded: expanded,
  13210. column: column,
  13211. columnIndex: columnIndex,
  13212. $columnIndex: $columnIndex,
  13213. row: row,
  13214. rowIndex: _this32.getRowIndex(row),
  13215. $rowIndex: _this32.getVMRowIndex(row)
  13216. });
  13217. }) : rows;
  13218. if (expanded) {
  13219. validRows.forEach(function (row) {
  13220. if (rowExpandeds.indexOf(row) === -1) {
  13221. var rest = fullAllDataRowMap.get(row);
  13222. var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
  13223. if (isLoad) {
  13224. lazyRests.push(_this32.handleAsyncRowExpand(row));
  13225. } else {
  13226. rowExpandeds.push(row);
  13227. }
  13228. }
  13229. });
  13230. } else {
  13231. ctor_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
  13232. return validRows.indexOf(row) > -1;
  13233. });
  13234. }
  13235. if (reserve) {
  13236. validRows.forEach(function (row) {
  13237. return _this32.handleRowExpandReserve(row, expanded);
  13238. });
  13239. }
  13240. }
  13241. this.rowExpandeds = rowExpandeds;
  13242. return Promise.all(lazyRests).then(this.recalculate);
  13243. },
  13244. // 在 v3.0 中废弃 getRecords
  13245. hasRowExpand: function hasRowExpand(row) {
  13246. UtilTools.warn('vxe.error.delFunc', ['hasRowExpand', 'isExpandByRow']);
  13247. return this.isExpandByRow(row);
  13248. },
  13249. /**
  13250. * 判断行是否为展开状态
  13251. * @param {Row} row 行对象
  13252. */
  13253. isExpandByRow: function isExpandByRow(row) {
  13254. return this.rowExpandeds.indexOf(row) > -1;
  13255. },
  13256. /**
  13257. * 手动清空展开行状态,数据会恢复成未展开的状态
  13258. */
  13259. clearRowExpand: function clearRowExpand() {
  13260. var _this33 = this;
  13261. var expandOpts = this.expandOpts,
  13262. rowExpandeds = this.rowExpandeds,
  13263. tableFullData = this.tableFullData;
  13264. var reserve = expandOpts.reserve;
  13265. var isExists = rowExpandeds.length;
  13266. this.rowExpandeds = [];
  13267. if (reserve) {
  13268. tableFullData.forEach(function (row) {
  13269. return _this33.handleRowExpandReserve(row, false);
  13270. });
  13271. }
  13272. return this.$nextTick().then(function () {
  13273. if (isExists) {
  13274. _this33.recalculate();
  13275. }
  13276. });
  13277. },
  13278. clearRowExpandReserve: function clearRowExpandReserve() {
  13279. this.rowExpandedReserveRowMap = {};
  13280. return this.$nextTick();
  13281. },
  13282. handleRowExpandReserve: function handleRowExpandReserve(row, expanded) {
  13283. var rowExpandedReserveRowMap = this.rowExpandedReserveRowMap,
  13284. expandOpts = this.expandOpts;
  13285. if (expandOpts.reserve) {
  13286. var rowid = methods_getRowid(this, row);
  13287. if (expanded) {
  13288. rowExpandedReserveRowMap[rowid] = row;
  13289. } else if (rowExpandedReserveRowMap[rowid]) {
  13290. delete rowExpandedReserveRowMap[rowid];
  13291. }
  13292. }
  13293. },
  13294. getRowExpandRecords: function getRowExpandRecords() {
  13295. return this.rowExpandeds.slice(0);
  13296. },
  13297. getTreeExpandRecords: function getTreeExpandRecords() {
  13298. return this.treeExpandeds.slice(0);
  13299. },
  13300. /**
  13301. * 获取数表格状态
  13302. */
  13303. getTreeStatus: function getTreeStatus() {
  13304. if (this.treeConfig) {
  13305. return {
  13306. config: this.treeOpts,
  13307. rowExpandeds: this.getTreeExpandRecords()
  13308. };
  13309. }
  13310. return null;
  13311. },
  13312. /**
  13313. * 判断树节点是否懒加载完成
  13314. * @param {Row} row 行对象
  13315. */
  13316. isTreeExpandLoaded: function isTreeExpandLoaded(row) {
  13317. var rest = this.fullAllDataRowMap.get(row);
  13318. return rest && rest.treeLoaded;
  13319. },
  13320. clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
  13321. var treeOpts = this.treeOpts,
  13322. treeExpandeds = this.treeExpandeds,
  13323. fullAllDataRowMap = this.fullAllDataRowMap;
  13324. var lazy = treeOpts.lazy;
  13325. var rest = fullAllDataRowMap.get(row);
  13326. if (lazy && rest) {
  13327. rest.treeLoaded = false;
  13328. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13329. return row === item;
  13330. });
  13331. }
  13332. return this.$nextTick();
  13333. },
  13334. /**
  13335. * 重新加载树的子节点
  13336. * @param {Row} row 行对象
  13337. */
  13338. reloadTreeChilds: function reloadTreeChilds(row) {
  13339. var _this34 = this;
  13340. var treeOpts = this.treeOpts,
  13341. treeLazyLoadeds = this.treeLazyLoadeds;
  13342. var lazy = treeOpts.lazy,
  13343. hasChild = treeOpts.hasChild;
  13344. if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
  13345. this.clearTreeExpandLoaded(row).then(function () {
  13346. return _this34.handleAsyncTreeExpandChilds(row);
  13347. });
  13348. }
  13349. return this.$nextTick();
  13350. },
  13351. /**
  13352. * 展开树节点事件
  13353. */
  13354. triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
  13355. var $listeners = this.$listeners,
  13356. treeOpts = this.treeOpts,
  13357. treeLazyLoadeds = this.treeLazyLoadeds;
  13358. var row = params.row,
  13359. column = params.column;
  13360. var lazy = treeOpts.lazy;
  13361. if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
  13362. var expanded = !this.isTreeExpandByRow(row);
  13363. var columnIndex = this.getColumnIndex(column);
  13364. var $columnIndex = this.getVMColumnIndex(column);
  13365. this.setTreeExpand(row, expanded); // 在 v3.0 中废弃 toggle-tree-change
  13366. if ($listeners['toggle-tree-change']) {
  13367. UtilTools.warn('vxe.error.delEvent', ['toggle-tree-change', 'toggle-tree-expand']);
  13368. this.emitEvent('toggle-tree-change', {
  13369. expanded: expanded,
  13370. column: column,
  13371. columnIndex: columnIndex,
  13372. $columnIndex: $columnIndex,
  13373. row: row
  13374. }, evnt);
  13375. } else {
  13376. this.emitEvent('toggle-tree-expand', {
  13377. expanded: expanded,
  13378. column: column,
  13379. columnIndex: columnIndex,
  13380. $columnIndex: $columnIndex,
  13381. row: row
  13382. }, evnt);
  13383. }
  13384. }
  13385. },
  13386. toggleTreeExpansion: function toggleTreeExpansion(row) {
  13387. UtilTools.warn('vxe.error.delFunc', ['toggleTreeExpansion', 'toggleTreeExpand']);
  13388. return this.toggleTreeExpand(row);
  13389. },
  13390. /**
  13391. * 切换/展开树节点
  13392. */
  13393. toggleTreeExpand: function toggleTreeExpand(row) {
  13394. return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
  13395. },
  13396. /**
  13397. * 处理默认展开树节点
  13398. */
  13399. handleDefaultTreeExpand: function handleDefaultTreeExpand() {
  13400. var treeConfig = this.treeConfig,
  13401. treeOpts = this.treeOpts,
  13402. tableFullData = this.tableFullData;
  13403. if (treeConfig) {
  13404. var expandAll = treeOpts.expandAll,
  13405. expandRowKeys = treeOpts.expandRowKeys;
  13406. if (expandAll) {
  13407. this.setAllTreeExpand(true);
  13408. } else if (expandRowKeys) {
  13409. var defExpandeds = [];
  13410. var rowkey = getRowkey(this);
  13411. expandRowKeys.forEach(function (rowid) {
  13412. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13413. return rowid === ctor_amd_xe_utils_default.a.get(item, rowkey);
  13414. }, treeOpts);
  13415. if (matchObj) {
  13416. defExpandeds.push(matchObj.item);
  13417. }
  13418. });
  13419. this.setTreeExpand(defExpandeds, true);
  13420. }
  13421. }
  13422. },
  13423. handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
  13424. var _this35 = this;
  13425. var fullAllDataRowMap = this.fullAllDataRowMap,
  13426. treeExpandeds = this.treeExpandeds,
  13427. treeOpts = this.treeOpts,
  13428. treeLazyLoadeds = this.treeLazyLoadeds,
  13429. checkboxOpts = this.checkboxOpts;
  13430. var loadMethod = treeOpts.loadMethod;
  13431. var checkStrictly = checkboxOpts.checkStrictly;
  13432. var rest = fullAllDataRowMap.get(row);
  13433. return new Promise(function (resolve) {
  13434. treeLazyLoadeds.push(row);
  13435. loadMethod({
  13436. $table: _this35,
  13437. row: row
  13438. }).catch(function () {
  13439. return [];
  13440. }).then(function (childRecords) {
  13441. rest.treeLoaded = true;
  13442. ctor_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
  13443. return item === row;
  13444. });
  13445. if (!ctor_amd_xe_utils_default.a.isArray(childRecords)) {
  13446. childRecords = [];
  13447. }
  13448. if (childRecords) {
  13449. _this35.loadChildren(row, childRecords).then(function (childRows) {
  13450. if (childRows.length && treeExpandeds.indexOf(row) === -1) {
  13451. treeExpandeds.push(row);
  13452. } // 如果当前节点已选中,则展开后子节点也被选中
  13453. if (!checkStrictly && _this35.isCheckedByCheckboxRow(row)) {
  13454. _this35.setCheckboxRow(childRows, true);
  13455. }
  13456. });
  13457. }
  13458. resolve(_this35.$nextTick().then(_this35.recalculate));
  13459. });
  13460. });
  13461. },
  13462. setAllTreeExpansion: function setAllTreeExpansion(expanded) {
  13463. UtilTools.warn('vxe.error.delFunc', ['setAllTreeExpansion', 'setAllTreeExpand']);
  13464. return this.setAllTreeExpand(expanded);
  13465. },
  13466. /**
  13467. * 设置所有树节点的展开与否
  13468. * @param {Boolean} expanded 是否展开
  13469. */
  13470. setAllTreeExpand: function setAllTreeExpand(expanded) {
  13471. var tableFullData = this.tableFullData,
  13472. treeOpts = this.treeOpts;
  13473. var lazy = treeOpts.lazy,
  13474. children = treeOpts.children;
  13475. var expandeds = [];
  13476. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  13477. var rowChildren = row[children];
  13478. if (lazy || rowChildren && rowChildren.length) {
  13479. expandeds.push(row);
  13480. }
  13481. }, treeOpts);
  13482. return this.setTreeExpand(expandeds, expanded);
  13483. },
  13484. setTreeExpansion: function setTreeExpansion(rows, expanded) {
  13485. UtilTools.warn('vxe.error.delFunc', ['setTreeExpansion', 'setTreeExpand']);
  13486. return this.setTreeExpand(rows, expanded);
  13487. },
  13488. /**
  13489. * 设置展开树形节点,二个参数设置这一行展开与否
  13490. * 支持单行
  13491. * 支持多行
  13492. * @param {Array/Row} rows 行数据
  13493. * @param {Boolean} expanded 是否展开
  13494. */
  13495. setTreeExpand: function setTreeExpand(rows, expanded) {
  13496. var _this36 = this;
  13497. var fullAllDataRowMap = this.fullAllDataRowMap,
  13498. tableFullData = this.tableFullData,
  13499. treeExpandeds = this.treeExpandeds,
  13500. treeOpts = this.treeOpts,
  13501. treeLazyLoadeds = this.treeLazyLoadeds,
  13502. treeNodeColumn = this.treeNodeColumn;
  13503. var reserve = treeOpts.reserve,
  13504. lazy = treeOpts.lazy,
  13505. hasChild = treeOpts.hasChild,
  13506. children = treeOpts.children,
  13507. accordion = treeOpts.accordion,
  13508. toggleMethod = treeOpts.toggleMethod;
  13509. var result = [];
  13510. var columnIndex = this.getColumnIndex(treeNodeColumn);
  13511. var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
  13512. if (rows) {
  13513. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  13514. rows = [rows];
  13515. }
  13516. if (rows.length) {
  13517. var validRows = toggleMethod ? rows.filter(function (row) {
  13518. return toggleMethod({
  13519. expanded: expanded,
  13520. column: treeNodeColumn,
  13521. columnIndex: columnIndex,
  13522. $columnIndex: $columnIndex,
  13523. row: row
  13524. });
  13525. }) : rows;
  13526. if (accordion) {
  13527. validRows = validRows.length ? [validRows[validRows.length - 1]] : []; // 同一级只能展开一个
  13528. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13529. return item === validRows[0];
  13530. }, treeOpts);
  13531. if (matchObj) {
  13532. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13533. return matchObj.items.indexOf(item) > -1;
  13534. });
  13535. }
  13536. }
  13537. if (expanded) {
  13538. validRows.forEach(function (row) {
  13539. if (treeExpandeds.indexOf(row) === -1) {
  13540. var rest = fullAllDataRowMap.get(row);
  13541. var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
  13542. if (isLoad) {
  13543. result.push(_this36.handleAsyncTreeExpandChilds(row));
  13544. } else {
  13545. if (row[children] && row[children].length) {
  13546. treeExpandeds.push(row);
  13547. }
  13548. }
  13549. }
  13550. });
  13551. } else {
  13552. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
  13553. return validRows.indexOf(row) > -1;
  13554. });
  13555. }
  13556. if (reserve) {
  13557. validRows.forEach(function (row) {
  13558. return _this36.handleTreeExpandReserve(row, expanded);
  13559. });
  13560. }
  13561. return Promise.all(result).then(this.recalculate);
  13562. }
  13563. }
  13564. return this.$nextTick();
  13565. },
  13566. // 在 v3.0 中废弃 hasTreeExpand
  13567. hasTreeExpand: function hasTreeExpand(row) {
  13568. UtilTools.warn('vxe.error.delFunc', ['hasTreeExpand', 'isTreeExpandByRow']);
  13569. return this.isTreeExpandByRow(row);
  13570. },
  13571. /**
  13572. * 判断行是否为树形节点展开状态
  13573. * @param {Row} row 行对象
  13574. */
  13575. isTreeExpandByRow: function isTreeExpandByRow(row) {
  13576. return this.treeExpandeds.indexOf(row) > -1;
  13577. },
  13578. /**
  13579. * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
  13580. */
  13581. clearTreeExpand: function clearTreeExpand() {
  13582. var _this37 = this;
  13583. var treeOpts = this.treeOpts,
  13584. treeExpandeds = this.treeExpandeds,
  13585. tableFullData = this.tableFullData;
  13586. var reserve = treeOpts.reserve;
  13587. var isExists = treeExpandeds.length;
  13588. this.treeExpandeds = [];
  13589. if (reserve) {
  13590. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  13591. return _this37.handleTreeExpandReserve(row, false);
  13592. }, treeOpts);
  13593. }
  13594. return this.$nextTick().then(function () {
  13595. if (isExists) {
  13596. _this37.recalculate();
  13597. }
  13598. });
  13599. },
  13600. clearTreeExpandReserve: function clearTreeExpandReserve() {
  13601. this.treeExpandedReserveRowMap = {};
  13602. return this.$nextTick();
  13603. },
  13604. handleTreeExpandReserve: function handleTreeExpandReserve(row, expanded) {
  13605. var treeExpandedReserveRowMap = this.treeExpandedReserveRowMap,
  13606. treeOpts = this.treeOpts;
  13607. if (treeOpts.reserve) {
  13608. var rowid = methods_getRowid(this, row);
  13609. if (expanded) {
  13610. treeExpandedReserveRowMap[rowid] = row;
  13611. } else if (treeExpandedReserveRowMap[rowid]) {
  13612. delete treeExpandedReserveRowMap[rowid];
  13613. }
  13614. }
  13615. },
  13616. getVirtualScroller: function getVirtualScroller() {
  13617. UtilTools.warn('vxe.error.delFunc', ['getVirtualScroller', 'getScroll']);
  13618. return this.getScroll();
  13619. },
  13620. getTableScroll: function getTableScroll() {
  13621. UtilTools.warn('vxe.error.delFunc', ['getTableScroll', 'getScroll']);
  13622. return this.getScroll();
  13623. },
  13624. /**
  13625. * 获取表格的滚动状态
  13626. */
  13627. getScroll: function getScroll() {
  13628. var $refs = this.$refs,
  13629. scrollXLoad = this.scrollXLoad,
  13630. scrollYLoad = this.scrollYLoad;
  13631. var bodyElem = $refs.tableBody.$el;
  13632. return {
  13633. virtualX: scrollXLoad,
  13634. virtualY: scrollYLoad,
  13635. scrollTop: bodyElem.scrollTop,
  13636. scrollLeft: bodyElem.scrollLeft
  13637. };
  13638. },
  13639. /**
  13640. * 横向 X 可视渲染事件处理
  13641. */
  13642. triggerScrollXEvent: function triggerScrollXEvent() {
  13643. this.loadScrollXData();
  13644. },
  13645. loadScrollXData: function loadScrollXData(force) {
  13646. var $refs = this.$refs,
  13647. visibleColumn = this.visibleColumn,
  13648. scrollXStore = this.scrollXStore;
  13649. var startIndex = scrollXStore.startIndex,
  13650. renderSize = scrollXStore.renderSize,
  13651. offsetSize = scrollXStore.offsetSize,
  13652. visibleSize = scrollXStore.visibleSize;
  13653. var scrollBodyElem = $refs.tableBody.$el;
  13654. var scrollLeft = scrollBodyElem.scrollLeft;
  13655. var toVisibleIndex = 0;
  13656. var width = 0;
  13657. var preload = force || false;
  13658. var colLen = visibleColumn.length;
  13659. for (var colIndex = 0; colIndex < colLen; colIndex++) {
  13660. width += visibleColumn[colIndex].renderWidth;
  13661. if (scrollLeft < width) {
  13662. toVisibleIndex = colIndex;
  13663. break;
  13664. }
  13665. }
  13666. if (force || scrollXStore.visibleIndex !== toVisibleIndex) {
  13667. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  13668. if (scrollXStore.visibleIndex === toVisibleIndex) {
  13669. scrollXStore.startIndex = toVisibleIndex;
  13670. } else if (scrollXStore.visibleIndex > toVisibleIndex) {
  13671. // 向左
  13672. preload = toVisibleIndex - offsetSize <= startIndex;
  13673. if (preload) {
  13674. scrollXStore.startIndex = Math.max(0, Math.max(0, toVisibleIndex - marginSize));
  13675. }
  13676. } else {
  13677. // 向右
  13678. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  13679. if (preload) {
  13680. scrollXStore.startIndex = Math.max(0, Math.min(visibleColumn.length - renderSize, toVisibleIndex - marginSize));
  13681. }
  13682. }
  13683. if (preload) {
  13684. this.updateScrollXData();
  13685. }
  13686. scrollXStore.visibleIndex = toVisibleIndex;
  13687. }
  13688. this.closeTooltip();
  13689. },
  13690. /**
  13691. * 纵向 Y 可视渲染事件处理
  13692. */
  13693. triggerScrollYEvent: function triggerScrollYEvent(evnt) {
  13694. var scrollYStore = this.scrollYStore;
  13695. var adaptive = scrollYStore.adaptive,
  13696. offsetSize = scrollYStore.offsetSize,
  13697. visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式
  13698. if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 80) {
  13699. this.loadScrollYData(evnt);
  13700. } else {
  13701. this.debounceScrollY(evnt);
  13702. }
  13703. },
  13704. debounceScrollY: ctor_amd_xe_utils_default.a.debounce(function (evnt) {
  13705. this.loadScrollYData(evnt);
  13706. }, debounceScrollYDuration, {
  13707. leading: false,
  13708. trailing: true
  13709. }),
  13710. /**
  13711. * 纵向 Y 可视渲染处理
  13712. */
  13713. loadScrollYData: function loadScrollYData(evnt) {
  13714. var afterFullData = this.afterFullData,
  13715. scrollYStore = this.scrollYStore,
  13716. isLoadData = this.isLoadData;
  13717. var startIndex = scrollYStore.startIndex,
  13718. renderSize = scrollYStore.renderSize,
  13719. offsetSize = scrollYStore.offsetSize,
  13720. visibleSize = scrollYStore.visibleSize,
  13721. rowHeight = scrollYStore.rowHeight;
  13722. var scrollBodyElem = evnt.target;
  13723. var scrollTop = scrollBodyElem.scrollTop;
  13724. var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
  13725. var preload = false;
  13726. if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
  13727. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  13728. if (scrollYStore.visibleIndex > toVisibleIndex) {
  13729. // 向上
  13730. preload = toVisibleIndex - offsetSize <= startIndex;
  13731. if (preload) {
  13732. scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
  13733. }
  13734. } else {
  13735. // 向下
  13736. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  13737. if (preload) {
  13738. scrollYStore.startIndex = Math.max(0, Math.min(afterFullData.length - renderSize, toVisibleIndex - marginSize));
  13739. }
  13740. }
  13741. if (preload) {
  13742. this.updateScrollYData();
  13743. }
  13744. scrollYStore.visibleIndex = toVisibleIndex;
  13745. this.isLoadData = false;
  13746. }
  13747. },
  13748. computeRowHeight: function computeRowHeight() {
  13749. var tableBody = this.$refs.tableBody;
  13750. var tableBodyElem = tableBody ? tableBody.$el : null;
  13751. var tableHeader = this.$refs.tableHeader;
  13752. var rowHeight;
  13753. if (tableBodyElem) {
  13754. var firstTrElem = tableBodyElem.querySelector('tbody>tr');
  13755. if (!firstTrElem && tableHeader) {
  13756. firstTrElem = tableHeader.$el.querySelector('thead>tr');
  13757. }
  13758. if (firstTrElem) {
  13759. rowHeight = firstTrElem.clientHeight;
  13760. }
  13761. } // 默认的行高
  13762. if (!rowHeight) {
  13763. rowHeight = this.rowHeightMaps[this.vSize || 'default'];
  13764. }
  13765. this.rowHeight = rowHeight;
  13766. },
  13767. // 计算可视渲染相关数据
  13768. computeScrollLoad: function computeScrollLoad() {
  13769. var _this38 = this;
  13770. return this.$nextTick().then(function () {
  13771. var vSize = _this38.vSize,
  13772. scrollXLoad = _this38.scrollXLoad,
  13773. scrollYLoad = _this38.scrollYLoad,
  13774. sYOpts = _this38.sYOpts,
  13775. scrollYStore = _this38.scrollYStore,
  13776. sXOpts = _this38.sXOpts,
  13777. scrollXStore = _this38.scrollXStore,
  13778. visibleColumn = _this38.visibleColumn,
  13779. rowHeightMaps = _this38.rowHeightMaps;
  13780. var tableBody = _this38.$refs.tableBody;
  13781. var tableBodyElem = tableBody ? tableBody.$el : null;
  13782. var tableHeader = _this38.$refs.tableHeader;
  13783. if (tableBodyElem) {
  13784. // 计算 X 逻辑
  13785. if (scrollXLoad) {
  13786. var bodyWidth = tableBodyElem.clientWidth;
  13787. var visibleXSize = ctor_amd_xe_utils_default.a.toNumber(sXOpts.vSize);
  13788. if (!sXOpts.vSize) {
  13789. var len = visibleXSize = visibleColumn.length;
  13790. var countWidth = 0;
  13791. var column;
  13792. for (var colIndex = 0; colIndex < len; colIndex++) {
  13793. column = visibleColumn[colIndex];
  13794. countWidth += column.renderWidth;
  13795. if (countWidth > bodyWidth) {
  13796. visibleXSize = colIndex + 1;
  13797. break;
  13798. }
  13799. }
  13800. }
  13801. scrollXStore.visibleSize = visibleXSize; // 自动优化
  13802. if (!sXOpts.oSize) {
  13803. scrollXStore.offsetSize = visibleXSize;
  13804. }
  13805. if (!sXOpts.rSize) {
  13806. scrollXStore.renderSize = Math.max(8, visibleXSize + 6);
  13807. }
  13808. _this38.updateScrollXData();
  13809. } else {
  13810. _this38.updateScrollXSpace();
  13811. } // 计算 Y 逻辑
  13812. if (scrollYLoad) {
  13813. var rHeight;
  13814. if (sYOpts.rHeight) {
  13815. rHeight = sYOpts.rHeight;
  13816. } else {
  13817. var firstTrElem = tableBodyElem.querySelector('tbody>tr');
  13818. if (!firstTrElem && tableHeader) {
  13819. firstTrElem = tableHeader.$el.querySelector('thead>tr');
  13820. }
  13821. if (firstTrElem) {
  13822. rHeight = firstTrElem.clientHeight;
  13823. }
  13824. } // 默认的行高
  13825. if (!rHeight) {
  13826. rHeight = rowHeightMaps[vSize || 'default'];
  13827. }
  13828. var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil(tableBodyElem.clientHeight / rHeight));
  13829. scrollYStore.visibleSize = visibleYSize;
  13830. scrollYStore.rowHeight = rHeight; // 自动优化
  13831. if (!sYOpts.oSize) {
  13832. scrollYStore.offsetSize = visibleYSize;
  13833. }
  13834. if (!sYOpts.rSize) {
  13835. scrollYStore.renderSize = Math.max(6, methods_browse.edge ? visibleYSize * 10 : isWebkit ? visibleYSize + 2 : visibleYSize * 6);
  13836. }
  13837. _this38.updateScrollYData();
  13838. } else {
  13839. _this38.updateScrollYSpace();
  13840. }
  13841. }
  13842. _this38.$nextTick(_this38.updateStyle);
  13843. });
  13844. },
  13845. updateScrollXData: function updateScrollXData() {
  13846. var visibleColumn = this.visibleColumn,
  13847. scrollXStore = this.scrollXStore;
  13848. this.tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
  13849. this.updateScrollXSpace();
  13850. },
  13851. // 更新横向 X 可视渲染上下剩余空间大小
  13852. updateScrollXSpace: function updateScrollXSpace() {
  13853. var $refs = this.$refs,
  13854. elemStore = this.elemStore,
  13855. visibleColumn = this.visibleColumn,
  13856. scrollXStore = this.scrollXStore,
  13857. scrollXLoad = this.scrollXLoad,
  13858. tableWidth = this.tableWidth,
  13859. scrollbarWidth = this.scrollbarWidth;
  13860. var tableHeader = $refs.tableHeader,
  13861. tableBody = $refs.tableBody,
  13862. tableFooter = $refs.tableFooter;
  13863. var headerElem = tableHeader ? tableHeader.$el.querySelector('.vxe-table--header') : null;
  13864. var bodyElem = tableBody.$el.querySelector('.vxe-table--body');
  13865. var footerElem = tableFooter ? tableFooter.$el.querySelector('.vxe-table--footer') : null;
  13866. var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) {
  13867. return previous + column.renderWidth;
  13868. }, 0);
  13869. var marginLeft = '';
  13870. if (scrollXLoad) {
  13871. marginLeft = "".concat(leftSpaceWidth, "px");
  13872. }
  13873. if (headerElem) {
  13874. headerElem.style.marginLeft = marginLeft;
  13875. }
  13876. bodyElem.style.marginLeft = marginLeft;
  13877. if (footerElem) {
  13878. footerElem.style.marginLeft = marginLeft;
  13879. }
  13880. var containerList = ['main'];
  13881. containerList.forEach(function (name) {
  13882. var layoutList = ['header', 'body', 'footer'];
  13883. layoutList.forEach(function (layout) {
  13884. var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")];
  13885. if (xSpaceElem) {
  13886. xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : '';
  13887. }
  13888. });
  13889. });
  13890. this.$nextTick(this.updateStyle);
  13891. },
  13892. updateScrollYData: function updateScrollYData() {
  13893. this.handleTableData();
  13894. this.updateScrollYSpace();
  13895. },
  13896. // 更新纵向 Y 可视渲染上下剩余空间大小
  13897. updateScrollYSpace: function updateScrollYSpace() {
  13898. var elemStore = this.elemStore,
  13899. scrollYStore = this.scrollYStore,
  13900. scrollYLoad = this.scrollYLoad,
  13901. afterFullData = this.afterFullData;
  13902. var bodyHeight = afterFullData.length * scrollYStore.rowHeight;
  13903. var topSpaceHeight = Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0);
  13904. var containerList = ['main', 'left', 'right'];
  13905. var marginTop = '';
  13906. var ySpaceHeight = '';
  13907. if (scrollYLoad) {
  13908. marginTop = "".concat(topSpaceHeight, "px");
  13909. ySpaceHeight = "".concat(bodyHeight, "px");
  13910. }
  13911. containerList.forEach(function (name) {
  13912. var layoutList = ['header', 'body', 'footer'];
  13913. var tableElem = elemStore["".concat(name, "-body-table")];
  13914. if (tableElem) {
  13915. tableElem.style.marginTop = marginTop;
  13916. }
  13917. layoutList.forEach(function (layout) {
  13918. var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")];
  13919. if (ySpaceElem) {
  13920. ySpaceElem.style.height = ySpaceHeight;
  13921. }
  13922. });
  13923. });
  13924. this.$nextTick(this.updateStyle);
  13925. },
  13926. /**
  13927. * 如果有滚动条,则滚动到对应的位置
  13928. * @param {Number} scrollLeft 左距离
  13929. * @param {Number} scrollTop 上距离
  13930. */
  13931. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  13932. var _this39 = this;
  13933. var $refs = this.$refs;
  13934. var tableBody = $refs.tableBody,
  13935. rightBody = $refs.rightBody,
  13936. tableFooter = $refs.tableFooter;
  13937. var tableBodyElem = tableBody ? tableBody.$el : null;
  13938. var rightBodyElem = rightBody ? rightBody.$el : null;
  13939. var bodyTargetElem = rightBodyElem || tableBodyElem;
  13940. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  13941. var footerTargetElem = tableFooterElem || tableBodyElem;
  13942. if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  13943. footerTargetElem.scrollLeft = scrollLeft;
  13944. }
  13945. if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
  13946. bodyTargetElem.scrollTop = scrollTop;
  13947. }
  13948. if (this.scrollXLoad || this.scrollYLoad) {
  13949. return new Promise(function (resolve) {
  13950. return setTimeout(function () {
  13951. return resolve(_this39.$nextTick());
  13952. }, 50);
  13953. });
  13954. }
  13955. return this.$nextTick();
  13956. },
  13957. /**
  13958. * 如果有滚动条,则滚动到对应的行
  13959. * @param {Row} row 行对象
  13960. * @param {ColumnInfo} column 列配置
  13961. */
  13962. scrollToRow: function scrollToRow(row, column) {
  13963. var rest = [];
  13964. if (row) {
  13965. if (this.treeConfig) {
  13966. rest.push(this.scrollToTreeRow(row));
  13967. } else {
  13968. rest.push(DomTools.rowToVisible(this, row));
  13969. }
  13970. }
  13971. if (column) {
  13972. rest.push(this.scrollToColumn(column));
  13973. }
  13974. return Promise.all(rest);
  13975. },
  13976. /**
  13977. * 如果有滚动条,则滚动到对应的列
  13978. * @param {ColumnInfo} column 列配置
  13979. */
  13980. scrollToColumn: function scrollToColumn(column) {
  13981. if (column && this.fullColumnMap.has(column)) {
  13982. return DomTools.colToVisible(this, column);
  13983. }
  13984. return this.$nextTick();
  13985. },
  13986. /**
  13987. * 对于树形结构中,可以直接滚动到指定深层节点中
  13988. * 对于某些特定的场景可能会用到,比如定位到某一节点
  13989. * @param {Row} row 行对象
  13990. */
  13991. scrollToTreeRow: function scrollToTreeRow(row) {
  13992. var _this40 = this;
  13993. var tableFullData = this.tableFullData,
  13994. treeConfig = this.treeConfig,
  13995. treeOpts = this.treeOpts;
  13996. var rests = [];
  13997. if (treeConfig) {
  13998. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13999. return item === row;
  14000. }, treeOpts);
  14001. if (matchObj) {
  14002. var nodes = matchObj.nodes;
  14003. nodes.forEach(function (row, index) {
  14004. if (index < nodes.length - 1 && !_this40.isTreeExpandByRow(row)) {
  14005. rests.push(_this40.setTreeExpand(row, true));
  14006. }
  14007. });
  14008. }
  14009. }
  14010. return Promise.all(rests).then(function () {
  14011. return DomTools.rowToVisible(_this40, row);
  14012. });
  14013. },
  14014. /**
  14015. * 手动清除滚动相关信息,还原到初始状态
  14016. */
  14017. clearScroll: function clearScroll() {
  14018. var $refs = this.$refs;
  14019. var tableBody = $refs.tableBody,
  14020. rightBody = $refs.rightBody,
  14021. tableFooter = $refs.tableFooter;
  14022. var tableBodyElem = tableBody ? tableBody.$el : null;
  14023. var rightBodyElem = rightBody ? rightBody.$el : null;
  14024. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  14025. if (rightBodyElem) {
  14026. rightBodyElem.scrollTop = 0;
  14027. }
  14028. if (tableFooterElem) {
  14029. tableFooterElem.scrollLeft = 0;
  14030. }
  14031. if (tableBodyElem) {
  14032. tableBodyElem.scrollTop = 0;
  14033. tableBodyElem.scrollLeft = 0;
  14034. }
  14035. return this.$nextTick();
  14036. },
  14037. /**
  14038. * 更新表尾合计
  14039. */
  14040. updateFooter: function updateFooter() {
  14041. var showFooter = this.showFooter,
  14042. visibleColumn = this.visibleColumn,
  14043. footerMethod = this.footerMethod;
  14044. if (showFooter && footerMethod) {
  14045. this.footerTableData = visibleColumn.length ? footerMethod({
  14046. columns: visibleColumn,
  14047. data: this.afterFullData,
  14048. $table: this,
  14049. $grid: this.$xegrid
  14050. }) : [];
  14051. }
  14052. return this.$nextTick();
  14053. },
  14054. /**
  14055. * 更新列状态
  14056. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
  14057. * 如果单元格配置了校验规则,则会进行校验
  14058. */
  14059. updateStatus: function updateStatus(scope, cellValue) {
  14060. var _this41 = this;
  14061. var customVal = !ctor_amd_xe_utils_default.a.isUndefined(cellValue);
  14062. return this.$nextTick().then(function () {
  14063. var $refs = _this41.$refs,
  14064. editRules = _this41.editRules,
  14065. validStore = _this41.validStore;
  14066. if (scope && $refs.tableBody && editRules) {
  14067. var row = scope.row,
  14068. column = scope.column;
  14069. var type = 'change';
  14070. if (_this41.hasCellRules(type, row, column)) {
  14071. var cell = _this41.getCell(row, column);
  14072. if (cell) {
  14073. return _this41.validCellRules(type, row, column, cellValue).then(function () {
  14074. if (customVal && validStore.visible) {
  14075. methods_setCellValue(row, column, cellValue);
  14076. }
  14077. _this41.clearValidate();
  14078. }).catch(function (_ref6) {
  14079. var rule = _ref6.rule;
  14080. if (customVal) {
  14081. methods_setCellValue(row, column, cellValue);
  14082. }
  14083. _this41.showValidTooltip({
  14084. rule: rule,
  14085. row: row,
  14086. column: column,
  14087. cell: cell
  14088. });
  14089. });
  14090. }
  14091. }
  14092. }
  14093. });
  14094. },
  14095. handleDefaultMergeCells: function handleDefaultMergeCells() {
  14096. this.setMergeCells(this.mergeCells);
  14097. },
  14098. /**
  14099. * 设置合并单元格
  14100. * @param {MergeOptions[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
  14101. */
  14102. setMergeCells: function setMergeCells(merges) {
  14103. var _this42 = this;
  14104. if (this.spanMethod) {
  14105. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14106. }
  14107. setMerges(this, merges, this.mergeList, this.afterFullData);
  14108. return this.$nextTick().then(function () {
  14109. return _this42.updateCellAreas();
  14110. });
  14111. },
  14112. /**
  14113. * 移除单元格合并
  14114. * @param {MergeOptions[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
  14115. */
  14116. removeMergeCells: function removeMergeCells(merges) {
  14117. var _this43 = this;
  14118. if (this.spanMethod) {
  14119. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14120. }
  14121. var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
  14122. return this.$nextTick().then(function () {
  14123. _this43.updateCellAreas();
  14124. return rest;
  14125. });
  14126. },
  14127. /**
  14128. * 获取所有被合并的单元格
  14129. */
  14130. getMergeCells: function getMergeCells() {
  14131. return this.mergeList.slice(0);
  14132. },
  14133. /**
  14134. * 清除所有单元格合并
  14135. */
  14136. clearMergeCells: function clearMergeCells() {
  14137. this.mergeList = [];
  14138. return this.$nextTick();
  14139. },
  14140. handleDefaultMergeFooterItems: function handleDefaultMergeFooterItems() {
  14141. this.setMergeFooterItems(this.mergeFooterItems);
  14142. },
  14143. setMergeFooterItems: function setMergeFooterItems(merges) {
  14144. var _this44 = this;
  14145. if (this.footerSpanMethod) {
  14146. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14147. }
  14148. setMerges(this, merges, this.mergeFooterList, null);
  14149. return this.$nextTick().then(function () {
  14150. return _this44.updateCellAreas();
  14151. });
  14152. },
  14153. removeMergeFooterItems: function removeMergeFooterItems(merges) {
  14154. var _this45 = this;
  14155. if (this.footerSpanMethod) {
  14156. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14157. }
  14158. var rest = removeMerges(this, merges, this.mergeFooterList, null);
  14159. return this.$nextTick().then(function () {
  14160. _this45.updateCellAreas();
  14161. return rest;
  14162. });
  14163. },
  14164. /**
  14165. * 获取所有被合并的表尾
  14166. */
  14167. getMergeFooterItems: function getMergeFooterItems() {
  14168. return this.mergeFooterList.slice(0);
  14169. },
  14170. /**
  14171. * 清除所有表尾合并
  14172. */
  14173. clearMergeFooterItems: function clearMergeFooterItems() {
  14174. this.mergeFooterList = [];
  14175. return this.$nextTick();
  14176. },
  14177. updateZindex: function updateZindex() {
  14178. if (this.zIndex) {
  14179. this.tZindex = this.zIndex;
  14180. } else if (this.tZindex < UtilTools.getLastZIndex()) {
  14181. this.tZindex = UtilTools.nextZIndex();
  14182. }
  14183. },
  14184. updateCellAreas: function updateCellAreas() {
  14185. if (this.mouseConfig && this.mouseOpts.area && this.handleUpdateCellAreas) {
  14186. this.handleUpdateCellAreas();
  14187. }
  14188. },
  14189. emitEvent: function emitEvent(type, params, evnt) {
  14190. this.$emit(type, Object.assign({
  14191. $table: this,
  14192. $grid: this.$xegrid,
  14193. $event: evnt
  14194. }, params), evnt);
  14195. },
  14196. focus: function focus() {
  14197. this.isActivated = true;
  14198. return this.$nextTick();
  14199. },
  14200. blur: function blur() {
  14201. this.isActivated = false;
  14202. return this.$nextTick();
  14203. },
  14204. // 与工具栏对接
  14205. connect: function connect($toolbar) {
  14206. if ($toolbar && $toolbar.syncUpdate) {
  14207. $toolbar.syncUpdate({
  14208. collectColumn: this.collectColumn,
  14209. $table: this
  14210. });
  14211. this.$toolbar = $toolbar;
  14212. } else {
  14213. UtilTools.error('vxe.error.barUnableLink');
  14214. }
  14215. return this.$nextTick();
  14216. },
  14217. // 检查触发源是否属于目标节点
  14218. getEventTargetNode: getEventTargetNode,
  14219. /*************************
  14220. * Publish methods
  14221. *************************/
  14222. getCell: function getCell(row, column) {
  14223. var $refs = this.$refs;
  14224. var rowid = methods_getRowid(this, row);
  14225. var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
  14226. if (bodyElem && bodyElem.$el) {
  14227. return bodyElem.$el.querySelector(".vxe-body--row[data-rowid=\"".concat(rowid, "\"] .").concat(column.id));
  14228. }
  14229. return null;
  14230. },
  14231. getCellLabel: function getCellLabel(row, column) {
  14232. var formatter = column.formatter;
  14233. var cellValue = UtilTools.getCellValue(row, column);
  14234. var cellLabel = cellValue;
  14235. if (formatter) {
  14236. var rest, formatData;
  14237. var colid = column.id;
  14238. var fullAllDataRowMap = this.fullAllDataRowMap;
  14239. var cacheFormat = fullAllDataRowMap.has(row);
  14240. if (cacheFormat) {
  14241. rest = fullAllDataRowMap.get(row);
  14242. formatData = rest.formatData;
  14243. if (!formatData) {
  14244. formatData = fullAllDataRowMap.get(row).formatData = {};
  14245. }
  14246. if (rest && formatData[colid]) {
  14247. if (formatData[colid].value === cellValue) {
  14248. return formatData[colid].label;
  14249. }
  14250. }
  14251. }
  14252. var formatParams = {
  14253. cellValue: cellValue,
  14254. row: row,
  14255. rowIndex: this.getRowIndex(row),
  14256. column: column,
  14257. columnIndex: this.getColumnIndex(column)
  14258. };
  14259. if (ctor_amd_xe_utils_default.a.isString(formatter)) {
  14260. if (ctor_amd_xe_utils_default.a[formatter]) {
  14261. cellLabel = ctor_amd_xe_utils_default.a[formatter](cellValue);
  14262. } else if (src_formats.get(formatter)) {
  14263. cellLabel = src_formats.get(formatter)(formatParams);
  14264. } else {
  14265. cellLabel = '';
  14266. }
  14267. } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
  14268. if (ctor_amd_xe_utils_default.a[formatter[0]]) {
  14269. cellLabel = ctor_amd_xe_utils_default.a[formatter[0]].apply(ctor_amd_xe_utils_default.a, [cellValue].concat(_toConsumableArray(formatter.slice(1))));
  14270. } else if (src_formats.get(formatter[0])) {
  14271. cellLabel = src_formats.get(formatter[0]).apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1))));
  14272. } else {
  14273. cellLabel = '';
  14274. }
  14275. } else {
  14276. cellLabel = formatter(formatParams);
  14277. }
  14278. if (formatData) {
  14279. formatData[colid] = {
  14280. value: cellValue,
  14281. label: cellLabel
  14282. };
  14283. }
  14284. }
  14285. return cellLabel;
  14286. }
  14287. /*************************
  14288. * Publish methods
  14289. *************************/
  14290. }; // Module methods
  14291. var funcs = 'setFilter,filter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getMouseSelecteds,getMouseCheckeds,getSelectedCell,getSelectedRanges,clearCopyed,clearChecked,clearHeaderChecked,clearIndexChecked,clearSelected,insert,insertAt,remove,removeSelecteds,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,getActiveRow,hasActiveRow,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,exportCsv,openExport,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
  14292. funcs.forEach(function (name) {
  14293. Methods[name] = function () {
  14294. return this["_".concat(name)] ? this["_".concat(name)].apply(this, arguments) : null;
  14295. };
  14296. });
  14297. /* harmony default export */ var methods = (Methods);
  14298. // CONCATENATED MODULE: ./packages/table/src/table.js
  14299. /**
  14300. * 渲染浮固定列
  14301. * 分别渲染左边固定列和右边固定列
  14302. * 如果宽度足够情况下,则不需要渲染固定列
  14303. * @param {Function} h 创建 VNode 函数
  14304. * @param {Object} $xetable 表格实例
  14305. * @param {String} fixedType 固定列类型
  14306. */
  14307. function renderFixed(h, $xetable, fixedType) {
  14308. var tableData = $xetable.tableData,
  14309. tableColumn = $xetable.tableColumn,
  14310. visibleColumn = $xetable.visibleColumn,
  14311. tableGroupColumn = $xetable.tableGroupColumn,
  14312. isGroup = $xetable.isGroup,
  14313. vSize = $xetable.vSize,
  14314. showHeader = $xetable.showHeader,
  14315. showFooter = $xetable.showFooter,
  14316. columnStore = $xetable.columnStore,
  14317. footerTableData = $xetable.footerTableData;
  14318. var fixedColumn = columnStore["".concat(fixedType, "List")];
  14319. return h('div', {
  14320. class: "vxe-table--fixed-".concat(fixedType, "-wrapper"),
  14321. ref: "".concat(fixedType, "Container")
  14322. }, [showHeader ? h('vxe-table-header', {
  14323. props: {
  14324. fixedType: fixedType,
  14325. tableData: tableData,
  14326. tableColumn: tableColumn,
  14327. visibleColumn: visibleColumn,
  14328. tableGroupColumn: tableGroupColumn,
  14329. size: vSize,
  14330. fixedColumn: fixedColumn,
  14331. isGroup: isGroup
  14332. },
  14333. ref: "".concat(fixedType, "Header")
  14334. }) : null, h('vxe-table-body', {
  14335. props: {
  14336. fixedType: fixedType,
  14337. tableData: tableData,
  14338. tableColumn: tableColumn,
  14339. visibleColumn: visibleColumn,
  14340. fixedColumn: fixedColumn,
  14341. size: vSize,
  14342. isGroup: isGroup
  14343. },
  14344. ref: "".concat(fixedType, "Body")
  14345. }), showFooter && footerTableData ? h('vxe-table-footer', {
  14346. props: {
  14347. footerTableData: footerTableData,
  14348. tableColumn: tableColumn,
  14349. visibleColumn: visibleColumn,
  14350. fixedColumn: fixedColumn,
  14351. fixedType: fixedType,
  14352. size: vSize
  14353. },
  14354. ref: "".concat(fixedType, "Footer")
  14355. }) : null]);
  14356. }
  14357. /* harmony default export */ var table = ({
  14358. name: 'VxeTable',
  14359. props: {
  14360. /** 基本属性 */
  14361. id: String,
  14362. // 数据
  14363. data: Array,
  14364. // (v3.0 废弃)
  14365. customs: Array,
  14366. // 表格的高度
  14367. height: [Number, String],
  14368. // 表格的最大高度
  14369. maxHeight: [Number, String],
  14370. // 所有列是否允许拖动列宽调整大小
  14371. resizable: {
  14372. type: Boolean,
  14373. default: function _default() {
  14374. return conf.table.resizable;
  14375. }
  14376. },
  14377. // 是否带有斑马纹
  14378. stripe: {
  14379. type: Boolean,
  14380. default: function _default() {
  14381. return conf.table.stripe;
  14382. }
  14383. },
  14384. // 是否带有边框
  14385. border: {
  14386. type: [Boolean, String],
  14387. default: function _default() {
  14388. return conf.table.border;
  14389. }
  14390. },
  14391. // 是否圆角边框
  14392. round: {
  14393. type: Boolean,
  14394. default: function _default() {
  14395. return conf.table.round;
  14396. }
  14397. },
  14398. // 表格的尺寸
  14399. size: {
  14400. type: String,
  14401. default: function _default() {
  14402. return conf.table.size || conf.size;
  14403. }
  14404. },
  14405. // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
  14406. fit: {
  14407. type: Boolean,
  14408. default: function _default() {
  14409. return conf.table.fit;
  14410. }
  14411. },
  14412. // 表格是否加载中
  14413. loading: Boolean,
  14414. // 所有的列对其方式
  14415. align: {
  14416. type: String,
  14417. default: function _default() {
  14418. return conf.table.align;
  14419. }
  14420. },
  14421. // 所有的表头列的对齐方式
  14422. headerAlign: {
  14423. type: String,
  14424. default: function _default() {
  14425. return conf.table.headerAlign;
  14426. }
  14427. },
  14428. // 所有的表尾列的对齐方式
  14429. footerAlign: {
  14430. type: String,
  14431. default: function _default() {
  14432. return conf.table.footerAlign;
  14433. }
  14434. },
  14435. // 是否显示表头
  14436. showHeader: {
  14437. type: Boolean,
  14438. default: function _default() {
  14439. return conf.table.showHeader;
  14440. }
  14441. },
  14442. // (v3.0 废弃)
  14443. startIndex: {
  14444. type: Number,
  14445. default: 0
  14446. },
  14447. // 是否要高亮当前选中行
  14448. highlightCurrentRow: {
  14449. type: Boolean,
  14450. default: function _default() {
  14451. return conf.table.highlightCurrentRow;
  14452. }
  14453. },
  14454. // 鼠标移到行是否要高亮显示
  14455. highlightHoverRow: {
  14456. type: Boolean,
  14457. default: function _default() {
  14458. return conf.table.highlightHoverRow;
  14459. }
  14460. },
  14461. // 是否要高亮当前选中列
  14462. highlightCurrentColumn: {
  14463. type: Boolean,
  14464. default: function _default() {
  14465. return conf.table.highlightCurrentColumn;
  14466. }
  14467. },
  14468. // 鼠标移到列是否要高亮显示
  14469. highlightHoverColumn: {
  14470. type: Boolean,
  14471. default: function _default() {
  14472. return conf.table.highlightHoverColumn;
  14473. }
  14474. },
  14475. // 激活单元格编辑时是否高亮显示
  14476. highlightCell: Boolean,
  14477. // 是否显示表尾合计
  14478. showFooter: Boolean,
  14479. // 表尾合计的计算方法
  14480. footerMethod: {
  14481. type: Function,
  14482. default: conf.table.footerMethod
  14483. },
  14484. // 给行附加 className
  14485. rowClassName: [String, Function],
  14486. // 给单元格附加 className
  14487. cellClassName: [String, Function],
  14488. // 给表头的行附加 className
  14489. headerRowClassName: [String, Function],
  14490. // 给表头的单元格附加 className
  14491. headerCellClassName: [String, Function],
  14492. // 给表尾的行附加 className
  14493. footerRowClassName: [String, Function],
  14494. // 给表尾的单元格附加 className
  14495. footerCellClassName: [String, Function],
  14496. // 给单元格附加样式
  14497. cellStyle: [Object, Function],
  14498. // 给表头单元格附加样式
  14499. headerCellStyle: [Object, Function],
  14500. // 给表尾单元格附加样式
  14501. footerCellStyle: [Object, Function],
  14502. // 给行附加样式
  14503. rowStyle: [Object, Function],
  14504. // 给表头行附加样式
  14505. headerRowStyle: [Object, Function],
  14506. // 给表尾行附加样式
  14507. footerRowStyle: [Object, Function],
  14508. // 合并指定单元格
  14509. mergeCells: Array,
  14510. // 合并指定的表尾数据
  14511. mergeFooterItems: Array,
  14512. // 自定义合并行或列的方法
  14513. spanMethod: Function,
  14514. // 表尾合并行或列
  14515. footerSpanMethod: Function,
  14516. // 设置所有内容过长时显示为省略号
  14517. showOverflow: {
  14518. type: [Boolean, String],
  14519. default: function _default() {
  14520. return conf.table.showOverflow;
  14521. }
  14522. },
  14523. // 设置表头所有内容过长时显示为省略号
  14524. showHeaderOverflow: {
  14525. type: [Boolean, String],
  14526. default: function _default() {
  14527. return conf.table.showHeaderOverflow;
  14528. }
  14529. },
  14530. // 设置表尾所有内容过长时显示为省略号
  14531. showFooterOverflow: {
  14532. type: [Boolean, String],
  14533. default: function _default() {
  14534. return conf.table.showFooterOverflow;
  14535. }
  14536. },
  14537. // 是否所有服务端筛选
  14538. remoteFilter: Boolean,
  14539. // 是否所有服务端排序
  14540. remoteSort: Boolean,
  14541. // 自定义所有列的排序方法
  14542. sortMethod: Function,
  14543. // 所有列宽度
  14544. columnWidth: [Number, String],
  14545. // 所有列最小宽度,把剩余宽度按比例分配
  14546. columnMinWidth: [Number, String],
  14547. /** 高级属性 */
  14548. // 主键配置
  14549. columnKey: Boolean,
  14550. rowKey: Boolean,
  14551. rowId: {
  14552. type: String,
  14553. default: function _default() {
  14554. return conf.table.rowId;
  14555. }
  14556. },
  14557. zIndex: Number,
  14558. emptyText: {
  14559. type: String,
  14560. default: function _default() {
  14561. return conf.table.emptyText;
  14562. }
  14563. },
  14564. keepSource: {
  14565. type: Boolean,
  14566. default: function _default() {
  14567. return conf.table.keepSource;
  14568. }
  14569. },
  14570. // 是否自动监听父容器变化去更新响应式表格宽高
  14571. autoResize: {
  14572. type: Boolean,
  14573. default: function _default() {
  14574. return conf.table.autoResize;
  14575. }
  14576. },
  14577. // 是否自动根据状态属性去更新响应式表格宽高
  14578. syncResize: [Boolean, String, Number],
  14579. // 设置列的默认参数,仅对部分支持的属性有效
  14580. columnConfig: Object,
  14581. resizableConfig: Object,
  14582. // 序号配置项
  14583. seqConfig: Object,
  14584. // 排序配置项
  14585. sortConfig: Object,
  14586. // 筛选配置项
  14587. filterConfig: Object,
  14588. // 单选框配置
  14589. radioConfig: Object,
  14590. // (v3.0 废弃)
  14591. selectConfig: Object,
  14592. // 复选框配置项
  14593. checkboxConfig: Object,
  14594. // tooltip 配置项
  14595. tooltipConfig: Object,
  14596. // 导出配置项
  14597. exportConfig: [Boolean, Object],
  14598. // 导入配置项
  14599. importConfig: [Boolean, Object],
  14600. // 打印配置项
  14601. printConfig: Object,
  14602. // 展开行配置项
  14603. expandConfig: Object,
  14604. // 树形结构配置项
  14605. treeConfig: [Boolean, Object],
  14606. // 快捷菜单配置项
  14607. menuConfig: [Boolean, Object],
  14608. // 在 v3 中废弃
  14609. contextMenu: [Boolean, Object],
  14610. // 鼠标配置项
  14611. mouseConfig: Object,
  14612. // 区域配置项
  14613. areaConfig: Object,
  14614. // 按键配置项
  14615. keyboardConfig: Object,
  14616. // 复制/粘贴配置项
  14617. clipConfig: Object,
  14618. // 查找/替换配置项
  14619. fnrConfig: Object,
  14620. // 编辑配置项
  14621. editConfig: [Boolean, Object],
  14622. // 校验配置项
  14623. validConfig: Object,
  14624. // 校验规则配置项
  14625. editRules: Object,
  14626. // 空内容渲染配置项
  14627. emptyRender: [Boolean, Object],
  14628. // 自定义列配置项
  14629. customConfig: [Boolean, Object],
  14630. // 横向虚拟滚动配置项
  14631. scrollX: Object,
  14632. // 纵向虚拟滚动配置项
  14633. scrollY: Object,
  14634. // 优化相关
  14635. cloak: {
  14636. type: Boolean,
  14637. default: function _default() {
  14638. return conf.table.cloak;
  14639. }
  14640. },
  14641. animat: {
  14642. type: Boolean,
  14643. default: function _default() {
  14644. return conf.table.animat;
  14645. }
  14646. },
  14647. delayHover: {
  14648. type: Number,
  14649. default: function _default() {
  14650. return conf.table.delayHover;
  14651. }
  14652. },
  14653. // 优化配置项
  14654. optimization: Object,
  14655. // 额外的参数
  14656. params: Object
  14657. },
  14658. components: {
  14659. VxeTableBody: packages_body
  14660. },
  14661. provide: function provide() {
  14662. return {
  14663. $xetable: this,
  14664. xecolgroup: null
  14665. };
  14666. },
  14667. inject: {
  14668. $xegrid: {
  14669. default: null
  14670. }
  14671. },
  14672. mixins: [],
  14673. data: function data() {
  14674. return {
  14675. tId: "".concat(ctor_amd_xe_utils_default.a.uniqueId()),
  14676. isCloak: false,
  14677. // 列分组配置
  14678. collectColumn: [],
  14679. // 渲染的列分组
  14680. tableGroupColumn: [],
  14681. // 完整所有列
  14682. tableFullColumn: [],
  14683. // 渲染所有列
  14684. visibleColumn: [],
  14685. // 可视区渲染的列
  14686. tableColumn: [],
  14687. // 渲染中的数据
  14688. tableData: [],
  14689. // 是否启用了横向 X 可视渲染方式加载
  14690. scrollXLoad: false,
  14691. // 是否启用了纵向 Y 可视渲染方式加载
  14692. scrollYLoad: false,
  14693. // 是否存在纵向滚动条
  14694. overflowY: true,
  14695. // 是否存在横向滚动条
  14696. overflowX: false,
  14697. // 纵向滚动条的宽度
  14698. scrollbarWidth: 0,
  14699. // 横向滚动条的高度
  14700. scrollbarHeight: 0,
  14701. // 行高
  14702. rowHeight: 0,
  14703. // 表格父容器的高度
  14704. parentHeight: 0,
  14705. // 复选框属性,是否全选
  14706. isAllSelected: false,
  14707. // 复选框属性,有选中且非全选状态
  14708. isIndeterminate: false,
  14709. // 复选框属性,已选中的行
  14710. selection: [],
  14711. // 当前行
  14712. currentRow: null,
  14713. // 单选框属性,选中列
  14714. currentColumn: null,
  14715. // 单选框属性,选中行
  14716. selectRow: null,
  14717. // 表尾合计数据
  14718. footerTableData: [],
  14719. // 展开列信息
  14720. expandColumn: null,
  14721. // 树节点列信息
  14722. treeNodeColumn: null,
  14723. // 已展开的行
  14724. rowExpandeds: [],
  14725. // 懒加载中的展开行的列表
  14726. expandLazyLoadeds: [],
  14727. // 已展开树节点
  14728. treeExpandeds: [],
  14729. // 懒加载中的树节点的列表
  14730. treeLazyLoadeds: [],
  14731. // 树节点不确定状态的列表
  14732. treeIndeterminates: [],
  14733. // 合并单元格的对象集
  14734. mergeList: [],
  14735. // 合并表尾数据的对象集
  14736. mergeFooterList: [],
  14737. // 是否已经加载了筛选
  14738. hasFilterPanel: false,
  14739. // 当前选中的筛选列
  14740. filterStore: {
  14741. isAllSelected: false,
  14742. isIndeterminate: false,
  14743. style: null,
  14744. options: [],
  14745. column: null,
  14746. multiple: false,
  14747. visible: false
  14748. },
  14749. // 存放列相关的信息
  14750. columnStore: {
  14751. leftList: [],
  14752. centerList: [],
  14753. rightList: [],
  14754. resizeList: [],
  14755. pxList: [],
  14756. pxMinList: [],
  14757. scaleList: [],
  14758. scaleMinList: [],
  14759. autoList: []
  14760. },
  14761. // 存放快捷菜单的信息
  14762. ctxMenuStore: {
  14763. selected: null,
  14764. visible: false,
  14765. showChild: false,
  14766. selectChild: null,
  14767. list: [],
  14768. style: null
  14769. },
  14770. // 存放可编辑相关信息
  14771. editStore: {
  14772. indexs: {
  14773. columns: []
  14774. },
  14775. titles: {
  14776. columns: []
  14777. },
  14778. // 所有选中
  14779. checked: {
  14780. rows: [],
  14781. columns: [],
  14782. tRows: [],
  14783. tColumns: []
  14784. },
  14785. // 选中源
  14786. selected: {
  14787. row: null,
  14788. column: null
  14789. },
  14790. // 已复制源
  14791. copyed: {
  14792. cut: false,
  14793. rows: [],
  14794. columns: []
  14795. },
  14796. // 激活
  14797. actived: {
  14798. row: null,
  14799. column: null
  14800. },
  14801. insertList: [],
  14802. removeList: []
  14803. },
  14804. // 存放数据校验相关信息
  14805. validStore: {
  14806. visible: false,
  14807. row: null,
  14808. column: null,
  14809. content: '',
  14810. rule: null,
  14811. isArrow: false
  14812. },
  14813. // 导入相关信息
  14814. importStore: {
  14815. file: null,
  14816. type: '',
  14817. modeList: [],
  14818. typeList: [],
  14819. filename: '',
  14820. visible: false
  14821. },
  14822. importParams: {
  14823. mode: '',
  14824. types: null,
  14825. message: true
  14826. },
  14827. // 导出相关信息
  14828. exportStore: {
  14829. name: '',
  14830. modeList: [],
  14831. typeList: [],
  14832. columns: [],
  14833. hasFooter: false,
  14834. visible: false
  14835. },
  14836. exportParams: {
  14837. filename: '',
  14838. sheetName: '',
  14839. mode: '',
  14840. type: '',
  14841. original: false,
  14842. message: true,
  14843. isHeader: false,
  14844. isFooter: false
  14845. }
  14846. };
  14847. },
  14848. computed: {
  14849. vSize: function vSize() {
  14850. return this.size || this.$parent.size || this.$parent.vSize;
  14851. },
  14852. validOpts: function validOpts() {
  14853. return Object.assign({
  14854. message: 'default'
  14855. }, conf.table.validConfig, this.validConfig);
  14856. },
  14857. sXOpts: function sXOpts() {
  14858. return Object.assign({}, conf.table.scrollX, this.optimizeOpts.scrollX, this.scrollX);
  14859. },
  14860. sYOpts: function sYOpts() {
  14861. return Object.assign({}, conf.table.scrollY, this.optimizeOpts.scrollY, this.scrollY);
  14862. },
  14863. optimizeOpts: function optimizeOpts() {
  14864. return Object.assign({}, conf.table.optimization, this.optimization);
  14865. },
  14866. rowHeightMaps: function rowHeightMaps() {
  14867. return {
  14868. default: 48,
  14869. medium: 44,
  14870. small: 40,
  14871. mini: 36
  14872. };
  14873. },
  14874. columnOpts: function columnOpts() {
  14875. return Object.assign({}, this.columnConfig);
  14876. },
  14877. resizableOpts: function resizableOpts() {
  14878. return Object.assign({}, conf.table.resizableConfig, this.resizableConfig);
  14879. },
  14880. seqOpts: function seqOpts() {
  14881. return Object.assign({
  14882. startIndex: 0
  14883. }, conf.table.seqConfig, this.seqConfig);
  14884. },
  14885. radioOpts: function radioOpts() {
  14886. return Object.assign({}, conf.table.radioConfig, this.radioConfig);
  14887. },
  14888. checkboxOpts: function checkboxOpts() {
  14889. return Object.assign({}, conf.table.checkboxConfig, this.checkboxConfig || this.selectConfig);
  14890. },
  14891. tooltipOpts: function tooltipOpts() {
  14892. return Object.assign({
  14893. size: this.vSize,
  14894. leaveDelay: 300
  14895. }, conf.table.tooltipConfig, this.tooltipConfig);
  14896. },
  14897. validTipOpts: function validTipOpts() {
  14898. return Object.assign({
  14899. isArrow: false
  14900. }, this.tooltipOpts);
  14901. },
  14902. editOpts: function editOpts() {
  14903. return Object.assign({}, conf.table.editConfig, this.editConfig);
  14904. },
  14905. sortOpts: function sortOpts() {
  14906. return Object.assign({
  14907. orders: ['asc', 'desc', null]
  14908. }, conf.table.sortConfig, this.sortConfig);
  14909. },
  14910. filterOpts: function filterOpts() {
  14911. return Object.assign({}, conf.table.filterConfig, this.filterConfig);
  14912. },
  14913. mouseOpts: function mouseOpts() {
  14914. return Object.assign({}, conf.table.mouseConfig, this.mouseConfig);
  14915. },
  14916. areaOpts: function areaOpts() {
  14917. return Object.assign({}, conf.table.areaConfig, this.areaConfig);
  14918. },
  14919. keyboardOpts: function keyboardOpts() {
  14920. return Object.assign({}, conf.table.keyboardConfig, this.keyboardConfig);
  14921. },
  14922. clipOpts: function clipOpts() {
  14923. return Object.assign({}, conf.table.clipConfig, this.clipConfig);
  14924. },
  14925. fnrOpts: function fnrOpts() {
  14926. return Object.assign({}, conf.table.fnrConfig, this.fnrConfig);
  14927. },
  14928. // 是否使用了分组表头
  14929. isGroup: function isGroup() {
  14930. return this.collectColumn.some(UtilTools.hasChildrenList);
  14931. },
  14932. hasTip: function hasTip() {
  14933. return v_x_e_table._tooltip;
  14934. },
  14935. isResizable: function isResizable() {
  14936. return this.resizable || this.tableFullColumn.some(function (column) {
  14937. return column.resizable;
  14938. });
  14939. },
  14940. headerCtxMenu: function headerCtxMenu() {
  14941. var headerOpts = this.ctxMenuOpts.header;
  14942. return headerOpts && headerOpts.options ? headerOpts.options : [];
  14943. },
  14944. bodyCtxMenu: function bodyCtxMenu() {
  14945. var bodyOpts = this.ctxMenuOpts.body;
  14946. return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
  14947. },
  14948. footerCtxMenu: function footerCtxMenu() {
  14949. var footerOpts = this.ctxMenuOpts.footer;
  14950. return footerOpts && footerOpts.options ? footerOpts.options : [];
  14951. },
  14952. isCtxMenu: function isCtxMenu() {
  14953. return (this.contextMenu || this.menuConfig) && UtilTools.isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length);
  14954. },
  14955. ctxMenuOpts: function ctxMenuOpts() {
  14956. return Object.assign({}, conf.table.contextMenu, conf.table.menuConfig, this.contextMenu, this.menuConfig);
  14957. },
  14958. ctxMenuList: function ctxMenuList() {
  14959. var rest = [];
  14960. this.ctxMenuStore.list.forEach(function (list) {
  14961. list.forEach(function (item) {
  14962. rest.push(item);
  14963. });
  14964. });
  14965. return rest;
  14966. },
  14967. exportOpts: function exportOpts() {
  14968. return Object.assign({}, conf.table.exportConfig, this.exportConfig);
  14969. },
  14970. importOpts: function importOpts() {
  14971. return Object.assign({}, conf.table.importConfig, this.importConfig);
  14972. },
  14973. printOpts: function printOpts() {
  14974. return Object.assign({}, conf.table.printConfig, this.printConfig);
  14975. },
  14976. expandOpts: function expandOpts() {
  14977. return Object.assign({}, conf.table.expandConfig, this.expandConfig);
  14978. },
  14979. treeOpts: function treeOpts() {
  14980. return Object.assign({}, conf.table.treeConfig, this.treeConfig);
  14981. },
  14982. emptyOpts: function emptyOpts() {
  14983. return Object.assign({}, conf.table.emptyRender, this.emptyRender);
  14984. },
  14985. cellOffsetWidth: function cellOffsetWidth() {
  14986. return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
  14987. },
  14988. customOpts: function customOpts() {
  14989. return Object.assign({}, conf.table.customConfig, this.customConfig);
  14990. },
  14991. tableBorder: function tableBorder() {
  14992. var border = this.border;
  14993. if (border === true) {
  14994. return 'full';
  14995. }
  14996. if (border) {
  14997. return border;
  14998. }
  14999. return 'default';
  15000. },
  15001. /**
  15002. * 判断列全选的复选框是否禁用
  15003. */
  15004. isAllCheckboxDisabled: function isAllCheckboxDisabled() {
  15005. var tableFullData = this.tableFullData,
  15006. treeConfig = this.treeConfig,
  15007. checkboxOpts = this.checkboxOpts;
  15008. var strict = checkboxOpts.strict,
  15009. checkMethod = checkboxOpts.checkMethod;
  15010. if (strict) {
  15011. if (tableFullData.length) {
  15012. if (checkMethod) {
  15013. if (treeConfig) {// 暂时不支持树形结构
  15014. } // 如果所有行都被禁用
  15015. return tableFullData.every(function (row) {
  15016. return !checkMethod({
  15017. row: row
  15018. });
  15019. });
  15020. }
  15021. return false;
  15022. }
  15023. return true;
  15024. }
  15025. return false;
  15026. }
  15027. },
  15028. watch: {
  15029. data: function data(value) {
  15030. var _this = this;
  15031. this.loadTableData(value).then(function () {
  15032. if (!_this.inited) {
  15033. _this.inited = true;
  15034. _this.handleDefaults();
  15035. }
  15036. if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
  15037. UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
  15038. }
  15039. });
  15040. },
  15041. customs: function customs(value) {
  15042. if (!this.isUpdateCustoms) {
  15043. this.mergeCustomColumn(value);
  15044. }
  15045. this.isUpdateCustoms = false;
  15046. },
  15047. collectColumn: function collectColumn(value) {
  15048. var _this2 = this;
  15049. var tableFullColumn = UtilTools.getColumnList(value);
  15050. this.tableFullColumn = tableFullColumn;
  15051. this.clearMergeCells();
  15052. this.clearMergeFooterItems();
  15053. this.cacheColumnMap();
  15054. if (this.customs) {
  15055. this.mergeCustomColumn(this.customs);
  15056. }
  15057. if (this.customConfig) {
  15058. this.restoreCustomStorage();
  15059. }
  15060. this.refreshColumn().then(function () {
  15061. if (_this2.scrollXLoad) {
  15062. _this2.loadScrollXData(true);
  15063. }
  15064. });
  15065. this.handleTableData(true);
  15066. if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
  15067. UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
  15068. }
  15069. if (this.isGroup && this.mouseConfig && this.mouseOpts.checked) {
  15070. UtilTools.error('vxe.error.groupMouseRange', ['mouse-config.checked']);
  15071. }
  15072. this.$nextTick(function () {
  15073. if (_this2.$toolbar) {
  15074. _this2.$toolbar.syncUpdate({
  15075. collectColumn: value,
  15076. $table: _this2
  15077. }); // 在 v3.0 中废弃 toolbar 方式
  15078. if (!_this2.customConfig) {
  15079. _this2.restoreCustomStorage();
  15080. _this2.analyColumnWidth();
  15081. _this2.refreshColumn();
  15082. }
  15083. }
  15084. });
  15085. },
  15086. tableColumn: function tableColumn() {
  15087. this.analyColumnWidth();
  15088. },
  15089. showHeader: function showHeader() {
  15090. var _this3 = this;
  15091. this.$nextTick(function () {
  15092. _this3.recalculate(true).then(function () {
  15093. return _this3.refreshScroll();
  15094. });
  15095. });
  15096. },
  15097. showFooter: function showFooter() {
  15098. var _this4 = this;
  15099. this.$nextTick(function () {
  15100. _this4.recalculate(true).then(function () {
  15101. return _this4.refreshScroll();
  15102. });
  15103. });
  15104. },
  15105. height: function height() {
  15106. var _this5 = this;
  15107. this.$nextTick(function () {
  15108. return _this5.recalculate(true);
  15109. });
  15110. },
  15111. maxHeight: function maxHeight() {
  15112. var _this6 = this;
  15113. this.$nextTick(function () {
  15114. return _this6.recalculate(true);
  15115. });
  15116. },
  15117. syncResize: function syncResize(value) {
  15118. var _this7 = this;
  15119. if (value) {
  15120. var $el = this.$el; // 只在可视状态下才去更新
  15121. if ($el.clientWidth && $el.clientHeight) {
  15122. this.recalculate();
  15123. }
  15124. this.$nextTick(function () {
  15125. setTimeout(function () {
  15126. if ($el.clientWidth && $el.clientHeight) {
  15127. _this7.recalculate(true);
  15128. }
  15129. });
  15130. });
  15131. }
  15132. },
  15133. mergeCells: function mergeCells(value) {
  15134. this.clearMergeCells();
  15135. this.setMergeCells(value);
  15136. },
  15137. mergeFooterItems: function mergeFooterItems(value) {
  15138. this.clearMergeFooterItems();
  15139. this.setMergeFooterItems(value);
  15140. }
  15141. },
  15142. created: function created() {
  15143. var _this8 = this;
  15144. var _Object$assign = Object.assign(this, {
  15145. tZindex: 0,
  15146. elemStore: {},
  15147. // 存放横向 X 虚拟滚动相关的信息
  15148. scrollXStore: {},
  15149. // 存放纵向 Y 虚拟滚动相关信息
  15150. scrollYStore: {},
  15151. // 存放 tooltip 相关信息
  15152. tooltipStore: {},
  15153. // 表格宽度
  15154. tableWidth: 0,
  15155. // 表格高度
  15156. tableHeight: 0,
  15157. // 表头高度
  15158. headerHeight: 0,
  15159. // 表尾高度
  15160. footerHeight: 0,
  15161. // 当前 hover 行
  15162. // hoverRow: null,
  15163. // 最后滚动位置
  15164. lastScrollLeft: 0,
  15165. lastScrollTop: 0,
  15166. // 单选框属性,已选中保留的行
  15167. radioReserveRow: null,
  15168. // 复选框属性,已选中保留的行
  15169. checkboxReserveRowMap: {},
  15170. // 行数据,已展开保留的行
  15171. rowExpandedReserveRowMap: {},
  15172. // 树结构数据,已展开保留的行
  15173. treeExpandedReserveRowMap: {},
  15174. // 完整数据、条件处理后
  15175. tableFullData: [],
  15176. afterFullData: [],
  15177. // 缓存数据集
  15178. fullAllDataRowMap: new Map(),
  15179. fullAllDataRowIdData: {},
  15180. fullDataRowMap: new Map(),
  15181. fullDataRowIdData: {},
  15182. fullColumnMap: new Map(),
  15183. fullColumnIdData: {},
  15184. fullColumnFieldData: {}
  15185. }),
  15186. sXOpts = _Object$assign.sXOpts,
  15187. scrollXStore = _Object$assign.scrollXStore,
  15188. sYOpts = _Object$assign.sYOpts,
  15189. scrollYStore = _Object$assign.scrollYStore,
  15190. mouseOpts = _Object$assign.mouseOpts,
  15191. data = _Object$assign.data,
  15192. editOpts = _Object$assign.editOpts,
  15193. treeOpts = _Object$assign.treeOpts,
  15194. treeConfig = _Object$assign.treeConfig,
  15195. showOverflow = _Object$assign.showOverflow;
  15196. if (!this.rowId && (this.checkboxOpts.reserve || this.checkboxOpts.checkRowKeys || this.radioOpts.reserve || this.radioOpts.checkRowKey || this.expandOpts.expandRowKeys || this.treeOpts.expandRowKeys)) {
  15197. UtilTools.warn('vxe.error.reqProp', ['row-id']);
  15198. } // 在 v3.0 中废弃 column-width
  15199. if (this.columnWidth) {
  15200. UtilTools.warn('vxe.error.delProp', ['column-width', 'column-config.width']);
  15201. } // 在 v3.0 中废弃 column-min-width
  15202. if (this.columnMinWidth) {
  15203. UtilTools.warn('vxe.error.delProp', ['column-min-width', 'column-config.minWidth']);
  15204. } // 在 v3.0 中废弃 start-index
  15205. if (this.startIndex) {
  15206. UtilTools.warn('vxe.error.delProp', ['start-index', 'seq-config.startIndex']);
  15207. } // 在 v3.0 中废弃 select-config
  15208. if (this.selectConfig) {
  15209. UtilTools.warn('vxe.error.delProp', ['select-config', 'checkbox-config']);
  15210. }
  15211. if (this.editConfig && editOpts.showStatus && !this.keepSource) {
  15212. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  15213. }
  15214. if (treeConfig && treeOpts.line && (!this.rowKey || !showOverflow)) {
  15215. UtilTools.warn('vxe.error.reqProp', ['row-key | show-overflow']);
  15216. }
  15217. if (this.showFooter && !this.footerMethod) {
  15218. UtilTools.warn('vxe.error.reqProp', ['footer-method']);
  15219. } // 在 v3.0 中废弃 customs
  15220. if (this.customs) {
  15221. UtilTools.warn('vxe.error.removeProp', ['customs']);
  15222. } // 在 v3.0 中废弃 sort-method
  15223. if (this.sortMethod) {
  15224. UtilTools.warn('vxe.error.delProp', ['sort-method', 'sort-config.sortMethod']);
  15225. } // 在 v3.0 中废弃 remote-sort
  15226. if (this.remoteSort) {
  15227. UtilTools.warn('vxe.error.delProp', ['remote-sort', 'sort-config.remote']);
  15228. } // 在 v3.0 中废弃 remote-filter
  15229. if (this.remoteFilter) {
  15230. UtilTools.warn('vxe.error.delProp', ['remote-filter', 'filter-config.remote']);
  15231. }
  15232. if (!this.handleUpdateCellAreas) {
  15233. if (this.clipConfig) {
  15234. UtilTools.warn('vxe.error.notProp', ['clip-config']);
  15235. }
  15236. if (this.fnrConfig) {
  15237. UtilTools.warn('vxe.error.notProp', ['fnr-config']);
  15238. }
  15239. if (this.mouseOpts.area) {
  15240. UtilTools.error('vxe.error.notProp', ['mouse-config.area']);
  15241. return;
  15242. }
  15243. }
  15244. if (mouseOpts.selected && mouseOpts.area) {
  15245. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
  15246. }
  15247. if (mouseOpts.checked && mouseOpts.area) {
  15248. UtilTools.error('vxe.error.errConflicts', ['mouse-config.checked', 'mouse-config.area']);
  15249. } // v3 中只支持对象类型
  15250. // 在 v3.0 中废弃 context-menu
  15251. if (this.contextMenu) {
  15252. UtilTools.warn('vxe.error.delProp', ['context-menu', 'menu-config']);
  15253. if (!ctor_amd_xe_utils_default.a.isObject(this.contextMenu)) {
  15254. UtilTools.warn('vxe.error.errProp', ["table.context-menu=".concat(this.contextMenu), 'table.context-menu={}']);
  15255. }
  15256. }
  15257. if (this.menuConfig && !ctor_amd_xe_utils_default.a.isObject(this.menuConfig)) {
  15258. UtilTools.warn('vxe.error.errProp', ["table.menu-config=".concat(this.menuConfig), 'table.menu-config={}']);
  15259. }
  15260. if (this.exportConfig && !ctor_amd_xe_utils_default.a.isObject(this.exportConfig)) {
  15261. UtilTools.warn('vxe.error.errProp', ["table.export-config=".concat(this.exportConfig), 'table.export-config={}']);
  15262. }
  15263. if (this.importConfig && !ctor_amd_xe_utils_default.a.isObject(this.importConfig)) {
  15264. UtilTools.warn('vxe.error.errProp', ["table.import-config=".concat(this.importConfig), 'table.import-config={}']);
  15265. }
  15266. if (this.printConfig && !ctor_amd_xe_utils_default.a.isObject(this.printConfig)) {
  15267. UtilTools.warn('vxe.error.errProp', ["table.print-config=".concat(this.printConfig), 'table.print-config={}']);
  15268. }
  15269. if (this.treeConfig && !ctor_amd_xe_utils_default.a.isObject(this.treeConfig)) {
  15270. UtilTools.warn('vxe.error.errProp', ["table.tree-config=".concat(this.treeConfig), 'table.tree-config={}']);
  15271. }
  15272. if (this.customConfig && !ctor_amd_xe_utils_default.a.isObject(this.customConfig)) {
  15273. UtilTools.warn('vxe.error.errProp', ["table.custom-config=".concat(this.customConfig), 'table.custom-config={}']);
  15274. }
  15275. if (this.editConfig && !ctor_amd_xe_utils_default.a.isObject(this.editConfig)) {
  15276. UtilTools.warn('vxe.error.errProp', ["table.edit-config=".concat(this.editConfig), 'table.edit-config={}']);
  15277. }
  15278. if (this.emptyRender && !ctor_amd_xe_utils_default.a.isObject(this.emptyRender)) {
  15279. UtilTools.warn('vxe.error.errProp', ["table.empty-render=".concat(this.emptyRender), 'table.empty-render={}']);
  15280. }
  15281. if (this.mouseConfig && this.editConfig) {
  15282. if (mouseOpts.checked && editOpts.trigger !== 'dblclick') {
  15283. UtilTools.warn('vxe.error.errProp', ['mouse-config.checked', 'edit-config.trigger=dblclick']);
  15284. }
  15285. }
  15286. if (this.mouseOpts.area && this.checkboxOpts.range) {
  15287. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range']);
  15288. }
  15289. if (treeConfig && this.stripe) {
  15290. UtilTools.warn('vxe.error.noTree', ['stripe']);
  15291. } // 在 v3.0 中废弃 optimization
  15292. if (this.optimization) {
  15293. UtilTools.warn('vxe.error.removeProp', ['optimization']);
  15294. } // 废弃 optimization.cloak
  15295. if (this.optimizeOpts.cloak) {
  15296. UtilTools.warn('vxe.error.delProp', ['optimization.cloak', 'cloak']);
  15297. } // 废弃 optimization.animat
  15298. if (this.optimizeOpts.animat) {
  15299. UtilTools.warn('vxe.error.delProp', ['optimization.animat', 'animat']);
  15300. } // 废弃 optimization.delayHover
  15301. if (this.optimizeOpts.delayHover) {
  15302. UtilTools.warn('vxe.error.delProp', ['optimization.delayHover', 'delay-hover']);
  15303. } // 废弃 optimization.scrollX
  15304. if (this.optimizeOpts.scrollX) {
  15305. UtilTools.warn('vxe.error.delProp', ['optimization.scrollX', 'scroll-x']);
  15306. } // 废弃 optimization.scrollY
  15307. if (this.optimizeOpts.scrollY) {
  15308. UtilTools.warn('vxe.error.delProp', ['optimization.scrollY', 'scroll-y']);
  15309. }
  15310. var customOpts = this.customOpts;
  15311. if (!this.id && this.customConfig && (customOpts.storage === true || customOpts.storage && customOpts.storage.resizable || customOpts.storage && customOpts.storage.visible)) {
  15312. UtilTools.error('vxe.error.reqProp', ['id']);
  15313. }
  15314. if (this.treeConfig && this.checkboxOpts.range) {
  15315. UtilTools.error('vxe.error.noTree', ['checkbox-config.range']);
  15316. }
  15317. if (this.treeConfig && this.mouseOpts.area) {
  15318. UtilTools.error('vxe.error.noTree', ['mouse-config.area']);
  15319. } // 检查是否有安装需要的模块
  15320. var errorModuleName;
  15321. if (!v_x_e_table._edit && this.editConfig) {
  15322. errorModuleName = 'Edit';
  15323. } else if (!v_x_e_table._valid && this.editRules) {
  15324. errorModuleName = 'Validator';
  15325. } else if (!v_x_e_table._keyboard && (this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig)) {
  15326. errorModuleName = 'Keyboard';
  15327. } else if (!v_x_e_table._export && (this.importConfig || this.exportConfig)) {
  15328. errorModuleName = 'Export';
  15329. }
  15330. if (errorModuleName) {
  15331. throw new Error(UtilTools.getLog('vxe.error.reqModule', [errorModuleName]));
  15332. }
  15333. Object.assign(scrollYStore, {
  15334. startIndex: 0,
  15335. visibleIndex: 0,
  15336. adaptive: sYOpts.adaptive !== false,
  15337. renderSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.rSize),
  15338. offsetSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.oSize)
  15339. });
  15340. Object.assign(scrollXStore, {
  15341. startIndex: 0,
  15342. visibleIndex: 0,
  15343. renderSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.rSize),
  15344. offsetSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.oSize)
  15345. });
  15346. if (this.cloak) {
  15347. this.isCloak = true;
  15348. setTimeout(function () {
  15349. _this8.isCloak = false;
  15350. }, DomTools.browse ? 500 : 300);
  15351. }
  15352. this.loadTableData(data).then(function () {
  15353. if (data && data.length) {
  15354. _this8.inited = true;
  15355. _this8.handleDefaults();
  15356. }
  15357. _this8.updateStyle();
  15358. _this8.recalculate();
  15359. });
  15360. GlobalEvent.on(this, 'paste', this.handleGlobalPasteEvent);
  15361. GlobalEvent.on(this, 'copy', this.handleGlobalCopyEvent);
  15362. GlobalEvent.on(this, 'cut', this.handleGlobalCutEvent);
  15363. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  15364. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  15365. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  15366. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  15367. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  15368. GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
  15369. this.preventEvent(null, 'created');
  15370. },
  15371. mounted: function mounted() {
  15372. var _this9 = this;
  15373. var $listeners = this.$listeners;
  15374. if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
  15375. UtilTools.warn('vxe.error.reqProp', ['menu-config']);
  15376. }
  15377. if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
  15378. UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
  15379. }
  15380. if (!this.tooltipConfig && (this.$listeners['cell-mouseenter'] || this.$listeners['cell-mouseleave'])) {
  15381. UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
  15382. }
  15383. if (this.autoResize) {
  15384. var resizeObserver = new ResizeEvent(function () {
  15385. return _this9.recalculate(true);
  15386. });
  15387. resizeObserver.observe(this.$el);
  15388. resizeObserver.observe(this.getParentElem());
  15389. this.$resize = resizeObserver;
  15390. }
  15391. if (!this.$xegrid && this.customs) {
  15392. UtilTools.warn('vxe.error.removeProp', ['customs']);
  15393. }
  15394. document.body.appendChild(this.$refs.tableWrapper);
  15395. this.preventEvent(null, 'mounted');
  15396. },
  15397. activated: function activated() {
  15398. var _this10 = this;
  15399. this.recalculate().then(function () {
  15400. return _this10.refreshScroll();
  15401. });
  15402. this.preventEvent(null, 'activated');
  15403. },
  15404. deactivated: function deactivated() {
  15405. this.preventEvent(null, 'deactivated');
  15406. },
  15407. beforeDestroy: function beforeDestroy() {
  15408. var tableWrapper = this.$refs.tableWrapper;
  15409. if (tableWrapper && tableWrapper.parentNode) {
  15410. tableWrapper.parentNode.removeChild(tableWrapper);
  15411. }
  15412. if (this.$resize) {
  15413. this.$resize.disconnect();
  15414. }
  15415. this.closeFilter();
  15416. this.closeMenu();
  15417. this.preventEvent(null, 'beforeDestroy');
  15418. },
  15419. destroyed: function destroyed() {
  15420. GlobalEvent.off(this, 'paste');
  15421. GlobalEvent.off(this, 'copy');
  15422. GlobalEvent.off(this, 'cut');
  15423. GlobalEvent.off(this, 'mousedown');
  15424. GlobalEvent.off(this, 'blur');
  15425. GlobalEvent.off(this, 'mousewheel');
  15426. GlobalEvent.off(this, 'keydown');
  15427. GlobalEvent.off(this, 'resize');
  15428. GlobalEvent.off(this, 'contextmenu');
  15429. this.preventEvent(null, 'destroyed');
  15430. },
  15431. render: function render(h) {
  15432. var _e = this._e,
  15433. $scopedSlots = this.$scopedSlots,
  15434. tId = this.tId,
  15435. tableData = this.tableData,
  15436. tableColumn = this.tableColumn,
  15437. visibleColumn = this.visibleColumn,
  15438. tableGroupColumn = this.tableGroupColumn,
  15439. isGroup = this.isGroup,
  15440. isResizable = this.isResizable,
  15441. isCtxMenu = this.isCtxMenu,
  15442. loading = this.loading,
  15443. isCloak = this.isCloak,
  15444. stripe = this.stripe,
  15445. showHeader = this.showHeader,
  15446. height = this.height,
  15447. tableBorder = this.tableBorder,
  15448. treeOpts = this.treeOpts,
  15449. treeConfig = this.treeConfig,
  15450. mouseConfig = this.mouseConfig,
  15451. mouseOpts = this.mouseOpts,
  15452. vSize = this.vSize,
  15453. validOpts = this.validOpts,
  15454. editRules = this.editRules,
  15455. showFooter = this.showFooter,
  15456. overflowX = this.overflowX,
  15457. overflowY = this.overflowY,
  15458. scrollXLoad = this.scrollXLoad,
  15459. scrollYLoad = this.scrollYLoad,
  15460. scrollbarHeight = this.scrollbarHeight,
  15461. highlightCell = this.highlightCell,
  15462. highlightHoverRow = this.highlightHoverRow,
  15463. highlightHoverColumn = this.highlightHoverColumn,
  15464. editConfig = this.editConfig,
  15465. checkboxOpts = this.checkboxOpts,
  15466. validTipOpts = this.validTipOpts,
  15467. tooltipOpts = this.tooltipOpts,
  15468. columnStore = this.columnStore,
  15469. filterStore = this.filterStore,
  15470. ctxMenuStore = this.ctxMenuStore,
  15471. ctxMenuOpts = this.ctxMenuOpts,
  15472. footerTableData = this.footerTableData,
  15473. hasTip = this.hasTip,
  15474. emptyRender = this.emptyRender,
  15475. emptyOpts = this.emptyOpts;
  15476. var leftList = columnStore.leftList,
  15477. rightList = columnStore.rightList;
  15478. var emptyContent;
  15479. if ($scopedSlots.empty) {
  15480. emptyContent = $scopedSlots.empty.call(this, {
  15481. $table: this
  15482. }, h);
  15483. } else {
  15484. var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  15485. if (compConf) {
  15486. emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
  15487. $table: this
  15488. }, {
  15489. $table: this
  15490. });
  15491. } else {
  15492. emptyContent = this.emptyText || conf.i18n('vxe.table.emptyText');
  15493. }
  15494. }
  15495. return h('div', {
  15496. class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
  15497. 'vxe-editable': !!editConfig,
  15498. 'show--head': showHeader,
  15499. 'show--foot': showFooter,
  15500. 'is--group': isGroup,
  15501. 'has--height': height,
  15502. 'has--tree-line': treeConfig && treeOpts.line,
  15503. 'fixed--left': leftList.length,
  15504. 'fixed--right': rightList.length,
  15505. 'c--highlight': highlightCell,
  15506. 't--animat': !!this.animat,
  15507. 'is--round': this.round,
  15508. 't--stripe': !treeConfig && stripe,
  15509. 't--selected': mouseConfig && mouseOpts.selected,
  15510. // 在 v3.0 中废弃 mouse-config.checked
  15511. 't--checked': mouseConfig && mouseOpts.checked,
  15512. 'is--area': mouseConfig && mouseOpts.area,
  15513. 'row--highlight': highlightHoverRow,
  15514. 'column--highlight': highlightHoverColumn,
  15515. 'is--loading': isCloak || loading,
  15516. 'is--empty': !loading && !tableData.length,
  15517. 'scroll--y': overflowY,
  15518. 'scroll--x': overflowX,
  15519. 'virtual--x': scrollXLoad,
  15520. 'virtual--y': scrollYLoad
  15521. }],
  15522. attrs: {
  15523. 'x-cloak': isCloak
  15524. }
  15525. }, [
  15526. /**
  15527. * 隐藏列
  15528. */
  15529. h('div', {
  15530. class: 'vxe-table-slots',
  15531. ref: 'hideColumn'
  15532. }, this.$slots.default), h('div', {
  15533. class: 'vxe-table--main-wrapper'
  15534. }, [
  15535. /**
  15536. * 主头部
  15537. */
  15538. showHeader ? h('vxe-table-header', {
  15539. ref: 'tableHeader',
  15540. props: {
  15541. tableData: tableData,
  15542. tableColumn: tableColumn,
  15543. visibleColumn: visibleColumn,
  15544. tableGroupColumn: tableGroupColumn,
  15545. size: vSize,
  15546. isGroup: isGroup
  15547. }
  15548. }) : _e(),
  15549. /**
  15550. * 主内容
  15551. */
  15552. h('vxe-table-body', {
  15553. ref: 'tableBody',
  15554. props: {
  15555. tableData: tableData,
  15556. tableColumn: tableColumn,
  15557. visibleColumn: visibleColumn,
  15558. size: vSize,
  15559. isGroup: isGroup
  15560. }
  15561. }),
  15562. /**
  15563. * 底部
  15564. */
  15565. showFooter ? h('vxe-table-footer', {
  15566. props: {
  15567. footerTableData: footerTableData,
  15568. tableColumn: tableColumn,
  15569. visibleColumn: visibleColumn,
  15570. size: vSize
  15571. },
  15572. ref: 'tableFooter'
  15573. }) : null]),
  15574. /**
  15575. * 左侧固定列
  15576. */
  15577. leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
  15578. /**
  15579. * 右侧固定列
  15580. */
  15581. rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e(),
  15582. /**
  15583. * 空数据
  15584. */
  15585. h('div', {
  15586. ref: 'emptyPlaceholder',
  15587. class: 'vxe-table--empty-placeholder'
  15588. }, [h('div', {
  15589. class: 'vxe-table--empty-content'
  15590. }, emptyContent)]),
  15591. /**
  15592. * 边框线
  15593. */
  15594. h('div', {
  15595. class: 'vxe-table--border-line'
  15596. }),
  15597. /**
  15598. * 列宽线
  15599. */
  15600. isResizable ? h('div', {
  15601. class: 'vxe-table--resizable-bar',
  15602. style: overflowX ? {
  15603. 'padding-bottom': "".concat(scrollbarHeight, "px")
  15604. } : null,
  15605. ref: 'resizeBar'
  15606. }) : _e(),
  15607. /**
  15608. * 加载中
  15609. */
  15610. h('div', {
  15611. class: ['vxe-table--loading vxe-loading', {
  15612. 'is--visible': isCloak || loading
  15613. }]
  15614. }, [h('div', {
  15615. class: 'vxe-loading--spinner'
  15616. })]),
  15617. /**
  15618. * 筛选
  15619. */
  15620. this.hasFilterPanel ? h('vxe-table-filter', {
  15621. props: {
  15622. filterStore: filterStore
  15623. },
  15624. ref: 'filterWrapper'
  15625. }) : _e(),
  15626. /**
  15627. * 导入
  15628. */
  15629. this.importConfig ? h('vxe-import-panel', {
  15630. props: {
  15631. defaultOptions: this.importParams,
  15632. storeData: this.importStore
  15633. }
  15634. }) : _e(),
  15635. /**
  15636. * 导出/打印
  15637. */
  15638. this.exportConfig || this.printConfig ? h('vxe-export-panel', {
  15639. props: {
  15640. defaultOptions: this.exportParams,
  15641. storeData: this.exportStore
  15642. }
  15643. }) : _e(), h('div', {
  15644. class: "vxe-table".concat(tId, "-wrapper ").concat(this.$vnode.data.staticClass || ''),
  15645. ref: 'tableWrapper'
  15646. }, [
  15647. /**
  15648. * 复选框-范围选择
  15649. */
  15650. checkboxOpts.range ? h('div', {
  15651. class: 'vxe-table--checkbox-range',
  15652. ref: 'checkboxRange'
  15653. }) : _e(),
  15654. /**
  15655. * 快捷菜单
  15656. */
  15657. isCtxMenu ? h('vxe-table-context-menu', {
  15658. props: {
  15659. ctxMenuStore: ctxMenuStore,
  15660. ctxMenuOpts: ctxMenuOpts
  15661. },
  15662. ref: 'ctxWrapper'
  15663. }) : _e(),
  15664. /**
  15665. * 公用提示
  15666. */
  15667. hasTip ? h('vxe-tooltip', {
  15668. key: 'cTip',
  15669. ref: 'commTip',
  15670. props: {
  15671. isArrow: false,
  15672. enterable: false
  15673. }
  15674. }) : _e(),
  15675. /**
  15676. * 单元格溢出的提示
  15677. */
  15678. hasTip ? h('vxe-tooltip', {
  15679. ref: 'tooltip',
  15680. props: tooltipOpts,
  15681. on: tooltipOpts.enterable ? {
  15682. leave: this.handleTooltipLeaveEvent
  15683. } : null
  15684. }) : _e(),
  15685. /**
  15686. * 单元格校验不通过的提示
  15687. * 仅用于一行数据时有效,多行数据使用内部的提示框
  15688. */
  15689. hasTip && editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
  15690. class: 'vxe-table--valid-error',
  15691. props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null,
  15692. ref: 'validTip'
  15693. }) : _e()])]);
  15694. },
  15695. methods: methods
  15696. });
  15697. // CONCATENATED MODULE: ./packages/table/index.js
  15698. table.install = function (Vue) {
  15699. if (typeof window !== 'undefined' && window.VXETableMixin) {
  15700. table.mixins.push(window.VXETableMixin);
  15701. delete window.VXETableMixin;
  15702. }
  15703. v_x_e_table.Vue = Vue;
  15704. v_x_e_table.Table = table;
  15705. v_x_e_table.TableComponent = table;
  15706. if (!Vue.prototype.$vxe) {
  15707. Vue.prototype.$vxe = {
  15708. t: v_x_e_table.t,
  15709. _t: v_x_e_table._t
  15710. };
  15711. } else {
  15712. Vue.prototype.$vxe.t = v_x_e_table.t;
  15713. Vue.prototype.$vxe._t = v_x_e_table._t;
  15714. }
  15715. Vue.component(table.name, table);
  15716. };
  15717. var Table = table;
  15718. /* harmony default export */ var packages_table = (table);
  15719. // CONCATENATED MODULE: ./packages/column/src/column.js
  15720. var column_props = {
  15721. // 列唯一主键
  15722. colId: [String, Number],
  15723. // 渲染类型 seq,radio,checkbox,expand
  15724. type: String,
  15725. // 在 v3.0 中废弃 prop
  15726. prop: String,
  15727. // 在 v3.0 中废弃 label
  15728. label: String,
  15729. // 列字段名
  15730. field: String,
  15731. // 列标题
  15732. title: String,
  15733. // 列宽度
  15734. width: [Number, String],
  15735. // 列最小宽度,把剩余宽度按比例分配
  15736. minWidth: [Number, String],
  15737. // 是否允许拖动列宽调整大小
  15738. resizable: {
  15739. type: Boolean,
  15740. default: null
  15741. },
  15742. // 将列固定在左侧或者右侧
  15743. fixed: String,
  15744. // 列对其方式
  15745. align: String,
  15746. // 表头对齐方式
  15747. headerAlign: String,
  15748. // 表尾列的对齐方式
  15749. footerAlign: String,
  15750. // 当内容过长时显示为省略号
  15751. showOverflow: {
  15752. type: [Boolean, String],
  15753. default: null
  15754. },
  15755. // 当表头内容过长时显示为省略号
  15756. showHeaderOverflow: {
  15757. type: [Boolean, String],
  15758. default: null
  15759. },
  15760. // 当表尾内容过长时显示为省略号
  15761. showFooterOverflow: {
  15762. type: [Boolean, String],
  15763. default: null
  15764. },
  15765. // 给单元格附加 className
  15766. className: [String, Function],
  15767. // 给表头单元格附加 className
  15768. headerClassName: [String, Function],
  15769. // 给表尾单元格附加 className
  15770. footerClassName: [String, Function],
  15771. // 格式化显示内容
  15772. formatter: [Function, Array, String],
  15773. // 自定义索引方法
  15774. seqMethod: Function,
  15775. // 在 v3.0 中废弃 indexMethod
  15776. indexMethod: Function,
  15777. // 是否允许排序
  15778. sortable: Boolean,
  15779. // 在 v3 中废弃
  15780. remoteSort: {
  15781. type: Boolean,
  15782. default: null
  15783. },
  15784. // 在 v3 中只支持字符串类型
  15785. sortBy: [String, Array],
  15786. // 排序的字段类型,比如字符串转数值等
  15787. sortType: String,
  15788. // 在 v3 中废弃
  15789. sortMethod: Function,
  15790. // 配置筛选条件数组
  15791. filters: {
  15792. type: Array,
  15793. default: null
  15794. },
  15795. // 筛选是否允许多选
  15796. filterMultiple: {
  15797. type: Boolean,
  15798. default: true
  15799. },
  15800. // 自定义筛选方法
  15801. filterMethod: Function,
  15802. // 筛选重置方法
  15803. filterResetMethod: Function,
  15804. // 筛选复原方法
  15805. filterRecoverMethod: Function,
  15806. // 筛选模板配置项
  15807. filterRender: Object,
  15808. // 指定为树节点
  15809. treeNode: Boolean,
  15810. // 是否可视
  15811. visible: {
  15812. type: Boolean,
  15813. default: null
  15814. },
  15815. // 单元格数据导出方法
  15816. exportMethod: Function,
  15817. // 表尾单元格数据导出方法
  15818. footerExportMethod: Function,
  15819. // 标题帮助图标配置项
  15820. titleHelp: Object,
  15821. // 单元格值类型
  15822. cellType: String,
  15823. // 单元格渲染配置项
  15824. cellRender: Object,
  15825. // 单元格编辑渲染配置项
  15826. editRender: Object,
  15827. // 内容渲染配置项
  15828. contentRender: Object,
  15829. // 额外的参数
  15830. params: Object
  15831. };
  15832. var watch = {};
  15833. Object.keys(column_props).forEach(function (name) {
  15834. watch[name] = function (value) {
  15835. this.columnConfig.update(name, value);
  15836. };
  15837. });
  15838. /* harmony default export */ var src_column = ({
  15839. name: 'VxeColumn',
  15840. props: column_props,
  15841. provide: function provide() {
  15842. return {
  15843. $xecolumn: this
  15844. };
  15845. },
  15846. inject: {
  15847. $xetable: {
  15848. default: null
  15849. },
  15850. $xecolumn: {
  15851. default: null
  15852. }
  15853. },
  15854. watch: watch,
  15855. created: function created() {
  15856. this.$xetable.isSC = true;
  15857. this.columnConfig = this.createColumn(this.$xetable, this);
  15858. },
  15859. mounted: function mounted() {
  15860. UtilTools.assemColumn(this);
  15861. if (this.type === 'expand' && !this.$scopedSlots.content && this.$scopedSlots.default) {
  15862. UtilTools.warn('vxe.error.expandContent');
  15863. }
  15864. },
  15865. destroyed: function destroyed() {
  15866. UtilTools.destroyColumn(this);
  15867. },
  15868. render: function render(h) {
  15869. return h('div', this.$slots.default);
  15870. },
  15871. methods: packages_cell
  15872. });
  15873. // CONCATENATED MODULE: ./packages/column/src/group.js
  15874. /* harmony default export */ var src_group = ({
  15875. name: 'VxeColgroup',
  15876. extends: src_column,
  15877. provide: function provide() {
  15878. return {
  15879. xecolgroup: this
  15880. };
  15881. }
  15882. });
  15883. // CONCATENATED MODULE: ./packages/column/index.js
  15884. src_column.install = function (Vue) {
  15885. Vue.component(src_column.name, src_column);
  15886. Vue.component('VxeTableColumn', src_column);
  15887. Vue.component(src_group.name, src_group);
  15888. Vue.component('VxeTableColgroup', src_group);
  15889. };
  15890. var Column = src_column;
  15891. /* harmony default export */ var packages_column = (src_column);
  15892. // CONCATENATED MODULE: ./packages/header/src/util.js
  15893. var util_getAllColumns = function getAllColumns(columns, parentColumn) {
  15894. var result = [];
  15895. columns.forEach(function (column) {
  15896. column.parentId = parentColumn ? parentColumn.id : null;
  15897. if (column.visible) {
  15898. if (column.children && column.children.length && column.children.some(function (column) {
  15899. return column.visible;
  15900. })) {
  15901. result.push(column);
  15902. result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
  15903. } else {
  15904. result.push(column);
  15905. }
  15906. }
  15907. });
  15908. return result;
  15909. };
  15910. var convertToRows = function convertToRows(originColumns) {
  15911. var maxLevel = 1;
  15912. var traverse = function traverse(column, parent) {
  15913. if (parent) {
  15914. column.level = parent.level + 1;
  15915. if (maxLevel < column.level) {
  15916. maxLevel = column.level;
  15917. }
  15918. }
  15919. if (column.children && column.children.length && column.children.some(function (column) {
  15920. return column.visible;
  15921. })) {
  15922. var colSpan = 0;
  15923. column.children.forEach(function (subColumn) {
  15924. if (subColumn.visible) {
  15925. traverse(subColumn, column);
  15926. colSpan += subColumn.colSpan;
  15927. }
  15928. });
  15929. column.colSpan = colSpan;
  15930. } else {
  15931. column.colSpan = 1;
  15932. }
  15933. };
  15934. originColumns.forEach(function (column) {
  15935. column.level = 1;
  15936. traverse(column);
  15937. });
  15938. var rows = [];
  15939. for (var i = 0; i < maxLevel; i++) {
  15940. rows.push([]);
  15941. }
  15942. var allColumns = util_getAllColumns(originColumns);
  15943. allColumns.forEach(function (column) {
  15944. if (column.children && column.children.length && column.children.some(function (column) {
  15945. return column.visible;
  15946. })) {
  15947. column.rowSpan = 1;
  15948. } else {
  15949. column.rowSpan = maxLevel - column.level + 1;
  15950. }
  15951. rows[column.level - 1].push(column);
  15952. });
  15953. return rows;
  15954. };
  15955. // CONCATENATED MODULE: ./packages/header/src/header.js
  15956. var header_cellType = 'header';
  15957. /* harmony default export */ var header = ({
  15958. name: 'VxeTableHeader',
  15959. props: {
  15960. tableData: Array,
  15961. tableColumn: Array,
  15962. visibleColumn: Array,
  15963. tableGroupColumn: Array,
  15964. fixedColumn: Array,
  15965. size: String,
  15966. fixedType: String,
  15967. isGroup: Boolean
  15968. },
  15969. data: function data() {
  15970. return {
  15971. headerColumn: []
  15972. };
  15973. },
  15974. watch: {
  15975. tableColumn: function tableColumn() {
  15976. this.uploadColumn();
  15977. }
  15978. },
  15979. created: function created() {
  15980. this.uploadColumn();
  15981. },
  15982. mounted: function mounted() {
  15983. var $xetable = this.$parent,
  15984. $el = this.$el,
  15985. $refs = this.$refs,
  15986. fixedType = this.fixedType;
  15987. var elemStore = $xetable.elemStore;
  15988. var prefix = "".concat(fixedType || 'main', "-header-");
  15989. elemStore["".concat(prefix, "wrapper")] = $el;
  15990. elemStore["".concat(prefix, "table")] = $refs.table;
  15991. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  15992. elemStore["".concat(prefix, "list")] = $refs.thead;
  15993. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  15994. elemStore["".concat(prefix, "repair")] = $refs.repair;
  15995. },
  15996. render: function render(h) {
  15997. var _this = this;
  15998. var _e = this._e,
  15999. $xetable = this.$parent,
  16000. fixedType = this.fixedType,
  16001. headerColumn = this.headerColumn,
  16002. fixedColumn = this.fixedColumn;
  16003. var tableColumn = this.tableColumn;
  16004. var tableListeners = $xetable.$listeners,
  16005. tId = $xetable.tId,
  16006. resizable = $xetable.resizable,
  16007. border = $xetable.border,
  16008. columnKey = $xetable.columnKey,
  16009. headerRowClassName = $xetable.headerRowClassName,
  16010. headerCellClassName = $xetable.headerCellClassName,
  16011. headerRowStyle = $xetable.headerRowStyle,
  16012. headerCellStyle = $xetable.headerCellStyle,
  16013. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  16014. allHeaderAlign = $xetable.headerAlign,
  16015. allAlign = $xetable.align,
  16016. highlightCurrentColumn = $xetable.highlightCurrentColumn,
  16017. currentColumn = $xetable.currentColumn,
  16018. mouseConfig = $xetable.mouseConfig,
  16019. scrollXLoad = $xetable.scrollXLoad,
  16020. overflowX = $xetable.overflowX,
  16021. scrollbarWidth = $xetable.scrollbarWidth,
  16022. getColumnIndex = $xetable.getColumnIndex,
  16023. sortOpts = $xetable.sortOpts; // 横向滚动渲染
  16024. if (scrollXLoad) {
  16025. if (fixedType) {
  16026. tableColumn = fixedColumn;
  16027. }
  16028. }
  16029. return h('div', {
  16030. class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  16031. attrs: {
  16032. 'data-tid': tId
  16033. }
  16034. }, [fixedType ? _e() : h('div', {
  16035. class: 'vxe-body--x-space',
  16036. ref: 'xSpace'
  16037. }), h('table', {
  16038. class: 'vxe-table--header',
  16039. attrs: {
  16040. 'data-tid': tId,
  16041. cellspacing: 0,
  16042. cellpadding: 0,
  16043. border: 0
  16044. },
  16045. ref: 'table'
  16046. }, [
  16047. /**
  16048. * 列宽
  16049. */
  16050. h('colgroup', {
  16051. ref: 'colgroup'
  16052. }, tableColumn.map(function (column, $columnIndex) {
  16053. return h('col', {
  16054. attrs: {
  16055. name: column.id
  16056. },
  16057. key: $columnIndex
  16058. });
  16059. }).concat(scrollbarWidth ? [h('col', {
  16060. attrs: {
  16061. name: 'col_gutter'
  16062. }
  16063. })] : [])),
  16064. /**
  16065. * 头部
  16066. */
  16067. h('thead', {
  16068. ref: 'thead'
  16069. }, headerColumn.map(function (cols, $rowIndex) {
  16070. return h('tr', {
  16071. class: ['vxe-header--row', headerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
  16072. $table: $xetable,
  16073. $rowIndex: $rowIndex,
  16074. fixed: fixedType,
  16075. type: header_cellType
  16076. }) : headerRowClassName : ''],
  16077. style: headerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(headerRowStyle) ? headerRowStyle({
  16078. $table: $xetable,
  16079. $rowIndex: $rowIndex,
  16080. fixed: fixedType,
  16081. type: header_cellType
  16082. }) : headerRowStyle : null
  16083. }, cols.map(function (column, $columnIndex) {
  16084. var _ref;
  16085. var showHeaderOverflow = column.showHeaderOverflow,
  16086. headerAlign = column.headerAlign,
  16087. align = column.align,
  16088. headerClassName = column.headerClassName;
  16089. var isColGroup = column.children && column.children.length;
  16090. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  16091. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  16092. var headAlign = headerAlign || align || allHeaderAlign || allAlign;
  16093. var showEllipsis = headOverflow === 'ellipsis';
  16094. var showTitle = headOverflow === 'title';
  16095. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  16096. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  16097. var thOns = {};
  16098. var hasFilter = column.filters && column.filters.some(function (item) {
  16099. return item.checked;
  16100. }); // 确保任何情况下 columnIndex 都精准指向真实列索引
  16101. var columnIndex = getColumnIndex(column);
  16102. var _columnIndex = $xetable.getVTColumnIndex(column);
  16103. var params = {
  16104. $table: $xetable,
  16105. $rowIndex: $rowIndex,
  16106. column: column,
  16107. columnIndex: columnIndex,
  16108. $columnIndex: $columnIndex,
  16109. _columnIndex: _columnIndex,
  16110. fixed: fixedType,
  16111. type: header_cellType,
  16112. isHidden: fixedHiddenColumn,
  16113. hasFilter: hasFilter
  16114. }; // 虚拟滚动不支持动态高度
  16115. if (scrollXLoad && !hasEllipsis) {
  16116. showEllipsis = hasEllipsis = true;
  16117. }
  16118. if (highlightCurrentColumn || tableListeners['header-cell-click'] || mouseConfig || sortOpts.trigger === 'cell') {
  16119. thOns.click = function (evnt) {
  16120. return $xetable.triggerHeaderCellClickEvent(evnt, params);
  16121. };
  16122. }
  16123. if (tableListeners['header-cell-dblclick']) {
  16124. thOns.dblclick = function (evnt) {
  16125. return $xetable.triggerHeaderCellDBLClickEvent(evnt, params);
  16126. };
  16127. } // 按下事件处理
  16128. if (mouseConfig) {
  16129. thOns.mousedown = function (evnt) {
  16130. return $xetable.triggerHeaderCellMousedownEvent(evnt, params);
  16131. };
  16132. }
  16133. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  16134. return h('th', {
  16135. class: ['vxe-header--column', column.id, (_ref = {}, _defineProperty(_ref, "col--".concat(headAlign), headAlign), _defineProperty(_ref, "col--".concat(type), type), _defineProperty(_ref, 'col--last', $columnIndex === cols.length - 1), _defineProperty(_ref, 'col--fixed', column.fixed), _defineProperty(_ref, 'col--group', isColGroup), _defineProperty(_ref, 'col--ellipsis', hasEllipsis), _defineProperty(_ref, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref, 'is--sortable', column.sortable), _defineProperty(_ref, 'is--filter', !!column.filters), _defineProperty(_ref, 'filter--active', hasFilter), _defineProperty(_ref, 'col--current', currentColumn === column), _ref), UtilTools.getClass(headerClassName, params), UtilTools.getClass(headerCellClassName, params)],
  16136. attrs: {
  16137. 'data-colid': column.id,
  16138. colspan: column.colSpan > 1 ? column.colSpan : null,
  16139. rowspan: column.rowSpan > 1 ? column.rowSpan : null
  16140. },
  16141. style: headerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
  16142. on: thOns,
  16143. key: columnKey || isColGroup ? column.id : $columnIndex
  16144. }, [h('div', {
  16145. class: ['vxe-cell', {
  16146. 'c--title': showTitle,
  16147. 'c--tooltip': showTooltip,
  16148. 'c--ellipsis': showEllipsis
  16149. }]
  16150. }, column.renderHeader(h, params)),
  16151. /**
  16152. * 列宽拖动
  16153. */
  16154. !fixedHiddenColumn && !isColGroup && (ctor_amd_xe_utils_default.a.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
  16155. class: ['vxe-resizable', {
  16156. 'is--line': !border || border === 'none'
  16157. }],
  16158. on: {
  16159. mousedown: function mousedown(evnt) {
  16160. return _this.resizeMousedown(evnt, params);
  16161. }
  16162. }
  16163. }) : null]);
  16164. }).concat(scrollbarWidth ? [h('th', {
  16165. class: 'vxe-header--gutter col--gutter'
  16166. })] : []));
  16167. }))]),
  16168. /**
  16169. * 其他
  16170. */
  16171. h('div', {
  16172. class: 'vxe-table--header-border-line',
  16173. ref: 'repair'
  16174. })]);
  16175. },
  16176. methods: {
  16177. uploadColumn: function uploadColumn() {
  16178. this.headerColumn = this.isGroup ? convertToRows(this.tableGroupColumn) : [this.$parent.scrollXLoad && this.fixedType ? this.fixedColumn : this.tableColumn];
  16179. },
  16180. resizeMousedown: function resizeMousedown(evnt, params) {
  16181. var column = params.column;
  16182. var $xetable = this.$parent,
  16183. $el = this.$el,
  16184. fixedType = this.fixedType;
  16185. var _$xetable$$refs = $xetable.$refs,
  16186. tableBody = _$xetable$$refs.tableBody,
  16187. leftContainer = _$xetable$$refs.leftContainer,
  16188. rightContainer = _$xetable$$refs.rightContainer,
  16189. resizeBarElem = _$xetable$$refs.resizeBar;
  16190. var dragBtnElem = evnt.target,
  16191. dragClientX = evnt.clientX;
  16192. var cell = params.cell = dragBtnElem.parentNode;
  16193. var dragLeft = 0;
  16194. var tableBodyElem = tableBody.$el;
  16195. var pos = DomTools.getOffsetPos(dragBtnElem, $el);
  16196. var dragBtnWidth = dragBtnElem.clientWidth;
  16197. var dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
  16198. var minInterval = UtilTools.getColMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
  16199. var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
  16200. var dragPosLeft = pos.left + dragBtnOffsetWidth;
  16201. var domMousemove = document.onmousemove;
  16202. var domMouseup = document.onmouseup;
  16203. var isLeftFixed = fixedType === 'left';
  16204. var isRightFixed = fixedType === 'right'; // 计算左右侧固定列偏移量
  16205. var fixedOffsetWidth = 0;
  16206. if (isLeftFixed || isRightFixed) {
  16207. var siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
  16208. var tempCellElem = cell[siblingProp];
  16209. while (tempCellElem) {
  16210. if (DomTools.hasClass(tempCellElem, 'fixed--hidden')) {
  16211. break;
  16212. } else if (!DomTools.hasClass(tempCellElem, 'col--group')) {
  16213. fixedOffsetWidth += tempCellElem.offsetWidth;
  16214. }
  16215. tempCellElem = tempCellElem[siblingProp];
  16216. }
  16217. if (isRightFixed && rightContainer) {
  16218. dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth;
  16219. }
  16220. } // 处理拖动事件
  16221. var updateEvent = function updateEvent(evnt) {
  16222. evnt.stopPropagation();
  16223. evnt.preventDefault();
  16224. var offsetX = evnt.clientX - dragClientX;
  16225. var left = dragPosLeft + offsetX;
  16226. var scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
  16227. if (isLeftFixed) {
  16228. // 左固定列(不允许超过右侧固定列、不允许超过右边距)
  16229. left = Math.min(left, (rightContainer ? rightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
  16230. } else if (isRightFixed) {
  16231. // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
  16232. dragMinLeft = (leftContainer ? leftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
  16233. left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
  16234. } else {
  16235. dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft); // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
  16236. }
  16237. dragLeft = Math.max(left, dragMinLeft);
  16238. resizeBarElem.style.left = "".concat(dragLeft - scrollLeft, "px");
  16239. };
  16240. $xetable._isResize = true;
  16241. DomTools.addClass($xetable.$el, 'drag--resize');
  16242. resizeBarElem.style.display = 'block';
  16243. document.onmousemove = updateEvent;
  16244. document.onmouseup = function () {
  16245. document.onmousemove = domMousemove;
  16246. document.onmouseup = domMouseup;
  16247. column.resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
  16248. resizeBarElem.style.display = 'none';
  16249. $xetable._isResize = false;
  16250. $xetable._lastResizeTime = Date.now();
  16251. $xetable.analyColumnWidth();
  16252. $xetable.recalculate(true).then(function () {
  16253. $xetable.saveCustomResizable();
  16254. $xetable.updateCellAreas();
  16255. $xetable.emitEvent('resizable-change', params, evnt);
  16256. });
  16257. DomTools.removeClass($xetable.$el, 'drag--resize');
  16258. };
  16259. updateEvent(evnt);
  16260. $xetable.closeMenu();
  16261. }
  16262. }
  16263. });
  16264. // CONCATENATED MODULE: ./packages/header/index.js
  16265. header.install = function (Vue) {
  16266. Vue.component(header.name, header);
  16267. };
  16268. var Header = header;
  16269. /* harmony default export */ var packages_header = (header);
  16270. // CONCATENATED MODULE: ./packages/footer/src/footer.js
  16271. var footer_cellType = 'footer';
  16272. function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
  16273. for (var mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
  16274. var _mergeFooterList$mInd = mergeFooterList[mIndex],
  16275. mergeRowIndex = _mergeFooterList$mInd.row,
  16276. mergeColIndex = _mergeFooterList$mInd.col,
  16277. mergeRowspan = _mergeFooterList$mInd.rowspan,
  16278. mergeColspan = _mergeFooterList$mInd.colspan;
  16279. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  16280. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  16281. return {
  16282. rowspan: mergeRowspan,
  16283. colspan: mergeColspan
  16284. };
  16285. }
  16286. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  16287. return {
  16288. rowspan: 0,
  16289. colspan: 0
  16290. };
  16291. }
  16292. }
  16293. }
  16294. }
  16295. /* harmony default export */ var footer = ({
  16296. name: 'VxeTableFooter',
  16297. props: {
  16298. footerTableData: Array,
  16299. tableColumn: Array,
  16300. visibleColumn: Array,
  16301. fixedColumn: Array,
  16302. size: String,
  16303. fixedType: String
  16304. },
  16305. mounted: function mounted() {
  16306. var $xetable = this.$parent,
  16307. $el = this.$el,
  16308. $refs = this.$refs,
  16309. fixedType = this.fixedType;
  16310. var elemStore = $xetable.elemStore;
  16311. var prefix = "".concat(fixedType || 'main', "-footer-");
  16312. elemStore["".concat(prefix, "wrapper")] = $el;
  16313. elemStore["".concat(prefix, "table")] = $refs.table;
  16314. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  16315. elemStore["".concat(prefix, "list")] = $refs.tfoot;
  16316. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  16317. },
  16318. render: function render(h) {
  16319. var _e = this._e,
  16320. $xetable = this.$parent,
  16321. fixedType = this.fixedType,
  16322. fixedColumn = this.fixedColumn,
  16323. tableColumn = this.tableColumn,
  16324. footerTableData = this.footerTableData;
  16325. var tableListeners = $xetable.$listeners,
  16326. tId = $xetable.tId,
  16327. footerRowClassName = $xetable.footerRowClassName,
  16328. footerCellClassName = $xetable.footerCellClassName,
  16329. footerRowStyle = $xetable.footerRowStyle,
  16330. footerCellStyle = $xetable.footerCellStyle,
  16331. allFooterAlign = $xetable.footerAlign,
  16332. mergeFooterList = $xetable.mergeFooterList,
  16333. footerSpanMethod = $xetable.footerSpanMethod,
  16334. allAlign = $xetable.align,
  16335. scrollXLoad = $xetable.scrollXLoad,
  16336. columnKey = $xetable.columnKey,
  16337. allColumnFooterOverflow = $xetable.showFooterOverflow,
  16338. currentColumn = $xetable.currentColumn,
  16339. overflowX = $xetable.overflowX,
  16340. scrollbarWidth = $xetable.scrollbarWidth,
  16341. tooltipOpts = $xetable.tooltipOpts; // 如果是使用优化模式
  16342. if (!mergeFooterList.length || !footerSpanMethod) {
  16343. if (fixedType && allColumnFooterOverflow) {
  16344. tableColumn = fixedColumn;
  16345. } else if (scrollXLoad) {
  16346. if (fixedType) {
  16347. tableColumn = fixedColumn;
  16348. }
  16349. }
  16350. }
  16351. return h('div', {
  16352. class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  16353. attrs: {
  16354. 'data-tid': tId
  16355. },
  16356. on: {
  16357. scroll: this.scrollEvent
  16358. }
  16359. }, [fixedType ? _e() : h('div', {
  16360. class: 'vxe-body--x-space',
  16361. ref: 'xSpace'
  16362. }), h('table', {
  16363. class: 'vxe-table--footer',
  16364. attrs: {
  16365. 'data-tid': tId,
  16366. cellspacing: 0,
  16367. cellpadding: 0,
  16368. border: 0
  16369. },
  16370. ref: 'table'
  16371. }, [
  16372. /**
  16373. * 列宽
  16374. */
  16375. h('colgroup', {
  16376. ref: 'colgroup'
  16377. }, tableColumn.map(function (column, columnIndex) {
  16378. return h('col', {
  16379. attrs: {
  16380. name: column.id
  16381. },
  16382. key: columnIndex
  16383. });
  16384. }).concat(scrollbarWidth ? [h('col', {
  16385. attrs: {
  16386. name: 'col_gutter'
  16387. }
  16388. })] : [])),
  16389. /**
  16390. * 底部
  16391. */
  16392. h('tfoot', {
  16393. ref: 'tfoot'
  16394. }, footerTableData.map(function (list, _rowIndex) {
  16395. var $rowIndex = _rowIndex;
  16396. return h('tr', {
  16397. class: ['vxe-footer--row', footerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
  16398. $table: $xetable,
  16399. _rowIndex: _rowIndex,
  16400. $rowIndex: $rowIndex,
  16401. fixed: fixedType,
  16402. type: footer_cellType
  16403. }) : footerRowClassName : ''],
  16404. style: footerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(footerRowStyle) ? footerRowStyle({
  16405. $table: $xetable,
  16406. _rowIndex: _rowIndex,
  16407. $rowIndex: $rowIndex,
  16408. fixed: fixedType,
  16409. type: footer_cellType
  16410. }) : footerRowStyle : null
  16411. }, tableColumn.map(function (column, $columnIndex) {
  16412. var _ref2;
  16413. var showFooterOverflow = column.showFooterOverflow,
  16414. footerAlign = column.footerAlign,
  16415. align = column.align,
  16416. footerClassName = column.footerClassName;
  16417. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  16418. var isColGroup = column.children && column.children.length;
  16419. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  16420. var footOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  16421. var footAlign = footerAlign || align || allFooterAlign || allAlign;
  16422. var showEllipsis = footOverflow === 'ellipsis';
  16423. var showTitle = footOverflow === 'title';
  16424. var showTooltip = footOverflow === true || footOverflow === 'tooltip';
  16425. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  16426. var attrs = {
  16427. 'data-colid': column.id
  16428. };
  16429. var tfOns = {};
  16430. var columnIndex = $xetable.getColumnIndex(column);
  16431. var _columnIndex = $xetable.getVTColumnIndex(column);
  16432. var itemIndex = _columnIndex;
  16433. var params = {
  16434. $table: $xetable,
  16435. _rowIndex: _rowIndex,
  16436. $rowIndex: $rowIndex,
  16437. column: column,
  16438. columnIndex: columnIndex,
  16439. $columnIndex: $columnIndex,
  16440. _columnIndex: _columnIndex,
  16441. itemIndex: itemIndex,
  16442. items: list,
  16443. fixed: fixedType,
  16444. type: footer_cellType,
  16445. data: footerTableData
  16446. }; // 虚拟滚动不支持动态高度
  16447. if (scrollXLoad && !hasEllipsis) {
  16448. showEllipsis = hasEllipsis = true;
  16449. }
  16450. if (showTitle || showTooltip || showAllTip) {
  16451. tfOns.mouseenter = function (evnt) {
  16452. if (showTitle) {
  16453. DomTools.updateCellTitle(evnt.currentTarget, column);
  16454. } else if (showTooltip || showAllTip) {
  16455. $xetable.triggerFooterTooltipEvent(evnt, params);
  16456. }
  16457. };
  16458. }
  16459. if (showTooltip || showAllTip) {
  16460. tfOns.mouseleave = function (evnt) {
  16461. if (showTooltip || showAllTip) {
  16462. $xetable.handleTargetLeaveEvent(evnt);
  16463. }
  16464. };
  16465. }
  16466. if (tableListeners['footer-cell-click']) {
  16467. tfOns.click = function (evnt) {
  16468. $xetable.emitEvent('footer-cell-click', Object.assign({
  16469. cell: evnt.currentTarget
  16470. }, params), evnt);
  16471. };
  16472. }
  16473. if (tableListeners['footer-cell-dblclick']) {
  16474. tfOns.dblclick = function (evnt) {
  16475. $xetable.emitEvent('footer-cell-dblclick', Object.assign({
  16476. cell: evnt.currentTarget
  16477. }, params), evnt);
  16478. };
  16479. } // 合并行或列
  16480. if (mergeFooterList.length) {
  16481. var spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
  16482. if (spanRest) {
  16483. var rowspan = spanRest.rowspan,
  16484. colspan = spanRest.colspan;
  16485. if (!rowspan || !colspan) {
  16486. return null;
  16487. }
  16488. if (rowspan > 1) {
  16489. attrs.rowspan = rowspan;
  16490. }
  16491. if (colspan > 1) {
  16492. attrs.colspan = colspan;
  16493. }
  16494. }
  16495. } else if (footerSpanMethod) {
  16496. // 自定义合并函数
  16497. var _ref = footerSpanMethod(params) || {},
  16498. _ref$rowspan = _ref.rowspan,
  16499. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  16500. _ref$colspan = _ref.colspan,
  16501. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  16502. if (!_rowspan || !_colspan) {
  16503. return null;
  16504. }
  16505. if (_rowspan > 1) {
  16506. attrs.rowspan = _rowspan;
  16507. }
  16508. if (_colspan > 1) {
  16509. attrs.colspan = _colspan;
  16510. }
  16511. }
  16512. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  16513. return h('td', {
  16514. class: ['vxe-footer--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(footAlign), footAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === tableColumn.length - 1), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'col--current', currentColumn === column), _ref2), UtilTools.getClass(footerClassName, params), UtilTools.getClass(footerCellClassName, params)],
  16515. attrs: attrs,
  16516. style: footerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle : null,
  16517. on: tfOns,
  16518. key: columnKey ? column.id : $columnIndex
  16519. }, [h('div', {
  16520. class: ['vxe-cell', {
  16521. 'c--title': showTitle,
  16522. 'c--tooltip': showTooltip,
  16523. 'c--ellipsis': showEllipsis
  16524. }]
  16525. }, column.renderFooter(h, params))]);
  16526. }).concat(scrollbarWidth ? [h('td', {
  16527. class: 'vxe-footer--gutter col--gutter'
  16528. })] : []));
  16529. }))])]);
  16530. },
  16531. methods: {
  16532. /**
  16533. * 滚动处理
  16534. * 如果存在列固定左侧,同步更新滚动状态
  16535. * 如果存在列固定右侧,同步更新滚动状态
  16536. */
  16537. scrollEvent: function scrollEvent(evnt) {
  16538. var $xetable = this.$parent,
  16539. fixedType = this.fixedType;
  16540. var $refs = $xetable.$refs,
  16541. scrollXLoad = $xetable.scrollXLoad,
  16542. triggerScrollXEvent = $xetable.triggerScrollXEvent,
  16543. lastScrollLeft = $xetable.lastScrollLeft;
  16544. var tableHeader = $refs.tableHeader,
  16545. tableBody = $refs.tableBody,
  16546. tableFooter = $refs.tableFooter,
  16547. validTip = $refs.validTip;
  16548. var headerElem = tableHeader ? tableHeader.$el : null;
  16549. var footerElem = tableFooter ? tableFooter.$el : null;
  16550. var bodyElem = tableBody.$el;
  16551. var scrollLeft = footerElem.scrollLeft;
  16552. var isX = scrollLeft !== lastScrollLeft;
  16553. $xetable.lastScrollLeft = scrollLeft;
  16554. $xetable.lastScrollTime = Date.now();
  16555. if (headerElem) {
  16556. headerElem.scrollLeft = scrollLeft;
  16557. }
  16558. if (bodyElem) {
  16559. bodyElem.scrollLeft = scrollLeft;
  16560. }
  16561. if (scrollXLoad && isX) {
  16562. triggerScrollXEvent(evnt);
  16563. }
  16564. if (isX && validTip && validTip.visible) {
  16565. validTip.updatePlacement();
  16566. }
  16567. $xetable.emitEvent('scroll', {
  16568. type: footer_cellType,
  16569. fixed: fixedType,
  16570. scrollTop: bodyElem.scrollTop,
  16571. scrollLeft: scrollLeft,
  16572. isX: isX,
  16573. isY: false
  16574. }, evnt);
  16575. }
  16576. }
  16577. });
  16578. // CONCATENATED MODULE: ./packages/footer/index.js
  16579. footer.install = function (Vue) {
  16580. Vue.component(footer.name, footer);
  16581. };
  16582. var Footer = footer;
  16583. /* harmony default export */ var packages_footer = (footer);
  16584. // CONCATENATED MODULE: ./packages/filter/src/panel.js
  16585. /* harmony default export */ var panel = ({
  16586. name: 'VxeTableFilter',
  16587. props: {
  16588. filterStore: Object
  16589. },
  16590. computed: {
  16591. hasCheckOption: function hasCheckOption() {
  16592. var filterStore = this.filterStore;
  16593. return filterStore && filterStore.options.some(function (option) {
  16594. return option.checked;
  16595. });
  16596. }
  16597. },
  16598. render: function render(h) {
  16599. var $xetable = this.$parent,
  16600. filterStore = this.filterStore;
  16601. var column = filterStore.column;
  16602. var filterRender = column ? column.filterRender : null;
  16603. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16604. return h('div', {
  16605. class: ['vxe-table--filter-wrapper', 'filter--prevent-default', compConf && compConf.className ? compConf.className : '', {
  16606. 't--animat': $xetable.animat,
  16607. 'is--multiple': filterStore.multiple,
  16608. 'filter--active': filterStore.visible
  16609. }],
  16610. style: filterStore.style
  16611. }, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : []);
  16612. },
  16613. methods: {
  16614. renderOptions: function renderOptions(h, filterRender, compConf) {
  16615. var _this = this;
  16616. var $xetable = this.$parent,
  16617. filterStore = this.filterStore;
  16618. var args = filterStore.args,
  16619. column = filterStore.column,
  16620. multiple = filterStore.multiple;
  16621. var slots = column.slots;
  16622. if (slots && slots.filter) {
  16623. return [h('div', {
  16624. class: 'vxe-table--filter-template'
  16625. }, slots.filter.call($xetable, Object.assign({
  16626. $panel: this,
  16627. context: this
  16628. }, args), h))];
  16629. } else if (compConf && compConf.renderFilter) {
  16630. return [h('div', {
  16631. class: 'vxe-table--filter-template'
  16632. }, compConf.renderFilter.call($xetable, h, filterRender, Object.assign({
  16633. $panel: this,
  16634. context: this
  16635. }, args), this))];
  16636. }
  16637. return [h('ul', {
  16638. class: 'vxe-table--filter-header'
  16639. }, [h('li', {
  16640. class: ['vxe-table--filter-option', {
  16641. 'is--checked': multiple ? filterStore.isAllSelected : !filterStore.options.some(function (item) {
  16642. return item._checked;
  16643. }),
  16644. 'is--indeterminate': multiple && filterStore.isIndeterminate
  16645. }],
  16646. attrs: {
  16647. title: conf.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
  16648. },
  16649. on: {
  16650. click: function click(evnt) {
  16651. _this.changeAllOption(evnt, !filterStore.isAllSelected);
  16652. }
  16653. }
  16654. }, (multiple ? [h('span', {
  16655. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  16656. }), h('span', {
  16657. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  16658. }), h('span', {
  16659. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  16660. })] : []).concat([h('span', {
  16661. class: 'vxe-checkbox--label'
  16662. }, conf.i18n('vxe.table.allFilter'))]))]), h('ul', {
  16663. class: 'vxe-table--filter-body'
  16664. }, filterStore.options.map(function (item) {
  16665. return h('li', {
  16666. class: ['vxe-table--filter-option', {
  16667. 'is--checked': item._checked
  16668. }],
  16669. attrs: {
  16670. title: item.label
  16671. },
  16672. on: {
  16673. click: function click(evnt) {
  16674. _this.changeOption(evnt, !item._checked, item);
  16675. }
  16676. }
  16677. }, (multiple ? [h('span', {
  16678. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  16679. }), h('span', {
  16680. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  16681. }), h('span', {
  16682. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  16683. })] : []).concat([h('span', {
  16684. class: 'vxe-checkbox--label'
  16685. }, UtilTools.formatText(item.label, 1))]));
  16686. }))];
  16687. },
  16688. renderFooter: function renderFooter(h) {
  16689. var hasCheckOption = this.hasCheckOption,
  16690. filterStore = this.filterStore;
  16691. var column = filterStore.column,
  16692. multiple = filterStore.multiple;
  16693. var filterRender = column.filterRender;
  16694. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16695. var isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
  16696. return multiple && (!compConf || (ctor_amd_xe_utils_default.a.isBoolean(compConf.showFilterFooter) ? compConf.showFilterFooter !== false : compConf.isFooter !== false)) ? [h('div', {
  16697. class: 'vxe-table--filter-footer'
  16698. }, [h('button', {
  16699. class: {
  16700. 'is--disabled': isDisabled
  16701. },
  16702. attrs: {
  16703. disabled: isDisabled
  16704. },
  16705. on: {
  16706. click: this.confirmFilter
  16707. }
  16708. }, conf.i18n('vxe.table.confirmFilter')), h('button', {
  16709. on: {
  16710. click: this.resetFilter
  16711. }
  16712. }, conf.i18n('vxe.table.resetFilter'))])] : [];
  16713. },
  16714. // 全部筛选事件
  16715. filterCheckAllEvent: function filterCheckAllEvent(evnt, value) {
  16716. var filterStore = this.filterStore;
  16717. filterStore.options.forEach(function (option) {
  16718. option._checked = value;
  16719. option.checked = value;
  16720. });
  16721. filterStore.isAllSelected = value;
  16722. filterStore.isIndeterminate = false;
  16723. },
  16724. /*************************
  16725. * Publish methods
  16726. *************************/
  16727. // (单选)筛选发生改变
  16728. changeRadioOption: function changeRadioOption(evnt, checked, item) {
  16729. var $xetable = this.$parent,
  16730. filterStore = this.filterStore;
  16731. filterStore.options.forEach(function (option) {
  16732. option._checked = false;
  16733. });
  16734. item._checked = checked;
  16735. $xetable.checkFilterOptions();
  16736. this.confirmFilter(evnt);
  16737. },
  16738. // (多选)筛选发生改变
  16739. changeMultipleOption: function changeMultipleOption(evnt, checked, item) {
  16740. var $xetable = this.$parent;
  16741. item._checked = checked;
  16742. $xetable.checkFilterOptions();
  16743. },
  16744. changeAllOption: function changeAllOption(evnt, checked) {
  16745. if (this.filterStore.multiple) {
  16746. this.filterCheckAllEvent(evnt, checked);
  16747. } else {
  16748. this.resetFilter(evnt);
  16749. }
  16750. },
  16751. // 筛选发生改变
  16752. changeOption: function changeOption(evnt, checked, item) {
  16753. if (this.filterStore.multiple) {
  16754. this.changeMultipleOption(evnt, checked, item);
  16755. } else {
  16756. this.changeRadioOption(evnt, checked, item);
  16757. }
  16758. },
  16759. // 确认筛选
  16760. confirmFilter: function confirmFilter(evnt) {
  16761. var $xetable = this.$parent,
  16762. filterStore = this.filterStore;
  16763. filterStore.options.forEach(function (option) {
  16764. option.checked = option._checked;
  16765. });
  16766. $xetable.confirmFilterEvent(evnt);
  16767. },
  16768. // 重置筛选
  16769. resetFilter: function resetFilter(evnt) {
  16770. var $xetable = this.$parent;
  16771. $xetable.resetFilterEvent(evnt);
  16772. }
  16773. /*************************
  16774. * Publish methods
  16775. *************************/
  16776. }
  16777. });
  16778. // CONCATENATED MODULE: ./packages/filter/src/mixin.js
  16779. /* harmony default export */ var src_mixin = ({
  16780. methods: {
  16781. /**
  16782. * v3 废弃 filter 方法,被 setFilter 取代
  16783. * 手动调用筛选的方法
  16784. * 如果不传回调则返回一个选项列表的 Promise 对象
  16785. * 如果传回调则通过回调返回的值更新选项列表,并返回一个新选项列表的 Promise 对象
  16786. * @param {String} field 字段名
  16787. * @param {Function} callback 重置列表的回调函数,返回新的选项列表
  16788. */
  16789. _filter: function _filter(field, callback) {
  16790. UtilTools.warn('vxe.error.delFunc', ['filter', 'setFilter']);
  16791. var column = this.getColumnByField(field);
  16792. if (column) {
  16793. var options = column.filters;
  16794. if (options && callback) {
  16795. var rest = callback(options);
  16796. if (ctor_amd_xe_utils_default.a.isArray(rest)) {
  16797. column.filters = UtilTools.getFilters(rest);
  16798. }
  16799. return this.$nextTick().then(function () {
  16800. return options;
  16801. });
  16802. }
  16803. }
  16804. return this.$nextTick();
  16805. },
  16806. /**
  16807. * 修改筛选条件列表
  16808. * @param {ColumnInfo} column 列
  16809. * @param {Array} options 选项
  16810. */
  16811. _setFilter: function _setFilter(column, options) {
  16812. if (column.filters && options) {
  16813. column.filters = UtilTools.getFilters(options);
  16814. }
  16815. return this.$nextTick();
  16816. },
  16817. checkFilterOptions: function checkFilterOptions() {
  16818. var filterStore = this.filterStore;
  16819. filterStore.isAllSelected = filterStore.options.every(function (item) {
  16820. return item._checked;
  16821. });
  16822. filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) {
  16823. return item._checked;
  16824. });
  16825. },
  16826. /**
  16827. * 点击筛选事件
  16828. * 当筛选图标被点击时触发
  16829. * 更新选项是否全部状态
  16830. * 打开筛选面板
  16831. * @param {Event} evnt 事件
  16832. * @param {ColumnInfo} column 列配置
  16833. * @param {Object} params 参数
  16834. */
  16835. triggerFilterEvent: function triggerFilterEvent(evnt, column, params) {
  16836. var _this = this;
  16837. var $refs = this.$refs,
  16838. filterStore = this.filterStore;
  16839. if (filterStore.column === column && filterStore.visible) {
  16840. filterStore.visible = false;
  16841. } else {
  16842. var bodyElem = $refs.tableBody.$el;
  16843. var targetElem = evnt.target,
  16844. pageX = evnt.pageX;
  16845. var filters = column.filters,
  16846. filterMultiple = column.filterMultiple,
  16847. filterRender = column.filterRender;
  16848. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16849. var filterRecoverMethod = column.filterRecoverMethod || (compConf ? compConf.filterRecoverMethod : null);
  16850. var _DomTools$getDomNode = DomTools.getDomNode(),
  16851. visibleWidth = _DomTools$getDomNode.visibleWidth;
  16852. Object.assign(filterStore, {
  16853. args: params,
  16854. multiple: filterMultiple,
  16855. options: filters,
  16856. column: column,
  16857. style: null,
  16858. visible: true
  16859. }); // 复原状态
  16860. filterStore.options.forEach(function (option) {
  16861. var _checked = option._checked,
  16862. checked = option.checked;
  16863. option._checked = checked;
  16864. if (!checked && _checked !== checked) {
  16865. if (filterRecoverMethod) {
  16866. filterRecoverMethod({
  16867. option: option,
  16868. column: column,
  16869. $table: _this
  16870. });
  16871. }
  16872. }
  16873. });
  16874. this.checkFilterOptions();
  16875. this.hasFilterPanel = true;
  16876. this.$nextTick(function () {
  16877. var filterWrapperElem = $refs.filterWrapper.$el;
  16878. var filterWidth = filterWrapperElem.offsetWidth;
  16879. var centerWidth = filterWidth / 2;
  16880. var minMargin = 32;
  16881. var left, right;
  16882. var style = {
  16883. top: "".concat(targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight + 8, "px")
  16884. };
  16885. if (column.fixed === 'left') {
  16886. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth;
  16887. } else if (column.fixed === 'right') {
  16888. right = targetElem.offsetParent.offsetWidth - targetElem.offsetLeft + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth;
  16889. } else {
  16890. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft;
  16891. }
  16892. if (left) {
  16893. var overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16894. if (overflowWidth > 0) {
  16895. left -= overflowWidth;
  16896. }
  16897. style.left = "".concat(Math.max(minMargin, left), "px");
  16898. } else if (right) {
  16899. var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16900. if (_overflowWidth > 0) {
  16901. right += _overflowWidth;
  16902. }
  16903. style.right = "".concat(right, "px");
  16904. }
  16905. filterStore.style = style;
  16906. });
  16907. }
  16908. },
  16909. _getCheckedFilters: function _getCheckedFilters() {
  16910. var tableFullColumn = this.tableFullColumn;
  16911. var filterList = [];
  16912. tableFullColumn.filter(function (column) {
  16913. var property = column.property,
  16914. filters = column.filters;
  16915. var valueList = [];
  16916. var dataList = [];
  16917. if (filters && filters.length) {
  16918. filters.forEach(function (item) {
  16919. if (item.checked) {
  16920. valueList.push(item.value);
  16921. dataList.push(item.data);
  16922. }
  16923. });
  16924. if (valueList.length) {
  16925. filterList.push({
  16926. column: column,
  16927. property: property,
  16928. values: valueList,
  16929. datas: dataList
  16930. });
  16931. }
  16932. }
  16933. });
  16934. return filterList;
  16935. },
  16936. /**
  16937. * 确认筛选
  16938. * 当筛选面板中的确定按钮被按下时触发
  16939. * @param {Event} evnt 事件
  16940. */
  16941. confirmFilterEvent: function confirmFilterEvent(evnt) {
  16942. var _this2 = this;
  16943. var filterStore = this.filterStore,
  16944. remoteFilter = this.remoteFilter,
  16945. filterOpts = this.filterOpts,
  16946. scrollXLoad = this.scrollXLoad,
  16947. scrollYLoad = this.scrollYLoad;
  16948. var column = filterStore.column;
  16949. var property = column.property;
  16950. var values = [];
  16951. var datas = [];
  16952. column.filters.forEach(function (item) {
  16953. if (item.checked) {
  16954. values.push(item.value);
  16955. datas.push(item.data);
  16956. }
  16957. });
  16958. filterStore.visible = false;
  16959. var filterList = this.getCheckedFilters(); // 如果是服务端筛选,则跳过本地筛选处理
  16960. if (!(filterOpts.remote || remoteFilter)) {
  16961. this.handleTableData(true);
  16962. this.checkSelectionStatus();
  16963. } // 在 v3.0 中废弃 prop
  16964. this.emitEvent('filter-change', {
  16965. column: column,
  16966. property: property,
  16967. field: property,
  16968. prop: property,
  16969. values: values,
  16970. datas: datas,
  16971. filters: filterList,
  16972. filterList: filterList
  16973. }, evnt);
  16974. this.updateFooter();
  16975. if (scrollXLoad || scrollYLoad) {
  16976. this.clearScroll();
  16977. if (scrollYLoad) {
  16978. this.updateScrollYSpace();
  16979. }
  16980. }
  16981. this.closeFilter();
  16982. this.$nextTick(function () {
  16983. _this2.recalculate();
  16984. _this2.updateCellAreas();
  16985. });
  16986. },
  16987. handleClearFilter: function handleClearFilter(column) {
  16988. if (column) {
  16989. var filters = column.filters,
  16990. filterRender = column.filterRender;
  16991. if (filters) {
  16992. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16993. var filterResetMethod = column.filterResetMethod || (compConf ? compConf.filterResetMethod : null);
  16994. filters.forEach(function (item) {
  16995. item._checked = false;
  16996. item.checked = false;
  16997. if (!filterResetMethod) {
  16998. item.data = ctor_amd_xe_utils_default.a.clone(item.resetValue, true);
  16999. }
  17000. });
  17001. if (filterResetMethod) {
  17002. filterResetMethod({
  17003. options: filters,
  17004. column: column,
  17005. $table: this
  17006. });
  17007. }
  17008. }
  17009. }
  17010. },
  17011. /**
  17012. * 重置筛选
  17013. * 当筛选面板中的重置按钮被按下时触发
  17014. * @param {Event} evnt 事件
  17015. */
  17016. resetFilterEvent: function resetFilterEvent(evnt) {
  17017. this.handleClearFilter(this.filterStore.column);
  17018. this.confirmFilterEvent(evnt);
  17019. },
  17020. /**
  17021. * 清空指定列的筛选条件
  17022. * 如果为空则清空所有列的筛选条件
  17023. * @param {String} column 列
  17024. */
  17025. _clearFilter: function _clearFilter(column) {
  17026. if (arguments.length && ctor_amd_xe_utils_default.a.isString(column)) {
  17027. column = this.getColumnByField(column);
  17028. }
  17029. var filterStore = this.filterStore;
  17030. if (column) {
  17031. this.handleClearFilter(column);
  17032. } else {
  17033. this.visibleColumn.forEach(this.handleClearFilter);
  17034. }
  17035. if (!column || column !== filterStore.column) {
  17036. Object.assign(filterStore, {
  17037. isAllSelected: false,
  17038. isIndeterminate: false,
  17039. style: null,
  17040. options: [],
  17041. column: null,
  17042. multiple: false,
  17043. visible: false
  17044. });
  17045. }
  17046. return this.updateData();
  17047. }
  17048. }
  17049. });
  17050. // CONCATENATED MODULE: ./packages/filter/index.js
  17051. panel.install = function (Vue) {
  17052. v_x_e_table.reg('filter');
  17053. packages_table.mixins.push(src_mixin);
  17054. Vue.component(panel.name, panel);
  17055. };
  17056. var Filter = panel;
  17057. /* harmony default export */ var filter = (panel);
  17058. // CONCATENATED MODULE: ./packages/loading/index.js
  17059. var VxeLoading = {
  17060. /* eslint-disable @typescript-eslint/no-empty-function */
  17061. install: function install() {}
  17062. };
  17063. var Loading = VxeLoading;
  17064. /* harmony default export */ var packages_loading = (VxeLoading);
  17065. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
  17066. var es_object_get_own_property_descriptor = __webpack_require__("e439");
  17067. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
  17068. var es_object_get_own_property_descriptors = __webpack_require__("dbb4");
  17069. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
  17070. function ownKeys(object, enumerableOnly) {
  17071. var keys = Object.keys(object);
  17072. if (Object.getOwnPropertySymbols) {
  17073. var symbols = Object.getOwnPropertySymbols(object);
  17074. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  17075. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  17076. });
  17077. keys.push.apply(keys, symbols);
  17078. }
  17079. return keys;
  17080. }
  17081. function _objectSpread2(target) {
  17082. for (var i = 1; i < arguments.length; i++) {
  17083. var source = arguments[i] != null ? arguments[i] : {};
  17084. if (i % 2) {
  17085. ownKeys(Object(source), true).forEach(function (key) {
  17086. _defineProperty(target, key, source[key]);
  17087. });
  17088. } else if (Object.getOwnPropertyDescriptors) {
  17089. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  17090. } else {
  17091. ownKeys(Object(source)).forEach(function (key) {
  17092. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  17093. });
  17094. }
  17095. }
  17096. return target;
  17097. }
  17098. // CONCATENATED MODULE: ./packages/grid/src/grid.js
  17099. var grid_methods = {};
  17100. var propKeys = Object.keys(packages_table.props);
  17101. function getOffsetHeight(elem) {
  17102. return elem ? elem.offsetHeight : 0;
  17103. }
  17104. function getPaddingTopBottomSize(elem) {
  17105. var computedStyle = getComputedStyle(elem);
  17106. var paddingTop = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
  17107. var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
  17108. return paddingTop + paddingBottom;
  17109. }
  17110. function renderDefaultForm(h, _vm) {
  17111. var proxyConfig = _vm.proxyConfig,
  17112. proxyOpts = _vm.proxyOpts,
  17113. formData = _vm.formData,
  17114. formConfig = _vm.formConfig,
  17115. formOpts = _vm.formOpts;
  17116. if (formOpts.items && formOpts.items.length) {
  17117. if (!formOpts.inited) {
  17118. formOpts.inited = true;
  17119. if (proxyOpts && proxyOpts.beforeItem) {
  17120. formOpts.items.forEach(function (item) {
  17121. proxyOpts.beforeItem.apply(_vm, [{
  17122. $grid: _vm,
  17123. item: item
  17124. }]);
  17125. });
  17126. }
  17127. }
  17128. return [h('vxe-form', {
  17129. props: Object.assign({}, formOpts, {
  17130. data: proxyConfig && proxyOpts.form ? formData : formConfig.data
  17131. }),
  17132. on: {
  17133. submit: _vm.submitEvent,
  17134. reset: _vm.resetEvent,
  17135. 'submit-invalid': _vm.submitInvalidEvent,
  17136. 'toggle-collapse': _vm.togglCollapseEvent
  17137. },
  17138. ref: 'form'
  17139. })];
  17140. }
  17141. return [];
  17142. }
  17143. function getToolbarSlots(_vm) {
  17144. var $scopedSlots = _vm.$scopedSlots,
  17145. toolbarOpts = _vm.toolbarOpts;
  17146. var toolbarOptSlots = toolbarOpts.slots; // v3.0 中废弃 buttons、tools
  17147. var $buttons = $scopedSlots.buttons;
  17148. var $tools = $scopedSlots.tools;
  17149. if ($buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
  17150. UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
  17151. }
  17152. if ($tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
  17153. UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.tools']);
  17154. }
  17155. var slots = {};
  17156. if (toolbarOptSlots) {
  17157. if (!$buttons) {
  17158. $buttons = toolbarOptSlots.buttons;
  17159. }
  17160. if (!$tools) {
  17161. $tools = toolbarOptSlots.tools;
  17162. }
  17163. if ($buttons && $scopedSlots[$buttons]) {
  17164. $buttons = $scopedSlots[$buttons];
  17165. }
  17166. if ($tools && $scopedSlots[$tools]) {
  17167. $tools = $scopedSlots[$tools];
  17168. }
  17169. }
  17170. if ($buttons) {
  17171. slots.buttons = $buttons;
  17172. }
  17173. if ($tools) {
  17174. slots.tools = $tools;
  17175. }
  17176. return slots;
  17177. }
  17178. function getPagerSlots(_vm) {
  17179. var $scopedSlots = _vm.$scopedSlots,
  17180. pagerOpts = _vm.pagerOpts;
  17181. var pagerOptSlots = pagerOpts.slots;
  17182. var slots = {};
  17183. var $left;
  17184. var $right;
  17185. if (pagerOptSlots) {
  17186. $left = pagerOptSlots.left;
  17187. $right = pagerOptSlots.right;
  17188. if ($left && $scopedSlots[$left]) {
  17189. $left = $scopedSlots[$left];
  17190. }
  17191. if ($right && $scopedSlots[$right]) {
  17192. $right = $scopedSlots[$right];
  17193. }
  17194. }
  17195. if ($left) {
  17196. slots.left = $left;
  17197. }
  17198. if ($right) {
  17199. slots.right = $right;
  17200. }
  17201. return slots;
  17202. }
  17203. function getTableOns(_vm) {
  17204. var $listeners = _vm.$listeners,
  17205. proxyConfig = _vm.proxyConfig,
  17206. proxyOpts = _vm.proxyOpts;
  17207. var ons = {};
  17208. ctor_amd_xe_utils_default.a.each($listeners, function (cb, type) {
  17209. ons[type] = function () {
  17210. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  17211. args[_key] = arguments[_key];
  17212. }
  17213. _vm.$emit.apply(_vm, [type].concat(args));
  17214. };
  17215. });
  17216. if (proxyConfig) {
  17217. if (proxyOpts.sort) {
  17218. ons['sort-change'] = _vm.sortChangeEvent;
  17219. }
  17220. if (proxyOpts.filter) {
  17221. ons['filter-change'] = _vm.filterChangeEvent;
  17222. }
  17223. }
  17224. return ons;
  17225. }
  17226. Object.keys(packages_table.methods).forEach(function (name) {
  17227. grid_methods[name] = function () {
  17228. var _this$$refs$xTable;
  17229. return this.$refs.xTable && (_this$$refs$xTable = this.$refs.xTable)[name].apply(_this$$refs$xTable, arguments);
  17230. };
  17231. });
  17232. /* harmony default export */ var grid = ({
  17233. name: 'VxeGrid',
  17234. props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
  17235. columns: Array,
  17236. pagerConfig: [Boolean, Object],
  17237. proxyConfig: Object,
  17238. toolbar: [Boolean, Object],
  17239. toolbarConfig: [Boolean, Object],
  17240. formConfig: [Boolean, Object],
  17241. size: {
  17242. type: String,
  17243. default: function _default() {
  17244. return conf.grid.size || conf.size;
  17245. }
  17246. }
  17247. }),
  17248. provide: function provide() {
  17249. return {
  17250. $xegrid: this
  17251. };
  17252. },
  17253. data: function data() {
  17254. return {
  17255. isCloak: false,
  17256. tableLoading: false,
  17257. isZMax: false,
  17258. tableData: [],
  17259. pendingRecords: [],
  17260. filterData: [],
  17261. formData: {},
  17262. sortData: {},
  17263. tZindex: 0,
  17264. tablePage: {
  17265. total: 0,
  17266. pageSize: 10,
  17267. currentPage: 1
  17268. }
  17269. };
  17270. },
  17271. computed: {
  17272. vSize: function vSize() {
  17273. return this.size || this.$parent.size || this.$parent.vSize;
  17274. },
  17275. isMsg: function isMsg() {
  17276. return this.proxyOpts.message !== false;
  17277. },
  17278. proxyOpts: function proxyOpts() {
  17279. return Object.assign({}, conf.grid.proxyConfig, this.proxyConfig);
  17280. },
  17281. pagerOpts: function pagerOpts() {
  17282. return Object.assign({}, conf.grid.pagerConfig, this.pagerConfig);
  17283. },
  17284. formOpts: function formOpts() {
  17285. return Object.assign({}, conf.grid.formConfig, this.formConfig);
  17286. },
  17287. toolbarOpts: function toolbarOpts() {
  17288. return Object.assign({}, conf.grid.toolbarConfig, this.toolbarConfig || this.toolbar);
  17289. },
  17290. zoomOpts: function zoomOpts() {
  17291. return Object.assign({}, conf.grid.zoomConfig, this.zoomConfig);
  17292. },
  17293. renderStyle: function renderStyle() {
  17294. return this.isZMax ? {
  17295. zIndex: this.tZindex
  17296. } : null;
  17297. },
  17298. tableExtendProps: function tableExtendProps() {
  17299. var _this = this;
  17300. var rest = {};
  17301. propKeys.forEach(function (key) {
  17302. rest[key] = _this[key];
  17303. });
  17304. return rest;
  17305. },
  17306. tableProps: function tableProps() {
  17307. var isZMax = this.isZMax,
  17308. seqConfig = this.seqConfig,
  17309. pagerConfig = this.pagerConfig,
  17310. loading = this.loading,
  17311. isCloak = this.isCloak,
  17312. editConfig = this.editConfig,
  17313. proxyConfig = this.proxyConfig,
  17314. proxyOpts = this.proxyOpts,
  17315. tableExtendProps = this.tableExtendProps,
  17316. tableLoading = this.tableLoading,
  17317. tablePage = this.tablePage,
  17318. tableData = this.tableData;
  17319. var props = Object.assign({}, tableExtendProps);
  17320. if (isZMax) {
  17321. if (tableExtendProps.maxHeight) {
  17322. props.maxHeight = 'auto';
  17323. } else {
  17324. props.height = 'auto';
  17325. }
  17326. }
  17327. if (proxyConfig) {
  17328. Object.assign(props, {
  17329. loading: isCloak || loading || tableLoading,
  17330. data: tableData,
  17331. rowClassName: this.handleRowClassName
  17332. });
  17333. if ((proxyOpts.seq || proxyOpts.index) && UtilTools.isEnableConf(pagerConfig)) {
  17334. props.seqConfig = Object.assign({}, seqConfig, {
  17335. startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
  17336. });
  17337. }
  17338. }
  17339. if (editConfig) {
  17340. props.editConfig = Object.assign({}, editConfig, {
  17341. activeMethod: this.handleActiveMethod
  17342. });
  17343. }
  17344. return props;
  17345. },
  17346. pagerProps: function pagerProps() {
  17347. return Object.assign({}, this.pagerOpts, this.proxyConfig ? this.tablePage : {});
  17348. }
  17349. },
  17350. watch: {
  17351. columns: function columns(value) {
  17352. var _this2 = this;
  17353. this.$nextTick(function () {
  17354. return _this2.loadColumn(value);
  17355. });
  17356. },
  17357. toolbar: function toolbar(value) {
  17358. if (value) {
  17359. this.initToolbar();
  17360. }
  17361. },
  17362. toolbarConfig: function toolbarConfig(value) {
  17363. if (value) {
  17364. this.initToolbar();
  17365. }
  17366. },
  17367. proxyConfig: function proxyConfig() {
  17368. this.initProxy();
  17369. },
  17370. pagerConfig: function pagerConfig() {
  17371. this.initPages();
  17372. }
  17373. },
  17374. created: function created() {
  17375. var _this3 = this;
  17376. var customs = this.customs,
  17377. data = this.data,
  17378. formOpts = this.formOpts,
  17379. proxyConfig = this.proxyConfig,
  17380. proxyOpts = this.proxyOpts;
  17381. var props = proxyOpts.props;
  17382. if (customs) {
  17383. UtilTools.warn('vxe.error.removeProp', ['customs']);
  17384. }
  17385. if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
  17386. console.warn('[vxe-grid] There is a conflict between the props proxy-config and data.');
  17387. } // v3.0 中废弃 proxy-config.index
  17388. if (proxyOpts.index) {
  17389. UtilTools.warn('vxe.error.delProp', ['proxy-config.index', 'proxy-config.seq']);
  17390. } // (v3.0 中废弃 proxyConfig.props.data)
  17391. if (props && props.data) {
  17392. UtilTools.warn('vxe.error.delProp', ['proxy-config.props.data', 'proxy-config.props.result']);
  17393. }
  17394. if (this.cloak) {
  17395. this.isCloak = true;
  17396. setTimeout(function () {
  17397. _this3.isCloak = false;
  17398. }, DomTools.browse ? 500 : 300);
  17399. } // 检查错误使用
  17400. this.$nextTick(function () {
  17401. var xTable = _this3.$refs.xTable;
  17402. if (xTable && xTable.isSC) {
  17403. UtilTools.warn('vxe.error.errProp', ['<vxe-table-column ...>', 'columns']);
  17404. }
  17405. });
  17406. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  17407. },
  17408. mounted: function mounted() {
  17409. if (this.columns && this.columns.length) {
  17410. this.loadColumn(this.columns);
  17411. }
  17412. this.initToolbar();
  17413. this.initPages();
  17414. this.initProxy();
  17415. },
  17416. destroyed: function destroyed() {
  17417. GlobalEvent.off(this, 'keydown');
  17418. },
  17419. render: function render(h) {
  17420. var _ref;
  17421. var $scopedSlots = this.$scopedSlots,
  17422. vSize = this.vSize,
  17423. isZMax = this.isZMax;
  17424. var hasForm = !!($scopedSlots.form || UtilTools.isEnableConf(this.formConfig));
  17425. var hasToolbar = !!($scopedSlots.toolbar || UtilTools.isEnableConf(this.toolbarConfig) || this.toolbar);
  17426. var hasTop = !!$scopedSlots.top;
  17427. var hasBottom = !!$scopedSlots.bottom;
  17428. var hasPager = !!($scopedSlots.pager || UtilTools.isEnableConf(this.pagerConfig));
  17429. return h('div', {
  17430. class: ['vxe-grid', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 't--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--maximize', isZMax), _defineProperty(_ref, 'is--loading', this.isCloak || this.loading || this.tableLoading), _ref)],
  17431. style: this.renderStyle
  17432. }, [
  17433. /**
  17434. * 渲染表单
  17435. */
  17436. hasForm ? h('div', {
  17437. ref: 'formWrapper',
  17438. class: 'vxe-grid--form-wrapper'
  17439. }, $scopedSlots.form ? $scopedSlots.form.call(this, {
  17440. $grid: this
  17441. }, h) : renderDefaultForm(h, this)) : null,
  17442. /**
  17443. * 渲染工具栏
  17444. */
  17445. hasToolbar ? h('div', {
  17446. ref: 'toolbarWrapper',
  17447. class: 'vxe-grid--toolbar-wrapper'
  17448. }, $scopedSlots.toolbar ? $scopedSlots.toolbar.call(this, {
  17449. $grid: this
  17450. }, h) : [h('vxe-toolbar', {
  17451. props: this.toolbarOpts,
  17452. ref: 'xToolbar',
  17453. scopedSlots: getToolbarSlots(this)
  17454. })]) : null,
  17455. /**
  17456. * 渲染表格顶部区域
  17457. */
  17458. hasTop ? h('div', {
  17459. ref: 'topWrapper',
  17460. class: 'vxe-grid--top-wrapper'
  17461. }, $scopedSlots.top.call(this, {
  17462. $grid: this
  17463. }, h)) : null,
  17464. /**
  17465. * 渲染表格
  17466. */
  17467. h('vxe-table', {
  17468. props: this.tableProps,
  17469. on: getTableOns(this),
  17470. scopedSlots: $scopedSlots,
  17471. ref: 'xTable'
  17472. }, this.$slots.default),
  17473. /**
  17474. * 渲染表格底部区域
  17475. */
  17476. hasBottom ? h('div', {
  17477. ref: 'bottomWrapper',
  17478. class: 'vxe-grid--bottom-wrapper'
  17479. }, $scopedSlots.bottom.call(this, {
  17480. $grid: this
  17481. }, h)) : null,
  17482. /**
  17483. * 渲染分页
  17484. */
  17485. hasPager ? h('div', {
  17486. ref: 'pagerWrapper',
  17487. class: 'vxe-grid--pager-wrapper'
  17488. }, $scopedSlots.pager ? $scopedSlots.pager.call(this, {
  17489. $grid: this
  17490. }, h) : [h('vxe-pager', {
  17491. props: this.pagerProps,
  17492. on: {
  17493. 'page-change': this.pageChangeEvent
  17494. },
  17495. scopedSlots: getPagerSlots(this)
  17496. })]) : null]);
  17497. },
  17498. methods: _objectSpread2(_objectSpread2({}, grid_methods), {}, {
  17499. getParentHeight: function getParentHeight() {
  17500. return (this.isZMax ? DomTools.getDomNode().visibleHeight : this.$el.parentNode.clientHeight) - this.getExcludeHeight();
  17501. },
  17502. /**
  17503. * 获取需要排除的高度
  17504. */
  17505. getExcludeHeight: function getExcludeHeight() {
  17506. var $refs = this.$refs,
  17507. $el = this.$el,
  17508. isZMax = this.isZMax,
  17509. height = this.height;
  17510. var formWrapper = $refs.formWrapper,
  17511. toolbarWrapper = $refs.toolbarWrapper,
  17512. topWrapper = $refs.topWrapper,
  17513. bottomWrapper = $refs.bottomWrapper,
  17514. pagerWrapper = $refs.pagerWrapper;
  17515. var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
  17516. return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
  17517. },
  17518. handleRowClassName: function handleRowClassName(params) {
  17519. var rowClassName = this.rowClassName;
  17520. var clss = [];
  17521. if (this.pendingRecords.some(function (item) {
  17522. return item === params.row;
  17523. })) {
  17524. clss.push('row--pending');
  17525. }
  17526. clss.push(rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
  17527. return clss;
  17528. },
  17529. handleActiveMethod: function handleActiveMethod(params) {
  17530. var activeMethod = this.editConfig.activeMethod;
  17531. return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
  17532. },
  17533. loadColumn: function loadColumn(columns) {
  17534. var $scopedSlots = this.$scopedSlots;
  17535. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  17536. if (column.slots) {
  17537. ctor_amd_xe_utils_default.a.each(column.slots, function (func, name, colSlots) {
  17538. if (!ctor_amd_xe_utils_default.a.isFunction(func)) {
  17539. if ($scopedSlots[func]) {
  17540. colSlots[name] = $scopedSlots[func];
  17541. } else {
  17542. colSlots[name] = null;
  17543. UtilTools.error('vxe.error.notSlot', [func]);
  17544. }
  17545. }
  17546. });
  17547. }
  17548. });
  17549. return this.$refs.xTable.loadColumn(columns);
  17550. },
  17551. reloadColumn: function reloadColumn(columns) {
  17552. this.clearAll();
  17553. return this.loadColumn(columns);
  17554. },
  17555. initToolbar: function initToolbar() {
  17556. var _this4 = this;
  17557. this.$nextTick(function () {
  17558. var _this4$$refs = _this4.$refs,
  17559. xTable = _this4$$refs.xTable,
  17560. xToolbar = _this4$$refs.xToolbar;
  17561. if (xTable && xToolbar) {
  17562. xTable.connect(xToolbar);
  17563. }
  17564. });
  17565. },
  17566. initPages: function initPages() {
  17567. var tablePage = this.tablePage,
  17568. pagerConfig = this.pagerConfig,
  17569. pagerOpts = this.pagerOpts;
  17570. var currentPage = pagerOpts.currentPage,
  17571. pageSize = pagerOpts.pageSize;
  17572. if (pagerConfig) {
  17573. if (currentPage) {
  17574. tablePage.currentPage = currentPage;
  17575. }
  17576. if (pageSize) {
  17577. tablePage.pageSize = pageSize;
  17578. }
  17579. }
  17580. },
  17581. initProxy: function initProxy() {
  17582. var _this5 = this;
  17583. var proxyInited = this.proxyInited,
  17584. proxyConfig = this.proxyConfig,
  17585. proxyOpts = this.proxyOpts,
  17586. formConfig = this.formConfig,
  17587. formOpts = this.formOpts;
  17588. if (proxyConfig) {
  17589. if (UtilTools.isEnableConf(formConfig) && proxyOpts.form && formOpts.items) {
  17590. var formData = {};
  17591. formOpts.items.forEach(function (_ref2) {
  17592. var field = _ref2.field,
  17593. itemRender = _ref2.itemRender;
  17594. if (field) {
  17595. formData[field] = itemRender && !ctor_amd_xe_utils_default.a.isUndefined(itemRender.defaultValue) ? itemRender.defaultValue : undefined;
  17596. }
  17597. });
  17598. this.formData = formData;
  17599. }
  17600. if (!proxyInited && proxyOpts.autoLoad !== false) {
  17601. this.proxyInited = true;
  17602. this.$nextTick(function () {
  17603. return _this5.initLoad();
  17604. });
  17605. }
  17606. }
  17607. },
  17608. initLoad: function initLoad() {
  17609. var $refs = this.$refs;
  17610. var $xetable = $refs.xTable;
  17611. var defaultSort = $xetable.sortOpts.defaultSort;
  17612. var sortParams = {}; // 如果使用默认排序
  17613. if (defaultSort) {
  17614. sortParams = {
  17615. property: defaultSort.field,
  17616. order: defaultSort.order
  17617. };
  17618. }
  17619. this.sortData = sortParams;
  17620. this.filterData = [];
  17621. this.pendingRecords = [];
  17622. this.commitProxy('query');
  17623. },
  17624. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  17625. var isEsc = evnt.keyCode === 27;
  17626. if (isEsc && this.isZMax && this.zoomOpts.escRestore !== false) {
  17627. this.triggerZoomEvent(evnt);
  17628. }
  17629. },
  17630. /**
  17631. * 提交指令,支持 code 或 button
  17632. * @param {String/Object} code 字符串或对象
  17633. */
  17634. commitProxy: function commitProxy(code) {
  17635. var _this6 = this;
  17636. var $refs = this.$refs,
  17637. toolbar = this.toolbar,
  17638. toolbarConfig = this.toolbarConfig,
  17639. toolbarOpts = this.toolbarOpts,
  17640. proxyOpts = this.proxyOpts,
  17641. tablePage = this.tablePage,
  17642. pagerConfig = this.pagerConfig,
  17643. sortData = this.sortData,
  17644. filterData = this.filterData,
  17645. formData = this.formData,
  17646. isMsg = this.isMsg;
  17647. var beforeQuery = proxyOpts.beforeQuery,
  17648. afterQuery = proxyOpts.afterQuery,
  17649. beforeDelete = proxyOpts.beforeDelete,
  17650. afterDelete = proxyOpts.afterDelete,
  17651. beforeSave = proxyOpts.beforeSave,
  17652. afterSave = proxyOpts.afterSave,
  17653. _proxyOpts$ajax = proxyOpts.ajax,
  17654. ajax = _proxyOpts$ajax === void 0 ? {} : _proxyOpts$ajax,
  17655. _proxyOpts$props = proxyOpts.props,
  17656. props = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
  17657. var $xetable = $refs.xTable;
  17658. var button;
  17659. if (ctor_amd_xe_utils_default.a.isString(code)) {
  17660. var matchObj = toolbarConfig || toolbar ? ctor_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
  17661. return item.code === code;
  17662. }, {
  17663. children: 'dropdowns'
  17664. }) : null;
  17665. button = matchObj ? matchObj.item : null;
  17666. } else {
  17667. button = code;
  17668. code = button.code;
  17669. }
  17670. var btnParams = button ? button.params : null;
  17671. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  17672. args[_key2 - 1] = arguments[_key2];
  17673. }
  17674. switch (code) {
  17675. case 'insert':
  17676. this.insert();
  17677. break;
  17678. case 'insert_actived':
  17679. this.insert().then(function (_ref3) {
  17680. var row = _ref3.row;
  17681. return _this6.setActiveRow(row);
  17682. });
  17683. break;
  17684. case 'mark_cancel':
  17685. this.triggerPendingEvent(code);
  17686. break;
  17687. // 在 v3 中废弃 remove_selection
  17688. case 'remove_selection':
  17689. case 'remove':
  17690. this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
  17691. return _this6.removeCheckboxRow();
  17692. });
  17693. break;
  17694. case 'import':
  17695. this.importData(btnParams);
  17696. break;
  17697. case 'open_import':
  17698. this.openImport(btnParams);
  17699. break;
  17700. case 'export':
  17701. this.exportData(btnParams);
  17702. break;
  17703. case 'open_export':
  17704. this.openExport(btnParams);
  17705. break;
  17706. case 'reset_custom':
  17707. this.resetColumn(true);
  17708. break;
  17709. case 'init':
  17710. case 'reload':
  17711. case 'query':
  17712. {
  17713. var isInited = code === 'init';
  17714. var isReload = code === 'reload';
  17715. var ajaxMethods = ajax.query;
  17716. if (ajaxMethods) {
  17717. var params = {
  17718. code: code,
  17719. button: button,
  17720. $grid: this,
  17721. sort: sortData,
  17722. sorts: proxyOpts.sort && sortData && (sortData.property || sortData.order) ? [sortData] : [],
  17723. filters: filterData,
  17724. form: formData,
  17725. options: ajaxMethods
  17726. };
  17727. if (pagerConfig) {
  17728. if (isReload) {
  17729. tablePage.currentPage = 1;
  17730. }
  17731. if (UtilTools.isEnableConf(pagerConfig)) {
  17732. params.page = tablePage;
  17733. }
  17734. }
  17735. if (isInited || isReload) {
  17736. var defaultSort = $xetable.sortOpts.defaultSort;
  17737. var sortParams = {};
  17738. if (isReload) {
  17739. tablePage.currentPage = 1;
  17740. } // 如果使用默认排序
  17741. if (defaultSort) {
  17742. sortParams = {
  17743. property: defaultSort.field,
  17744. order: defaultSort.order
  17745. };
  17746. }
  17747. this.sortData = params.sort = sortParams;
  17748. this.filterData = params.filters = [];
  17749. this.pendingRecords = [];
  17750. if (proxyOpts.sort) {
  17751. params.sorts = sortParams && (sortParams.property || sortParams.order) ? [sortParams] : [];
  17752. }
  17753. this.clearAll();
  17754. }
  17755. var applyArgs = [params].concat(args);
  17756. this.tableLoading = true;
  17757. return Promise.resolve((beforeQuery || ajaxMethods).apply(this, applyArgs)).catch(function (e) {
  17758. return e;
  17759. }).then(function (rest) {
  17760. _this6.tableLoading = false;
  17761. if (rest) {
  17762. if (UtilTools.isEnableConf(pagerConfig)) {
  17763. var total = ctor_amd_xe_utils_default.a.get(rest, props.total || 'page.total') || 0;
  17764. tablePage.total = total;
  17765. _this6.tableData = ctor_amd_xe_utils_default.a.get(rest, props.result || props.data || 'result') || []; // 检验当前页码,不能超出当前最大页数
  17766. var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
  17767. if (tablePage.currentPage > pageCount) {
  17768. tablePage.currentPage = pageCount;
  17769. }
  17770. } else {
  17771. _this6.tableData = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  17772. }
  17773. } else {
  17774. _this6.tableData = [];
  17775. }
  17776. if (afterQuery) {
  17777. afterQuery.apply(void 0, _toConsumableArray(applyArgs));
  17778. }
  17779. });
  17780. } else {
  17781. UtilTools.error('vxe.error.notFunc', ['query']);
  17782. }
  17783. break;
  17784. }
  17785. // 在 v3 中废弃 delete_selection
  17786. case 'delete_selection':
  17787. case 'delete':
  17788. {
  17789. var _ajaxMethods = ajax.delete;
  17790. if (_ajaxMethods) {
  17791. var selectRecords = $xetable.getCheckboxRecords();
  17792. var removeRecords = selectRecords.filter(function (row) {
  17793. return !$xetable.isInsertByRow(row);
  17794. });
  17795. var body = {
  17796. removeRecords: removeRecords
  17797. };
  17798. var _applyArgs = [{
  17799. $grid: this,
  17800. code: code,
  17801. button: button,
  17802. body: body,
  17803. options: _ajaxMethods
  17804. }].concat(args);
  17805. if (selectRecords.length) {
  17806. return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
  17807. if (!removeRecords.length) {
  17808. return $xetable.remove(selectRecords);
  17809. }
  17810. _this6.tableLoading = true;
  17811. return Promise.resolve((beforeDelete || _ajaxMethods).apply(_this6, _applyArgs)).then(function (rest) {
  17812. _this6.tableLoading = false;
  17813. _this6.pendingRecords = _this6.pendingRecords.filter(function (row) {
  17814. return removeRecords.indexOf(row) === -1;
  17815. });
  17816. if (isMsg) {
  17817. v_x_e_table.modal.message({
  17818. message: _this6.getRespMsg(rest, 'vxe.grid.delSuccess'),
  17819. status: 'success'
  17820. });
  17821. }
  17822. if (afterDelete) {
  17823. afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
  17824. } else {
  17825. _this6.commitProxy('query');
  17826. }
  17827. }).catch(function (rest) {
  17828. _this6.tableLoading = false;
  17829. if (isMsg) {
  17830. v_x_e_table.modal.message({
  17831. id: code,
  17832. message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
  17833. status: 'error'
  17834. });
  17835. }
  17836. });
  17837. });
  17838. } else {
  17839. if (isMsg) {
  17840. v_x_e_table.modal.message({
  17841. id: code,
  17842. message: conf.i18n('vxe.grid.selectOneRecord'),
  17843. status: 'warning'
  17844. });
  17845. }
  17846. }
  17847. } else {
  17848. UtilTools.error('vxe.error.notFunc', [code]);
  17849. }
  17850. break;
  17851. }
  17852. case 'save':
  17853. {
  17854. var _ajaxMethods2 = ajax.save;
  17855. if (_ajaxMethods2) {
  17856. var _body = Object.assign({
  17857. pendingRecords: this.pendingRecords
  17858. }, this.getRecordset());
  17859. var insertRecords = _body.insertRecords,
  17860. _removeRecords = _body.removeRecords,
  17861. updateRecords = _body.updateRecords,
  17862. pendingRecords = _body.pendingRecords;
  17863. var _applyArgs2 = [{
  17864. $grid: this,
  17865. code: code,
  17866. button: button,
  17867. body: _body,
  17868. options: _ajaxMethods2
  17869. }].concat(args); // 排除掉新增且标记为删除的数据
  17870. if (insertRecords.length) {
  17871. _body.pendingRecords = pendingRecords.filter(function (row) {
  17872. return insertRecords.indexOf(row) === -1;
  17873. });
  17874. } // 排除已标记为删除的数据
  17875. if (pendingRecords.length) {
  17876. _body.insertRecords = insertRecords.filter(function (row) {
  17877. return pendingRecords.indexOf(row) === -1;
  17878. });
  17879. } // 只校验新增和修改的数据
  17880. return this.validate(_body.insertRecords.concat(updateRecords)).then(function () {
  17881. if (_body.insertRecords.length || _removeRecords.length || updateRecords.length || _body.pendingRecords.length) {
  17882. _this6.tableLoading = true;
  17883. return Promise.resolve((beforeSave || _ajaxMethods2).apply(_this6, _applyArgs2)).then(function (rest) {
  17884. _this6.tableLoading = false;
  17885. _this6.pendingRecords = [];
  17886. if (isMsg) {
  17887. v_x_e_table.modal.message({
  17888. message: _this6.getRespMsg(rest, 'vxe.grid.saveSuccess'),
  17889. status: 'success'
  17890. });
  17891. }
  17892. if (afterSave) {
  17893. afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
  17894. } else {
  17895. _this6.commitProxy('query');
  17896. }
  17897. }).catch(function (rest) {
  17898. _this6.tableLoading = false;
  17899. if (isMsg) {
  17900. v_x_e_table.modal.message({
  17901. id: code,
  17902. message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
  17903. status: 'error'
  17904. });
  17905. }
  17906. });
  17907. } else {
  17908. if (isMsg) {
  17909. v_x_e_table.modal.message({
  17910. id: code,
  17911. message: conf.i18n('vxe.grid.dataUnchanged'),
  17912. status: 'info'
  17913. });
  17914. }
  17915. }
  17916. }).catch(function (errMap) {
  17917. return errMap;
  17918. });
  17919. } else {
  17920. UtilTools.error('vxe.error.notFunc', [code]);
  17921. }
  17922. break;
  17923. }
  17924. default:
  17925. {
  17926. var btnMethod = v_x_e_table.commands.get(code);
  17927. if (btnMethod) {
  17928. btnMethod.apply(this, [{
  17929. code: code,
  17930. button: button,
  17931. $grid: this,
  17932. $table: $xetable
  17933. }].concat(args));
  17934. }
  17935. }
  17936. }
  17937. return this.$nextTick();
  17938. },
  17939. getRespMsg: function getRespMsg(rest, defaultMsg) {
  17940. var _this$proxyOpts$props = this.proxyOpts.props,
  17941. props = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
  17942. var msg;
  17943. if (rest && props.message) {
  17944. msg = ctor_amd_xe_utils_default.a.get(rest, props.message);
  17945. }
  17946. return msg || conf.i18n(defaultMsg);
  17947. },
  17948. handleDeleteRow: function handleDeleteRow(code, alertKey, callback) {
  17949. var selectRecords = this.getCheckboxRecords();
  17950. if (this.isMsg) {
  17951. if (selectRecords.length) {
  17952. return v_x_e_table.modal.confirm({
  17953. id: "cfm_".concat(code),
  17954. message: conf.i18n(alertKey),
  17955. escClosable: true
  17956. }).then(function (type) {
  17957. if (type === 'confirm') {
  17958. callback();
  17959. }
  17960. });
  17961. } else {
  17962. v_x_e_table.modal.message({
  17963. id: "msg_".concat(code),
  17964. message: conf.i18n('vxe.grid.selectOneRecord'),
  17965. status: 'warning'
  17966. });
  17967. }
  17968. } else {
  17969. if (selectRecords.length) {
  17970. callback();
  17971. }
  17972. }
  17973. },
  17974. getFormItems: function getFormItems(index) {
  17975. var formConfig = this.formConfig;
  17976. var items = UtilTools.isEnableConf(formConfig) && formConfig.items ? formConfig.items : [];
  17977. return arguments.length ? items[index] : items;
  17978. },
  17979. getPendingRecords: function getPendingRecords() {
  17980. return this.pendingRecords;
  17981. },
  17982. triggerToolbarBtnEvent: function triggerToolbarBtnEvent(button, evnt) {
  17983. this.commitProxy(button, evnt);
  17984. this.$emit('toolbar-button-click', {
  17985. code: button.code,
  17986. button: button,
  17987. $grid: this,
  17988. $event: evnt
  17989. }, evnt);
  17990. },
  17991. triggerPendingEvent: function triggerPendingEvent(code) {
  17992. var pendingRecords = this.pendingRecords,
  17993. isMsg = this.isMsg;
  17994. var selectRecords = this.getCheckboxRecords();
  17995. if (selectRecords.length) {
  17996. var plus = [];
  17997. var minus = [];
  17998. selectRecords.forEach(function (data) {
  17999. if (pendingRecords.some(function (item) {
  18000. return data === item;
  18001. })) {
  18002. minus.push(data);
  18003. } else {
  18004. plus.push(data);
  18005. }
  18006. });
  18007. if (minus.length) {
  18008. this.pendingRecords = pendingRecords.filter(function (item) {
  18009. return minus.indexOf(item) === -1;
  18010. }).concat(plus);
  18011. } else if (plus.length) {
  18012. this.pendingRecords = pendingRecords.concat(plus);
  18013. }
  18014. this.clearCheckboxRow();
  18015. } else {
  18016. if (isMsg) {
  18017. v_x_e_table.modal.message({
  18018. id: code,
  18019. message: conf.i18n('vxe.grid.selectOneRecord'),
  18020. status: 'warning'
  18021. });
  18022. }
  18023. }
  18024. },
  18025. pageChangeEvent: function pageChangeEvent(params) {
  18026. var proxyConfig = this.proxyConfig,
  18027. tablePage = this.tablePage;
  18028. var currentPage = params.currentPage,
  18029. pageSize = params.pageSize;
  18030. tablePage.currentPage = currentPage;
  18031. tablePage.pageSize = pageSize;
  18032. if (params.type === 'current-change') {
  18033. if (this.$listeners['current-page-change']) {
  18034. UtilTools.warn('vxe.error.delEvent', ['current-page-change', 'page-change']);
  18035. this.$emit('current-page-change', currentPage);
  18036. }
  18037. } else {
  18038. if (this.$listeners['page-size-change']) {
  18039. UtilTools.warn('vxe.error.delEvent', ['page-size-change', 'page-change']);
  18040. this.$emit('page-size-change', pageSize);
  18041. }
  18042. }
  18043. this.$emit('page-change', Object.assign({
  18044. $grid: this
  18045. }, params));
  18046. if (proxyConfig) {
  18047. this.commitProxy('query');
  18048. }
  18049. },
  18050. sortChangeEvent: function sortChangeEvent(params) {
  18051. var remoteSort = this.remoteSort;
  18052. var $table = params.$table,
  18053. column = params.column;
  18054. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote || remoteSort;
  18055. var property = params.order ? params.property : null; // 如果是服务端排序
  18056. if (isRemote) {
  18057. this.sortData = property ? {
  18058. property: property,
  18059. field: property,
  18060. // v3 废弃 prop
  18061. prop: property,
  18062. order: params.order,
  18063. sortBy: params.sortBy
  18064. } : {};
  18065. if (this.proxyConfig) {
  18066. this.tablePage.currentPage = 1;
  18067. this.commitProxy('query');
  18068. }
  18069. }
  18070. this.$emit('sort-change', Object.assign({
  18071. $grid: this
  18072. }, params));
  18073. },
  18074. filterChangeEvent: function filterChangeEvent(params) {
  18075. var $table = params.$table,
  18076. filterList = params.filterList; // 如果是服务端过滤
  18077. if ($table.filterOpts.remote || this.remoteFilter) {
  18078. this.filterData = filterList;
  18079. if (this.proxyConfig) {
  18080. this.tablePage.currentPage = 1;
  18081. this.commitProxy('query');
  18082. }
  18083. }
  18084. this.$emit('filter-change', Object.assign({
  18085. $grid: this
  18086. }, params));
  18087. },
  18088. submitEvent: function submitEvent(params, evnt) {
  18089. var proxyConfig = this.proxyConfig;
  18090. if (proxyConfig) {
  18091. this.commitProxy('reload');
  18092. }
  18093. this.$emit('form-submit', Object.assign({
  18094. $grid: this
  18095. }, params), evnt);
  18096. },
  18097. resetEvent: function resetEvent(params, evnt) {
  18098. var proxyConfig = this.proxyConfig;
  18099. if (proxyConfig) {
  18100. this.commitProxy('reload');
  18101. }
  18102. this.$emit('form-reset', Object.assign({
  18103. $grid: this
  18104. }, params), evnt);
  18105. },
  18106. submitInvalidEvent: function submitInvalidEvent(params, evnt) {
  18107. this.$emit('form-submit-invalid', Object.assign({
  18108. $grid: this
  18109. }, params), evnt);
  18110. },
  18111. togglCollapseEvent: function togglCollapseEvent(params, evnt) {
  18112. var _this7 = this;
  18113. this.$nextTick(function () {
  18114. return _this7.recalculate(true);
  18115. });
  18116. this.$emit('form-toggle-collapse', Object.assign({
  18117. $grid: this
  18118. }, params), evnt);
  18119. },
  18120. triggerZoomEvent: function triggerZoomEvent(evnt) {
  18121. this.zoom();
  18122. this.$emit('zoom', {
  18123. $grid: this,
  18124. maximize: this.isZMax,
  18125. type: this.isZMax ? 'max' : 'revert',
  18126. $event: evnt
  18127. });
  18128. },
  18129. zoom: function zoom() {
  18130. return this[this.isZMax ? 'revert' : 'maximize']();
  18131. },
  18132. isMaximized: function isMaximized() {
  18133. return this.isZMax;
  18134. },
  18135. maximize: function maximize() {
  18136. return this.handleZoom(true);
  18137. },
  18138. revert: function revert() {
  18139. return this.handleZoom();
  18140. },
  18141. handleZoom: function handleZoom(isMax) {
  18142. var _this8 = this;
  18143. var isZMax = this.isZMax;
  18144. if (isMax ? !isZMax : isZMax) {
  18145. this.isZMax = !isZMax;
  18146. if (this.tZindex < UtilTools.getLastZIndex()) {
  18147. this.tZindex = UtilTools.nextZIndex();
  18148. }
  18149. }
  18150. return this.$nextTick().then(function () {
  18151. return _this8.recalculate(true);
  18152. }).then(function () {
  18153. return _this8.isZMax;
  18154. });
  18155. },
  18156. getProxyInfo: function getProxyInfo() {
  18157. return this.proxyConfig ? {
  18158. data: this.tableData,
  18159. filter: this.filterData,
  18160. form: this.formData,
  18161. sort: this.sortData,
  18162. sorts: this.proxyOpts.sort ? [this.sortData] : [],
  18163. pager: this.tablePage,
  18164. pendingRecords: this.pendingRecords
  18165. } : null;
  18166. }
  18167. })
  18168. });
  18169. // CONCATENATED MODULE: ./packages/grid/index.js
  18170. grid.install = function (Vue) {
  18171. v_x_e_table.Grid = grid;
  18172. v_x_e_table.GridComponent = grid;
  18173. Vue.component(grid.name, grid);
  18174. };
  18175. var Grid = grid;
  18176. /* harmony default export */ var packages_grid = (grid);
  18177. // CONCATENATED MODULE: ./packages/menu/src/panel.js
  18178. /* harmony default export */ var src_panel = ({
  18179. name: 'VxeTableContextMenu',
  18180. props: {
  18181. ctxMenuStore: Object,
  18182. ctxMenuOpts: Object
  18183. },
  18184. render: function render(h) {
  18185. var $xetable = this.$parent;
  18186. var _e = this._e,
  18187. ctxMenuOpts = this.ctxMenuOpts,
  18188. ctxMenuStore = this.ctxMenuStore;
  18189. return h('div', {
  18190. class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
  18191. 'is--show': ctxMenuStore.visible
  18192. }],
  18193. style: ctxMenuStore.style
  18194. }, ctxMenuStore.list.map(function (options, gIndex) {
  18195. return options.every(function (item) {
  18196. return item.visible === false;
  18197. }) ? _e() : h('ul', {
  18198. class: 'vxe-context-menu--option-wrapper',
  18199. key: gIndex
  18200. }, options.map(function (item, index) {
  18201. var hasChildMenus = item.children && item.children.some(function (child) {
  18202. return child.visible !== false;
  18203. });
  18204. return item.visible === false ? _e() : h('li', {
  18205. class: [item.className, {
  18206. 'link--disabled': item.disabled,
  18207. 'link--active': item === ctxMenuStore.selected
  18208. }],
  18209. key: "".concat(gIndex, "_").concat(index)
  18210. }, [h('a', {
  18211. class: 'vxe-context-menu--link',
  18212. on: {
  18213. click: function click(evnt) {
  18214. $xetable.ctxMenuLinkEvent(evnt, item);
  18215. },
  18216. mouseover: function mouseover(evnt) {
  18217. $xetable.ctxMenuMouseoverEvent(evnt, item);
  18218. },
  18219. mouseout: function mouseout(evnt) {
  18220. $xetable.ctxMenuMouseoutEvent(evnt, item);
  18221. }
  18222. }
  18223. }, [h('i', {
  18224. class: ['vxe-context-menu--link-prefix', item.prefixIcon]
  18225. }), h('span', {
  18226. class: 'vxe-context-menu--link-content'
  18227. }, UtilTools.getFuncText(item.name)), h('i', {
  18228. class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
  18229. })]), hasChildMenus ? h('ul', {
  18230. class: ['vxe-table--context-menu-clild-wrapper', {
  18231. 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
  18232. }]
  18233. }, item.children.map(function (child, cIndex) {
  18234. return child.visible === false ? _e() : h('li', {
  18235. class: [child.className, {
  18236. 'link--disabled': child.disabled,
  18237. 'link--active': child === ctxMenuStore.selectChild
  18238. }],
  18239. key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
  18240. }, [h('a', {
  18241. class: 'vxe-context-menu--link',
  18242. on: {
  18243. click: function click(evnt) {
  18244. $xetable.ctxMenuLinkEvent(evnt, child);
  18245. },
  18246. mouseover: function mouseover(evnt) {
  18247. $xetable.ctxMenuMouseoverEvent(evnt, item, child);
  18248. },
  18249. mouseout: function mouseout(evnt) {
  18250. $xetable.ctxMenuMouseoutEvent(evnt, item, child);
  18251. }
  18252. }
  18253. }, [h('i', {
  18254. class: ['vxe-context-menu--link-prefix', child.prefixIcon]
  18255. }), h('span', {
  18256. class: 'vxe-context-menu--link-content'
  18257. }, UtilTools.getFuncText(child.name))])]);
  18258. })) : _e()]);
  18259. }));
  18260. }));
  18261. }
  18262. });
  18263. // CONCATENATED MODULE: ./packages/menu/src/mixin.js
  18264. /* harmony default export */ var menu_src_mixin = ({
  18265. methods: {
  18266. /**
  18267. * 关闭快捷菜单
  18268. */
  18269. _closeMenu: function _closeMenu() {
  18270. Object.assign(this.ctxMenuStore, {
  18271. visible: false,
  18272. selected: null,
  18273. selectChild: null,
  18274. showChild: false
  18275. });
  18276. return this.$nextTick();
  18277. },
  18278. // 处理菜单的移动
  18279. moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
  18280. var selectItem;
  18281. var selectIndex = ctor_amd_xe_utils_default.a.findIndexOf(menuList, function (item) {
  18282. return ctxMenuStore[property] === item;
  18283. });
  18284. if (keyCode === operKey) {
  18285. if (operRest && UtilTools.hasChildrenList(ctxMenuStore.selected)) {
  18286. ctxMenuStore.showChild = true;
  18287. } else {
  18288. ctxMenuStore.showChild = false;
  18289. ctxMenuStore.selectChild = null;
  18290. }
  18291. } else if (keyCode === 38) {
  18292. for (var len = selectIndex - 1; len >= 0; len--) {
  18293. if (menuList[len].visible !== false) {
  18294. selectItem = menuList[len];
  18295. break;
  18296. }
  18297. }
  18298. ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
  18299. } else if (keyCode === 40) {
  18300. for (var index = selectIndex + 1; index < menuList.length; index++) {
  18301. if (menuList[index].visible !== false) {
  18302. selectItem = menuList[index];
  18303. break;
  18304. }
  18305. }
  18306. ctxMenuStore[property] = selectItem || menuList[0];
  18307. } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) {
  18308. this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
  18309. }
  18310. },
  18311. /**
  18312. * 快捷菜单事件处理
  18313. */
  18314. handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) {
  18315. var $refs = this.$refs,
  18316. tId = this.tId,
  18317. editStore = this.editStore,
  18318. menuConfig = this.menuConfig,
  18319. contextMenu = this.contextMenu,
  18320. ctxMenuStore = this.ctxMenuStore,
  18321. ctxMenuOpts = this.ctxMenuOpts,
  18322. mouseConfig = this.mouseConfig,
  18323. mouseOpts = this.mouseOpts;
  18324. var selected = editStore.selected;
  18325. var layoutList = ['header', 'body', 'footer'];
  18326. if (menuConfig || contextMenu) {
  18327. if (ctxMenuStore.visible && $refs.ctxWrapper && DomTools.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
  18328. evnt.preventDefault();
  18329. return;
  18330. }
  18331. if (this._keyCtx) {
  18332. var type = 'body';
  18333. var params = {
  18334. type: type,
  18335. $grid: this.$xegrid,
  18336. $table: this,
  18337. keyboard: true,
  18338. columns: this.visibleColumn.slice(0),
  18339. $event: evnt
  18340. }; // 如果开启单元格区域
  18341. if (mouseConfig && mouseOpts.area) {
  18342. var activeArea = this.getActiveCellArea();
  18343. if (activeArea && activeArea.row && activeArea.column) {
  18344. params.row = activeArea.row;
  18345. params.column = activeArea.column;
  18346. this.openContextMenu(evnt, type, params);
  18347. return;
  18348. }
  18349. } else if (mouseConfig && mouseOpts.selected) {
  18350. // 如果启用键盘导航且已选中单元格
  18351. if (selected.row && selected.column) {
  18352. params.row = selected.row;
  18353. params.column = selected.column;
  18354. this.openContextMenu(evnt, type, params);
  18355. return;
  18356. }
  18357. }
  18358. } // 分别匹配表尾、内容、表尾的快捷菜单
  18359. for (var index = 0; index < layoutList.length; index++) {
  18360. var layout = layoutList[index];
  18361. var columnTargetNode = DomTools.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
  18362. // target=td|th,直接向上找 table 去匹配即可
  18363. return target.parentNode.parentNode.parentNode.getAttribute('data-tid') === tId;
  18364. });
  18365. var _params = {
  18366. type: layout,
  18367. $grid: this.$xegrid,
  18368. $table: this,
  18369. columns: this.visibleColumn.slice(0),
  18370. $event: evnt
  18371. };
  18372. if (columnTargetNode.flag) {
  18373. var cell = columnTargetNode.targetElem;
  18374. var column = this.getColumnNode(cell).item;
  18375. var typePrefix = "".concat(layout, "-");
  18376. Object.assign(_params, {
  18377. column: column,
  18378. columnIndex: this.getColumnIndex(column),
  18379. cell: cell
  18380. });
  18381. if (layout === 'body') {
  18382. var row = this.getRowNode(cell.parentNode).item;
  18383. typePrefix = '';
  18384. _params.row = row;
  18385. _params.rowIndex = this.getRowIndex(row);
  18386. }
  18387. this.openContextMenu(evnt, layout, _params); // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
  18388. if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
  18389. UtilTools.warn('vxe.error.delEvent', ["".concat(typePrefix, "cell-context-menu"), "".concat(typePrefix, "cell-menu")]);
  18390. this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
  18391. } else {
  18392. this.emitEvent("".concat(typePrefix, "cell-menu"), _params, evnt);
  18393. }
  18394. return;
  18395. } else if (DomTools.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
  18396. return target.getAttribute('data-tid') === tId;
  18397. }).flag) {
  18398. if (ctxMenuOpts.trigger === 'cell') {
  18399. evnt.preventDefault();
  18400. } else {
  18401. this.openContextMenu(evnt, layout, _params);
  18402. }
  18403. return;
  18404. }
  18405. }
  18406. }
  18407. if ($refs.filterWrapper && !DomTools.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
  18408. this.closeFilter();
  18409. }
  18410. this.closeMenu();
  18411. },
  18412. /**
  18413. * 显示快捷菜单
  18414. */
  18415. openContextMenu: function openContextMenu(evnt, type, params) {
  18416. var _this = this;
  18417. var isCtxMenu = this.isCtxMenu,
  18418. ctxMenuStore = this.ctxMenuStore,
  18419. ctxMenuOpts = this.ctxMenuOpts;
  18420. var config = ctxMenuOpts[type];
  18421. var visibleMethod = ctxMenuOpts.visibleMethod;
  18422. if (config) {
  18423. var options = config.options,
  18424. disabled = config.disabled;
  18425. if (disabled) {
  18426. evnt.preventDefault();
  18427. } else if (isCtxMenu && options && options.length) {
  18428. params.options = options;
  18429. this.preventEvent(evnt, 'event.showMenu', params, function () {
  18430. if (!visibleMethod || visibleMethod(params, evnt)) {
  18431. evnt.preventDefault();
  18432. _this.updateZindex();
  18433. var _DomTools$getDomNode = DomTools.getDomNode(),
  18434. scrollTop = _DomTools$getDomNode.scrollTop,
  18435. scrollLeft = _DomTools$getDomNode.scrollLeft,
  18436. visibleHeight = _DomTools$getDomNode.visibleHeight,
  18437. visibleWidth = _DomTools$getDomNode.visibleWidth;
  18438. var top = evnt.clientY + scrollTop;
  18439. var left = evnt.clientX + scrollLeft;
  18440. var handleVisible = function handleVisible() {
  18441. Object.assign(ctxMenuStore, {
  18442. args: params,
  18443. visible: true,
  18444. list: options,
  18445. selected: null,
  18446. selectChild: null,
  18447. showChild: false,
  18448. style: {
  18449. zIndex: _this.tZindex,
  18450. top: "".concat(top, "px"),
  18451. left: "".concat(left, "px")
  18452. }
  18453. });
  18454. _this.$nextTick(function () {
  18455. var ctxElem = _this.$refs.ctxWrapper.$el;
  18456. var clientHeight = ctxElem.clientHeight;
  18457. var clientWidth = ctxElem.clientWidth;
  18458. var _DomTools$getAbsolute = DomTools.getAbsolutePos(ctxElem),
  18459. boundingTop = _DomTools$getAbsolute.boundingTop,
  18460. boundingLeft = _DomTools$getAbsolute.boundingLeft;
  18461. var offsetTop = boundingTop + clientHeight - visibleHeight;
  18462. var offsetLeft = boundingLeft + clientWidth - visibleWidth;
  18463. if (offsetTop > -10) {
  18464. ctxMenuStore.style.top = "".concat(Math.max(scrollTop + 2, top - clientHeight - 2), "px");
  18465. }
  18466. if (offsetLeft > -10) {
  18467. ctxMenuStore.style.left = "".concat(Math.max(scrollLeft + 2, left - clientWidth - 2), "px");
  18468. }
  18469. });
  18470. };
  18471. var keyboard = params.keyboard,
  18472. row = params.row,
  18473. column = params.column;
  18474. if (keyboard && row && column) {
  18475. _this.scrollToRow(row, column).then(function () {
  18476. var cell = _this.getCell(row, column);
  18477. var _DomTools$getAbsolute2 = DomTools.getAbsolutePos(cell),
  18478. boundingTop = _DomTools$getAbsolute2.boundingTop,
  18479. boundingLeft = _DomTools$getAbsolute2.boundingLeft;
  18480. top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
  18481. left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
  18482. handleVisible();
  18483. });
  18484. } else {
  18485. handleVisible();
  18486. }
  18487. } else {
  18488. _this.closeMenu();
  18489. }
  18490. });
  18491. }
  18492. }
  18493. this.closeFilter();
  18494. },
  18495. ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) {
  18496. var menuElem = evnt.currentTarget;
  18497. var ctxMenuStore = this.ctxMenuStore;
  18498. evnt.preventDefault();
  18499. evnt.stopPropagation();
  18500. ctxMenuStore.selected = item;
  18501. ctxMenuStore.selectChild = child;
  18502. if (!child) {
  18503. ctxMenuStore.showChild = UtilTools.hasChildrenList(item);
  18504. if (ctxMenuStore.showChild) {
  18505. this.$nextTick(function () {
  18506. var childWrapperElem = menuElem.nextElementSibling;
  18507. if (childWrapperElem) {
  18508. var _DomTools$getAbsolute3 = DomTools.getAbsolutePos(menuElem),
  18509. boundingTop = _DomTools$getAbsolute3.boundingTop,
  18510. boundingLeft = _DomTools$getAbsolute3.boundingLeft,
  18511. visibleHeight = _DomTools$getAbsolute3.visibleHeight,
  18512. visibleWidth = _DomTools$getAbsolute3.visibleWidth;
  18513. var posTop = boundingTop + menuElem.offsetHeight;
  18514. var posLeft = boundingLeft + menuElem.offsetWidth;
  18515. var left = '';
  18516. var right = ''; // 是否超出右侧
  18517. if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
  18518. left = 'auto';
  18519. right = "".concat(menuElem.offsetWidth, "px");
  18520. } // 是否超出底部
  18521. var top = '';
  18522. var bottom = '';
  18523. if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
  18524. top = 'auto';
  18525. bottom = '0';
  18526. }
  18527. childWrapperElem.style.left = left;
  18528. childWrapperElem.style.right = right;
  18529. childWrapperElem.style.top = top;
  18530. childWrapperElem.style.bottom = bottom;
  18531. }
  18532. });
  18533. }
  18534. }
  18535. },
  18536. ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item) {
  18537. var ctxMenuStore = this.ctxMenuStore;
  18538. if (!item.children) {
  18539. ctxMenuStore.selected = null;
  18540. }
  18541. ctxMenuStore.selectChild = null;
  18542. },
  18543. /**
  18544. * 快捷菜单点击事件
  18545. */
  18546. ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
  18547. // 如果一级菜单有配置 code 则允许点击,否则不能点击
  18548. if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
  18549. var ctxMenuMethod = v_x_e_table.menus.get(menu.code);
  18550. var params = Object.assign({
  18551. menu: menu,
  18552. $grid: this.$xegrid,
  18553. $table: this,
  18554. $event: evnt
  18555. }, this.ctxMenuStore.args);
  18556. if (ctxMenuMethod) {
  18557. ctxMenuMethod.call(this, params, evnt);
  18558. } // 在 v3 中废弃事件 context-menu-click
  18559. if (this.$listeners['context-menu-click']) {
  18560. UtilTools.warn('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
  18561. this.emitEvent('context-menu-click', params, evnt);
  18562. } else {
  18563. this.emitEvent('menu-click', params, evnt);
  18564. }
  18565. this.closeMenu();
  18566. }
  18567. }
  18568. }
  18569. });
  18570. // CONCATENATED MODULE: ./packages/menu/index.js
  18571. src_panel.install = function (Vue) {
  18572. v_x_e_table.reg('menu');
  18573. packages_table.mixins.push(menu_src_mixin);
  18574. Vue.component(src_panel.name, src_panel);
  18575. };
  18576. var Menu = src_panel;
  18577. /* harmony default export */ var packages_menu = (src_panel);
  18578. // CONCATENATED MODULE: ./packages/toolbar/src/toolbar.js
  18579. /**
  18580. * 渲染按钮
  18581. */
  18582. function renderBtns(h, _vm) {
  18583. var _e = _vm._e,
  18584. $scopedSlots = _vm.$scopedSlots,
  18585. $xegrid = _vm.$xegrid,
  18586. $xetable = _vm.$xetable,
  18587. _vm$buttons = _vm.buttons,
  18588. buttons = _vm$buttons === void 0 ? [] : _vm$buttons;
  18589. if ($scopedSlots.buttons) {
  18590. return $scopedSlots.buttons.call(_vm, {
  18591. $grid: $xegrid,
  18592. $table: $xetable
  18593. }, h);
  18594. }
  18595. return buttons.map(function (item) {
  18596. var name = item.name,
  18597. visible = item.visible,
  18598. _dropdowns = item.dropdowns,
  18599. buttonRender = item.buttonRender;
  18600. var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
  18601. if (visible === false) {
  18602. return _e();
  18603. }
  18604. if (compConf) {
  18605. var renderToolbarButton = compConf.renderToolbarButton || compConf.renderButton;
  18606. if (renderToolbarButton) {
  18607. return h('span', {
  18608. class: 'vxe-button--item'
  18609. }, renderToolbarButton.call(_vm, h, buttonRender, {
  18610. $grid: $xegrid,
  18611. $table: $xetable,
  18612. button: item
  18613. }, {
  18614. $grid: $xegrid,
  18615. $table: $xetable
  18616. }));
  18617. }
  18618. }
  18619. return h('vxe-button', {
  18620. on: {
  18621. click: function click(evnt) {
  18622. return _vm.btnEvent(evnt, item);
  18623. }
  18624. },
  18625. props: {
  18626. disabled: item.disabled,
  18627. loading: item.loading,
  18628. type: item.type,
  18629. icon: item.icon,
  18630. circle: item.circle,
  18631. round: item.round,
  18632. status: item.status,
  18633. destroyOnClose: item.destroyOnClose,
  18634. placement: item.placement,
  18635. transfer: item.transfer
  18636. },
  18637. scopedSlots: _dropdowns && _dropdowns.length ? {
  18638. default: function _default() {
  18639. return UtilTools.getFuncText(name);
  18640. },
  18641. dropdowns: function dropdowns() {
  18642. return _dropdowns.map(function (child) {
  18643. return child.visible === false ? _e() : h('vxe-button', {
  18644. on: {
  18645. click: function click(evnt) {
  18646. return _vm.btnEvent(evnt, child);
  18647. }
  18648. },
  18649. props: {
  18650. disabled: child.disabled,
  18651. loading: child.loading,
  18652. type: child.type,
  18653. icon: child.icon,
  18654. circle: child.circle,
  18655. round: child.round,
  18656. status: child.status
  18657. }
  18658. }, UtilTools.getFuncText(child.name));
  18659. });
  18660. }
  18661. } : null
  18662. }, UtilTools.getFuncText(name));
  18663. });
  18664. }
  18665. /**
  18666. * 渲染右侧工具
  18667. */
  18668. function renderRightTools(h, _vm) {
  18669. var $scopedSlots = _vm.$scopedSlots,
  18670. $xegrid = _vm.$xegrid,
  18671. $xetable = _vm.$xetable;
  18672. if ($scopedSlots.tools) {
  18673. return $scopedSlots.tools.call(_vm, {
  18674. $grid: $xegrid,
  18675. $table: $xetable
  18676. }, h);
  18677. }
  18678. return [];
  18679. }
  18680. function renderCustoms(h, _vm) {
  18681. var $xetable = _vm.$xetable,
  18682. customStore = _vm.customStore,
  18683. customOpts = _vm.customOpts,
  18684. columns = _vm.columns;
  18685. var cols = [];
  18686. var customBtnOns = {};
  18687. var customWrapperOns = {};
  18688. var checkMethod = ($xetable && $xetable.customOpts ? $xetable.customOpts.checkMethod : null) || customOpts.checkMethod;
  18689. if (customOpts.trigger === 'manual') {// 手动触发
  18690. } else if (customOpts.trigger === 'hover') {
  18691. // hover 触发
  18692. customBtnOns.mouseenter = _vm.handleMouseenterSettingEvent;
  18693. customBtnOns.mouseleave = _vm.handleMouseleaveSettingEvent;
  18694. customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
  18695. customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
  18696. } else {
  18697. // 点击触发
  18698. customBtnOns.click = _vm.handleClickSettingEvent;
  18699. }
  18700. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  18701. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  18702. var colKey = column.getKey();
  18703. var isColGroup = column.children && column.children.length;
  18704. var isDisabled = checkMethod ? !checkMethod({
  18705. column: column
  18706. }) : false;
  18707. if (isColGroup || colKey) {
  18708. cols.push(h('li', {
  18709. class: ['vxe-custom--option', "level--".concat(column.level), {
  18710. 'is--group': isColGroup,
  18711. 'is--checked': column.visible,
  18712. 'is--indeterminate': column.halfVisible,
  18713. 'is--disabled': isDisabled
  18714. }],
  18715. attrs: {
  18716. title: colTitle
  18717. },
  18718. on: {
  18719. click: function click() {
  18720. if (!isDisabled) {
  18721. _vm.changeCustomOption(column);
  18722. }
  18723. }
  18724. }
  18725. }, [h('span', {
  18726. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  18727. }), h('span', {
  18728. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  18729. }), h('span', {
  18730. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  18731. }), h('span', {
  18732. class: 'vxe-checkbox--label'
  18733. }, colTitle)]));
  18734. }
  18735. });
  18736. return h('div', {
  18737. class: ['vxe-custom--wrapper', {
  18738. 'is--active': customStore.visible
  18739. }],
  18740. ref: 'customWrapper'
  18741. }, [h('vxe-button', {
  18742. props: {
  18743. circle: true,
  18744. icon: customOpts.icon || conf.icon.TOOLBAR_TOOLS_CUSTOM
  18745. },
  18746. attrs: {
  18747. title: conf.i18n('vxe.toolbar.custom')
  18748. },
  18749. on: customBtnOns
  18750. }), h('div', {
  18751. class: 'vxe-custom--option-wrapper'
  18752. }, [h('ul', {
  18753. class: 'vxe-custom--header'
  18754. }, [h('li', {
  18755. class: ['vxe-custom--option', {
  18756. 'is--checked': customStore.isAll,
  18757. 'is--indeterminate': customStore.isIndeterminate
  18758. }],
  18759. attrs: {
  18760. title: conf.i18n('vxe.table.allTitle')
  18761. },
  18762. on: {
  18763. click: _vm.allCustomEvent
  18764. }
  18765. }, [h('span', {
  18766. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  18767. }), h('span', {
  18768. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  18769. }), h('span', {
  18770. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  18771. }), h('span', {
  18772. class: 'vxe-checkbox--label'
  18773. }, conf.i18n('vxe.toolbar.customAll'))])]), h('ul', {
  18774. class: 'vxe-custom--body',
  18775. on: customWrapperOns
  18776. }, cols), customOpts.isFooter === false ? null : h('div', {
  18777. class: 'vxe-custom--footer'
  18778. }, [h('button', {
  18779. class: 'btn--confirm',
  18780. on: {
  18781. click: _vm.confirmCustomEvent
  18782. }
  18783. }, conf.i18n('vxe.toolbar.customConfirm')), h('button', {
  18784. class: 'btn--reset',
  18785. on: {
  18786. click: _vm.resetCustomEvent
  18787. }
  18788. }, conf.i18n('vxe.toolbar.customRestore'))])])]);
  18789. }
  18790. /* harmony default export */ var src_toolbar = ({
  18791. name: 'VxeToolbar',
  18792. props: {
  18793. id: String,
  18794. loading: Boolean,
  18795. resizable: [Boolean, Object],
  18796. refresh: [Boolean, Object],
  18797. import: [Boolean, Object],
  18798. export: [Boolean, Object],
  18799. print: [Boolean, Object],
  18800. zoom: [Boolean, Object],
  18801. setting: [Boolean, Object],
  18802. custom: [Boolean, Object],
  18803. buttons: {
  18804. type: Array,
  18805. default: function _default() {
  18806. return conf.toolbar.buttons;
  18807. }
  18808. },
  18809. perfect: {
  18810. type: Boolean,
  18811. default: function _default() {
  18812. return conf.toolbar.perfect;
  18813. }
  18814. },
  18815. size: {
  18816. type: String,
  18817. default: function _default() {
  18818. return conf.toolbar.size || conf.size;
  18819. }
  18820. }
  18821. },
  18822. inject: {
  18823. $xegrid: {
  18824. default: null
  18825. }
  18826. },
  18827. data: function data() {
  18828. return {
  18829. $xetable: null,
  18830. isRefresh: false,
  18831. columns: [],
  18832. customStore: {
  18833. isAll: false,
  18834. isIndeterminate: false,
  18835. visible: false
  18836. }
  18837. };
  18838. },
  18839. computed: {
  18840. vSize: function vSize() {
  18841. return this.size || this.$parent.size || this.$parent.vSize;
  18842. },
  18843. refreshOpts: function refreshOpts() {
  18844. return Object.assign({}, conf.toolbar.refresh, this.refresh);
  18845. },
  18846. importOpts: function importOpts() {
  18847. return Object.assign({}, conf.toolbar.import, this.import);
  18848. },
  18849. exportOpts: function exportOpts() {
  18850. return Object.assign({}, conf.toolbar.export, this.export);
  18851. },
  18852. printOpts: function printOpts() {
  18853. return Object.assign({}, conf.toolbar.print, this.print);
  18854. },
  18855. // 在 v3.0 中废弃 toolbar.resizable
  18856. resizableOpts: function resizableOpts() {
  18857. return Object.assign({}, conf.toolbar.resizable, this.resizable);
  18858. },
  18859. zoomOpts: function zoomOpts() {
  18860. return Object.assign({}, conf.toolbar.zoom, this.zoom);
  18861. },
  18862. // 在 v3.0 中废弃 toolbar.custom
  18863. customOpts: function customOpts() {
  18864. return Object.assign({}, conf.toolbar.custom, this.custom);
  18865. }
  18866. },
  18867. created: function created() {
  18868. var _this = this;
  18869. var customOpts = this.customOpts,
  18870. refresh = this.refresh,
  18871. resizable = this.resizable,
  18872. setting = this.setting,
  18873. id = this.id,
  18874. refreshOpts = this.refreshOpts;
  18875. if (customOpts.storage && !id) {
  18876. return UtilTools.error('vxe.error.reqProp', ['toolbar.id']);
  18877. }
  18878. if (id) {
  18879. UtilTools.warn('vxe.error.removeProp', ['toolbar.id']);
  18880. } // 在 v3 中废弃 setting
  18881. if (setting) {
  18882. UtilTools.warn('vxe.error.delProp', ['toolbar.setting', 'toolbar.custom']);
  18883. }
  18884. if (!v_x_e_table._export && (this.export || this.import)) {
  18885. UtilTools.error('vxe.error.reqModule', ['Export']);
  18886. }
  18887. if (resizable) {
  18888. UtilTools.warn('vxe.error.delProp', ['toolbar.resizable', 'custom-config.storage']);
  18889. }
  18890. if (customOpts.storage) {
  18891. UtilTools.warn('vxe.error.delProp', ['toolbar.custom.storage', 'custom-config.storage']);
  18892. }
  18893. this.$nextTick(function () {
  18894. var $xetable = _this.fintTable();
  18895. if (refresh && !_this.$xegrid && !refreshOpts.query) {
  18896. UtilTools.warn('vxe.error.notFunc', ['query']);
  18897. }
  18898. if ($xetable) {
  18899. $xetable.connect(_this);
  18900. }
  18901. });
  18902. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  18903. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  18904. },
  18905. destroyed: function destroyed() {
  18906. GlobalEvent.off(this, 'mousedown');
  18907. GlobalEvent.off(this, 'blur');
  18908. },
  18909. render: function render(h) {
  18910. var _ref;
  18911. var $xegrid = this.$xegrid,
  18912. perfect = this.perfect,
  18913. loading = this.loading,
  18914. importOpts = this.importOpts,
  18915. exportOpts = this.exportOpts,
  18916. refresh = this.refresh,
  18917. refreshOpts = this.refreshOpts,
  18918. zoom = this.zoom,
  18919. zoomOpts = this.zoomOpts,
  18920. custom = this.custom,
  18921. setting = this.setting,
  18922. vSize = this.vSize;
  18923. return h('div', {
  18924. class: ['vxe-toolbar', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--perfect', perfect), _defineProperty(_ref, 'is--loading', loading), _ref)]
  18925. }, [h('div', {
  18926. class: 'vxe-buttons--wrapper'
  18927. }, renderBtns(h, this)), h('div', {
  18928. class: 'vxe-tools--wrapper'
  18929. }, renderRightTools(h, this)), h('div', {
  18930. class: 'vxe-tools--operate'
  18931. }, [this.import ? h('vxe-button', {
  18932. props: {
  18933. circle: true,
  18934. icon: importOpts.icon || conf.icon.TOOLBAR_TOOLS_IMPORT
  18935. },
  18936. attrs: {
  18937. title: conf.i18n('vxe.toolbar.import')
  18938. },
  18939. on: {
  18940. click: this.importEvent
  18941. }
  18942. }) : null, this.export ? h('vxe-button', {
  18943. props: {
  18944. circle: true,
  18945. icon: exportOpts.icon || conf.icon.TOOLBAR_TOOLS_EXPORT
  18946. },
  18947. attrs: {
  18948. title: conf.i18n('vxe.toolbar.export')
  18949. },
  18950. on: {
  18951. click: this.exportEvent
  18952. }
  18953. }) : null, this.print ? h('vxe-button', {
  18954. props: {
  18955. circle: true,
  18956. icon: this.printOpts.icon || conf.icon.TOOLBAR_TOOLS_PRINT
  18957. },
  18958. attrs: {
  18959. title: conf.i18n('vxe.toolbar.print')
  18960. },
  18961. on: {
  18962. click: this.printEvent
  18963. }
  18964. }) : null, refresh ? h('vxe-button', {
  18965. props: {
  18966. circle: true,
  18967. icon: this.isRefresh ? refreshOpts.iconLoading || conf.icon.TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || conf.icon.TOOLBAR_TOOLS_REFRESH
  18968. },
  18969. attrs: {
  18970. title: conf.i18n('vxe.toolbar.refresh')
  18971. },
  18972. on: {
  18973. click: this.refreshEvent
  18974. }
  18975. }) : null, zoom && $xegrid ? h('vxe-button', {
  18976. props: {
  18977. circle: true,
  18978. icon: $xegrid.isMaximized() ? zoomOpts.iconOut || conf.icon.TOOLBAR_TOOLS_ZOOM_OUT : zoomOpts.iconIn || conf.icon.TOOLBAR_TOOLS_ZOOM_IN
  18979. },
  18980. attrs: {
  18981. title: conf.i18n("vxe.toolbar.zoom".concat($xegrid.isMaximized() ? 'Out' : 'In'))
  18982. },
  18983. on: {
  18984. click: $xegrid.triggerZoomEvent
  18985. }
  18986. }) : null, custom || setting ? renderCustoms(h, this) : null])]);
  18987. },
  18988. methods: {
  18989. syncUpdate: function syncUpdate(params) {
  18990. var collectColumn = params.collectColumn,
  18991. $table = params.$table;
  18992. this.$xetable = $table;
  18993. this.columns = collectColumn;
  18994. },
  18995. fintTable: function fintTable() {
  18996. var $children = this.$parent.$children;
  18997. var selfIndex = $children.indexOf(this);
  18998. return ctor_amd_xe_utils_default.a.find($children, function (comp, index) {
  18999. return comp && comp.refreshColumn && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table';
  19000. });
  19001. },
  19002. checkTable: function checkTable() {
  19003. if (this.$xetable) {
  19004. return true;
  19005. }
  19006. UtilTools.error('vxe.error.barUnableLink');
  19007. },
  19008. showCustom: function showCustom() {
  19009. this.customStore.visible = true;
  19010. this.checkCustomStatus();
  19011. },
  19012. closeCustom: function closeCustom() {
  19013. var custom = this.custom,
  19014. setting = this.setting,
  19015. customStore = this.customStore;
  19016. if (customStore.visible) {
  19017. customStore.visible = false;
  19018. if ((custom || setting) && !customStore.immediate) {
  19019. this.handleCustoms();
  19020. }
  19021. }
  19022. },
  19023. confirmCustomEvent: function confirmCustomEvent(evnt) {
  19024. this.closeCustom();
  19025. this.emitCustomEvent('confirm', evnt);
  19026. },
  19027. customOpenEvent: function customOpenEvent(evnt) {
  19028. var customStore = this.customStore;
  19029. if (this.checkTable()) {
  19030. if (!customStore.visible) {
  19031. this.showCustom();
  19032. this.emitCustomEvent('open', evnt);
  19033. }
  19034. }
  19035. },
  19036. customColseEvent: function customColseEvent(evnt) {
  19037. var customStore = this.customStore;
  19038. if (customStore.visible) {
  19039. this.closeCustom();
  19040. this.emitCustomEvent('close', evnt);
  19041. }
  19042. },
  19043. resetCustomEvent: function resetCustomEvent(evnt) {
  19044. var $xetable = this.$xetable,
  19045. columns = this.columns,
  19046. customOpts = this.customOpts;
  19047. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19048. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  19049. if (!checkMethod || checkMethod({
  19050. column: column
  19051. })) {
  19052. column.visible = column.defaultVisible;
  19053. column.halfVisible = false;
  19054. }
  19055. column.resizeWidth = 0;
  19056. });
  19057. $xetable.saveCustomResizable(true);
  19058. this.closeCustom();
  19059. this.emitCustomEvent('reset', evnt);
  19060. },
  19061. emitCustomEvent: function emitCustomEvent(type, evnt) {
  19062. var $xetable = this.$xetable,
  19063. $xegrid = this.$xegrid;
  19064. var comp = $xegrid || $xetable;
  19065. comp.$emit('custom', {
  19066. type: type,
  19067. $table: $xetable,
  19068. $grid: $xegrid,
  19069. $event: evnt
  19070. }, evnt);
  19071. },
  19072. changeCustomOption: function changeCustomOption(column) {
  19073. var isChecked = !column.visible;
  19074. ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
  19075. item.visible = isChecked;
  19076. item.halfVisible = false;
  19077. });
  19078. this.handleOptionCheck(column);
  19079. if (this.custom && this.customOpts.immediate) {
  19080. this.handleCustoms();
  19081. }
  19082. this.checkCustomStatus();
  19083. },
  19084. handleOptionCheck: function handleOptionCheck(column) {
  19085. var matchObj = ctor_amd_xe_utils_default.a.findTree(this.columns, function (item) {
  19086. return item === column;
  19087. });
  19088. if (matchObj && matchObj.parent) {
  19089. var parent = matchObj.parent;
  19090. if (parent.children && parent.children.length) {
  19091. parent.visible = parent.children.every(function (column) {
  19092. return column.visible;
  19093. });
  19094. parent.halfVisible = !parent.visible && parent.children.some(function (column) {
  19095. return column.visible || column.halfVisible;
  19096. });
  19097. this.handleOptionCheck(parent);
  19098. }
  19099. }
  19100. },
  19101. handleCustoms: function handleCustoms() {
  19102. var $xetable = this.$xetable;
  19103. $xetable.saveCustomVisible();
  19104. $xetable.analyColumnWidth();
  19105. $xetable.refreshColumn();
  19106. },
  19107. checkCustomStatus: function checkCustomStatus() {
  19108. var $xetable = this.$xetable,
  19109. columns = this.columns,
  19110. customOpts = this.customOpts;
  19111. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19112. this.customStore.isAll = columns.every(function (column) {
  19113. return (checkMethod ? !checkMethod({
  19114. column: column
  19115. }) : false) || column.visible;
  19116. });
  19117. this.customStore.isIndeterminate = !this.customStore.isAll && columns.some(function (column) {
  19118. return (!checkMethod || checkMethod({
  19119. column: column
  19120. })) && (column.visible || column.halfVisible);
  19121. });
  19122. },
  19123. allCustomEvent: function allCustomEvent() {
  19124. var $xetable = this.$xetable,
  19125. columns = this.columns,
  19126. customOpts = this.customOpts,
  19127. customStore = this.customStore;
  19128. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19129. var isAll = !customStore.isAll;
  19130. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  19131. if (!checkMethod || checkMethod({
  19132. column: column
  19133. })) {
  19134. column.visible = isAll;
  19135. column.halfVisible = false;
  19136. }
  19137. });
  19138. customStore.isAll = isAll;
  19139. this.checkCustomStatus();
  19140. },
  19141. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  19142. if (!DomTools.getEventTargetNode(evnt, this.$refs.customWrapper).flag) {
  19143. this.customColseEvent(evnt);
  19144. }
  19145. },
  19146. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  19147. this.customColseEvent(evnt);
  19148. },
  19149. handleClickSettingEvent: function handleClickSettingEvent(evnt) {
  19150. if (this.customStore.visible) {
  19151. this.customColseEvent(evnt);
  19152. } else {
  19153. this.customOpenEvent(evnt);
  19154. }
  19155. },
  19156. handleMouseenterSettingEvent: function handleMouseenterSettingEvent(evnt) {
  19157. this.customStore.activeBtn = true;
  19158. this.customOpenEvent(evnt);
  19159. },
  19160. handleMouseleaveSettingEvent: function handleMouseleaveSettingEvent(evnt) {
  19161. var _this2 = this;
  19162. var customStore = this.customStore;
  19163. customStore.activeBtn = false;
  19164. setTimeout(function () {
  19165. if (!customStore.activeBtn && !customStore.activeWrapper) {
  19166. _this2.customColseEvent(evnt);
  19167. }
  19168. }, 300);
  19169. },
  19170. handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
  19171. this.customStore.activeWrapper = true;
  19172. this.customOpenEvent(evnt);
  19173. },
  19174. handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
  19175. var _this3 = this;
  19176. var customStore = this.customStore;
  19177. customStore.activeWrapper = false;
  19178. setTimeout(function () {
  19179. if (!customStore.activeBtn && !customStore.activeWrapper) {
  19180. _this3.customColseEvent(evnt);
  19181. }
  19182. }, 300);
  19183. },
  19184. refreshEvent: function refreshEvent() {
  19185. var _this4 = this;
  19186. var $xegrid = this.$xegrid,
  19187. refreshOpts = this.refreshOpts,
  19188. isRefresh = this.isRefresh;
  19189. if (!isRefresh) {
  19190. if (refreshOpts.query) {
  19191. this.isRefresh = true;
  19192. try {
  19193. Promise.resolve(refreshOpts.query()).catch(function (e) {
  19194. return e;
  19195. }).then(function () {
  19196. _this4.isRefresh = false;
  19197. });
  19198. } catch (e) {
  19199. this.isRefresh = false;
  19200. }
  19201. } else if ($xegrid) {
  19202. this.isRefresh = true;
  19203. $xegrid.commitProxy('reload').catch(function (e) {
  19204. return e;
  19205. }).then(function () {
  19206. _this4.isRefresh = false;
  19207. });
  19208. }
  19209. }
  19210. },
  19211. btnEvent: function btnEvent(evnt, item) {
  19212. var $xegrid = this.$xegrid,
  19213. $xetable = this.$xetable;
  19214. var code = item.code;
  19215. if (code) {
  19216. if ($xegrid) {
  19217. $xegrid.triggerToolbarBtnEvent(item, evnt);
  19218. } else {
  19219. var commandMethod = v_x_e_table.commands.get(code);
  19220. var params = {
  19221. code: code,
  19222. button: item,
  19223. $xegrid: $xegrid,
  19224. $table: $xetable,
  19225. $event: evnt
  19226. };
  19227. if (commandMethod) {
  19228. commandMethod.call(this, params, evnt);
  19229. }
  19230. this.$emit('button-click', params, evnt);
  19231. }
  19232. }
  19233. },
  19234. importEvent: function importEvent() {
  19235. if (this.checkTable()) {
  19236. this.$xetable.openImport(this.importOpts);
  19237. }
  19238. },
  19239. exportEvent: function exportEvent() {
  19240. if (this.checkTable()) {
  19241. this.$xetable.openExport(this.exportOpts);
  19242. }
  19243. },
  19244. printEvent: function printEvent() {
  19245. if (this.checkTable()) {
  19246. this.$xetable.print(this.printOpts);
  19247. }
  19248. }
  19249. }
  19250. });
  19251. // CONCATENATED MODULE: ./packages/toolbar/index.js
  19252. src_toolbar.install = function (Vue) {
  19253. Vue.component(src_toolbar.name, src_toolbar);
  19254. };
  19255. var Toolbar = src_toolbar;
  19256. /* harmony default export */ var packages_toolbar = (src_toolbar);
  19257. // CONCATENATED MODULE: ./packages/pager/src/pager.js
  19258. /* harmony default export */ var pager = ({
  19259. name: 'VxePager',
  19260. props: {
  19261. size: {
  19262. type: String,
  19263. default: function _default() {
  19264. return conf.pager.size || conf.size;
  19265. }
  19266. },
  19267. // 自定义布局
  19268. layouts: {
  19269. type: Array,
  19270. default: function _default() {
  19271. return conf.pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total'];
  19272. }
  19273. },
  19274. // 当前页
  19275. currentPage: {
  19276. type: Number,
  19277. default: 1
  19278. },
  19279. // 加载中
  19280. loading: Boolean,
  19281. // 每页大小
  19282. pageSize: {
  19283. type: Number,
  19284. default: function _default() {
  19285. return conf.pager.pageSize || 10;
  19286. }
  19287. },
  19288. // 总条数
  19289. total: {
  19290. type: Number,
  19291. default: 0
  19292. },
  19293. // 显示页码按钮的数量
  19294. pagerCount: {
  19295. type: Number,
  19296. default: function _default() {
  19297. return conf.pager.pagerCount || 7;
  19298. }
  19299. },
  19300. // 每页大小选项列表
  19301. pageSizes: {
  19302. type: Array,
  19303. default: function _default() {
  19304. return conf.pager.pageSizes || [10, 15, 20, 50, 100];
  19305. }
  19306. },
  19307. // 列对其方式
  19308. align: {
  19309. type: String,
  19310. default: function _default() {
  19311. return conf.pager.align;
  19312. }
  19313. },
  19314. // 带边框
  19315. border: {
  19316. type: Boolean,
  19317. default: function _default() {
  19318. return conf.pager.border;
  19319. }
  19320. },
  19321. // 带背景颜色
  19322. background: {
  19323. type: Boolean,
  19324. default: function _default() {
  19325. return conf.pager.background;
  19326. }
  19327. },
  19328. // 配套的样式
  19329. perfect: {
  19330. type: Boolean,
  19331. default: function _default() {
  19332. return conf.pager.perfect;
  19333. }
  19334. },
  19335. // 当只有一页时隐藏
  19336. autoHidden: {
  19337. type: Boolean,
  19338. default: function _default() {
  19339. return conf.pager.autoHidden;
  19340. }
  19341. },
  19342. transfer: {
  19343. type: Boolean,
  19344. default: function _default() {
  19345. return conf.pager.transfer;
  19346. }
  19347. },
  19348. // 自定义图标
  19349. iconPrevPage: String,
  19350. iconJumpPrev: String,
  19351. iconJumpNext: String,
  19352. iconNextPage: String,
  19353. iconJumpMore: String
  19354. },
  19355. inject: {
  19356. $xegrid: {
  19357. default: null
  19358. }
  19359. },
  19360. computed: {
  19361. vSize: function vSize() {
  19362. return this.size || this.$parent.size || this.$parent.vSize;
  19363. },
  19364. isSizes: function isSizes() {
  19365. return this.layouts.some(function (name) {
  19366. return name === 'Sizes';
  19367. });
  19368. },
  19369. pageCount: function pageCount() {
  19370. return this.getPageCount(this.total, this.pageSize);
  19371. },
  19372. numList: function numList() {
  19373. var len = this.pageCount > this.pagerCount ? this.pagerCount - 2 : this.pagerCount;
  19374. var rest = [];
  19375. for (var index = 0; index < len; index++) {
  19376. rest.push(index);
  19377. }
  19378. return rest;
  19379. },
  19380. offsetNumber: function offsetNumber() {
  19381. return Math.floor((this.pagerCount - 2) / 2);
  19382. },
  19383. sizeList: function sizeList() {
  19384. return this.pageSizes.map(function (item) {
  19385. if (ctor_amd_xe_utils_default.a.isNumber(item)) {
  19386. return {
  19387. value: item,
  19388. label: "".concat(conf.i18n('vxe.pager.pagesize', [item]))
  19389. };
  19390. }
  19391. return _objectSpread2({
  19392. value: '',
  19393. label: ''
  19394. }, item);
  19395. });
  19396. }
  19397. },
  19398. render: function render(h) {
  19399. var _this = this,
  19400. _ref;
  19401. var $scopedSlots = this.$scopedSlots,
  19402. $xegrid = this.$xegrid,
  19403. vSize = this.vSize,
  19404. align = this.align;
  19405. var childNodes = [];
  19406. if ($scopedSlots.left) {
  19407. childNodes.push(h('span', {
  19408. class: 'vxe-pager--left-wrapper'
  19409. }, [$scopedSlots.left.call(this, {
  19410. $grid: $xegrid
  19411. })]));
  19412. }
  19413. this.layouts.forEach(function (name) {
  19414. childNodes.push(_this["render".concat(name)](h));
  19415. });
  19416. if ($scopedSlots.right) {
  19417. childNodes.push(h('span', {
  19418. class: 'vxe-pager--right-wrapper'
  19419. }, [$scopedSlots.right.call(this, {
  19420. $grid: $xegrid
  19421. })]));
  19422. }
  19423. return h('div', {
  19424. class: ['vxe-pager', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "align--".concat(align), align), _defineProperty(_ref, 'is--border', this.border), _defineProperty(_ref, 'is--background', this.background), _defineProperty(_ref, 'is--perfect', this.perfect), _defineProperty(_ref, 'is--hidden', this.autoHidden && this.pageCount === 1), _defineProperty(_ref, 'is--loading', this.loading), _ref)]
  19425. }, [h('div', {
  19426. class: 'vxe-pager--wrapper'
  19427. }, childNodes)]);
  19428. },
  19429. methods: {
  19430. // 上一页
  19431. renderPrevPage: function renderPrevPage(h) {
  19432. return h('span', {
  19433. class: ['vxe-pager--prev-btn', {
  19434. 'is--disabled': this.currentPage <= 1
  19435. }],
  19436. attrs: {
  19437. title: conf.i18n('vxe.pager.prevPage')
  19438. },
  19439. on: {
  19440. click: this.prevPage
  19441. }
  19442. }, [h('i', {
  19443. class: ['vxe-pager--btn-icon', this.iconPrevPage || conf.icon.PAGER_PREV_PAGE]
  19444. })]);
  19445. },
  19446. // 向上翻页
  19447. renderPrevJump: function renderPrevJump(h, tagName) {
  19448. return h(tagName || 'span', {
  19449. class: ['vxe-pager--jump-prev', {
  19450. 'is--fixed': !tagName,
  19451. 'is--disabled': this.currentPage <= 1
  19452. }],
  19453. attrs: {
  19454. title: conf.i18n('vxe.pager.prevJump')
  19455. },
  19456. on: {
  19457. click: this.prevJump
  19458. }
  19459. }, [tagName ? h('i', {
  19460. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  19461. }) : null, h('i', {
  19462. class: ['vxe-pager--jump-icon', this.iconJumpPrev || conf.icon.PAGER_JUMP_PREV]
  19463. })]);
  19464. },
  19465. // number
  19466. renderNumber: function renderNumber(h) {
  19467. return h('ul', {
  19468. class: 'vxe-pager--btn-wrapper'
  19469. }, this.renderPageBtn(h));
  19470. },
  19471. // jumpNumber
  19472. renderJumpNumber: function renderJumpNumber(h) {
  19473. return h('ul', {
  19474. class: 'vxe-pager--btn-wrapper'
  19475. }, this.renderPageBtn(h, true));
  19476. },
  19477. // 向下翻页
  19478. renderNextJump: function renderNextJump(h, tagName) {
  19479. return h(tagName || 'span', {
  19480. class: ['vxe-pager--jump-next', {
  19481. 'is--fixed': !tagName,
  19482. 'is--disabled': this.currentPage >= this.pageCount
  19483. }],
  19484. attrs: {
  19485. title: conf.i18n('vxe.pager.nextJump')
  19486. },
  19487. on: {
  19488. click: this.nextJump
  19489. }
  19490. }, [tagName ? h('i', {
  19491. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  19492. }) : null, h('i', {
  19493. class: ['vxe-pager--jump-icon', this.iconJumpNext || conf.icon.PAGER_JUMP_NEXT]
  19494. })]);
  19495. },
  19496. // 下一页
  19497. renderNextPage: function renderNextPage(h) {
  19498. return h('span', {
  19499. class: ['vxe-pager--next-btn', {
  19500. 'is--disabled': this.currentPage >= this.pageCount
  19501. }],
  19502. attrs: {
  19503. title: conf.i18n('vxe.pager.nextPage')
  19504. },
  19505. on: {
  19506. click: this.nextPage
  19507. }
  19508. }, [h('i', {
  19509. class: ['vxe-pager--btn-icon', this.iconNextPage || conf.icon.PAGER_NEXT_PAGE]
  19510. })]);
  19511. },
  19512. // sizes
  19513. renderSizes: function renderSizes(h) {
  19514. var _this2 = this;
  19515. return h('vxe-select', {
  19516. class: 'vxe-pager--sizes',
  19517. props: {
  19518. value: this.pageSize,
  19519. placement: 'top',
  19520. transfer: this.transfer,
  19521. options: this.sizeList
  19522. },
  19523. on: {
  19524. change: function change(_ref2) {
  19525. var value = _ref2.value;
  19526. _this2.pageSizeEvent(value);
  19527. }
  19528. }
  19529. });
  19530. },
  19531. // FullJump
  19532. renderFullJump: function renderFullJump(h) {
  19533. return this.renderJump(h, true);
  19534. },
  19535. // Jump
  19536. renderJump: function renderJump(h, isFull) {
  19537. return h('span', {
  19538. class: 'vxe-pager--jump'
  19539. }, [isFull ? h('span', {
  19540. class: 'vxe-pager--goto-text'
  19541. }, conf.i18n('vxe.pager.goto')) : null, h('input', {
  19542. class: 'vxe-pager--goto',
  19543. domProps: {
  19544. value: this.currentPage
  19545. },
  19546. attrs: {
  19547. type: 'text',
  19548. autocomplete: 'off'
  19549. },
  19550. on: {
  19551. keydown: this.jumpKeydownEvent,
  19552. blur: this.triggerJumpEvent
  19553. }
  19554. }), isFull ? h('span', {
  19555. class: 'vxe-pager--classifier-text'
  19556. }, conf.i18n('vxe.pager.pageClassifier')) : null]);
  19557. },
  19558. // PageCount
  19559. renderPageCount: function renderPageCount(h) {
  19560. return h('span', {
  19561. class: 'vxe-pager--count'
  19562. }, [h('span', {
  19563. class: 'vxe-pager--separator'
  19564. }), h('span', this.pageCount)]);
  19565. },
  19566. // total
  19567. renderTotal: function renderTotal(h) {
  19568. return h('span', {
  19569. class: 'vxe-pager--total'
  19570. }, conf.i18n('vxe.pager.total', [this.total]));
  19571. },
  19572. // number
  19573. renderPageBtn: function renderPageBtn(h, showJump) {
  19574. var _this3 = this;
  19575. var numList = this.numList,
  19576. currentPage = this.currentPage,
  19577. pageCount = this.pageCount,
  19578. pagerCount = this.pagerCount,
  19579. offsetNumber = this.offsetNumber;
  19580. var nums = [];
  19581. var isOv = pageCount > pagerCount;
  19582. var isLt = isOv && currentPage > offsetNumber + 1;
  19583. var isGt = isOv && currentPage < pageCount - offsetNumber;
  19584. var startNumber = 1;
  19585. if (isOv) {
  19586. if (currentPage >= pageCount - offsetNumber) {
  19587. startNumber = Math.max(pageCount - numList.length + 1, 1);
  19588. } else {
  19589. startNumber = Math.max(currentPage - offsetNumber, 1);
  19590. }
  19591. }
  19592. if (showJump && isLt) {
  19593. nums.push(h('li', {
  19594. class: 'vxe-pager--num-btn',
  19595. on: {
  19596. click: function click() {
  19597. return _this3.jumpPage(1);
  19598. }
  19599. }
  19600. }, 1), this.renderPrevJump(h, 'li'));
  19601. }
  19602. numList.forEach(function (item, index) {
  19603. var number = startNumber + index;
  19604. if (number <= pageCount) {
  19605. nums.push(h('li', {
  19606. class: ['vxe-pager--num-btn', {
  19607. 'is--active': currentPage === number
  19608. }],
  19609. on: {
  19610. click: function click() {
  19611. return _this3.jumpPage(number);
  19612. }
  19613. },
  19614. key: number
  19615. }, number));
  19616. }
  19617. });
  19618. if (showJump && isGt) {
  19619. nums.push(this.renderNextJump(h, 'li'), h('li', {
  19620. class: 'vxe-pager--num-btn',
  19621. on: {
  19622. click: function click() {
  19623. return _this3.jumpPage(pageCount);
  19624. }
  19625. }
  19626. }, pageCount));
  19627. }
  19628. return nums;
  19629. },
  19630. getPageCount: function getPageCount(total, size) {
  19631. return Math.max(Math.ceil(total / size), 1);
  19632. },
  19633. prevPage: function prevPage() {
  19634. var currentPage = this.currentPage,
  19635. pageCount = this.pageCount;
  19636. if (currentPage > 1) {
  19637. this.jumpPage(Math.min(pageCount, Math.max(currentPage - 1, 1)));
  19638. }
  19639. },
  19640. nextPage: function nextPage() {
  19641. var currentPage = this.currentPage,
  19642. pageCount = this.pageCount;
  19643. if (currentPage < pageCount) {
  19644. this.jumpPage(Math.min(pageCount, currentPage + 1));
  19645. }
  19646. },
  19647. prevJump: function prevJump() {
  19648. this.jumpPage(Math.max(this.currentPage - this.numList.length, 1));
  19649. },
  19650. nextJump: function nextJump() {
  19651. this.jumpPage(Math.min(this.currentPage + this.numList.length, this.pageCount));
  19652. },
  19653. jumpPage: function jumpPage(currentPage) {
  19654. if (currentPage !== this.currentPage) {
  19655. this.$emit('update:currentPage', currentPage);
  19656. if (this.$listeners['current-change']) {
  19657. UtilTools.warn('vxe.error.delEvent', ['current-change', 'page-change']);
  19658. this.$emit('current-change', currentPage);
  19659. }
  19660. this.$emit('page-change', {
  19661. type: 'current',
  19662. pageSize: this.pageSize,
  19663. currentPage: currentPage,
  19664. $event: {
  19665. type: 'current'
  19666. }
  19667. });
  19668. }
  19669. },
  19670. pageSizeEvent: function pageSizeEvent(pageSize) {
  19671. this.changePageSize(pageSize);
  19672. },
  19673. changePageSize: function changePageSize(pageSize) {
  19674. if (pageSize !== this.pageSize) {
  19675. this.$emit('update:pageSize', pageSize);
  19676. if (this.$listeners['size-change']) {
  19677. UtilTools.warn('vxe.error.delEvent', ['size-change', 'page-change']);
  19678. this.$emit('size-change', pageSize);
  19679. }
  19680. this.$emit('page-change', {
  19681. type: 'size',
  19682. pageSize: pageSize,
  19683. currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize)),
  19684. $event: {
  19685. type: 'size'
  19686. }
  19687. });
  19688. }
  19689. },
  19690. jumpKeydownEvent: function jumpKeydownEvent(evnt) {
  19691. if (evnt.keyCode === 13) {
  19692. this.triggerJumpEvent(evnt);
  19693. } else if (evnt.keyCode === 38) {
  19694. evnt.preventDefault();
  19695. this.nextPage();
  19696. } else if (evnt.keyCode === 40) {
  19697. evnt.preventDefault();
  19698. this.prevPage();
  19699. }
  19700. },
  19701. triggerJumpEvent: function triggerJumpEvent(evnt) {
  19702. var value = ctor_amd_xe_utils_default.a.toNumber(evnt.target.value);
  19703. var current = value <= 0 ? 1 : value >= this.pageCount ? this.pageCount : value;
  19704. evnt.target.value = current;
  19705. this.jumpPage(current);
  19706. }
  19707. }
  19708. });
  19709. // CONCATENATED MODULE: ./packages/pager/index.js
  19710. pager.install = function (Vue) {
  19711. Vue.component(pager.name, pager);
  19712. };
  19713. var Pager = pager;
  19714. /* harmony default export */ var packages_pager = (pager);
  19715. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.js
  19716. /* harmony default export */ var src_checkbox = ({
  19717. name: 'VxeCheckbox',
  19718. props: {
  19719. value: [String, Number, Boolean],
  19720. label: [String, Number],
  19721. indeterminate: Boolean,
  19722. title: [String, Number],
  19723. content: [String, Number],
  19724. checkedValue: {
  19725. type: [String, Number, Boolean],
  19726. default: true
  19727. },
  19728. uncheckedValue: {
  19729. type: [String, Number, Boolean],
  19730. default: false
  19731. },
  19732. disabled: Boolean,
  19733. size: {
  19734. type: String,
  19735. default: function _default() {
  19736. return conf.checkbox.size || conf.size;
  19737. }
  19738. }
  19739. },
  19740. inject: {
  19741. $xegroup: {
  19742. default: null
  19743. }
  19744. },
  19745. computed: {
  19746. vSize: function vSize() {
  19747. return this.size || this.$parent.size || this.$parent.vSize;
  19748. },
  19749. isGroup: function isGroup() {
  19750. return this.$xegroup;
  19751. },
  19752. isDisabled: function isDisabled() {
  19753. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19754. }
  19755. },
  19756. render: function render(h) {
  19757. var _ref,
  19758. _this = this;
  19759. var $slots = this.$slots,
  19760. $xegroup = this.$xegroup,
  19761. isGroup = this.isGroup,
  19762. isDisabled = this.isDisabled,
  19763. title = this.title,
  19764. vSize = this.vSize,
  19765. indeterminate = this.indeterminate,
  19766. value = this.value,
  19767. label = this.label,
  19768. content = this.content,
  19769. checkedValue = this.checkedValue,
  19770. uncheckedValue = this.uncheckedValue;
  19771. var attrs = {};
  19772. if (title) {
  19773. attrs.title = title;
  19774. }
  19775. return h('label', {
  19776. class: ['vxe-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  19777. attrs: attrs
  19778. }, [h('input', {
  19779. class: 'vxe-checkbox--input',
  19780. attrs: {
  19781. type: 'checkbox',
  19782. disabled: isDisabled
  19783. },
  19784. domProps: {
  19785. checked: isGroup ? $xegroup.value && $xegroup.value.some(function (item) {
  19786. return item === label;
  19787. }) : value === checkedValue
  19788. },
  19789. on: {
  19790. change: function change(evnt) {
  19791. if (!isDisabled) {
  19792. var checked = evnt.target.checked;
  19793. var _value = checked ? checkedValue : uncheckedValue;
  19794. var params = {
  19795. checked: checked,
  19796. value: _value,
  19797. label: label,
  19798. $event: evnt
  19799. };
  19800. if (isGroup) {
  19801. $xegroup.handleChecked(params, evnt);
  19802. } else {
  19803. _this.$emit('input', _value);
  19804. _this.$emit('change', params, evnt);
  19805. }
  19806. }
  19807. }
  19808. }
  19809. }), h('span', {
  19810. class: 'vxe-checkbox--icon'
  19811. }), h('span', {
  19812. class: 'vxe-checkbox--label'
  19813. }, $slots.default || [UtilTools.getFuncText(content)])]);
  19814. }
  19815. });
  19816. // CONCATENATED MODULE: ./packages/checkbox/src/group.js
  19817. /* harmony default export */ var checkbox_src_group = ({
  19818. name: 'VxeCheckboxGroup',
  19819. props: {
  19820. value: Array,
  19821. disabled: Boolean,
  19822. size: {
  19823. type: String,
  19824. default: function _default() {
  19825. return conf.checkbox.size || conf.size;
  19826. }
  19827. }
  19828. },
  19829. provide: function provide() {
  19830. return {
  19831. $xegroup: this
  19832. };
  19833. },
  19834. computed: {
  19835. vSize: function vSize() {
  19836. return this.size || this.$parent.size || this.$parent.vSize;
  19837. }
  19838. },
  19839. render: function render(h) {
  19840. return h('div', {
  19841. class: 'vxe-checkbox-group'
  19842. }, this.$slots.default);
  19843. },
  19844. methods: {
  19845. handleChecked: function handleChecked(params, evnt) {
  19846. var checked = params.checked,
  19847. label = params.label;
  19848. var checklist = this.value || [];
  19849. var checkIndex = checklist.indexOf(label);
  19850. if (checked) {
  19851. if (checkIndex === -1) {
  19852. checklist.push(label);
  19853. }
  19854. } else {
  19855. checklist.splice(checkIndex, 1);
  19856. }
  19857. this.$emit('input', checklist);
  19858. this.$emit('change', Object.assign({
  19859. checklist: checklist
  19860. }, params), evnt);
  19861. }
  19862. }
  19863. });
  19864. // CONCATENATED MODULE: ./packages/checkbox/index.js
  19865. src_checkbox.install = function (Vue) {
  19866. Vue.component(src_checkbox.name, src_checkbox);
  19867. Vue.component(checkbox_src_group.name, checkbox_src_group);
  19868. };
  19869. var Checkbox = src_checkbox;
  19870. /* harmony default export */ var packages_checkbox = (src_checkbox);
  19871. // CONCATENATED MODULE: ./packages/radio/src/radio.js
  19872. /* harmony default export */ var src_radio = ({
  19873. name: 'VxeRadio',
  19874. props: {
  19875. value: [String, Number],
  19876. label: [String, Number],
  19877. title: [String, Number],
  19878. content: [String, Number],
  19879. disabled: Boolean,
  19880. name: String,
  19881. size: {
  19882. type: String,
  19883. default: function _default() {
  19884. return conf.radio.size || conf.size;
  19885. }
  19886. }
  19887. },
  19888. inject: {
  19889. $xegroup: {
  19890. default: null
  19891. }
  19892. },
  19893. computed: {
  19894. vSize: function vSize() {
  19895. return this.size || this.$parent.size || this.$parent.vSize;
  19896. },
  19897. isGroup: function isGroup() {
  19898. return this.$xegroup;
  19899. },
  19900. isDisabled: function isDisabled() {
  19901. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19902. }
  19903. },
  19904. render: function render(h) {
  19905. var _ref,
  19906. _this = this;
  19907. var $slots = this.$slots,
  19908. $xegroup = this.$xegroup,
  19909. isGroup = this.isGroup,
  19910. isDisabled = this.isDisabled,
  19911. title = this.title,
  19912. vSize = this.vSize,
  19913. value = this.value,
  19914. label = this.label,
  19915. name = this.name,
  19916. content = this.content;
  19917. var attrs = {};
  19918. if (title) {
  19919. attrs.title = title;
  19920. }
  19921. return h('label', {
  19922. class: ['vxe-radio', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  19923. attrs: attrs
  19924. }, [h('input', {
  19925. class: 'vxe-radio--input',
  19926. attrs: {
  19927. type: 'radio',
  19928. name: isGroup ? $xegroup.name : name,
  19929. disabled: isDisabled
  19930. },
  19931. domProps: {
  19932. checked: isGroup ? $xegroup.value === label : value === label
  19933. },
  19934. on: {
  19935. change: function change(evnt) {
  19936. if (!isDisabled) {
  19937. var params = {
  19938. label: label,
  19939. $event: evnt
  19940. };
  19941. if (isGroup) {
  19942. $xegroup.handleChecked(params, evnt);
  19943. } else {
  19944. _this.$emit('input', label);
  19945. _this.$emit('change', params, evnt);
  19946. }
  19947. }
  19948. }
  19949. }
  19950. }), h('span', {
  19951. class: 'vxe-radio--icon'
  19952. }), h('span', {
  19953. class: 'vxe-radio--label'
  19954. }, $slots.default || [UtilTools.getFuncText(content)])]);
  19955. }
  19956. });
  19957. // CONCATENATED MODULE: ./packages/radio/src/button.js
  19958. /* harmony default export */ var src_button = ({
  19959. name: 'VxeRadioButton',
  19960. props: {
  19961. label: [String, Number],
  19962. title: [String, Number],
  19963. content: [String, Number],
  19964. disabled: Boolean,
  19965. size: {
  19966. type: String,
  19967. default: function _default() {
  19968. return conf.radio.size || conf.size;
  19969. }
  19970. }
  19971. },
  19972. inject: {
  19973. $xegroup: {
  19974. default: null
  19975. }
  19976. },
  19977. computed: {
  19978. vSize: function vSize() {
  19979. return this.size || this.$parent.size || this.$parent.vSize;
  19980. },
  19981. isGroup: function isGroup() {
  19982. return this.$xegroup;
  19983. },
  19984. isDisabled: function isDisabled() {
  19985. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19986. }
  19987. },
  19988. render: function render(h) {
  19989. var _ref;
  19990. var $slots = this.$slots,
  19991. $xegroup = this.$xegroup,
  19992. isGroup = this.isGroup,
  19993. isDisabled = this.isDisabled,
  19994. title = this.title,
  19995. vSize = this.vSize,
  19996. label = this.label,
  19997. content = this.content;
  19998. var attrs = {};
  19999. if (title) {
  20000. attrs.title = title;
  20001. }
  20002. return h('label', {
  20003. class: ['vxe-radio', 'vxe-radio-button', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  20004. attrs: attrs
  20005. }, [h('input', {
  20006. class: 'vxe-radio--input',
  20007. attrs: {
  20008. type: 'radio',
  20009. name: isGroup ? $xegroup.name : null,
  20010. disabled: isDisabled
  20011. },
  20012. domProps: {
  20013. checked: isGroup && $xegroup.value === label
  20014. },
  20015. on: {
  20016. change: function change(evnt) {
  20017. if (!isDisabled) {
  20018. if (isGroup) {
  20019. $xegroup.handleChecked({
  20020. label: label,
  20021. $event: evnt
  20022. });
  20023. }
  20024. }
  20025. }
  20026. }
  20027. }), h('span', {
  20028. class: 'vxe-radio--label'
  20029. }, $slots.default || [UtilTools.getFuncText(content)])]);
  20030. }
  20031. });
  20032. // CONCATENATED MODULE: ./packages/radio/src/group.js
  20033. /* harmony default export */ var radio_src_group = ({
  20034. name: 'VxeRadioGroup',
  20035. props: {
  20036. value: [String, Number],
  20037. disabled: Boolean,
  20038. size: {
  20039. type: String,
  20040. default: function _default() {
  20041. return conf.radio.size || conf.size;
  20042. }
  20043. }
  20044. },
  20045. provide: function provide() {
  20046. return {
  20047. $xegroup: this
  20048. };
  20049. },
  20050. computed: {
  20051. vSize: function vSize() {
  20052. return this.size || this.$parent.size || this.$parent.vSize;
  20053. }
  20054. },
  20055. data: function data() {
  20056. return {
  20057. name: ctor_amd_xe_utils_default.a.uniqueId('xegroup_')
  20058. };
  20059. },
  20060. render: function render(h) {
  20061. return h('div', {
  20062. class: 'vxe-radio-group'
  20063. }, this.$slots.default);
  20064. },
  20065. methods: {
  20066. handleChecked: function handleChecked(params, evnt) {
  20067. this.$emit('input', params.label);
  20068. this.$emit('change', params, evnt);
  20069. }
  20070. }
  20071. });
  20072. // CONCATENATED MODULE: ./packages/radio/index.js
  20073. src_radio.install = function (Vue) {
  20074. Vue.component(src_radio.name, src_radio);
  20075. Vue.component(src_button.name, src_button);
  20076. Vue.component(radio_src_group.name, radio_src_group);
  20077. };
  20078. var Radio = src_radio;
  20079. /* harmony default export */ var packages_radio = (src_radio);
  20080. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
  20081. var es_string_pad_start = __webpack_require__("4d90");
  20082. // CONCATENATED MODULE: ./packages/input/src/input.js
  20083. var input_browse = DomTools.browse;
  20084. var input_wheelName = input_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  20085. var yearSize = 20;
  20086. var monthSize = 20;
  20087. function toStringTime(str) {
  20088. if (str) {
  20089. var rest = new Date();
  20090. var h, m, s;
  20091. if (ctor_amd_xe_utils_default.a.isDate(str)) {
  20092. h = str.getHours();
  20093. m = str.getMinutes();
  20094. s = str.getSeconds();
  20095. } else {
  20096. str = ctor_amd_xe_utils_default.a.toString(str);
  20097. var parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/);
  20098. if (parses) {
  20099. h = parses[1];
  20100. m = parses[3];
  20101. s = parses[5];
  20102. }
  20103. }
  20104. rest.setHours(h || 0);
  20105. rest.setMinutes(m || 0);
  20106. rest.setSeconds(s || 0);
  20107. return rest;
  20108. }
  20109. return new Date('');
  20110. }
  20111. function toFloatValueFixed(inputValue, digitsValue) {
  20112. if (/^-/.test('' + inputValue)) {
  20113. return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.ceil(inputValue, digitsValue), digitsValue);
  20114. }
  20115. return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(inputValue, digitsValue), digitsValue);
  20116. }
  20117. function renderDefaultInput(h, _vm) {
  20118. var inpAttrs = _vm.inpAttrs,
  20119. inpEvents = _vm.inpEvents,
  20120. value = _vm.value;
  20121. return h('input', {
  20122. ref: 'input',
  20123. class: 'vxe-input--inner',
  20124. domProps: {
  20125. value: value
  20126. },
  20127. attrs: inpAttrs,
  20128. on: inpEvents
  20129. });
  20130. }
  20131. function renderDateInput(h, _vm) {
  20132. var inpAttrs = _vm.inpAttrs,
  20133. inpEvents = _vm.inpEvents,
  20134. inputValue = _vm.inputValue;
  20135. return h('input', {
  20136. ref: 'input',
  20137. class: 'vxe-input--inner',
  20138. domProps: {
  20139. value: inputValue
  20140. },
  20141. attrs: inpAttrs,
  20142. on: inpEvents
  20143. });
  20144. }
  20145. function renderDateLabel(h, _vm, item, label) {
  20146. var festivalMethod = _vm.festivalMethod;
  20147. if (festivalMethod) {
  20148. var festivalRest = festivalMethod(_objectSpread2({
  20149. $input: _vm,
  20150. type: _vm.datePanelType,
  20151. viewType: _vm.datePanelType
  20152. }, item));
  20153. var festivalItem = festivalRest ? ctor_amd_xe_utils_default.a.isString(festivalRest) ? {
  20154. label: festivalRest
  20155. } : festivalRest : {};
  20156. var extraItem = festivalItem.extra ? ctor_amd_xe_utils_default.a.isString(festivalItem.extra) ? {
  20157. label: festivalItem.extra
  20158. } : festivalItem.extra : null;
  20159. var labels = [h('span', {
  20160. class: ['vxe-input--date-label', {
  20161. 'is-notice': festivalItem.notice
  20162. }]
  20163. }, extraItem && extraItem.label ? [h('span', label), h('span', {
  20164. class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
  20165. style: extraItem.style
  20166. }, ctor_amd_xe_utils_default.a.toString(extraItem.label))] : label)];
  20167. var festivalLabel = festivalItem.label;
  20168. if (festivalLabel) {
  20169. // 默认最多支持3个节日重叠
  20170. var festivalLabels = ctor_amd_xe_utils_default.a.toString(festivalLabel).split(',');
  20171. labels.push(h('span', {
  20172. class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
  20173. style: festivalItem.style
  20174. }, [festivalLabels.length > 1 ? h('span', {
  20175. class: ['vxe-input--date-festival--overlap', "overlap--".concat(festivalLabels.length)]
  20176. }, festivalLabels.map(function (label) {
  20177. return h('span', label.substring(0, 3));
  20178. })) : h('span', {
  20179. class: 'vxe-input--date-festival--label'
  20180. }, festivalLabels[0].substring(0, 3))]));
  20181. }
  20182. return labels;
  20183. }
  20184. return label;
  20185. }
  20186. function isDateDisabled(_vm, item) {
  20187. var disabledMethod = _vm.disabledMethod || _vm.dateOpts.disabledMethod;
  20188. return disabledMethod && disabledMethod({
  20189. $input: _vm,
  20190. type: _vm.datePanelType,
  20191. viewType: _vm.datePanelType,
  20192. date: item.date
  20193. });
  20194. }
  20195. function renderDateDayTable(h, _vm) {
  20196. var datePanelType = _vm.datePanelType,
  20197. dateValue = _vm.dateValue,
  20198. datePanelValue = _vm.datePanelValue,
  20199. dateHeaders = _vm.dateHeaders,
  20200. dayDatas = _vm.dayDatas;
  20201. var matchFormat = 'yyyy-MM-dd';
  20202. return [h('table', {
  20203. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20204. attrs: {
  20205. cellspacing: 0,
  20206. cellpadding: 0,
  20207. border: 0
  20208. }
  20209. }, [h('thead', [h('tr', dateHeaders.map(function (item) {
  20210. return h('th', item.label);
  20211. }))]), h('tbody', dayDatas.map(function (rows) {
  20212. return h('tr', rows.map(function (item) {
  20213. return h('td', {
  20214. class: {
  20215. 'is--prev': item.isPrev,
  20216. 'is--current': item.isCurrent,
  20217. 'is--now': item.isNow,
  20218. 'is--next': item.isNext,
  20219. 'is--disabled': isDateDisabled(_vm, item),
  20220. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20221. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20222. },
  20223. on: {
  20224. click: function click() {
  20225. return _vm.dateSelectEvent(item);
  20226. },
  20227. mouseenter: function mouseenter() {
  20228. return _vm.dateMouseenterEvent(item);
  20229. }
  20230. }
  20231. }, renderDateLabel(h, _vm, item, item.label));
  20232. }));
  20233. }))])];
  20234. }
  20235. function renderDateWeekTable(h, _vm) {
  20236. var datePanelType = _vm.datePanelType,
  20237. dateValue = _vm.dateValue,
  20238. datePanelValue = _vm.datePanelValue,
  20239. weekHeaders = _vm.weekHeaders,
  20240. weekDates = _vm.weekDates;
  20241. var matchFormat = 'yyyy-MM-dd';
  20242. return [h('table', {
  20243. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20244. attrs: {
  20245. cellspacing: 0,
  20246. cellpadding: 0,
  20247. border: 0
  20248. }
  20249. }, [h('thead', [h('tr', weekHeaders.map(function (item) {
  20250. return h('th', item.label);
  20251. }))]), h('tbody', weekDates.map(function (rows) {
  20252. var isSelected = rows.some(function (item) {
  20253. return ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
  20254. });
  20255. var isHover = rows.some(function (item) {
  20256. return ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat);
  20257. });
  20258. return h('tr', rows.map(function (item) {
  20259. return h('td', {
  20260. class: {
  20261. 'is--prev': item.isPrev,
  20262. 'is--current': item.isCurrent,
  20263. 'is--now': item.isNow,
  20264. 'is--next': item.isNext,
  20265. 'is--disabled': isDateDisabled(_vm, item),
  20266. 'is--selected': isSelected,
  20267. 'is--hover': isHover
  20268. },
  20269. on: {
  20270. click: function click() {
  20271. return _vm.dateSelectEvent(item);
  20272. },
  20273. mouseenter: function mouseenter() {
  20274. return _vm.dateMouseenterEvent(item);
  20275. }
  20276. }
  20277. }, renderDateLabel(h, _vm, item, item.label));
  20278. }));
  20279. }))])];
  20280. }
  20281. function renderDateMonthTable(h, _vm) {
  20282. var dateValue = _vm.dateValue,
  20283. datePanelType = _vm.datePanelType,
  20284. monthDatas = _vm.monthDatas,
  20285. datePanelValue = _vm.datePanelValue;
  20286. var matchFormat = 'yyyy-MM';
  20287. return [h('table', {
  20288. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20289. attrs: {
  20290. cellspacing: 0,
  20291. cellpadding: 0,
  20292. border: 0
  20293. }
  20294. }, [h('tbody', monthDatas.map(function (rows) {
  20295. return h('tr', rows.map(function (item) {
  20296. return h('td', {
  20297. class: {
  20298. 'is--prev': item.isPrev,
  20299. 'is--current': item.isCurrent,
  20300. 'is--now': item.isNow,
  20301. 'is--next': item.isNext,
  20302. 'is--disabled': isDateDisabled(_vm, item),
  20303. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20304. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20305. },
  20306. on: {
  20307. click: function click() {
  20308. return _vm.dateSelectEvent(item);
  20309. },
  20310. mouseenter: function mouseenter() {
  20311. return _vm.dateMouseenterEvent(item);
  20312. }
  20313. }
  20314. }, renderDateLabel(h, _vm, item, conf.i18n("vxe.input.date.months.m".concat(item.month))));
  20315. }));
  20316. }))])];
  20317. }
  20318. function renderDateYearTable(h, _vm) {
  20319. var dateValue = _vm.dateValue,
  20320. datePanelType = _vm.datePanelType,
  20321. yearDatas = _vm.yearDatas,
  20322. datePanelValue = _vm.datePanelValue;
  20323. var matchFormat = 'yyyy';
  20324. return [h('table', {
  20325. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20326. attrs: {
  20327. cellspacing: 0,
  20328. cellpadding: 0,
  20329. border: 0
  20330. }
  20331. }, [h('tbody', yearDatas.map(function (rows) {
  20332. return h('tr', rows.map(function (item) {
  20333. return h('td', {
  20334. class: {
  20335. 'is--disabled': isDateDisabled(_vm, item),
  20336. 'is--current': item.isCurrent,
  20337. 'is--now': item.isNow,
  20338. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20339. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20340. },
  20341. on: {
  20342. click: function click() {
  20343. return _vm.dateSelectEvent(item);
  20344. },
  20345. mouseenter: function mouseenter() {
  20346. return _vm.dateMouseenterEvent(item);
  20347. }
  20348. }
  20349. }, renderDateLabel(h, _vm, item, item.year));
  20350. }));
  20351. }))])];
  20352. }
  20353. function renderDateTable(h, _vm) {
  20354. var datePanelType = _vm.datePanelType;
  20355. switch (datePanelType) {
  20356. case 'week':
  20357. return renderDateWeekTable(h, _vm);
  20358. case 'month':
  20359. return renderDateMonthTable(h, _vm);
  20360. case 'year':
  20361. return renderDateYearTable(h, _vm);
  20362. }
  20363. return renderDateDayTable(h, _vm);
  20364. }
  20365. function renderDatePanel(h, _vm) {
  20366. var datePanelType = _vm.datePanelType,
  20367. selectDatePanelLabel = _vm.selectDatePanelLabel,
  20368. isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
  20369. isDisabledNextDateBtn = _vm.isDisabledNextDateBtn;
  20370. return [h('div', {
  20371. class: 'vxe-input--date-picker-header'
  20372. }, [h('div', {
  20373. class: 'vxe-input--date-picker-type-wrapper'
  20374. }, [datePanelType === 'year' ? h('span', {
  20375. class: 'vxe-input--date-picker-label'
  20376. }, selectDatePanelLabel) : h('span', {
  20377. class: 'vxe-input--date-picker-btn',
  20378. on: {
  20379. click: _vm.dateToggleTypeEvent
  20380. }
  20381. }, selectDatePanelLabel)]), h('div', {
  20382. class: 'vxe-input--date-picker-btn-wrapper'
  20383. }, [h('span', {
  20384. class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
  20385. 'is--disabled': isDisabledPrevDateBtn
  20386. }],
  20387. on: {
  20388. click: _vm.datePrevEvent
  20389. }
  20390. }, [h('i', {
  20391. class: 'vxe-icon--caret-left'
  20392. })]), h('span', {
  20393. class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
  20394. on: {
  20395. click: _vm.dateTodayMonthEvent
  20396. }
  20397. }, [h('i', {
  20398. class: 'vxe-icon--dot'
  20399. })]), h('span', {
  20400. class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
  20401. 'is--disabled': isDisabledNextDateBtn
  20402. }],
  20403. on: {
  20404. click: _vm.dateNextEvent
  20405. }
  20406. }, [h('i', {
  20407. class: 'vxe-icon--caret-right'
  20408. })])])]), h('div', {
  20409. class: 'vxe-input--date-picker-body'
  20410. }, renderDateTable(h, _vm))];
  20411. }
  20412. function renderTimePanel(h, _vm) {
  20413. var dateTimeLabel = _vm.dateTimeLabel,
  20414. datetimePanelValue = _vm.datetimePanelValue,
  20415. hourList = _vm.hourList,
  20416. minuteList = _vm.minuteList,
  20417. secondList = _vm.secondList;
  20418. return [h('div', {
  20419. class: 'vxe-input--time-picker-header'
  20420. }, [h('span', {
  20421. class: 'vxe-input--time-picker-title'
  20422. }, dateTimeLabel), h('button', {
  20423. class: 'vxe-input--time-picker-confirm',
  20424. attrs: {
  20425. type: 'button'
  20426. },
  20427. on: {
  20428. click: _vm.dateConfirmEvent
  20429. }
  20430. }, conf.i18n('vxe.button.confirm'))]), h('div', {
  20431. ref: 'timeBody',
  20432. class: 'vxe-input--time-picker-body'
  20433. }, [h('ul', {
  20434. class: 'vxe-input--time-picker-hour-list'
  20435. }, hourList.map(function (item, index) {
  20436. return h('li', {
  20437. key: index,
  20438. class: {
  20439. 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
  20440. },
  20441. on: {
  20442. click: function click(evnt) {
  20443. return _vm.dateHourEvent(evnt, item);
  20444. }
  20445. }
  20446. }, item.label);
  20447. })), h('ul', {
  20448. class: 'vxe-input--time-picker-minute-list'
  20449. }, minuteList.map(function (item, index) {
  20450. return h('li', {
  20451. key: index,
  20452. class: {
  20453. 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
  20454. },
  20455. on: {
  20456. click: function click(evnt) {
  20457. return _vm.dateMinuteEvent(evnt, item);
  20458. }
  20459. }
  20460. }, item.label);
  20461. })), h('ul', {
  20462. class: 'vxe-input--time-picker-second-list'
  20463. }, secondList.map(function (item, index) {
  20464. return h('li', {
  20465. key: index,
  20466. class: {
  20467. 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
  20468. },
  20469. on: {
  20470. click: function click(evnt) {
  20471. return _vm.dateSecondEvent(evnt, item);
  20472. }
  20473. }
  20474. }, item.label);
  20475. }))])];
  20476. }
  20477. function renderPanel(h, _vm) {
  20478. var type = _vm.type,
  20479. vSize = _vm.vSize,
  20480. isDatePicker = _vm.isDatePicker,
  20481. transfer = _vm.transfer,
  20482. animatVisible = _vm.animatVisible,
  20483. visiblePanel = _vm.visiblePanel,
  20484. panelPlacement = _vm.panelPlacement,
  20485. panelStyle = _vm.panelStyle;
  20486. var renders = [];
  20487. if (isDatePicker) {
  20488. var _ref;
  20489. if (type === 'datetime') {
  20490. renders.push(h('div', {
  20491. class: 'vxe-input--panel-layout-wrapper'
  20492. }, [h('div', {
  20493. class: 'vxe-input--panel-left-wrapper'
  20494. }, renderDatePanel(h, _vm)), h('div', {
  20495. class: 'vxe-input--panel-right-wrapper'
  20496. }, renderTimePanel(h, _vm))]));
  20497. } else if (type === 'time') {
  20498. renders.push(h('div', {
  20499. class: 'vxe-input--panel-wrapper'
  20500. }, renderTimePanel(h, _vm)));
  20501. } else {
  20502. renders.push(h('div', {
  20503. class: 'vxe-input--panel-wrapper'
  20504. }, renderDatePanel(h, _vm)));
  20505. }
  20506. return h('div', {
  20507. ref: 'panel',
  20508. class: ['vxe-table--ignore-clear vxe-input--panel', "type--".concat(type), (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--transfer', transfer), _defineProperty(_ref, 'animat--leave', animatVisible), _defineProperty(_ref, 'animat--enter', visiblePanel), _ref)],
  20509. attrs: {
  20510. 'data-placement': panelPlacement
  20511. },
  20512. style: panelStyle
  20513. }, renders);
  20514. }
  20515. return null;
  20516. }
  20517. function renderNumberIcon(h, _vm) {
  20518. return h('span', {
  20519. class: 'vxe-input--number-suffix'
  20520. }, [h('span', {
  20521. class: 'vxe-input--number-prev is--prev',
  20522. on: {
  20523. mousedown: _vm.numberMousedownEvent,
  20524. mouseup: _vm.numberStopDown,
  20525. mouseleave: _vm.numberStopDown
  20526. }
  20527. }, [h('i', {
  20528. class: ['vxe-input--number-prev-icon', conf.icon.INPUT_PREV_NUM]
  20529. })]), h('span', {
  20530. class: 'vxe-input--number-next is--next',
  20531. on: {
  20532. mousedown: _vm.numberMousedownEvent,
  20533. mouseup: _vm.numberStopDown,
  20534. mouseleave: _vm.numberStopDown
  20535. }
  20536. }, [h('i', {
  20537. class: ['vxe-input--number-next-icon', conf.icon.INPUT_NEXT_NUM]
  20538. })])]);
  20539. }
  20540. function renderDatePickerIcon(h, _vm) {
  20541. return h('span', {
  20542. class: 'vxe-input--date-picker-suffix',
  20543. on: {
  20544. click: _vm.datePickerOpenEvent
  20545. }
  20546. }, [h('i', {
  20547. class: ['vxe-input--date-picker-icon', conf.icon.INPUT_DATE]
  20548. })]);
  20549. }
  20550. function renderSearchIcon(h, _vm) {
  20551. return h('span', {
  20552. class: 'vxe-input--search-suffix',
  20553. on: {
  20554. click: _vm.searchEvent
  20555. }
  20556. }, [h('i', {
  20557. class: ['vxe-input--search-icon', conf.icon.INPUT_SEARCH]
  20558. })]);
  20559. }
  20560. function renderPasswordIcon(h, _vm) {
  20561. var showPwd = _vm.showPwd;
  20562. return h('span', {
  20563. class: 'vxe-input--password-suffix',
  20564. on: {
  20565. click: _vm.passwordToggleEvent
  20566. }
  20567. }, [h('i', {
  20568. class: ['vxe-input--password-icon', showPwd ? conf.icon.INPUT_SHOW_PWD : conf.icon.INPUT_PWD]
  20569. })]);
  20570. }
  20571. function rendePrefixIcon(h, _vm) {
  20572. var $scopedSlots = _vm.$scopedSlots,
  20573. prefixIcon = _vm.prefixIcon;
  20574. var icons = [];
  20575. if ($scopedSlots.prefix) {
  20576. icons.push(h('span', {
  20577. class: 'vxe-input--prefix-icon'
  20578. }, $scopedSlots.prefix.call(this, {}, h)));
  20579. } else if (prefixIcon) {
  20580. icons.push(h('i', {
  20581. class: ['vxe-input--prefix-icon', prefixIcon]
  20582. }));
  20583. }
  20584. return icons.length ? h('span', {
  20585. class: 'vxe-input--prefix',
  20586. on: {
  20587. click: _vm.clickPrefixEvent
  20588. }
  20589. }, icons) : null;
  20590. }
  20591. function renderSuffixIcon(h, _vm) {
  20592. var $scopedSlots = _vm.$scopedSlots,
  20593. value = _vm.value,
  20594. isClearable = _vm.isClearable,
  20595. disabled = _vm.disabled,
  20596. suffixIcon = _vm.suffixIcon;
  20597. var icons = [];
  20598. if ($scopedSlots.suffix) {
  20599. icons.push(h('span', {
  20600. class: 'vxe-input--suffix-icon'
  20601. }, $scopedSlots.suffix.call(this, {}, h)));
  20602. } else if (suffixIcon) {
  20603. icons.push(h('i', {
  20604. class: ['vxe-input--suffix-icon', suffixIcon]
  20605. }));
  20606. }
  20607. if (isClearable) {
  20608. icons.push(h('i', {
  20609. class: ['vxe-input--clear-icon', conf.icon.INPUT_CLEAR]
  20610. }));
  20611. }
  20612. return icons.length ? h('span', {
  20613. class: ['vxe-input--suffix', {
  20614. 'is--clear': isClearable && !disabled && !(value === '' || ctor_amd_xe_utils_default.a.eqNull(value))
  20615. }],
  20616. on: {
  20617. click: _vm.clickSuffixEvent
  20618. }
  20619. }, icons) : null;
  20620. }
  20621. function renderExtraSuffixIcon(h, _vm) {
  20622. var controls = _vm.controls,
  20623. isPassword = _vm.isPassword,
  20624. isNumber = _vm.isNumber,
  20625. isDatePicker = _vm.isDatePicker,
  20626. isSearch = _vm.isSearch;
  20627. var icons;
  20628. if (isPassword) {
  20629. icons = renderPasswordIcon(h, _vm);
  20630. } else if (isNumber) {
  20631. if (controls) {
  20632. icons = renderNumberIcon(h, _vm);
  20633. }
  20634. } else if (isDatePicker) {
  20635. icons = renderDatePickerIcon(h, _vm);
  20636. } else if (isSearch) {
  20637. icons = renderSearchIcon(h, _vm);
  20638. }
  20639. return icons ? h('span', {
  20640. class: 'vxe-input--extra-suffix'
  20641. }, [icons]) : null;
  20642. }
  20643. /* harmony default export */ var input = ({
  20644. name: 'VxeInput',
  20645. props: {
  20646. value: [String, Number, Date],
  20647. name: String,
  20648. type: {
  20649. type: String,
  20650. default: 'text'
  20651. },
  20652. clearable: {
  20653. type: Boolean,
  20654. default: function _default() {
  20655. return conf.input.clearable;
  20656. }
  20657. },
  20658. readonly: Boolean,
  20659. disabled: Boolean,
  20660. placeholder: String,
  20661. maxlength: [String, Number],
  20662. autocomplete: {
  20663. type: String,
  20664. default: 'off'
  20665. },
  20666. align: String,
  20667. form: String,
  20668. size: {
  20669. type: String,
  20670. default: function _default() {
  20671. return conf.input.size || conf.size;
  20672. }
  20673. },
  20674. // number、integer、float
  20675. min: {
  20676. type: [String, Number],
  20677. default: null
  20678. },
  20679. max: {
  20680. type: [String, Number],
  20681. default: null
  20682. },
  20683. step: [String, Number],
  20684. // number、integer、float、password
  20685. controls: {
  20686. type: Boolean,
  20687. default: function _default() {
  20688. return conf.input.controls;
  20689. }
  20690. },
  20691. // float
  20692. digits: {
  20693. type: [String, Number],
  20694. default: function _default() {
  20695. return conf.input.digits;
  20696. }
  20697. },
  20698. // date、week、month、year
  20699. dateConfig: Object,
  20700. minDate: {
  20701. type: [String, Number, Date],
  20702. default: function _default() {
  20703. return conf.input.minDate;
  20704. }
  20705. },
  20706. maxDate: {
  20707. type: [String, Number, Date],
  20708. default: function _default() {
  20709. return conf.input.maxDate;
  20710. }
  20711. },
  20712. // 已废弃 startWeek,被 startDay 替换
  20713. startWeek: Number,
  20714. startDay: {
  20715. type: [String, Number],
  20716. default: function _default() {
  20717. return conf.input.startDay;
  20718. }
  20719. },
  20720. labelFormat: {
  20721. type: String,
  20722. default: function _default() {
  20723. return conf.input.labelFormat;
  20724. }
  20725. },
  20726. parseFormat: {
  20727. type: String,
  20728. default: function _default() {
  20729. return conf.input.parseFormat;
  20730. }
  20731. },
  20732. valueFormat: {
  20733. type: String,
  20734. default: function _default() {
  20735. return conf.input.valueFormat;
  20736. }
  20737. },
  20738. editable: {
  20739. type: Boolean,
  20740. default: true
  20741. },
  20742. festivalMethod: {
  20743. type: Function,
  20744. default: function _default() {
  20745. return conf.input.festivalMethod;
  20746. }
  20747. },
  20748. disabledMethod: {
  20749. type: Function,
  20750. default: function _default() {
  20751. return conf.input.disabledMethod;
  20752. }
  20753. },
  20754. prefixIcon: String,
  20755. suffixIcon: String,
  20756. placement: String,
  20757. transfer: {
  20758. type: Boolean,
  20759. default: function _default() {
  20760. return conf.input.transfer;
  20761. }
  20762. }
  20763. },
  20764. data: function data() {
  20765. return {
  20766. panelIndex: 0,
  20767. showPwd: false,
  20768. visiblePanel: false,
  20769. animatVisible: false,
  20770. panelStyle: null,
  20771. panelPlacement: null,
  20772. isActivated: false,
  20773. inputValue: '',
  20774. datetimePanelValue: null,
  20775. datePanelValue: null,
  20776. datePanelLabel: '',
  20777. datePanelType: 'day',
  20778. selectMonth: null,
  20779. currentDate: null
  20780. };
  20781. },
  20782. computed: {
  20783. vSize: function vSize() {
  20784. return this.size || this.$parent.size || this.$parent.vSize;
  20785. },
  20786. isNumber: function isNumber() {
  20787. return ['number', 'integer', 'float'].indexOf(this.type) > -1;
  20788. },
  20789. isDatePicker: function isDatePicker() {
  20790. return this.hasTime || ['date', 'week', 'month', 'year'].indexOf(this.type) > -1;
  20791. },
  20792. hasTime: function hasTime() {
  20793. var type = this.type;
  20794. return type === 'time' || type === 'datetime';
  20795. },
  20796. isPassword: function isPassword() {
  20797. return this.type === 'password';
  20798. },
  20799. isSearch: function isSearch() {
  20800. return this.type === 'search';
  20801. },
  20802. stepValue: function stepValue() {
  20803. var type = this.type,
  20804. step = this.step;
  20805. if (type === 'integer') {
  20806. return ctor_amd_xe_utils_default.a.toInteger(step) || 1;
  20807. } else if (type === 'float') {
  20808. return ctor_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
  20809. }
  20810. return ctor_amd_xe_utils_default.a.toNumber(step) || 1;
  20811. },
  20812. digitsValue: function digitsValue() {
  20813. return ctor_amd_xe_utils_default.a.toInteger(this.digits) || 1;
  20814. },
  20815. isClearable: function isClearable() {
  20816. return this.clearable && (this.isPassword || this.isNumber || this.isDatePicker || this.type === 'text' || this.type === 'search');
  20817. },
  20818. isDisabledPrevDateBtn: function isDisabledPrevDateBtn() {
  20819. var selectMonth = this.selectMonth,
  20820. dateMinTime = this.dateMinTime;
  20821. if (selectMonth) {
  20822. return selectMonth <= dateMinTime;
  20823. }
  20824. return false;
  20825. },
  20826. isDisabledNextDateBtn: function isDisabledNextDateBtn() {
  20827. var selectMonth = this.selectMonth,
  20828. dateMaxTime = this.dateMaxTime;
  20829. if (selectMonth) {
  20830. return selectMonth >= dateMaxTime;
  20831. }
  20832. return false;
  20833. },
  20834. dateMinTime: function dateMinTime() {
  20835. return this.minDate ? ctor_amd_xe_utils_default.a.toStringDate(this.minDate) : null;
  20836. },
  20837. dateMaxTime: function dateMaxTime() {
  20838. return this.maxDate ? ctor_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
  20839. },
  20840. dateValue: function dateValue() {
  20841. var value = this.value,
  20842. isDatePicker = this.isDatePicker,
  20843. type = this.type,
  20844. dateValueFormat = this.dateValueFormat;
  20845. var val = null;
  20846. if (value && isDatePicker) {
  20847. var date;
  20848. if (type === 'time') {
  20849. date = toStringTime(value);
  20850. } else {
  20851. date = ctor_amd_xe_utils_default.a.toStringDate(value, dateValueFormat);
  20852. }
  20853. if (ctor_amd_xe_utils_default.a.isValidDate(date)) {
  20854. val = date;
  20855. }
  20856. }
  20857. return val;
  20858. },
  20859. dateTimeLabel: function dateTimeLabel() {
  20860. var datetimePanelValue = this.datetimePanelValue;
  20861. if (datetimePanelValue) {
  20862. return ctor_amd_xe_utils_default.a.toDateString(datetimePanelValue, 'HH:mm:ss');
  20863. }
  20864. return '';
  20865. },
  20866. hmsTime: function hmsTime() {
  20867. var dateValue = this.dateValue;
  20868. return dateValue && this.hasTime ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
  20869. },
  20870. dateLabelFormat: function dateLabelFormat() {
  20871. if (this.isDatePicker) {
  20872. return this.labelFormat || this.dateOpts.labelFormat || conf.i18n("vxe.input.date.labelFormat.".concat(this.type));
  20873. }
  20874. return null;
  20875. },
  20876. dateValueFormat: function dateValueFormat() {
  20877. var type = this.type;
  20878. return type === 'time' ? 'HH:mm:ss' : this.valueFormat || this.dateOpts.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
  20879. },
  20880. selectDatePanelLabel: function selectDatePanelLabel() {
  20881. if (this.isDatePicker) {
  20882. var datePanelType = this.datePanelType,
  20883. selectMonth = this.selectMonth,
  20884. yearList = this.yearList;
  20885. var year = '';
  20886. var month;
  20887. if (selectMonth) {
  20888. year = selectMonth.getFullYear();
  20889. month = selectMonth.getMonth() + 1;
  20890. }
  20891. if (datePanelType === 'month') {
  20892. return conf.i18n('vxe.input.date.monthLabel', [year]);
  20893. } else if (datePanelType === 'year') {
  20894. return yearList.length ? "".concat(yearList[0].year, " - ").concat(yearList[yearList.length - 1].year) : '';
  20895. }
  20896. return conf.i18n('vxe.input.date.dayLabel', [year, month ? conf.i18n("vxe.input.date.m".concat(month)) : '-']);
  20897. }
  20898. return '';
  20899. },
  20900. weekDatas: function weekDatas() {
  20901. var weeks = [];
  20902. if (this.isDatePicker) {
  20903. var startDay = this.startDay,
  20904. startWeek = this.startWeek;
  20905. var sWeek = ctor_amd_xe_utils_default.a.toNumber(ctor_amd_xe_utils_default.a.isNumber(startDay) || ctor_amd_xe_utils_default.a.isString(startDay) ? startDay : ctor_amd_xe_utils_default.a.isNumber(startWeek) ? startWeek : this.dateOpts.startWeek);
  20906. weeks.push(sWeek);
  20907. for (var index = 0; index < 6; index++) {
  20908. if (sWeek >= 6) {
  20909. sWeek = 0;
  20910. } else {
  20911. sWeek++;
  20912. }
  20913. weeks.push(sWeek);
  20914. }
  20915. }
  20916. return weeks;
  20917. },
  20918. dateHeaders: function dateHeaders() {
  20919. if (this.isDatePicker) {
  20920. return this.weekDatas.map(function (day) {
  20921. return {
  20922. value: day,
  20923. label: conf.i18n("vxe.input.date.weeks.w".concat(day))
  20924. };
  20925. });
  20926. }
  20927. return [];
  20928. },
  20929. weekHeaders: function weekHeaders() {
  20930. if (this.isDatePicker) {
  20931. return [{
  20932. label: conf.i18n('vxe.input.date.weeks.w')
  20933. }].concat(this.dateHeaders);
  20934. }
  20935. return [];
  20936. },
  20937. yearList: function yearList() {
  20938. var selectMonth = this.selectMonth,
  20939. currentDate = this.currentDate;
  20940. var months = [];
  20941. if (selectMonth && currentDate) {
  20942. var currFullYear = currentDate.getFullYear();
  20943. var startYear = new Date(('' + selectMonth.getFullYear()).replace(/\d{1}$/, '0'), 0, 1);
  20944. for (var index = -10; index < yearSize - 10; index++) {
  20945. var date = ctor_amd_xe_utils_default.a.getWhatYear(startYear, index, 'first');
  20946. var itemFullYear = date.getFullYear();
  20947. months.push({
  20948. date: date,
  20949. isCurrent: true,
  20950. isNow: currFullYear === itemFullYear,
  20951. year: itemFullYear
  20952. });
  20953. }
  20954. }
  20955. return months;
  20956. },
  20957. yearDatas: function yearDatas() {
  20958. return ctor_amd_xe_utils_default.a.chunk(this.yearList, 4);
  20959. },
  20960. monthList: function monthList() {
  20961. var selectMonth = this.selectMonth,
  20962. currentDate = this.currentDate;
  20963. var months = [];
  20964. if (selectMonth && currentDate) {
  20965. var currFullYear = currentDate.getFullYear();
  20966. var currMonth = currentDate.getMonth();
  20967. var selFullYear = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
  20968. for (var index = -4; index < monthSize - 4; index++) {
  20969. var date = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, index);
  20970. var itemFullYear = date.getFullYear();
  20971. var itemMonth = date.getMonth();
  20972. var isPrev = itemFullYear < selFullYear;
  20973. months.push({
  20974. date: date,
  20975. isPrev: isPrev,
  20976. isCurrent: itemFullYear === selFullYear,
  20977. isNow: itemFullYear === currFullYear && itemMonth === currMonth,
  20978. isNext: !isPrev && itemFullYear > selFullYear,
  20979. month: itemMonth
  20980. });
  20981. }
  20982. }
  20983. return months;
  20984. },
  20985. monthDatas: function monthDatas() {
  20986. return ctor_amd_xe_utils_default.a.chunk(this.monthList, 4);
  20987. },
  20988. dayList: function dayList() {
  20989. var weekDatas = this.weekDatas,
  20990. selectMonth = this.selectMonth,
  20991. currentDate = this.currentDate,
  20992. hmsTime = this.hmsTime;
  20993. var days = [];
  20994. if (selectMonth && currentDate) {
  20995. var currFullYear = currentDate.getFullYear();
  20996. var currMonth = currentDate.getMonth();
  20997. var currDate = currentDate.getDate();
  20998. var selFullYear = selectMonth.getFullYear();
  20999. var selMonth = selectMonth.getMonth();
  21000. var selDay = selectMonth.getDay();
  21001. var prevOffsetDate = -weekDatas.indexOf(selDay);
  21002. var startDate = new Date(ctor_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
  21003. for (var index = 0; index < 42; index++) {
  21004. var date = ctor_amd_xe_utils_default.a.getWhatDay(startDate, index);
  21005. var itemFullYear = date.getFullYear();
  21006. var itemMonth = date.getMonth();
  21007. var itemDate = date.getDate();
  21008. var isPrev = date < selectMonth;
  21009. days.push({
  21010. date: date,
  21011. isPrev: isPrev,
  21012. isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
  21013. isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
  21014. isNext: !isPrev && selMonth !== itemMonth,
  21015. label: itemDate
  21016. });
  21017. }
  21018. }
  21019. return days;
  21020. },
  21021. dayDatas: function dayDatas() {
  21022. return ctor_amd_xe_utils_default.a.chunk(this.dayList, 7);
  21023. },
  21024. weekDates: function weekDates() {
  21025. return this.dayDatas.map(function (list) {
  21026. var firstItem = list[0];
  21027. var item = {
  21028. date: firstItem.date,
  21029. isWeekNumber: true,
  21030. isPrev: false,
  21031. isCurrent: false,
  21032. isNow: false,
  21033. isNext: false,
  21034. label: ctor_amd_xe_utils_default.a.getYearWeek(firstItem.date)
  21035. };
  21036. return [item].concat(list);
  21037. });
  21038. },
  21039. dateOpts: function dateOpts() {
  21040. return Object.assign({}, this.dateConfig, conf.input.dateConfig);
  21041. },
  21042. hourList: function hourList() {
  21043. var list = [];
  21044. if (this.hasTime) {
  21045. for (var index = 0; index < 24; index++) {
  21046. list.push({
  21047. value: index,
  21048. label: ('' + index).padStart(2, 0)
  21049. });
  21050. }
  21051. }
  21052. return list;
  21053. },
  21054. minuteList: function minuteList() {
  21055. var list = [];
  21056. if (this.hasTime) {
  21057. for (var index = 0; index < 60; index++) {
  21058. list.push({
  21059. value: index,
  21060. label: ('' + index).padStart(2, 0)
  21061. });
  21062. }
  21063. }
  21064. return list;
  21065. },
  21066. secondList: function secondList() {
  21067. return this.minuteList;
  21068. },
  21069. inpAttrs: function inpAttrs() {
  21070. var isDatePicker = this.isDatePicker,
  21071. isNumber = this.isNumber,
  21072. isPassword = this.isPassword,
  21073. type = this.type,
  21074. name = this.name,
  21075. placeholder = this.placeholder,
  21076. readonly = this.readonly,
  21077. disabled = this.disabled,
  21078. maxlength = this.maxlength,
  21079. form = this.form,
  21080. autocomplete = this.autocomplete,
  21081. showPwd = this.showPwd,
  21082. editable = this.editable;
  21083. var inputType = type;
  21084. if (isDatePicker || isNumber || isPassword && showPwd || type === 'number') {
  21085. inputType = 'text';
  21086. }
  21087. var attrs = {
  21088. name: name,
  21089. form: form,
  21090. type: inputType,
  21091. placeholder: placeholder,
  21092. maxlength: isNumber && !ctor_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength,
  21093. // 数值最大长度限制 16 位,包含小数
  21094. readonly: readonly || type === 'week' || !editable || this.dateOpts.editable === false,
  21095. disabled: disabled,
  21096. autocomplete: autocomplete
  21097. };
  21098. if (placeholder) {
  21099. attrs.placeholder = UtilTools.getFuncText(placeholder);
  21100. }
  21101. return attrs;
  21102. },
  21103. inpEvents: function inpEvents() {
  21104. var _this = this;
  21105. var evnts = {};
  21106. ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  21107. if (['change', 'clear', 'prefix-click', 'suffix-click'].indexOf(name) === -1) {
  21108. evnts[name] = _this.triggerEvent;
  21109. }
  21110. });
  21111. if (this.isNumber) {
  21112. evnts.keydown = this.keydownEvent;
  21113. evnts[input_wheelName] = this.mousewheelEvent;
  21114. } else if (this.isDatePicker) {
  21115. evnts.click = this.clickEvent;
  21116. }
  21117. evnts.input = this.inputEvent;
  21118. evnts.focus = this.focusEvent;
  21119. evnts.blur = this.blurEvent;
  21120. return evnts;
  21121. }
  21122. },
  21123. watch: {
  21124. value: function value() {
  21125. this.changeValue();
  21126. },
  21127. dateLabelFormat: function dateLabelFormat() {
  21128. this.dateParseValue(this.datePanelValue);
  21129. this.inputValue = this.datePanelLabel;
  21130. }
  21131. },
  21132. created: function created() {
  21133. this.initValue();
  21134. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  21135. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  21136. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  21137. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  21138. },
  21139. mounted: function mounted() {
  21140. if (this.dateConfig) {
  21141. UtilTools.warn('vxe.error.removeProp', ['date-config']);
  21142. }
  21143. if (this.isDatePicker) {
  21144. if (this.transfer) {
  21145. document.body.appendChild(this.$refs.panel);
  21146. }
  21147. }
  21148. },
  21149. beforeDestroy: function beforeDestroy() {
  21150. var panelElem = this.$refs.panel;
  21151. if (panelElem && panelElem.parentNode) {
  21152. panelElem.parentNode.removeChild(panelElem);
  21153. }
  21154. },
  21155. destroyed: function destroyed() {
  21156. this.numberStopDown();
  21157. GlobalEvent.off(this, 'mousewheel');
  21158. GlobalEvent.off(this, 'mousedown');
  21159. GlobalEvent.off(this, 'keydown');
  21160. GlobalEvent.off(this, 'blur');
  21161. },
  21162. render: function render(h) {
  21163. var _ref2;
  21164. var controls = this.controls,
  21165. isDatePicker = this.isDatePicker,
  21166. visiblePanel = this.visiblePanel,
  21167. isActivated = this.isActivated,
  21168. vSize = this.vSize,
  21169. type = this.type,
  21170. align = this.align,
  21171. readonly = this.readonly,
  21172. disabled = this.disabled;
  21173. var childs = [];
  21174. var prefix = rendePrefixIcon(h, this);
  21175. var suffix = renderSuffixIcon(h, this); // 前缀图标
  21176. if (prefix) {
  21177. childs.push(prefix);
  21178. } // 输入框
  21179. childs.push(isDatePicker ? renderDateInput(h, this) : renderDefaultInput(h, this)); // 后缀图标
  21180. if (suffix) {
  21181. childs.push(suffix);
  21182. } // 特殊功能图标
  21183. childs.push(renderExtraSuffixIcon(h, this)); // 面板容器
  21184. if (isDatePicker) {
  21185. childs.push(renderPanel(h, this));
  21186. }
  21187. return h('div', {
  21188. class: ['vxe-input', "type--".concat(type), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "is--".concat(align), align), _defineProperty(_ref2, 'is--controls', controls), _defineProperty(_ref2, 'is--prefix', !!prefix), _defineProperty(_ref2, 'is--suffix', !!suffix), _defineProperty(_ref2, 'is--readonly', readonly), _defineProperty(_ref2, 'is--visivle', visiblePanel), _defineProperty(_ref2, 'is--disabled', disabled), _defineProperty(_ref2, 'is--active', isActivated), _ref2)]
  21189. }, childs);
  21190. },
  21191. methods: {
  21192. focus: function focus() {
  21193. this.isActivated = true;
  21194. this.$refs.input.focus();
  21195. return this.$nextTick();
  21196. },
  21197. blur: function blur() {
  21198. this.$refs.input.blur();
  21199. this.isActivated = false;
  21200. return this.$nextTick();
  21201. },
  21202. triggerEvent: function triggerEvent(evnt) {
  21203. var $refs = this.$refs,
  21204. value = this.value;
  21205. this.$emit(evnt.type, {
  21206. $panel: $refs.panel,
  21207. value: value,
  21208. $event: evnt
  21209. }, evnt);
  21210. },
  21211. emitUpdate: function emitUpdate(value, evnt) {
  21212. this.$emit('input', value);
  21213. if (ctor_amd_xe_utils_default.a.toString(this.value) !== value) {
  21214. this.$emit('change', {
  21215. value: value,
  21216. $event: evnt
  21217. });
  21218. }
  21219. },
  21220. inputEvent: function inputEvent(evnt) {
  21221. var isDatePicker = this.isDatePicker;
  21222. var value = evnt.target.value;
  21223. this.inputValue = value;
  21224. if (!isDatePicker) {
  21225. this.emitUpdate(value, evnt);
  21226. }
  21227. },
  21228. focusEvent: function focusEvent(evnt) {
  21229. this.isActivated = true;
  21230. this.triggerEvent(evnt);
  21231. },
  21232. blurEvent: function blurEvent(evnt) {
  21233. this.afterCheckValue();
  21234. if (!this.visiblePanel) {
  21235. this.isActivated = false;
  21236. }
  21237. this.triggerEvent(evnt);
  21238. },
  21239. keydownEvent: function keydownEvent(evnt) {
  21240. if (this.isNumber) {
  21241. var isCtrlKey = evnt.ctrlKey;
  21242. var isShiftKey = evnt.shiftKey;
  21243. var isAltKey = evnt.altKey;
  21244. var keyCode = evnt.keyCode;
  21245. if (!isCtrlKey && !isShiftKey && !isAltKey && (keyCode === 32 || keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191)) {
  21246. evnt.preventDefault();
  21247. }
  21248. this.numberKeydownEvent(evnt);
  21249. }
  21250. this.triggerEvent(evnt);
  21251. },
  21252. mousewheelEvent: function mousewheelEvent(evnt) {
  21253. if (this.isNumber && this.controls) {
  21254. if (this.isActivated) {
  21255. var delta = -evnt.wheelDelta || evnt.detail;
  21256. if (delta > 0) {
  21257. this.numberNextEvent(evnt);
  21258. } else if (delta < 0) {
  21259. this.numberPrevEvent(evnt);
  21260. }
  21261. evnt.preventDefault();
  21262. }
  21263. }
  21264. },
  21265. clickEvent: function clickEvent(evnt) {
  21266. var isDatePicker = this.isDatePicker;
  21267. if (isDatePicker) {
  21268. this.datePickerOpenEvent(evnt);
  21269. }
  21270. this.triggerEvent(evnt);
  21271. },
  21272. clickPrefixEvent: function clickPrefixEvent(evnt) {
  21273. var $refs = this.$refs,
  21274. disabled = this.disabled,
  21275. value = this.value;
  21276. if (!disabled) {
  21277. this.$emit('prefix-click', {
  21278. $panel: $refs.panel,
  21279. value: value,
  21280. $event: evnt
  21281. }, evnt);
  21282. }
  21283. },
  21284. clickSuffixEvent: function clickSuffixEvent(evnt) {
  21285. var $refs = this.$refs,
  21286. disabled = this.disabled,
  21287. value = this.value;
  21288. if (!disabled) {
  21289. if (DomTools.hasClass(evnt.currentTarget, 'is--clear')) {
  21290. this.emitUpdate('', evnt);
  21291. this.clearValueEvent(evnt, '');
  21292. } else {
  21293. this.$emit('suffix-click', {
  21294. $panel: $refs.panel,
  21295. value: value,
  21296. $event: evnt
  21297. }, evnt);
  21298. }
  21299. }
  21300. },
  21301. clearValueEvent: function clearValueEvent(evnt, value) {
  21302. var $refs = this.$refs,
  21303. type = this.type,
  21304. isNumber = this.isNumber;
  21305. if (this.isDatePicker) {
  21306. this.hidePanel();
  21307. }
  21308. if (isNumber || ['text', 'password'].indexOf(type) > -1) {
  21309. this.focus();
  21310. }
  21311. this.$emit('clear', {
  21312. $panel: $refs.panel,
  21313. value: value,
  21314. $event: evnt
  21315. }, evnt);
  21316. },
  21317. /**
  21318. * 检查初始值
  21319. */
  21320. initValue: function initValue() {
  21321. var type = this.type,
  21322. isDatePicker = this.isDatePicker,
  21323. value = this.value,
  21324. digitsValue = this.digitsValue;
  21325. if (isDatePicker) {
  21326. this.changeValue();
  21327. } else if (type === 'float') {
  21328. if (value) {
  21329. var validValue = toFloatValueFixed(value, digitsValue);
  21330. if (value !== validValue) {
  21331. this.emitUpdate(validValue, {
  21332. type: 'init'
  21333. });
  21334. }
  21335. }
  21336. }
  21337. },
  21338. /**
  21339. * 值变化时处理
  21340. */
  21341. changeValue: function changeValue() {
  21342. if (this.isDatePicker) {
  21343. this.dateParseValue(this.value);
  21344. this.inputValue = this.datePanelLabel;
  21345. }
  21346. },
  21347. afterCheckValue: function afterCheckValue() {
  21348. var type = this.type,
  21349. inpAttrs = this.inpAttrs,
  21350. value = this.value,
  21351. inputValue = this.inputValue,
  21352. isDatePicker = this.isDatePicker,
  21353. isNumber = this.isNumber,
  21354. datetimePanelValue = this.datetimePanelValue,
  21355. dateLabelFormat = this.dateLabelFormat,
  21356. min = this.min,
  21357. max = this.max,
  21358. digitsValue = this.digitsValue;
  21359. if (!inpAttrs.readonly) {
  21360. if (isNumber) {
  21361. if (value) {
  21362. var inpVal = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
  21363. if (!this.vaildMinNum(inpVal)) {
  21364. inpVal = min;
  21365. } else if (!this.vaildMaxNum(inpVal)) {
  21366. inpVal = max;
  21367. }
  21368. this.emitUpdate(type === 'float' ? toFloatValueFixed(inpVal, digitsValue) : ctor_amd_xe_utils_default.a.toString(inpVal), {
  21369. type: 'check'
  21370. });
  21371. }
  21372. } else if (isDatePicker) {
  21373. var _inpVal = inputValue;
  21374. if (_inpVal) {
  21375. if (type === 'time') {
  21376. _inpVal = toStringTime(_inpVal, dateLabelFormat);
  21377. } else {
  21378. _inpVal = ctor_amd_xe_utils_default.a.toStringDate(_inpVal, dateLabelFormat);
  21379. }
  21380. if (ctor_amd_xe_utils_default.a.isValidDate(_inpVal)) {
  21381. if (type === 'time') {
  21382. _inpVal = ctor_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
  21383. if (value !== _inpVal) {
  21384. this.emitUpdate(_inpVal, {
  21385. type: 'check'
  21386. });
  21387. }
  21388. this.inputValue = _inpVal;
  21389. } else {
  21390. if (!ctor_amd_xe_utils_default.a.isDateSame(value, _inpVal, dateLabelFormat)) {
  21391. if (type === 'datetime') {
  21392. datetimePanelValue.setHours(_inpVal.getHours());
  21393. datetimePanelValue.setMinutes(_inpVal.getMinutes());
  21394. datetimePanelValue.setSeconds(_inpVal.getSeconds());
  21395. }
  21396. this.dateChange(_inpVal);
  21397. } else {
  21398. this.inputValue = ctor_amd_xe_utils_default.a.toDateString(value, dateLabelFormat);
  21399. }
  21400. }
  21401. } else {
  21402. this.dateRevert();
  21403. }
  21404. } else {
  21405. this.emitUpdate('', {
  21406. type: 'check'
  21407. });
  21408. }
  21409. }
  21410. }
  21411. },
  21412. // 密码
  21413. passwordToggleEvent: function passwordToggleEvent(evnt) {
  21414. var disabled = this.disabled,
  21415. readonly = this.readonly,
  21416. showPwd = this.showPwd;
  21417. if (!disabled && !readonly) {
  21418. this.showPwd = !showPwd;
  21419. }
  21420. this.$emit('toggle-visible', {
  21421. visible: this.showPwd,
  21422. $event: evnt
  21423. });
  21424. },
  21425. // 密码
  21426. // 搜索
  21427. searchEvent: function searchEvent(evnt) {
  21428. this.$emit('search-click', {
  21429. $event: evnt
  21430. });
  21431. },
  21432. // 搜索
  21433. // 数值
  21434. vaildMinNum: function vaildMinNum(num) {
  21435. return this.min === null || num >= ctor_amd_xe_utils_default.a.toNumber(this.min);
  21436. },
  21437. vaildMaxNum: function vaildMaxNum(num) {
  21438. return this.max === null || num <= ctor_amd_xe_utils_default.a.toNumber(this.max);
  21439. },
  21440. numberStopDown: function numberStopDown() {
  21441. clearTimeout(this.downbumTimeout);
  21442. },
  21443. numberDownPrevEvent: function numberDownPrevEvent(evnt) {
  21444. var _this2 = this;
  21445. this.downbumTimeout = setTimeout(function () {
  21446. _this2.numberPrevEvent(evnt);
  21447. _this2.numberDownPrevEvent(evnt);
  21448. }, 60);
  21449. },
  21450. numberDownNextEvent: function numberDownNextEvent(evnt) {
  21451. var _this3 = this;
  21452. this.downbumTimeout = setTimeout(function () {
  21453. _this3.numberNextEvent(evnt);
  21454. _this3.numberDownNextEvent(evnt);
  21455. }, 60);
  21456. },
  21457. numberKeydownEvent: function numberKeydownEvent(evnt) {
  21458. var keyCode = evnt.keyCode;
  21459. var isUpArrow = keyCode === 38;
  21460. var isDwArrow = keyCode === 40;
  21461. if (isUpArrow || isDwArrow) {
  21462. evnt.preventDefault();
  21463. if (isUpArrow) {
  21464. this.numberPrevEvent(evnt);
  21465. } else {
  21466. this.numberNextEvent(evnt);
  21467. }
  21468. }
  21469. },
  21470. numberMousedownEvent: function numberMousedownEvent(evnt) {
  21471. var _this4 = this;
  21472. this.numberStopDown();
  21473. if (evnt.button === 0) {
  21474. var isPrevNumber = DomTools.hasClass(evnt.currentTarget, 'is--prev');
  21475. if (isPrevNumber) {
  21476. this.numberPrevEvent(evnt);
  21477. } else {
  21478. this.numberNextEvent(evnt);
  21479. }
  21480. this.downbumTimeout = setTimeout(function () {
  21481. if (isPrevNumber) {
  21482. _this4.numberDownPrevEvent(evnt);
  21483. } else {
  21484. _this4.numberDownNextEvent(evnt);
  21485. }
  21486. }, 500);
  21487. }
  21488. },
  21489. numberPrevEvent: function numberPrevEvent(evnt) {
  21490. var disabled = this.disabled,
  21491. readonly = this.readonly;
  21492. clearTimeout(this.downbumTimeout);
  21493. if (!disabled && !readonly) {
  21494. this.numberChange(true, evnt);
  21495. }
  21496. this.$emit('prev-number', {
  21497. $event: evnt
  21498. });
  21499. },
  21500. numberNextEvent: function numberNextEvent(evnt) {
  21501. var disabled = this.disabled,
  21502. readonly = this.readonly;
  21503. clearTimeout(this.downbumTimeout);
  21504. if (!disabled && !readonly) {
  21505. this.numberChange(false, evnt);
  21506. }
  21507. this.$emit('next-number', {
  21508. $event: evnt
  21509. });
  21510. },
  21511. numberChange: function numberChange(isPlus, evnt) {
  21512. var type = this.type,
  21513. digitsValue = this.digitsValue,
  21514. value = this.value,
  21515. stepValue = this.stepValue;
  21516. var inputValue = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
  21517. var newValue = isPlus ? ctor_amd_xe_utils_default.a.add(inputValue, stepValue) : ctor_amd_xe_utils_default.a.subtract(inputValue, stepValue);
  21518. if (this.vaildMinNum(newValue) && this.vaildMaxNum(newValue)) {
  21519. this.emitUpdate(type === 'float' ? toFloatValueFixed(newValue, digitsValue) : ctor_amd_xe_utils_default.a.toString(newValue), evnt);
  21520. }
  21521. },
  21522. // 数值
  21523. // 日期
  21524. datePickerOpenEvent: function datePickerOpenEvent(evnt) {
  21525. var readonly = this.readonly;
  21526. if (!readonly) {
  21527. evnt.preventDefault();
  21528. this.showPanel();
  21529. }
  21530. },
  21531. dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
  21532. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
  21533. },
  21534. dateNowHandle: function dateNowHandle() {
  21535. var currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21536. this.currentDate = currentDate;
  21537. this.dateMonthHandle(currentDate, 0);
  21538. },
  21539. dateToggleTypeEvent: function dateToggleTypeEvent() {
  21540. var datePanelType = this.datePanelType;
  21541. if (datePanelType === 'month') {
  21542. datePanelType = 'year';
  21543. } else {
  21544. datePanelType = 'month';
  21545. }
  21546. this.datePanelType = datePanelType;
  21547. },
  21548. datePrevEvent: function datePrevEvent(evnt) {
  21549. var isDisabledPrevDateBtn = this.isDisabledPrevDateBtn,
  21550. type = this.type,
  21551. datePanelType = this.datePanelType;
  21552. if (!isDisabledPrevDateBtn) {
  21553. if (type === 'year') {
  21554. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21555. } else if (type === 'month') {
  21556. if (datePanelType === 'year') {
  21557. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21558. } else {
  21559. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  21560. }
  21561. } else {
  21562. if (datePanelType === 'year') {
  21563. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21564. } else if (datePanelType === 'month') {
  21565. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  21566. } else {
  21567. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, -1, 'first');
  21568. }
  21569. }
  21570. this.$emit('date-prev', {
  21571. type: type,
  21572. $event: evnt
  21573. });
  21574. }
  21575. },
  21576. dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
  21577. this.dateNowHandle();
  21578. this.dateChange(this.currentDate);
  21579. this.hidePanel();
  21580. this.$emit('date-today', {
  21581. type: this.type,
  21582. $event: evnt
  21583. });
  21584. },
  21585. dateNextEvent: function dateNextEvent(evnt) {
  21586. var isDisabledNextDateBtn = this.isDisabledNextDateBtn,
  21587. type = this.type,
  21588. datePanelType = this.datePanelType;
  21589. if (!isDisabledNextDateBtn) {
  21590. if (type === 'year') {
  21591. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21592. } else if (type === 'month') {
  21593. if (datePanelType === 'year') {
  21594. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21595. } else {
  21596. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  21597. }
  21598. } else {
  21599. if (datePanelType === 'year') {
  21600. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21601. } else if (datePanelType === 'month') {
  21602. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  21603. } else {
  21604. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
  21605. }
  21606. }
  21607. this.$emit('date-prev', {
  21608. type: type,
  21609. $event: evnt
  21610. });
  21611. }
  21612. },
  21613. dateSelectEvent: function dateSelectEvent(item) {
  21614. if (!isDateDisabled(this, item)) {
  21615. this.dateSelectItem(item.date);
  21616. }
  21617. },
  21618. dateSelectItem: function dateSelectItem(date) {
  21619. var type = this.type,
  21620. datePanelType = this.datePanelType;
  21621. if (type === 'month') {
  21622. if (datePanelType === 'year') {
  21623. this.datePanelType = 'month';
  21624. this.dateCheckMonth(date);
  21625. } else {
  21626. this.dateChange(date);
  21627. this.hidePanel();
  21628. }
  21629. } else if (type === 'year') {
  21630. this.hidePanel();
  21631. this.dateChange(date);
  21632. } else {
  21633. if (datePanelType === 'month') {
  21634. this.datePanelType = type === 'week' ? type : 'day';
  21635. this.dateCheckMonth(date);
  21636. } else if (datePanelType === 'year') {
  21637. this.datePanelType = 'month';
  21638. this.dateCheckMonth(date);
  21639. } else {
  21640. this.dateChange(date);
  21641. this.hidePanel();
  21642. }
  21643. }
  21644. },
  21645. dateMouseenterEvent: function dateMouseenterEvent(item) {
  21646. if (!isDateDisabled(this, item)) {
  21647. var datePanelType = this.datePanelType;
  21648. if (datePanelType === 'month') {
  21649. this.dateMoveMonth(item.date);
  21650. } else if (datePanelType === 'year') {
  21651. this.dateMoveYear(item.date);
  21652. } else {
  21653. this.dateMoveDay(item.date);
  21654. }
  21655. }
  21656. },
  21657. dateHourEvent: function dateHourEvent(evnt, item) {
  21658. this.datetimePanelValue.setHours(item.value);
  21659. this.dateTimeChangeEvent(evnt);
  21660. },
  21661. dateConfirmEvent: function dateConfirmEvent() {
  21662. this.dateChange(this.dateValue || this.currentDate);
  21663. this.hidePanel();
  21664. },
  21665. dateMinuteEvent: function dateMinuteEvent(evnt, item) {
  21666. this.datetimePanelValue.setMinutes(item.value);
  21667. this.dateTimeChangeEvent(evnt);
  21668. },
  21669. dateSecondEvent: function dateSecondEvent(evnt, item) {
  21670. this.datetimePanelValue.setSeconds(item.value);
  21671. this.dateTimeChangeEvent(evnt);
  21672. },
  21673. dateTimeChangeEvent: function dateTimeChangeEvent(evnt) {
  21674. this.datetimePanelValue = new Date(this.datetimePanelValue.getTime());
  21675. this.updateTimePos(evnt.currentTarget);
  21676. },
  21677. updateTimePos: function updateTimePos(liElem) {
  21678. if (liElem) {
  21679. var height = liElem.offsetHeight;
  21680. liElem.parentNode.scrollTop = liElem.offsetTop - height * 4;
  21681. }
  21682. },
  21683. dateMoveDay: function dateMoveDay(offsetDay) {
  21684. if (!isDateDisabled(this, {
  21685. date: offsetDay
  21686. })) {
  21687. if (!this.dayList.some(function (item) {
  21688. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetDay, 'yyyy-MM-dd');
  21689. })) {
  21690. this.dateCheckMonth(offsetDay);
  21691. }
  21692. this.dateParseValue(offsetDay);
  21693. }
  21694. },
  21695. dateMoveMonth: function dateMoveMonth(offsetMonth) {
  21696. if (!isDateDisabled(this, {
  21697. date: offsetMonth
  21698. })) {
  21699. if (!this.monthList.some(function (item) {
  21700. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetMonth, 'yyyy-MM');
  21701. })) {
  21702. this.dateCheckMonth(offsetMonth);
  21703. }
  21704. this.dateParseValue(offsetMonth);
  21705. }
  21706. },
  21707. dateMoveYear: function dateMoveYear(offsetYear) {
  21708. if (!isDateDisabled(this, {
  21709. date: offsetYear
  21710. })) {
  21711. if (!this.yearList.some(function (item) {
  21712. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetYear, 'yyyy');
  21713. })) {
  21714. this.dateCheckMonth(offsetYear);
  21715. }
  21716. this.dateParseValue(offsetYear);
  21717. }
  21718. },
  21719. dateParseValue: function dateParseValue(date) {
  21720. var type = this.type,
  21721. dateLabelFormat = this.dateLabelFormat,
  21722. valueFormat = this.valueFormat,
  21723. parseFormat = this.parseFormat;
  21724. var dValue = null;
  21725. var dLabel = '';
  21726. if (date) {
  21727. if (type === 'time') {
  21728. dValue = toStringTime(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
  21729. } else {
  21730. dValue = ctor_amd_xe_utils_default.a.toStringDate(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
  21731. }
  21732. }
  21733. if (ctor_amd_xe_utils_default.a.isValidDate(dValue)) {
  21734. dLabel = ctor_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat);
  21735. } else {
  21736. dValue = null;
  21737. }
  21738. this.datePanelValue = dValue;
  21739. this.datePanelLabel = dLabel;
  21740. },
  21741. dateOffsetEvent: function dateOffsetEvent(evnt) {
  21742. var isActivated = this.isActivated,
  21743. datePanelValue = this.datePanelValue,
  21744. datePanelType = this.datePanelType;
  21745. if (isActivated) {
  21746. evnt.preventDefault();
  21747. var keyCode = evnt.keyCode;
  21748. var isLeftArrow = keyCode === 37;
  21749. var isUpArrow = keyCode === 38;
  21750. var isRightArrow = keyCode === 39;
  21751. var isDwArrow = keyCode === 40;
  21752. if (datePanelType === 'year') {
  21753. var offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
  21754. if (isLeftArrow) {
  21755. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
  21756. } else if (isUpArrow) {
  21757. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
  21758. } else if (isRightArrow) {
  21759. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
  21760. } else if (isDwArrow) {
  21761. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
  21762. }
  21763. this.dateMoveYear(offsetYear);
  21764. } else if (datePanelType === 'month') {
  21765. var offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
  21766. if (isLeftArrow) {
  21767. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
  21768. } else if (isUpArrow) {
  21769. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
  21770. } else if (isRightArrow) {
  21771. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
  21772. } else if (isDwArrow) {
  21773. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
  21774. }
  21775. this.dateMoveMonth(offsetMonth);
  21776. } else {
  21777. var offsetDay = datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21778. if (isLeftArrow) {
  21779. offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
  21780. } else if (isUpArrow) {
  21781. offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
  21782. } else if (isRightArrow) {
  21783. offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
  21784. } else if (isDwArrow) {
  21785. offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1);
  21786. }
  21787. this.dateMoveDay(offsetDay);
  21788. }
  21789. }
  21790. },
  21791. datePgOffsetEvent: function datePgOffsetEvent(evnt) {
  21792. var isActivated = this.isActivated;
  21793. if (isActivated) {
  21794. var isPgUp = evnt.keyCode === 33;
  21795. evnt.preventDefault();
  21796. if (isPgUp) {
  21797. this.datePrevEvent(evnt);
  21798. } else {
  21799. this.dateNextEvent(evnt);
  21800. }
  21801. }
  21802. },
  21803. dateChange: function dateChange(date) {
  21804. var value = this.value,
  21805. datetimePanelValue = this.datetimePanelValue,
  21806. dateValueFormat = this.dateValueFormat;
  21807. if (this.type === 'week') {
  21808. var sWeek = ctor_amd_xe_utils_default.a.toNumber(ctor_amd_xe_utils_default.a.isNumber(this.startWeek) ? this.startWeek : this.dateOpts.startWeek);
  21809. date = ctor_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek);
  21810. } else if (this.hasTime) {
  21811. date.setHours(datetimePanelValue.getHours());
  21812. date.setMinutes(datetimePanelValue.getMinutes());
  21813. date.setSeconds(datetimePanelValue.getSeconds());
  21814. }
  21815. var inpVal = ctor_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
  21816. this.dateCheckMonth(date);
  21817. if (!ctor_amd_xe_utils_default.a.isEqual(value, inpVal)) {
  21818. this.emitUpdate(inpVal, {
  21819. type: 'update'
  21820. });
  21821. }
  21822. },
  21823. dateCheckMonth: function dateCheckMonth(date) {
  21824. var month = ctor_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
  21825. if (!ctor_amd_xe_utils_default.a.isEqual(month, this.selectMonth)) {
  21826. this.selectMonth = month;
  21827. }
  21828. },
  21829. dateOpenPanel: function dateOpenPanel() {
  21830. var _this5 = this;
  21831. var type = this.type,
  21832. dateValue = this.dateValue;
  21833. if (['year', 'month', 'week'].indexOf(type) > -1) {
  21834. this.datePanelType = type;
  21835. } else {
  21836. this.datePanelType = 'day';
  21837. }
  21838. this.currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21839. if (dateValue) {
  21840. this.dateMonthHandle(dateValue, 0);
  21841. this.dateParseValue(dateValue);
  21842. } else {
  21843. this.dateNowHandle();
  21844. }
  21845. if (this.hasTime) {
  21846. this.datetimePanelValue = this.datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21847. this.$nextTick(function () {
  21848. ctor_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
  21849. });
  21850. }
  21851. },
  21852. dateRevert: function dateRevert() {
  21853. this.inputValue = this.datePanelLabel;
  21854. },
  21855. // 日期
  21856. // 弹出面板
  21857. updateZindex: function updateZindex() {
  21858. if (this.panelIndex < UtilTools.getLastZIndex()) {
  21859. this.panelIndex = UtilTools.nextZIndex();
  21860. }
  21861. },
  21862. showPanel: function showPanel() {
  21863. var _this6 = this;
  21864. var disabled = this.disabled,
  21865. visiblePanel = this.visiblePanel,
  21866. isDatePicker = this.isDatePicker;
  21867. if (!disabled && !visiblePanel) {
  21868. clearTimeout(this.hidePanelTimeout);
  21869. this.isActivated = true;
  21870. this.animatVisible = true;
  21871. if (isDatePicker) {
  21872. this.dateOpenPanel();
  21873. }
  21874. setTimeout(function () {
  21875. _this6.visiblePanel = true;
  21876. }, 10);
  21877. this.updateZindex();
  21878. this.updatePlacement();
  21879. }
  21880. },
  21881. hidePanel: function hidePanel() {
  21882. var _this7 = this;
  21883. this.visiblePanel = false;
  21884. this.hidePanelTimeout = setTimeout(function () {
  21885. _this7.animatVisible = false;
  21886. }, 350);
  21887. },
  21888. updatePlacement: function updatePlacement() {
  21889. var _this8 = this;
  21890. return this.$nextTick().then(function () {
  21891. var $refs = _this8.$refs,
  21892. transfer = _this8.transfer,
  21893. placement = _this8.placement,
  21894. panelIndex = _this8.panelIndex;
  21895. var targetElem = $refs.input;
  21896. var panelElem = $refs.panel;
  21897. if (targetElem && panelElem) {
  21898. var targetHeight = targetElem.offsetHeight;
  21899. var targetWidth = targetElem.offsetWidth;
  21900. var panelHeight = panelElem.offsetHeight;
  21901. var panelWidth = panelElem.offsetWidth;
  21902. var marginSize = 5;
  21903. var panelStyle = {
  21904. zIndex: panelIndex
  21905. };
  21906. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  21907. boundingTop = _DomTools$getAbsolute.boundingTop,
  21908. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  21909. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  21910. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  21911. var panelPlacement = 'bottom';
  21912. if (transfer) {
  21913. var left = boundingLeft;
  21914. var top = boundingTop + targetHeight;
  21915. if (placement === 'top') {
  21916. panelPlacement = 'top';
  21917. top = boundingTop - panelHeight;
  21918. } else if (!placement) {
  21919. // 如果下面不够放,则向上
  21920. if (top + panelHeight + marginSize > visibleHeight) {
  21921. panelPlacement = 'top';
  21922. top = boundingTop - panelHeight;
  21923. } // 如果上面不够放,则向下(优先)
  21924. if (top < marginSize) {
  21925. panelPlacement = 'bottom';
  21926. top = boundingTop + targetHeight;
  21927. }
  21928. } // 如果溢出右边
  21929. if (left + panelWidth + marginSize > visibleWidth) {
  21930. left -= left + panelWidth + marginSize - visibleWidth;
  21931. } // 如果溢出左边
  21932. if (left < marginSize) {
  21933. left = marginSize;
  21934. }
  21935. Object.assign(panelStyle, {
  21936. left: "".concat(left, "px"),
  21937. top: "".concat(top, "px"),
  21938. minWidth: "".concat(targetWidth, "px")
  21939. });
  21940. } else {
  21941. if (placement === 'top') {
  21942. panelPlacement = 'top';
  21943. panelStyle.bottom = "".concat(targetHeight, "px");
  21944. } else if (!placement) {
  21945. // 如果下面不够放,则向上
  21946. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  21947. // 如果上面不够放,则向下(优先)
  21948. if (boundingTop - targetHeight - panelHeight > marginSize) {
  21949. panelPlacement = 'top';
  21950. panelStyle.bottom = "".concat(targetHeight, "px");
  21951. }
  21952. }
  21953. }
  21954. }
  21955. _this8.panelStyle = panelStyle;
  21956. _this8.panelPlacement = panelPlacement;
  21957. return _this8.$nextTick();
  21958. }
  21959. });
  21960. },
  21961. // 弹出面板
  21962. // 全局事件
  21963. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  21964. var $refs = this.$refs,
  21965. $el = this.$el,
  21966. disabled = this.disabled,
  21967. visiblePanel = this.visiblePanel,
  21968. isActivated = this.isActivated;
  21969. if (!disabled && isActivated) {
  21970. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  21971. if (!this.isActivated) {
  21972. // 如果是日期类型
  21973. if (this.isDatePicker) {
  21974. if (visiblePanel) {
  21975. this.hidePanel();
  21976. this.afterCheckValue();
  21977. }
  21978. } else {
  21979. this.afterCheckValue();
  21980. }
  21981. }
  21982. }
  21983. },
  21984. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  21985. var isDatePicker = this.isDatePicker,
  21986. visiblePanel = this.visiblePanel,
  21987. clearable = this.clearable,
  21988. disabled = this.disabled;
  21989. if (!disabled) {
  21990. var keyCode = evnt.keyCode;
  21991. var isTab = keyCode === 9;
  21992. var isDel = keyCode === 46;
  21993. var isEsc = keyCode === 27;
  21994. var isEnter = keyCode === 13;
  21995. var isLeftArrow = keyCode === 37;
  21996. var isUpArrow = keyCode === 38;
  21997. var isRightArrow = keyCode === 39;
  21998. var isDwArrow = keyCode === 40;
  21999. var isPgUp = keyCode === 33;
  22000. var isPgDn = keyCode === 34;
  22001. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  22002. var isActivated = this.isActivated;
  22003. if (isTab) {
  22004. if (isActivated) {
  22005. this.afterCheckValue();
  22006. }
  22007. isActivated = false;
  22008. this.isActivated = isActivated;
  22009. } else if (operArrow) {
  22010. if (isDatePicker) {
  22011. if (isActivated) {
  22012. if (visiblePanel) {
  22013. this.dateOffsetEvent(evnt);
  22014. } else if (isUpArrow || isDwArrow) {
  22015. this.datePickerOpenEvent(evnt);
  22016. }
  22017. }
  22018. }
  22019. } else if (isEnter) {
  22020. if (isDatePicker) {
  22021. if (visiblePanel) {
  22022. if (this.datePanelValue) {
  22023. this.dateSelectItem(this.datePanelValue);
  22024. } else {
  22025. this.hidePanel();
  22026. }
  22027. } else if (isActivated) {
  22028. this.datePickerOpenEvent(evnt);
  22029. }
  22030. }
  22031. } else if (isPgUp || isPgDn) {
  22032. if (isDatePicker) {
  22033. if (isActivated) {
  22034. this.datePgOffsetEvent(evnt);
  22035. }
  22036. }
  22037. }
  22038. if (isTab || isEsc) {
  22039. if (visiblePanel) {
  22040. this.hidePanel();
  22041. }
  22042. } else if (isDel && clearable) {
  22043. if (isActivated) {
  22044. this.clearValueEvent(evnt, null);
  22045. }
  22046. }
  22047. }
  22048. },
  22049. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  22050. var $refs = this.$refs,
  22051. disabled = this.disabled,
  22052. visiblePanel = this.visiblePanel;
  22053. if (!disabled) {
  22054. if (visiblePanel) {
  22055. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  22056. this.updatePlacement();
  22057. } else {
  22058. this.hidePanel();
  22059. this.afterCheckValue();
  22060. }
  22061. }
  22062. }
  22063. },
  22064. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  22065. var isActivated = this.isActivated,
  22066. visiblePanel = this.visiblePanel;
  22067. if (visiblePanel) {
  22068. this.hidePanel();
  22069. this.afterCheckValue();
  22070. } else if (isActivated) {
  22071. this.afterCheckValue();
  22072. }
  22073. } // 全局事件
  22074. }
  22075. });
  22076. // CONCATENATED MODULE: ./packages/input/index.js
  22077. input.install = function (Vue) {
  22078. Vue.component(input.name, input);
  22079. };
  22080. var Input = input;
  22081. /* harmony default export */ var packages_input = (input);
  22082. // CONCATENATED MODULE: ./packages/textarea/src/textarea.js
  22083. var autoTxtElem;
  22084. /* harmony default export */ var src_textarea = ({
  22085. name: 'VxeTextarea',
  22086. props: {
  22087. value: [String, Number],
  22088. name: String,
  22089. readonly: Boolean,
  22090. disabled: Boolean,
  22091. placeholder: String,
  22092. maxlength: [String, Number],
  22093. rows: {
  22094. type: [String, Number],
  22095. default: 2
  22096. },
  22097. showWordCount: Boolean,
  22098. autosize: [Boolean, Object],
  22099. form: String,
  22100. resize: {
  22101. type: String,
  22102. default: function _default() {
  22103. return conf.textarea.resize;
  22104. }
  22105. },
  22106. size: {
  22107. type: String,
  22108. default: function _default() {
  22109. return conf.textarea.size || conf.size;
  22110. }
  22111. }
  22112. },
  22113. computed: {
  22114. vSize: function vSize() {
  22115. return this.size || this.$parent.size || this.$parent.vSize;
  22116. },
  22117. inputCount: function inputCount() {
  22118. return ctor_amd_xe_utils_default.a.getSize(this.value);
  22119. },
  22120. isCountError: function isCountError() {
  22121. return this.maxlength && this.inputCount > ctor_amd_xe_utils_default.a.toNumber(this.maxlength);
  22122. },
  22123. defaultEvents: function defaultEvents() {
  22124. var _this = this;
  22125. var evnts = {};
  22126. ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  22127. if (['change'].indexOf(name) === -1) {
  22128. evnts[name] = _this.triggerEvent;
  22129. }
  22130. });
  22131. evnts.input = this.inputEvent;
  22132. return evnts;
  22133. },
  22134. sizeOpts: function sizeOpts() {
  22135. return Object.assign({
  22136. minRows: 1,
  22137. maxRows: 10
  22138. }, conf.textarea.autosize, this.autosize);
  22139. }
  22140. },
  22141. watch: {
  22142. value: function value() {
  22143. this.updateAutoTxt();
  22144. }
  22145. },
  22146. created: function created() {
  22147. if (!autoTxtElem) {
  22148. autoTxtElem = document.createElement('div');
  22149. document.body.appendChild(autoTxtElem);
  22150. }
  22151. },
  22152. mounted: function mounted() {
  22153. this.updateAutoTxt();
  22154. this.handleResize();
  22155. },
  22156. render: function render(h) {
  22157. var _ref;
  22158. var defaultEvents = this.defaultEvents,
  22159. value = this.value,
  22160. vSize = this.vSize,
  22161. name = this.name,
  22162. form = this.form,
  22163. resize = this.resize,
  22164. placeholder = this.placeholder,
  22165. readonly = this.readonly,
  22166. disabled = this.disabled,
  22167. maxlength = this.maxlength,
  22168. autosize = this.autosize,
  22169. showWordCount = this.showWordCount;
  22170. var attrs = {
  22171. name: name,
  22172. form: form,
  22173. placeholder: placeholder,
  22174. maxlength: maxlength,
  22175. readonly: readonly,
  22176. disabled: disabled
  22177. };
  22178. if (placeholder) {
  22179. attrs.placeholder = UtilTools.getFuncText(placeholder);
  22180. }
  22181. return h('div', {
  22182. class: ['vxe-textarea', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--autosize', autosize), _defineProperty(_ref, 'is--disabled', disabled), _ref)]
  22183. }, [h('textarea', {
  22184. ref: 'textarea',
  22185. class: 'vxe-textarea--inner',
  22186. domProps: {
  22187. value: value
  22188. },
  22189. attrs: attrs,
  22190. style: resize ? {
  22191. resize: resize
  22192. } : null,
  22193. on: defaultEvents
  22194. }), showWordCount ? h('span', {
  22195. class: ['vxe-textarea--count', {
  22196. 'is--error': this.isCountError
  22197. }]
  22198. }, "".concat(this.inputCount).concat(maxlength ? "/".concat(maxlength) : '')) : null]);
  22199. },
  22200. methods: {
  22201. focus: function focus() {
  22202. this.$refs.textarea.focus();
  22203. return this.$nextTick();
  22204. },
  22205. blur: function blur() {
  22206. this.$refs.textarea.blur();
  22207. return this.$nextTick();
  22208. },
  22209. triggerEvent: function triggerEvent(evnt) {
  22210. var value = this.value;
  22211. this.$emit(evnt.type, {
  22212. value: value,
  22213. $event: evnt
  22214. }, evnt);
  22215. },
  22216. emitUpdate: function emitUpdate(value, evnt) {
  22217. if (this.value !== value) {
  22218. this.$emit('input', value);
  22219. this.$emit('change', {
  22220. value: value,
  22221. $event: evnt
  22222. });
  22223. }
  22224. },
  22225. inputEvent: function inputEvent(evnt) {
  22226. this.emitUpdate(evnt.target.value, evnt);
  22227. this.handleResize();
  22228. },
  22229. updateAutoTxt: function updateAutoTxt() {
  22230. var $refs = this.$refs,
  22231. value = this.value,
  22232. size = this.size,
  22233. autosize = this.autosize;
  22234. if (autosize) {
  22235. var textElem = $refs.textarea;
  22236. var textStyle = getComputedStyle(textElem);
  22237. autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
  22238. autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
  22239. autoTxtElem.style.padding = textStyle.padding;
  22240. autoTxtElem.innerHTML = ('' + (value || ' ')).replace(/\n$/, '\n ');
  22241. }
  22242. },
  22243. handleResize: function handleResize() {
  22244. var _this2 = this;
  22245. if (this.autosize) {
  22246. this.$nextTick(function () {
  22247. var $refs = _this2.$refs,
  22248. sizeOpts = _this2.sizeOpts;
  22249. var minRows = sizeOpts.minRows,
  22250. maxRows = sizeOpts.maxRows;
  22251. var textElem = $refs.textarea;
  22252. var sizeHeight = autoTxtElem.clientHeight;
  22253. var textStyle = getComputedStyle(textElem);
  22254. var lineHeight = ctor_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
  22255. var paddingTop = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
  22256. var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
  22257. var borderTopWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
  22258. var borderBottomWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderBottomWidth);
  22259. var intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
  22260. var rowNum = (sizeHeight - intervalHeight) / lineHeight;
  22261. var textRows = rowNum && /[0-9]/.test(rowNum) ? rowNum : Math.floor(rowNum) + 1;
  22262. var vaildRows = textRows;
  22263. if (textRows < minRows) {
  22264. vaildRows = minRows;
  22265. } else if (textRows > maxRows) {
  22266. vaildRows = maxRows;
  22267. }
  22268. textElem.style.height = "".concat(vaildRows * lineHeight + intervalHeight, "px");
  22269. });
  22270. }
  22271. }
  22272. }
  22273. });
  22274. // CONCATENATED MODULE: ./packages/textarea/index.js
  22275. src_textarea.install = function (Vue) {
  22276. Vue.component(src_textarea.name, src_textarea);
  22277. };
  22278. var Textarea = src_textarea;
  22279. /* harmony default export */ var packages_textarea = (src_textarea);
  22280. // CONCATENATED MODULE: ./packages/button/src/button.js
  22281. /* harmony default export */ var button_src_button = ({
  22282. name: 'VxeButton',
  22283. props: {
  22284. type: String,
  22285. size: {
  22286. type: String,
  22287. default: function _default() {
  22288. return conf.button.size || conf.size;
  22289. }
  22290. },
  22291. name: [String, Number],
  22292. content: String,
  22293. placement: String,
  22294. status: String,
  22295. icon: String,
  22296. round: Boolean,
  22297. circle: Boolean,
  22298. disabled: Boolean,
  22299. loading: Boolean,
  22300. destroyOnClose: Boolean,
  22301. transfer: {
  22302. type: Boolean,
  22303. default: function _default() {
  22304. return conf.button.transfer;
  22305. }
  22306. }
  22307. },
  22308. data: function data() {
  22309. return {
  22310. inited: false,
  22311. showPanel: false,
  22312. animatVisible: false,
  22313. panelIndex: 0,
  22314. panelStyle: null,
  22315. panelPlacement: null
  22316. };
  22317. },
  22318. computed: {
  22319. vSize: function vSize() {
  22320. return this.size || this.$parent.size || this.$parent.vSize;
  22321. },
  22322. isText: function isText() {
  22323. return this.type === 'text';
  22324. },
  22325. isFormBtn: function isFormBtn() {
  22326. return ['submit', 'reset', 'button'].indexOf(this.type) > -1;
  22327. },
  22328. btnType: function btnType() {
  22329. return this.isText ? this.type : 'button';
  22330. },
  22331. btnStatus: function btnStatus() {
  22332. return this.status || (this.type === 'primary' ? this.type : null);
  22333. }
  22334. },
  22335. created: function created() {
  22336. if (this.type === 'primary') {
  22337. UtilTools.warn('vxe.error.delProp', ['type=primary', 'status=primary']);
  22338. }
  22339. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  22340. },
  22341. beforeDestroy: function beforeDestroy() {
  22342. var panelElem = this.$refs.panel;
  22343. if (panelElem && panelElem.parentNode) {
  22344. panelElem.parentNode.removeChild(panelElem);
  22345. }
  22346. },
  22347. destroyed: function destroyed() {
  22348. GlobalEvent.off(this, 'mousewheel');
  22349. },
  22350. render: function render(h) {
  22351. var _ref,
  22352. _ref2,
  22353. _this = this,
  22354. _ref3,
  22355. _ref4;
  22356. var $scopedSlots = this.$scopedSlots,
  22357. $listeners = this.$listeners,
  22358. inited = this.inited,
  22359. type = this.type,
  22360. destroyOnClose = this.destroyOnClose,
  22361. isFormBtn = this.isFormBtn,
  22362. btnStatus = this.btnStatus,
  22363. btnType = this.btnType,
  22364. vSize = this.vSize,
  22365. name = this.name,
  22366. disabled = this.disabled,
  22367. loading = this.loading,
  22368. showPanel = this.showPanel,
  22369. animatVisible = this.animatVisible,
  22370. panelPlacement = this.panelPlacement;
  22371. var downsSlot = $scopedSlots.dropdowns;
  22372. return downsSlot ? h('div', {
  22373. class: ['vxe-button--dropdown', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
  22374. }, [h('button', {
  22375. ref: 'btn',
  22376. class: ['vxe-button', "type--".concat(btnType), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "theme--".concat(btnStatus), btnStatus), _defineProperty(_ref2, 'is--round', this.round), _defineProperty(_ref2, 'is--circle', this.circle), _defineProperty(_ref2, 'is--disabled', disabled || loading), _defineProperty(_ref2, 'is--loading', loading), _ref2)],
  22377. attrs: {
  22378. name: name,
  22379. type: isFormBtn ? type : 'button',
  22380. disabled: disabled || loading
  22381. },
  22382. on: Object.assign({
  22383. mouseenter: this.mouseenterTargetEvent,
  22384. mouseleave: this.mouseleaveEvent
  22385. }, ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  22386. return function (evnt) {
  22387. return _this.$emit(type, {
  22388. $event: evnt
  22389. }, evnt);
  22390. };
  22391. }))
  22392. }, this.renderContent(h).concat([h('i', {
  22393. class: "vxe-button--dropdown-arrow ".concat(conf.icon.BUTTON_DROPDOWN)
  22394. })])), h('div', {
  22395. ref: 'panel',
  22396. class: ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
  22397. attrs: {
  22398. 'data-placement': panelPlacement
  22399. },
  22400. style: this.panelStyle
  22401. }, inited ? [h('div', {
  22402. class: 'vxe-button--dropdown-wrapper',
  22403. on: {
  22404. click: this.clickDropdownEvent,
  22405. mouseenter: this.mouseenterEvent,
  22406. mouseleave: this.mouseleaveEvent
  22407. }
  22408. }, destroyOnClose && !showPanel ? [] : downsSlot.call(this, {}, h))] : null)]) : h('button', {
  22409. ref: 'btn',
  22410. class: ['vxe-button', "type--".concat(btnType), (_ref4 = {}, _defineProperty(_ref4, "size--".concat(vSize), vSize), _defineProperty(_ref4, "theme--".concat(btnStatus), btnStatus), _defineProperty(_ref4, 'is--round', this.round), _defineProperty(_ref4, 'is--circle', this.circle), _defineProperty(_ref4, 'is--disabled', disabled || loading), _defineProperty(_ref4, 'is--loading', loading), _ref4)],
  22411. attrs: {
  22412. name: name,
  22413. type: isFormBtn ? type : 'button',
  22414. disabled: disabled || loading
  22415. },
  22416. on: ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  22417. return function (evnt) {
  22418. return _this.$emit(type, {
  22419. $event: evnt
  22420. }, evnt);
  22421. };
  22422. })
  22423. }, this.renderContent(h));
  22424. },
  22425. methods: {
  22426. renderContent: function renderContent(h) {
  22427. var $scopedSlots = this.$scopedSlots,
  22428. content = this.content,
  22429. icon = this.icon,
  22430. loading = this.loading;
  22431. var contents = [];
  22432. if (loading) {
  22433. contents.push(h('i', {
  22434. class: ['vxe-button--loading-icon', conf.icon.BUTTON_LOADING]
  22435. }));
  22436. } else if (icon) {
  22437. contents.push(h('i', {
  22438. class: ['vxe-button--icon', icon]
  22439. }));
  22440. }
  22441. if ($scopedSlots.default) {
  22442. contents.push(h('span', {
  22443. class: 'vxe-button--content'
  22444. }, $scopedSlots.default.call(this)));
  22445. } else if (content) {
  22446. contents.push(h('span', {
  22447. class: 'vxe-button--content'
  22448. }, [UtilTools.getFuncText(content)]));
  22449. }
  22450. return contents;
  22451. },
  22452. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  22453. if (this.showPanel && !DomTools.getEventTargetNode(evnt, this.$refs.panel).flag) {
  22454. this.closePanel();
  22455. }
  22456. },
  22457. updateZindex: function updateZindex() {
  22458. if (this.panelIndex < UtilTools.getLastZIndex()) {
  22459. this.panelIndex = UtilTools.nextZIndex();
  22460. }
  22461. },
  22462. clickDropdownEvent: function clickDropdownEvent(evnt) {
  22463. var _this2 = this;
  22464. var dropdownElem = evnt.currentTarget;
  22465. var panelElem = this.$refs.panel;
  22466. var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
  22467. flag = _DomTools$getEventTar.flag,
  22468. targetElem = _DomTools$getEventTar.targetElem;
  22469. if (flag) {
  22470. if (panelElem) {
  22471. panelElem.dataset.active = 'N';
  22472. }
  22473. this.showPanel = false;
  22474. setTimeout(function () {
  22475. if (!panelElem || panelElem.dataset.active !== 'Y') {
  22476. _this2.animatVisible = false;
  22477. }
  22478. }, 350);
  22479. this.$emit('dropdown-click', {
  22480. name: targetElem.getAttribute('name'),
  22481. $event: evnt
  22482. }, evnt);
  22483. }
  22484. },
  22485. mouseenterTargetEvent: function mouseenterTargetEvent() {
  22486. var _this3 = this;
  22487. var panelElem = this.$refs.panel;
  22488. panelElem.dataset.active = 'Y';
  22489. if (!this.inited) {
  22490. this.inited = true;
  22491. if (this.transfer) {
  22492. document.body.appendChild(panelElem);
  22493. }
  22494. }
  22495. this.showTime = setTimeout(function () {
  22496. if (panelElem.dataset.active === 'Y') {
  22497. _this3.mouseenterEvent();
  22498. } else {
  22499. _this3.animatVisible = false;
  22500. }
  22501. }, 250);
  22502. },
  22503. mouseenterEvent: function mouseenterEvent() {
  22504. var _this4 = this;
  22505. var panelElem = this.$refs.panel;
  22506. panelElem.dataset.active = 'Y';
  22507. this.animatVisible = true;
  22508. setTimeout(function () {
  22509. if (panelElem.dataset.active === 'Y') {
  22510. _this4.showPanel = true;
  22511. _this4.updateZindex();
  22512. _this4.updatePlacement();
  22513. setTimeout(function () {
  22514. if (_this4.showPanel) {
  22515. _this4.updatePlacement();
  22516. }
  22517. }, 50);
  22518. }
  22519. }, 20);
  22520. },
  22521. mouseleaveEvent: function mouseleaveEvent() {
  22522. this.closePanel();
  22523. },
  22524. closePanel: function closePanel() {
  22525. var _this5 = this;
  22526. var panelElem = this.$refs.panel;
  22527. clearTimeout(this.showTime);
  22528. if (panelElem) {
  22529. panelElem.dataset.active = 'N';
  22530. setTimeout(function () {
  22531. if (panelElem.dataset.active !== 'Y') {
  22532. _this5.showPanel = false;
  22533. setTimeout(function () {
  22534. if (panelElem.dataset.active !== 'Y') {
  22535. _this5.animatVisible = false;
  22536. }
  22537. }, 350);
  22538. }
  22539. }, 100);
  22540. } else {
  22541. this.animatVisible = false;
  22542. this.showPanel = false;
  22543. }
  22544. },
  22545. updatePlacement: function updatePlacement() {
  22546. var _this6 = this;
  22547. return this.$nextTick().then(function () {
  22548. var $refs = _this6.$refs,
  22549. transfer = _this6.transfer,
  22550. placement = _this6.placement,
  22551. panelIndex = _this6.panelIndex;
  22552. var targetElem = $refs.btn;
  22553. var panelElem = $refs.panel;
  22554. if (panelElem && targetElem) {
  22555. var targetHeight = targetElem.offsetHeight;
  22556. var targetWidth = targetElem.offsetWidth;
  22557. var panelHeight = panelElem.offsetHeight;
  22558. var panelWidth = panelElem.offsetWidth;
  22559. var marginSize = 5;
  22560. var panelStyle = {
  22561. zIndex: panelIndex
  22562. };
  22563. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  22564. boundingTop = _DomTools$getAbsolute.boundingTop,
  22565. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  22566. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  22567. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  22568. var panelPlacement = 'bottom';
  22569. if (transfer) {
  22570. var left = boundingLeft;
  22571. var top = boundingTop + targetHeight;
  22572. if (placement === 'top') {
  22573. panelPlacement = 'top';
  22574. top = boundingTop - panelHeight;
  22575. } else if (!placement) {
  22576. // 如果下面不够放,则向上
  22577. if (top + panelHeight + marginSize > visibleHeight) {
  22578. panelPlacement = 'top';
  22579. top = boundingTop - panelHeight;
  22580. } // 如果上面不够放,则向下(优先)
  22581. if (top < marginSize) {
  22582. panelPlacement = 'bottom';
  22583. top = boundingTop + targetHeight;
  22584. }
  22585. } // 如果溢出右边
  22586. if (left + panelWidth + marginSize > visibleWidth) {
  22587. left -= left + panelWidth + marginSize - visibleWidth;
  22588. } // 如果溢出左边
  22589. if (left < marginSize) {
  22590. left = marginSize;
  22591. }
  22592. Object.assign(panelStyle, {
  22593. left: "".concat(left, "px"),
  22594. top: "".concat(top, "px"),
  22595. minWidth: "".concat(targetWidth, "px")
  22596. });
  22597. } else {
  22598. if (placement === 'top') {
  22599. panelPlacement = 'top';
  22600. panelStyle.bottom = "".concat(targetHeight, "px");
  22601. } else if (!placement) {
  22602. // 如果下面不够放,则向上
  22603. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  22604. // 如果上面不够放,则向下(优先)
  22605. if (boundingTop - targetHeight - panelHeight > marginSize) {
  22606. panelPlacement = 'top';
  22607. panelStyle.bottom = "".concat(targetHeight, "px");
  22608. }
  22609. }
  22610. }
  22611. }
  22612. _this6.panelStyle = panelStyle;
  22613. _this6.panelPlacement = panelPlacement;
  22614. return _this6.$nextTick();
  22615. }
  22616. });
  22617. },
  22618. focus: function focus() {
  22619. this.$el.focus();
  22620. return this.$nextTick();
  22621. },
  22622. blur: function blur() {
  22623. this.$el.blur();
  22624. return this.$nextTick();
  22625. }
  22626. }
  22627. });
  22628. // CONCATENATED MODULE: ./packages/button/index.js
  22629. button_src_button.install = function (Vue) {
  22630. Vue.component(button_src_button.name, button_src_button);
  22631. };
  22632. var Button = button_src_button;
  22633. /* harmony default export */ var packages_button = (button_src_button);
  22634. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  22635. function _arrayWithHoles(arr) {
  22636. if (Array.isArray(arr)) return arr;
  22637. }
  22638. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  22639. function _iterableToArrayLimit(arr, i) {
  22640. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  22641. var _arr = [];
  22642. var _n = true;
  22643. var _d = false;
  22644. var _e = undefined;
  22645. try {
  22646. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  22647. _arr.push(_s.value);
  22648. if (i && _arr.length === i) break;
  22649. }
  22650. } catch (err) {
  22651. _d = true;
  22652. _e = err;
  22653. } finally {
  22654. try {
  22655. if (!_n && _i["return"] != null) _i["return"]();
  22656. } finally {
  22657. if (_d) throw _e;
  22658. }
  22659. }
  22660. return _arr;
  22661. }
  22662. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  22663. function _nonIterableRest() {
  22664. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  22665. }
  22666. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  22667. function _slicedToArray(arr, i) {
  22668. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  22669. }
  22670. // CONCATENATED MODULE: ./packages/modal/src/queue.js
  22671. var queue = [];
  22672. /* harmony default export */ var src_queue = (queue);
  22673. // CONCATENATED MODULE: ./packages/modal/src/activities.js
  22674. var allActivedModals = [];
  22675. /* harmony default export */ var activities = (allActivedModals);
  22676. // CONCATENATED MODULE: ./packages/modal/src/modal.js
  22677. var activeModals = [];
  22678. /* harmony default export */ var modal = ({
  22679. name: 'VxeModal',
  22680. props: {
  22681. value: Boolean,
  22682. id: String,
  22683. type: {
  22684. type: String,
  22685. default: 'modal'
  22686. },
  22687. loading: {
  22688. type: Boolean,
  22689. default: null
  22690. },
  22691. status: String,
  22692. iconStatus: String,
  22693. className: String,
  22694. top: {
  22695. type: [Number, String],
  22696. default: function _default() {
  22697. return conf.modal.top;
  22698. }
  22699. },
  22700. position: [String, Object],
  22701. title: String,
  22702. duration: {
  22703. type: [Number, String],
  22704. default: function _default() {
  22705. return conf.modal.duration;
  22706. }
  22707. },
  22708. // 请使用 content
  22709. message: [String, Function],
  22710. content: [String, Function],
  22711. cancelButtonText: {
  22712. type: String,
  22713. default: function _default() {
  22714. return conf.modal.cancelButtonText;
  22715. }
  22716. },
  22717. confirmButtonText: {
  22718. type: String,
  22719. default: function _default() {
  22720. return conf.modal.confirmButtonText;
  22721. }
  22722. },
  22723. lockView: {
  22724. type: Boolean,
  22725. default: function _default() {
  22726. return conf.modal.lockView;
  22727. }
  22728. },
  22729. lockScroll: Boolean,
  22730. mask: {
  22731. type: Boolean,
  22732. default: function _default() {
  22733. return conf.modal.mask;
  22734. }
  22735. },
  22736. maskClosable: {
  22737. type: Boolean,
  22738. default: function _default() {
  22739. return conf.modal.maskClosable;
  22740. }
  22741. },
  22742. escClosable: {
  22743. type: Boolean,
  22744. default: function _default() {
  22745. return conf.modal.escClosable;
  22746. }
  22747. },
  22748. resize: {
  22749. type: Boolean,
  22750. default: function _default() {
  22751. return conf.modal.resize;
  22752. }
  22753. },
  22754. showHeader: {
  22755. type: Boolean,
  22756. default: function _default() {
  22757. return conf.modal.showHeader;
  22758. }
  22759. },
  22760. showFooter: {
  22761. type: Boolean,
  22762. default: function _default() {
  22763. return conf.modal.showFooter;
  22764. }
  22765. },
  22766. showZoom: {
  22767. type: Boolean,
  22768. default: null
  22769. },
  22770. dblclickZoom: {
  22771. type: Boolean,
  22772. default: function _default() {
  22773. return conf.modal.dblclickZoom;
  22774. }
  22775. },
  22776. width: [Number, String],
  22777. height: [Number, String],
  22778. minWidth: {
  22779. type: [Number, String],
  22780. default: function _default() {
  22781. return conf.modal.minWidth;
  22782. }
  22783. },
  22784. minHeight: {
  22785. type: [Number, String],
  22786. default: function _default() {
  22787. return conf.modal.minHeight;
  22788. }
  22789. },
  22790. zIndex: Number,
  22791. marginSize: {
  22792. type: [Number, String],
  22793. default: conf.modal.marginSize
  22794. },
  22795. fullscreen: Boolean,
  22796. remember: {
  22797. type: Boolean,
  22798. default: function _default() {
  22799. return conf.modal.remember;
  22800. }
  22801. },
  22802. destroyOnClose: {
  22803. type: Boolean,
  22804. default: function _default() {
  22805. return conf.modal.destroyOnClose;
  22806. }
  22807. },
  22808. showTitleOverflow: {
  22809. type: Boolean,
  22810. default: function _default() {
  22811. return conf.modal.showTitleOverflow;
  22812. }
  22813. },
  22814. transfer: {
  22815. type: Boolean,
  22816. default: function _default() {
  22817. return conf.modal.transfer;
  22818. }
  22819. },
  22820. storage: {
  22821. type: Boolean,
  22822. default: function _default() {
  22823. return conf.modal.storage;
  22824. }
  22825. },
  22826. storageKey: {
  22827. type: String,
  22828. default: function _default() {
  22829. return conf.modal.storageKey;
  22830. }
  22831. },
  22832. animat: {
  22833. type: Boolean,
  22834. default: function _default() {
  22835. return conf.modal.animat;
  22836. }
  22837. },
  22838. size: {
  22839. type: String,
  22840. default: function _default() {
  22841. return conf.modal.size || conf.size;
  22842. }
  22843. },
  22844. beforeHideMethod: {
  22845. type: Function,
  22846. default: function _default() {
  22847. return conf.modal.beforeHideMethod;
  22848. }
  22849. },
  22850. slots: Object,
  22851. events: Object
  22852. },
  22853. data: function data() {
  22854. return {
  22855. inited: false,
  22856. visible: false,
  22857. contentVisible: false,
  22858. modalTop: 0,
  22859. modalZindex: 0,
  22860. zoomLocat: null,
  22861. firstOpen: false
  22862. };
  22863. },
  22864. computed: {
  22865. vSize: function vSize() {
  22866. return this.size || this.$parent && (this.$parent.size || this.$parent.vSize);
  22867. },
  22868. isMsg: function isMsg() {
  22869. return this.type === 'message';
  22870. }
  22871. },
  22872. watch: {
  22873. width: function width() {
  22874. this.recalculate();
  22875. },
  22876. height: function height() {
  22877. this.recalculate();
  22878. },
  22879. value: function value(visible) {
  22880. this[visible ? 'open' : 'close']();
  22881. }
  22882. },
  22883. created: function created() {
  22884. if (this.storage && !this.id) {
  22885. UtilTools.error('vxe.error.reqProp', ['modal.id']);
  22886. }
  22887. activeModals.push(this);
  22888. },
  22889. mounted: function mounted() {
  22890. var $listeners = this.$listeners,
  22891. _this$events = this.events,
  22892. events = _this$events === void 0 ? {} : _this$events;
  22893. if (this.value) {
  22894. this.open();
  22895. }
  22896. this.recalculate();
  22897. if (this.escClosable) {
  22898. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  22899. } // 触发 inserted 事件
  22900. var type = 'inserted';
  22901. var params = {
  22902. type: type,
  22903. $modal: this,
  22904. $event: {
  22905. type: type
  22906. }
  22907. };
  22908. if ($listeners.inserted) {
  22909. this.$emit('inserted', params);
  22910. } else if (events.inserted) {
  22911. events.inserted.call(this, params);
  22912. }
  22913. },
  22914. beforeDestroy: function beforeDestroy() {
  22915. var _this = this;
  22916. var $el = this.$el;
  22917. GlobalEvent.off(this, 'keydown');
  22918. this.removeMsgQueue();
  22919. if ($el.parentNode === document.body) {
  22920. $el.parentNode.removeChild($el);
  22921. }
  22922. ctor_amd_xe_utils_default.a.remove(activeModals, function ($modal) {
  22923. return $modal === _this;
  22924. });
  22925. },
  22926. render: function render(h) {
  22927. var _ref,
  22928. _this2 = this;
  22929. var $scopedSlots = this.$scopedSlots,
  22930. _this$slots = this.slots,
  22931. slots = _this$slots === void 0 ? {} : _this$slots,
  22932. inited = this.inited,
  22933. vSize = this.vSize,
  22934. className = this.className,
  22935. type = this.type,
  22936. resize = this.resize,
  22937. showZoom = this.showZoom,
  22938. animat = this.animat,
  22939. loading = this.loading,
  22940. status = this.status,
  22941. iconStatus = this.iconStatus,
  22942. showFooter = this.showFooter,
  22943. zoomLocat = this.zoomLocat,
  22944. modalTop = this.modalTop,
  22945. dblclickZoom = this.dblclickZoom,
  22946. contentVisible = this.contentVisible,
  22947. visible = this.visible,
  22948. title = this.title,
  22949. lockScroll = this.lockScroll,
  22950. lockView = this.lockView,
  22951. mask = this.mask,
  22952. isMsg = this.isMsg,
  22953. showTitleOverflow = this.showTitleOverflow,
  22954. destroyOnClose = this.destroyOnClose;
  22955. var content = this.content || this.message;
  22956. var defaultSlot = $scopedSlots.default || slots.default;
  22957. var footerSlot = $scopedSlots.footer || slots.footer;
  22958. var headerSlot = $scopedSlots.header || slots.header;
  22959. var titleSlot = $scopedSlots.title || slots.title;
  22960. var headerOns = {
  22961. mousedown: this.mousedownEvent
  22962. };
  22963. if ((showZoom === null ? resize : showZoom) && dblclickZoom && type === 'modal') {
  22964. headerOns.dblclick = this.toggleZoomEvent;
  22965. }
  22966. return h('div', {
  22967. class: ['vxe-modal--wrapper', "type--".concat(type), className, (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "status--".concat(status), status), _defineProperty(_ref, 'is--animat', animat), _defineProperty(_ref, 'lock--scroll', lockScroll), _defineProperty(_ref, 'lock--view', lockView), _defineProperty(_ref, 'is--resize', resize), _defineProperty(_ref, 'is--mask', mask), _defineProperty(_ref, 'is--maximize', zoomLocat), _defineProperty(_ref, 'is--visible', contentVisible), _defineProperty(_ref, 'is--active', visible), _defineProperty(_ref, 'is--loading', loading), _ref)],
  22968. style: {
  22969. zIndex: this.modalZindex,
  22970. top: modalTop ? "".concat(modalTop, "px") : null
  22971. },
  22972. on: {
  22973. click: this.selfClickEvent
  22974. }
  22975. }, [h('div', {
  22976. class: 'vxe-modal--box',
  22977. on: {
  22978. mousedown: this.boxMousedownEvent
  22979. },
  22980. ref: 'modalBox'
  22981. }, [this.showHeader ? h('div', {
  22982. class: ['vxe-modal--header', !isMsg && showTitleOverflow ? 'is--ellipsis' : ''],
  22983. on: headerOns
  22984. }, headerSlot ? !inited || destroyOnClose && !visible ? [] : headerSlot.call(this, {
  22985. $modal: this
  22986. }, h) : [titleSlot ? titleSlot.call(this, {
  22987. $modal: this
  22988. }, h) : h('span', {
  22989. class: 'vxe-modal--title'
  22990. }, title ? UtilTools.getFuncText(title) : conf.i18n('vxe.alert.title')), (showZoom === null ? resize : showZoom) ? h('i', {
  22991. class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? conf.icon.MODAL_ZOOM_OUT : conf.icon.MODAL_ZOOM_IN],
  22992. attrs: {
  22993. title: conf.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
  22994. },
  22995. on: {
  22996. click: this.toggleZoomEvent
  22997. }
  22998. }) : null, h('i', {
  22999. class: ['vxe-modal--close-btn', 'trigger--btn', conf.icon.MODAL_CLOSE],
  23000. attrs: {
  23001. title: conf.i18n('vxe.modal.close')
  23002. },
  23003. on: {
  23004. click: this.closeEvent
  23005. }
  23006. })]) : null, h('div', {
  23007. class: 'vxe-modal--body'
  23008. }, [status ? h('div', {
  23009. class: 'vxe-modal--status-wrapper'
  23010. }, [h('i', {
  23011. class: ['vxe-modal--status-icon', iconStatus || conf.icon["MODAL_".concat(status).toLocaleUpperCase()]]
  23012. })]) : null, h('div', {
  23013. class: 'vxe-modal--content'
  23014. }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
  23015. $modal: this
  23016. }, h) : UtilTools.getFuncText(content)), !isMsg ? h('div', {
  23017. class: ['vxe-loading', {
  23018. 'is--visible': loading
  23019. }]
  23020. }, [h('div', {
  23021. class: 'vxe-loading--spinner'
  23022. })]) : null]), showFooter ? h('div', {
  23023. class: 'vxe-modal--footer'
  23024. }, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
  23025. $modal: this
  23026. }, h) : [type === 'confirm' ? h('vxe-button', {
  23027. ref: 'cancelBtn',
  23028. on: {
  23029. click: this.cancelEvent
  23030. }
  23031. }, this.cancelButtonText || conf.i18n('vxe.button.cancel')) : null, h('vxe-button', {
  23032. ref: 'confirmBtn',
  23033. props: {
  23034. status: 'primary'
  23035. },
  23036. on: {
  23037. click: this.confirmEvent
  23038. }
  23039. }, this.confirmButtonText || conf.i18n('vxe.button.confirm'))]) : null, !isMsg && resize ? h('span', {
  23040. class: 'vxe-modal--resize'
  23041. }, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(function (type) {
  23042. return h('span', {
  23043. class: "".concat(type, "-resize"),
  23044. attrs: {
  23045. 'data-type': type
  23046. },
  23047. on: {
  23048. mousedown: _this2.dragEvent
  23049. }
  23050. });
  23051. })) : null])]);
  23052. },
  23053. methods: {
  23054. recalculate: function recalculate() {
  23055. var width = this.width,
  23056. height = this.height;
  23057. var modalBoxElem = this.getBox();
  23058. modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
  23059. modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
  23060. return this.$nextTick();
  23061. },
  23062. selfClickEvent: function selfClickEvent(evnt) {
  23063. if (this.maskClosable && evnt.target === this.$el) {
  23064. var type = 'mask';
  23065. this.close(type);
  23066. }
  23067. },
  23068. updateZindex: function updateZindex() {
  23069. var zIndex = this.zIndex,
  23070. modalZindex = this.modalZindex;
  23071. if (zIndex) {
  23072. this.modalZindex = zIndex;
  23073. } else if (modalZindex < UtilTools.getLastZIndex()) {
  23074. this.modalZindex = UtilTools.nextZIndex();
  23075. }
  23076. },
  23077. closeEvent: function closeEvent(evnt) {
  23078. var type = 'close';
  23079. this.$emit(type, {
  23080. type: type,
  23081. $modal: this,
  23082. $event: evnt
  23083. }, evnt);
  23084. this.close(type);
  23085. },
  23086. confirmEvent: function confirmEvent(evnt) {
  23087. var type = 'confirm';
  23088. this.$emit(type, {
  23089. type: type,
  23090. $modal: this,
  23091. $event: evnt
  23092. }, evnt);
  23093. this.close(type);
  23094. },
  23095. cancelEvent: function cancelEvent(evnt) {
  23096. var type = 'cancel';
  23097. this.$emit(type, {
  23098. type: type,
  23099. $modal: this,
  23100. $event: evnt
  23101. }, evnt);
  23102. this.close(type);
  23103. },
  23104. open: function open() {
  23105. var _this3 = this;
  23106. var $refs = this.$refs,
  23107. _this$events2 = this.events,
  23108. events = _this$events2 === void 0 ? {} : _this$events2,
  23109. inited = this.inited,
  23110. duration = this.duration,
  23111. visible = this.visible,
  23112. isMsg = this.isMsg,
  23113. remember = this.remember,
  23114. showFooter = this.showFooter;
  23115. if (!inited) {
  23116. this.inited = true;
  23117. if (this.transfer) {
  23118. document.body.appendChild(this.$el);
  23119. }
  23120. }
  23121. if (!visible) {
  23122. var type = 'show';
  23123. var params = {
  23124. type: type,
  23125. $modal: this,
  23126. $event: {
  23127. type: type
  23128. }
  23129. };
  23130. if (!remember) {
  23131. this.recalculate();
  23132. }
  23133. this.visible = true;
  23134. this.contentVisible = false;
  23135. this.updateZindex();
  23136. activities.push(this);
  23137. this.$emit('activated', params);
  23138. setTimeout(function () {
  23139. _this3.contentVisible = true;
  23140. _this3.$nextTick(function () {
  23141. if (showFooter) {
  23142. var operBtn = $refs.confirmBtn || $refs.cancelBtn;
  23143. if (operBtn) {
  23144. operBtn.focus();
  23145. }
  23146. }
  23147. if (events.show) {
  23148. events.show.call(_this3, params);
  23149. } else {
  23150. _this3.$emit('input', true);
  23151. _this3.$emit('show', params);
  23152. }
  23153. });
  23154. }, 10);
  23155. if (isMsg) {
  23156. this.addMsgQueue();
  23157. if (duration !== -1) {
  23158. setTimeout(this.close, ctor_amd_xe_utils_default.a.toNumber(duration));
  23159. }
  23160. } else {
  23161. this.$nextTick(function () {
  23162. var firstOpen = _this3.firstOpen,
  23163. fullscreen = _this3.fullscreen;
  23164. if (!remember || !firstOpen) {
  23165. _this3.updatePosition().then(function () {
  23166. setTimeout(function () {
  23167. return _this3.updatePosition();
  23168. }, 20);
  23169. });
  23170. }
  23171. if (!firstOpen) {
  23172. _this3.firstOpen = true;
  23173. if (_this3.hasPosStorage()) {
  23174. _this3.restorePosStorage();
  23175. } else if (fullscreen) {
  23176. _this3.$nextTick(function () {
  23177. return _this3.maximize();
  23178. });
  23179. }
  23180. }
  23181. });
  23182. }
  23183. }
  23184. },
  23185. addMsgQueue: function addMsgQueue() {
  23186. if (src_queue.indexOf(this) === -1) {
  23187. src_queue.push(this);
  23188. }
  23189. this.updateStyle();
  23190. },
  23191. removeMsgQueue: function removeMsgQueue() {
  23192. var _this4 = this;
  23193. if (src_queue.indexOf(this) > -1) {
  23194. ctor_amd_xe_utils_default.a.remove(src_queue, function (comp) {
  23195. return comp === _this4;
  23196. });
  23197. }
  23198. this.updateStyle();
  23199. },
  23200. updateStyle: function updateStyle() {
  23201. this.$nextTick(function () {
  23202. var offsetTop = 0;
  23203. src_queue.forEach(function (comp) {
  23204. offsetTop += ctor_amd_xe_utils_default.a.toNumber(comp.top);
  23205. comp.modalTop = offsetTop;
  23206. offsetTop += comp.$refs.modalBox.clientHeight;
  23207. });
  23208. });
  23209. },
  23210. updatePosition: function updatePosition() {
  23211. var _this5 = this;
  23212. return this.$nextTick().then(function () {
  23213. var marginSize = _this5.marginSize,
  23214. position = _this5.position;
  23215. var modalBoxElem = _this5.getBox();
  23216. var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
  23217. var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
  23218. var isPosCenter = position === 'center';
  23219. var _ref2 = isPosCenter ? {
  23220. top: position,
  23221. left: position
  23222. } : Object.assign({}, position),
  23223. top = _ref2.top,
  23224. left = _ref2.left;
  23225. var topCenter = isPosCenter || top === 'center';
  23226. var leftCenter = isPosCenter || left === 'center';
  23227. var posTop = '';
  23228. var posLeft = '';
  23229. if (left && !leftCenter) {
  23230. posLeft = isNaN(left) ? left : "".concat(left, "px");
  23231. } else {
  23232. posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
  23233. }
  23234. if (top && !topCenter) {
  23235. posTop = isNaN(top) ? top : "".concat(top, "px");
  23236. } else {
  23237. posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
  23238. }
  23239. modalBoxElem.style.top = posTop;
  23240. modalBoxElem.style.left = posLeft;
  23241. });
  23242. },
  23243. close: function close(type) {
  23244. var _this6 = this;
  23245. var _this$events3 = this.events,
  23246. events = _this$events3 === void 0 ? {} : _this$events3,
  23247. remember = this.remember,
  23248. visible = this.visible,
  23249. isMsg = this.isMsg,
  23250. beforeHideMethod = this.beforeHideMethod;
  23251. var params = {
  23252. type: type,
  23253. $modal: this,
  23254. $event: {
  23255. type: type
  23256. }
  23257. };
  23258. if (visible) {
  23259. Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
  23260. if (!ctor_amd_xe_utils_default.a.isError(rest)) {
  23261. if (isMsg) {
  23262. _this6.removeMsgQueue();
  23263. }
  23264. _this6.contentVisible = false;
  23265. if (!remember) {
  23266. _this6.zoomLocat = null;
  23267. }
  23268. _this6.$emit('deactivated', params);
  23269. ctor_amd_xe_utils_default.a.remove(activities, function (item) {
  23270. return item === _this6;
  23271. });
  23272. setTimeout(function () {
  23273. _this6.visible = false;
  23274. if (events.hide) {
  23275. events.hide.call(_this6, params);
  23276. } else {
  23277. _this6.$emit('input', false);
  23278. _this6.$emit('hide', params);
  23279. }
  23280. }, 200);
  23281. }
  23282. }).catch(function (e) {
  23283. return e;
  23284. });
  23285. }
  23286. },
  23287. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  23288. var _this7 = this;
  23289. if (evnt.keyCode === 27) {
  23290. var lastModal = ctor_amd_xe_utils_default.a.max(activities, function (item) {
  23291. return item.modalZindex;
  23292. }); // 多个时,只关掉最上层的窗口
  23293. if (lastModal) {
  23294. setTimeout(function () {
  23295. if (lastModal === _this7 && lastModal.escClosable) {
  23296. _this7.close();
  23297. }
  23298. }, 10);
  23299. }
  23300. }
  23301. },
  23302. getBox: function getBox() {
  23303. return this.$refs.modalBox;
  23304. },
  23305. isMaximized: function isMaximized() {
  23306. return !!this.zoomLocat;
  23307. },
  23308. maximize: function maximize() {
  23309. var _this8 = this;
  23310. return this.$nextTick().then(function () {
  23311. var zoomLocat = _this8.zoomLocat;
  23312. if (!zoomLocat) {
  23313. var marginSize = _this8.marginSize;
  23314. var modalBoxElem = _this8.getBox();
  23315. var _DomTools$getDomNode = DomTools.getDomNode(),
  23316. visibleHeight = _DomTools$getDomNode.visibleHeight,
  23317. visibleWidth = _DomTools$getDomNode.visibleWidth;
  23318. _this8.zoomLocat = {
  23319. top: modalBoxElem.offsetTop,
  23320. left: modalBoxElem.offsetLeft,
  23321. width: modalBoxElem.offsetWidth + (modalBoxElem.style.width ? 0 : 1),
  23322. height: modalBoxElem.offsetHeight + (modalBoxElem.style.height ? 0 : 1)
  23323. };
  23324. Object.assign(modalBoxElem.style, {
  23325. top: "".concat(marginSize, "px"),
  23326. left: "".concat(marginSize, "px"),
  23327. width: "".concat(visibleWidth - marginSize * 2, "px"),
  23328. height: "".concat(visibleHeight - marginSize * 2, "px")
  23329. });
  23330. _this8.savePosStorage();
  23331. }
  23332. });
  23333. },
  23334. revert: function revert() {
  23335. var _this9 = this;
  23336. return this.$nextTick().then(function () {
  23337. var zoomLocat = _this9.zoomLocat;
  23338. if (zoomLocat) {
  23339. var modalBoxElem = _this9.getBox();
  23340. _this9.zoomLocat = null;
  23341. Object.assign(modalBoxElem.style, {
  23342. top: "".concat(zoomLocat.top, "px"),
  23343. left: "".concat(zoomLocat.left, "px"),
  23344. width: "".concat(zoomLocat.width, "px"),
  23345. height: "".concat(zoomLocat.height, "px")
  23346. });
  23347. _this9.savePosStorage();
  23348. }
  23349. });
  23350. },
  23351. zoom: function zoom() {
  23352. var _this10 = this;
  23353. return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
  23354. return _this10.isMaximized();
  23355. });
  23356. },
  23357. toggleZoomEvent: function toggleZoomEvent(evnt) {
  23358. var _this11 = this;
  23359. var $listeners = this.$listeners,
  23360. zoomLocat = this.zoomLocat,
  23361. _this$events4 = this.events,
  23362. events = _this$events4 === void 0 ? {} : _this$events4;
  23363. var params = {
  23364. type: zoomLocat ? 'revert' : 'max',
  23365. $modal: this,
  23366. $event: evnt
  23367. };
  23368. return this.zoom().then(function () {
  23369. if ($listeners.zoom) {
  23370. _this11.$emit('zoom', params, evnt);
  23371. } else if (events.zoom) {
  23372. events.zoom.call(_this11, params, evnt);
  23373. }
  23374. });
  23375. },
  23376. getPosition: function getPosition() {
  23377. if (!this.isMsg) {
  23378. var modalBoxElem = this.getBox();
  23379. if (modalBoxElem) {
  23380. return {
  23381. top: modalBoxElem.offsetTop,
  23382. left: modalBoxElem.offsetLeft
  23383. };
  23384. }
  23385. }
  23386. return null;
  23387. },
  23388. setPosition: function setPosition(top, left) {
  23389. if (!this.isMsg) {
  23390. var modalBoxElem = this.getBox();
  23391. if (ctor_amd_xe_utils_default.a.isNumber(top)) {
  23392. modalBoxElem.style.top = "".concat(top, "px");
  23393. }
  23394. if (ctor_amd_xe_utils_default.a.isNumber(left)) {
  23395. modalBoxElem.style.left = "".concat(left, "px");
  23396. }
  23397. }
  23398. return this.$nextTick();
  23399. },
  23400. boxMousedownEvent: function boxMousedownEvent() {
  23401. var modalZindex = this.modalZindex;
  23402. if (activeModals.some(function (_vm) {
  23403. return _vm.visible && _vm.modalZindex > modalZindex;
  23404. })) {
  23405. this.updateZindex();
  23406. }
  23407. },
  23408. mousedownEvent: function mousedownEvent(evnt) {
  23409. var _this12 = this;
  23410. var remember = this.remember,
  23411. storage = this.storage,
  23412. marginSize = this.marginSize,
  23413. zoomLocat = this.zoomLocat;
  23414. var modalBoxElem = this.getBox();
  23415. if (!zoomLocat && evnt.button === 0 && !DomTools.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
  23416. evnt.preventDefault();
  23417. var domMousemove = document.onmousemove;
  23418. var domMouseup = document.onmouseup;
  23419. var disX = evnt.clientX - modalBoxElem.offsetLeft;
  23420. var disY = evnt.clientY - modalBoxElem.offsetTop;
  23421. var _DomTools$getDomNode2 = DomTools.getDomNode(),
  23422. visibleHeight = _DomTools$getDomNode2.visibleHeight,
  23423. visibleWidth = _DomTools$getDomNode2.visibleWidth;
  23424. document.onmousemove = function (evnt) {
  23425. evnt.preventDefault();
  23426. var offsetWidth = modalBoxElem.offsetWidth;
  23427. var offsetHeight = modalBoxElem.offsetHeight;
  23428. var minX = marginSize;
  23429. var maxX = visibleWidth - offsetWidth - marginSize - 1;
  23430. var minY = marginSize;
  23431. var maxY = visibleHeight - offsetHeight - marginSize - 1;
  23432. var left = evnt.clientX - disX;
  23433. var top = evnt.clientY - disY;
  23434. if (left > maxX) {
  23435. left = maxX;
  23436. }
  23437. if (left < minX) {
  23438. left = minX;
  23439. }
  23440. if (top > maxY) {
  23441. top = maxY;
  23442. }
  23443. if (top < minY) {
  23444. top = minY;
  23445. }
  23446. modalBoxElem.style.left = "".concat(left, "px");
  23447. modalBoxElem.style.top = "".concat(top, "px");
  23448. };
  23449. document.onmouseup = function () {
  23450. document.onmousemove = domMousemove;
  23451. document.onmouseup = domMouseup;
  23452. if (remember && storage) {
  23453. _this12.$nextTick(function () {
  23454. _this12.savePosStorage();
  23455. });
  23456. }
  23457. };
  23458. }
  23459. },
  23460. dragEvent: function dragEvent(evnt) {
  23461. var _this13 = this;
  23462. evnt.preventDefault();
  23463. var $listeners = this.$listeners,
  23464. marginSize = this.marginSize,
  23465. _this$events5 = this.events,
  23466. events = _this$events5 === void 0 ? {} : _this$events5,
  23467. remember = this.remember,
  23468. storage = this.storage;
  23469. var _DomTools$getDomNode3 = DomTools.getDomNode(),
  23470. visibleHeight = _DomTools$getDomNode3.visibleHeight,
  23471. visibleWidth = _DomTools$getDomNode3.visibleWidth;
  23472. var type = evnt.target.dataset.type;
  23473. var minWidth = ctor_amd_xe_utils_default.a.toNumber(this.minWidth);
  23474. var minHeight = ctor_amd_xe_utils_default.a.toNumber(this.minHeight);
  23475. var maxWidth = visibleWidth;
  23476. var maxHeight = visibleHeight;
  23477. var modalBoxElem = this.getBox();
  23478. var domMousemove = document.onmousemove;
  23479. var domMouseup = document.onmouseup;
  23480. var clientWidth = modalBoxElem.clientWidth;
  23481. var clientHeight = modalBoxElem.clientHeight;
  23482. var disX = evnt.clientX;
  23483. var disY = evnt.clientY;
  23484. var offsetTop = modalBoxElem.offsetTop;
  23485. var offsetLeft = modalBoxElem.offsetLeft;
  23486. var params = {
  23487. type: 'resize',
  23488. $modal: this
  23489. };
  23490. document.onmousemove = function (evnt) {
  23491. evnt.preventDefault();
  23492. var dragLeft;
  23493. var dragTop;
  23494. var width;
  23495. var height;
  23496. switch (type) {
  23497. case 'wl':
  23498. dragLeft = disX - evnt.clientX;
  23499. width = dragLeft + clientWidth;
  23500. if (offsetLeft - dragLeft > marginSize) {
  23501. if (width > minWidth) {
  23502. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23503. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23504. }
  23505. }
  23506. break;
  23507. case 'swst':
  23508. dragLeft = disX - evnt.clientX;
  23509. dragTop = disY - evnt.clientY;
  23510. width = dragLeft + clientWidth;
  23511. height = dragTop + clientHeight;
  23512. if (offsetLeft - dragLeft > marginSize) {
  23513. if (width > minWidth) {
  23514. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23515. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23516. }
  23517. }
  23518. if (offsetTop - dragTop > marginSize) {
  23519. if (height > minHeight) {
  23520. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23521. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23522. }
  23523. }
  23524. break;
  23525. case 'swlb':
  23526. dragLeft = disX - evnt.clientX;
  23527. dragTop = evnt.clientY - disY;
  23528. width = dragLeft + clientWidth;
  23529. height = dragTop + clientHeight;
  23530. if (offsetLeft - dragLeft > marginSize) {
  23531. if (width > minWidth) {
  23532. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23533. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23534. }
  23535. }
  23536. if (offsetTop + height + marginSize < visibleHeight) {
  23537. if (height > minHeight) {
  23538. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23539. }
  23540. }
  23541. break;
  23542. case 'st':
  23543. dragTop = disY - evnt.clientY;
  23544. height = clientHeight + dragTop;
  23545. if (offsetTop - dragTop > marginSize) {
  23546. if (height > minHeight) {
  23547. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23548. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23549. }
  23550. }
  23551. break;
  23552. case 'wr':
  23553. dragLeft = evnt.clientX - disX;
  23554. width = dragLeft + clientWidth;
  23555. if (offsetLeft + width + marginSize < visibleWidth) {
  23556. if (width > minWidth) {
  23557. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23558. }
  23559. }
  23560. break;
  23561. case 'sest':
  23562. dragLeft = evnt.clientX - disX;
  23563. dragTop = disY - evnt.clientY;
  23564. width = dragLeft + clientWidth;
  23565. height = dragTop + clientHeight;
  23566. if (offsetLeft + width + marginSize < visibleWidth) {
  23567. if (width > minWidth) {
  23568. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23569. }
  23570. }
  23571. if (offsetTop - dragTop > marginSize) {
  23572. if (height > minHeight) {
  23573. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23574. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23575. }
  23576. }
  23577. break;
  23578. case 'selb':
  23579. dragLeft = evnt.clientX - disX;
  23580. dragTop = evnt.clientY - disY;
  23581. width = dragLeft + clientWidth;
  23582. height = dragTop + clientHeight;
  23583. if (offsetLeft + width + marginSize < visibleWidth) {
  23584. if (width > minWidth) {
  23585. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23586. }
  23587. }
  23588. if (offsetTop + height + marginSize < visibleHeight) {
  23589. if (height > minHeight) {
  23590. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23591. }
  23592. }
  23593. break;
  23594. case 'sb':
  23595. dragTop = evnt.clientY - disY;
  23596. height = dragTop + clientHeight;
  23597. if (offsetTop + height + marginSize < visibleHeight) {
  23598. if (height > minHeight) {
  23599. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23600. }
  23601. }
  23602. break;
  23603. }
  23604. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
  23605. if (remember && storage) {
  23606. _this13.savePosStorage();
  23607. }
  23608. if ($listeners.zoom) {
  23609. _this13.$emit('zoom', params, evnt);
  23610. } else if (events.zoom) {
  23611. events.zoom.call(_this13, params, evnt);
  23612. }
  23613. };
  23614. document.onmouseup = function () {
  23615. _this13.zoomLocat = null;
  23616. document.onmousemove = domMousemove;
  23617. document.onmouseup = domMouseup;
  23618. setTimeout(function () {
  23619. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
  23620. }, 50);
  23621. };
  23622. },
  23623. getStorageMap: function getStorageMap(key) {
  23624. var version = conf.version;
  23625. var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  23626. return rest && rest._v === version ? rest : {
  23627. _v: version
  23628. };
  23629. },
  23630. hasPosStorage: function hasPosStorage() {
  23631. var id = this.id,
  23632. remember = this.remember,
  23633. storage = this.storage,
  23634. storageKey = this.storageKey;
  23635. return !!(remember && storage && this.getStorageMap(storageKey)[id]);
  23636. },
  23637. restorePosStorage: function restorePosStorage() {
  23638. var id = this.id,
  23639. remember = this.remember,
  23640. storage = this.storage,
  23641. storageKey = this.storageKey;
  23642. if (remember && storage) {
  23643. var posStorage = this.getStorageMap(storageKey)[id];
  23644. if (posStorage) {
  23645. var modalBoxElem = this.getBox();
  23646. var _posStorage$split = posStorage.split(','),
  23647. _posStorage$split2 = _slicedToArray(_posStorage$split, 8),
  23648. left = _posStorage$split2[0],
  23649. top = _posStorage$split2[1],
  23650. width = _posStorage$split2[2],
  23651. height = _posStorage$split2[3],
  23652. zoomLeft = _posStorage$split2[4],
  23653. zoomTop = _posStorage$split2[5],
  23654. zoomWidth = _posStorage$split2[6],
  23655. zoomHeight = _posStorage$split2[7];
  23656. if (left) {
  23657. modalBoxElem.style.left = "".concat(left, "px");
  23658. }
  23659. if (top) {
  23660. modalBoxElem.style.top = "".concat(top, "px");
  23661. }
  23662. if (width) {
  23663. modalBoxElem.style.width = "".concat(width, "px");
  23664. }
  23665. if (height) {
  23666. modalBoxElem.style.height = "".concat(height, "px");
  23667. }
  23668. if (zoomLeft && zoomTop) {
  23669. this.zoomLocat = {
  23670. left: zoomLeft,
  23671. top: zoomTop,
  23672. width: zoomWidth,
  23673. height: zoomHeight
  23674. };
  23675. }
  23676. }
  23677. }
  23678. },
  23679. savePosStorage: function savePosStorage() {
  23680. var id = this.id,
  23681. remember = this.remember,
  23682. storage = this.storage,
  23683. storageKey = this.storageKey,
  23684. zoomLocat = this.zoomLocat;
  23685. if (remember && storage) {
  23686. var modalBoxElem = this.getBox();
  23687. var posStorageMap = this.getStorageMap(storageKey);
  23688. posStorageMap[id] = [modalBoxElem.style.left, modalBoxElem.style.top, modalBoxElem.style.width, modalBoxElem.style.height].concat(zoomLocat ? [zoomLocat.left, zoomLocat.top, zoomLocat.width, zoomLocat.height] : []).map(function (val) {
  23689. return val ? ctor_amd_xe_utils_default.a.toNumber(val) : '';
  23690. }).join(',');
  23691. localStorage.setItem(storageKey, ctor_amd_xe_utils_default.a.toJSONString(posStorageMap));
  23692. }
  23693. }
  23694. }
  23695. });
  23696. // CONCATENATED MODULE: ./packages/modal/index.js
  23697. /* eslint-disable @typescript-eslint/no-use-before-define */
  23698. var ModalClass = null;
  23699. function openModal(opts) {
  23700. var options = Object.assign({}, opts, {
  23701. transfer: true
  23702. });
  23703. return new Promise(function (resolve) {
  23704. if (options && options.id && activities.some(function (comp) {
  23705. return comp.id === options.id;
  23706. })) {
  23707. resolve('exist');
  23708. } else {
  23709. var events = options.events || {};
  23710. options.events = Object.assign({}, events, {
  23711. hide: function hide(params) {
  23712. if (events.hide) {
  23713. events.hide.call(this, params);
  23714. }
  23715. setTimeout(function () {
  23716. return $modal.$destroy();
  23717. }, $modal.isMsg ? 500 : 100);
  23718. resolve(params.type);
  23719. }
  23720. });
  23721. var $modal = new ModalClass({
  23722. el: document.createElement('div'),
  23723. propsData: options
  23724. });
  23725. setTimeout(function () {
  23726. if ($modal.isDestroy) {
  23727. $modal.close();
  23728. } else {
  23729. $modal.open();
  23730. }
  23731. });
  23732. }
  23733. });
  23734. }
  23735. function ModalController(options) {
  23736. UtilTools.warn('vxe.error.delFunc', ['Modal', 'Modal.open']);
  23737. return openModal(options);
  23738. }
  23739. ['alert', 'confirm', 'message'].forEach(function (type, index) {
  23740. var defOpts = index === 2 ? {
  23741. mask: false,
  23742. lockView: false,
  23743. showHeader: false
  23744. } : {
  23745. showFooter: true
  23746. };
  23747. defOpts.type = type;
  23748. defOpts.dblclickZoom = false;
  23749. if (index === 1) {
  23750. defOpts.status = 'question';
  23751. }
  23752. ModalController[type] = function (content, title, options) {
  23753. var opts = {};
  23754. if (ctor_amd_xe_utils_default.a.isObject(content)) {
  23755. opts = content;
  23756. } else {
  23757. if (title) {
  23758. opts = index === 2 ? {
  23759. status: title
  23760. } : {
  23761. title: title
  23762. };
  23763. }
  23764. opts.content = ctor_amd_xe_utils_default.a.toString(content);
  23765. }
  23766. return openModal(Object.assign({
  23767. type: type
  23768. }, defOpts, opts, options));
  23769. };
  23770. });
  23771. /**
  23772. * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
  23773. * 如果传 id 则关闭指定的窗口
  23774. * 如果不传则关闭所有窗口
  23775. */
  23776. function closeModal(id) {
  23777. var modals = arguments.length ? [getModal(id)] : activities;
  23778. modals.forEach(function ($modal) {
  23779. if ($modal) {
  23780. $modal.isDestroy = true;
  23781. $modal.close('close');
  23782. }
  23783. });
  23784. return Promise.resolve();
  23785. }
  23786. function getModal(id) {
  23787. return ctor_amd_xe_utils_default.a.find(activities, function ($modal) {
  23788. return $modal.id === id;
  23789. });
  23790. }
  23791. ModalController.closeAll = function () {
  23792. UtilTools.warn('vxe.error.delFunc', ['closeAll', 'close']);
  23793. closeModal();
  23794. };
  23795. ModalController.get = getModal;
  23796. ModalController.close = closeModal;
  23797. ModalController.open = openModal;
  23798. ModalController.install = function (Vue) {
  23799. v_x_e_table._modal = 1;
  23800. Vue.component('vxe-message', modal);
  23801. Vue.component(modal.name, modal);
  23802. ModalClass = Vue.extend(modal);
  23803. Vue.prototype.$XMsg = ModalController;
  23804. Vue.prototype.$XModal = ModalController;
  23805. v_x_e_table.$modal = ModalController;
  23806. v_x_e_table.modal = ModalController;
  23807. if (!Vue.prototype.$vxe) {
  23808. Vue.prototype.$vxe = {
  23809. modal: ModalController
  23810. };
  23811. } else {
  23812. Vue.prototype.$vxe.modal = ModalController;
  23813. }
  23814. };
  23815. var Modal = ModalController;
  23816. /* harmony default export */ var packages_modal = (ModalController);
  23817. // CONCATENATED MODULE: ./packages/tooltip/src/tooltip.js
  23818. function updateTipStyle(_vm) {
  23819. var wrapperElem = _vm.$el,
  23820. tipTarget = _vm.tipTarget,
  23821. tipStore = _vm.tipStore;
  23822. if (tipTarget) {
  23823. var _DomTools$getDomNode = DomTools.getDomNode(),
  23824. scrollTop = _DomTools$getDomNode.scrollTop,
  23825. scrollLeft = _DomTools$getDomNode.scrollLeft,
  23826. visibleWidth = _DomTools$getDomNode.visibleWidth;
  23827. var _DomTools$getAbsolute = DomTools.getAbsolutePos(tipTarget),
  23828. top = _DomTools$getAbsolute.top,
  23829. left = _DomTools$getAbsolute.left;
  23830. var marginSize = 6;
  23831. var offsetHeight = wrapperElem.offsetHeight;
  23832. var offsetWidth = wrapperElem.offsetWidth;
  23833. var tipLeft = left;
  23834. var tipTop = top - offsetHeight - marginSize;
  23835. tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
  23836. if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
  23837. tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
  23838. }
  23839. if (top - offsetHeight < scrollTop + marginSize) {
  23840. tipStore.placement = 'bottom';
  23841. tipTop = top + tipTarget.offsetHeight + marginSize;
  23842. }
  23843. tipStore.style.top = "".concat(tipTop, "px");
  23844. tipStore.style.left = "".concat(tipLeft, "px");
  23845. tipStore.arrowStyle.left = "".concat(left - tipLeft + tipTarget.offsetWidth / 2, "px");
  23846. }
  23847. }
  23848. /* harmony default export */ var src_tooltip = ({
  23849. name: 'VxeTooltip',
  23850. props: {
  23851. value: Boolean,
  23852. size: {
  23853. type: String,
  23854. default: function _default() {
  23855. return conf.tooltip.size || conf.size;
  23856. }
  23857. },
  23858. trigger: {
  23859. type: String,
  23860. default: function _default() {
  23861. return conf.tooltip.trigger;
  23862. }
  23863. },
  23864. theme: {
  23865. type: String,
  23866. default: function _default() {
  23867. return conf.tooltip.theme;
  23868. }
  23869. },
  23870. content: [String, Function],
  23871. zIndex: [String, Number],
  23872. isArrow: {
  23873. type: Boolean,
  23874. default: true
  23875. },
  23876. enterable: Boolean,
  23877. leaveDelay: {
  23878. type: Number,
  23879. default: conf.tooltip.leaveDelay
  23880. }
  23881. },
  23882. data: function data() {
  23883. return {
  23884. isUpdate: false,
  23885. isHover: false,
  23886. visible: false,
  23887. message: '',
  23888. tipTarget: null,
  23889. tipZindex: 0,
  23890. tipStore: {
  23891. style: {},
  23892. placement: '',
  23893. arrowStyle: null
  23894. }
  23895. };
  23896. },
  23897. computed: {
  23898. vSize: function vSize() {
  23899. return this.size || this.$parent.size || this.$parent.vSize;
  23900. }
  23901. },
  23902. watch: {
  23903. content: function content(value) {
  23904. this.message = value;
  23905. },
  23906. value: function value(_value) {
  23907. if (!this.isUpdate) {
  23908. this[_value ? 'open' : 'close']();
  23909. }
  23910. this.isUpdate = false;
  23911. }
  23912. },
  23913. mounted: function mounted() {
  23914. var $el = this.$el,
  23915. trigger = this.trigger,
  23916. content = this.content,
  23917. value = this.value;
  23918. var parentNode = $el.parentNode;
  23919. var target;
  23920. this.message = content;
  23921. this.tipZindex = UtilTools.nextZIndex();
  23922. ctor_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
  23923. if (index > 1) {
  23924. parentNode.insertBefore(elem, $el);
  23925. if (!target) {
  23926. target = elem;
  23927. }
  23928. }
  23929. });
  23930. parentNode.removeChild($el);
  23931. this.target = target;
  23932. if (target) {
  23933. if (trigger === 'hover') {
  23934. target.onmouseleave = this.targetMouseleaveEvent;
  23935. target.onmouseenter = this.targetMouseenterEvent;
  23936. } else if (trigger === 'click') {
  23937. target.onclick = this.clickEvent;
  23938. }
  23939. }
  23940. if (value) {
  23941. this.open();
  23942. }
  23943. },
  23944. beforeDestroy: function beforeDestroy() {
  23945. var $el = this.$el,
  23946. target = this.target,
  23947. trigger = this.trigger;
  23948. var parentNode = $el.parentNode;
  23949. if (parentNode) {
  23950. parentNode.removeChild($el);
  23951. }
  23952. if (target) {
  23953. if (trigger === 'hover') {
  23954. target.onmouseenter = null;
  23955. target.onmouseleave = null;
  23956. } else if (trigger === 'click') {
  23957. target.onclick = null;
  23958. }
  23959. }
  23960. },
  23961. render: function render(h) {
  23962. var _ref;
  23963. var vSize = this.vSize,
  23964. theme = this.theme,
  23965. message = this.message,
  23966. isHover = this.isHover,
  23967. isArrow = this.isArrow,
  23968. visible = this.visible,
  23969. tipStore = this.tipStore,
  23970. enterable = this.enterable;
  23971. var on;
  23972. if (enterable) {
  23973. on = {
  23974. mouseenter: this.wrapperMouseenterEvent,
  23975. mouseleave: this.wrapperMouseleaveEvent
  23976. };
  23977. }
  23978. return h('div', {
  23979. class: ['vxe-table--tooltip-wrapper', "theme--".concat(theme), (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--hover', isHover), _ref)],
  23980. style: tipStore.style,
  23981. ref: 'tipWrapper',
  23982. on: on
  23983. }, [h('div', {
  23984. class: 'vxe-table--tooltip-content'
  23985. }, this.$slots.content || message), h('div', {
  23986. class: 'vxe-table--tooltip-arrow',
  23987. style: tipStore.arrowStyle
  23988. })].concat(this.$slots.default));
  23989. },
  23990. methods: {
  23991. show: function show(target, message) {
  23992. return this.open(target, message);
  23993. },
  23994. open: function open(target, message) {
  23995. return this.toVisible(target || this.target, message);
  23996. },
  23997. close: function close() {
  23998. this.tipTarget = null;
  23999. Object.assign(this.tipStore, {
  24000. style: {},
  24001. placement: '',
  24002. arrowStyle: null
  24003. });
  24004. this.update(false);
  24005. return this.$nextTick();
  24006. },
  24007. update: function update(value) {
  24008. if (value !== this.visible) {
  24009. this.visible = value;
  24010. this.isUpdate = true;
  24011. if (this.$listeners.input) {
  24012. this.$emit('input', this.visible);
  24013. }
  24014. }
  24015. },
  24016. updateZindex: function updateZindex() {
  24017. if (this.tipZindex < UtilTools.getLastZIndex()) {
  24018. this.tipZindex = UtilTools.nextZIndex();
  24019. }
  24020. },
  24021. toVisible: function toVisible(target, message) {
  24022. this.targetActive = true;
  24023. if (target) {
  24024. var $el = this.$el,
  24025. tipStore = this.tipStore,
  24026. zIndex = this.zIndex;
  24027. var parentNode = $el.parentNode;
  24028. if (!parentNode) {
  24029. document.body.appendChild($el);
  24030. }
  24031. if (message) {
  24032. this.message = message;
  24033. }
  24034. this.tipTarget = target;
  24035. this.update(true);
  24036. this.updateZindex();
  24037. tipStore.placement = 'top';
  24038. tipStore.style = {
  24039. width: 'auto',
  24040. left: 0,
  24041. top: 0,
  24042. zIndex: zIndex || this.tipZindex
  24043. };
  24044. tipStore.arrowStyle = {
  24045. left: '50%'
  24046. };
  24047. return this.updatePlacement();
  24048. }
  24049. return this.$nextTick();
  24050. },
  24051. updatePlacement: function updatePlacement() {
  24052. var _this = this;
  24053. return this.$nextTick().then(function () {
  24054. var wrapperElem = _this.$el,
  24055. tipTarget = _this.tipTarget;
  24056. if (tipTarget && wrapperElem) {
  24057. updateTipStyle(_this);
  24058. return _this.$nextTick().then(function () {
  24059. return updateTipStyle(_this);
  24060. });
  24061. }
  24062. });
  24063. },
  24064. clickEvent: function clickEvent() {
  24065. this[this.visible ? 'close' : 'open']();
  24066. },
  24067. targetMouseenterEvent: function targetMouseenterEvent() {
  24068. this.open();
  24069. },
  24070. targetMouseleaveEvent: function targetMouseleaveEvent() {
  24071. var _this2 = this;
  24072. var trigger = this.trigger,
  24073. enterable = this.enterable,
  24074. leaveDelay = this.leaveDelay;
  24075. this.targetActive = false;
  24076. if (enterable && trigger === 'hover') {
  24077. setTimeout(function () {
  24078. if (!_this2.isHover) {
  24079. _this2.close();
  24080. }
  24081. }, leaveDelay);
  24082. } else {
  24083. this.close();
  24084. }
  24085. },
  24086. wrapperMouseenterEvent: function wrapperMouseenterEvent() {
  24087. this.isHover = true;
  24088. },
  24089. wrapperMouseleaveEvent: function wrapperMouseleaveEvent(evnt) {
  24090. var _this3 = this;
  24091. var $listeners = this.$listeners,
  24092. trigger = this.trigger,
  24093. enterable = this.enterable,
  24094. leaveDelay = this.leaveDelay;
  24095. this.isHover = false;
  24096. if ($listeners.leave) {
  24097. this.$emit('leave', {
  24098. $event: evnt
  24099. });
  24100. } else if (enterable && trigger === 'hover') {
  24101. setTimeout(function () {
  24102. if (!_this3.targetActive) {
  24103. _this3.close();
  24104. }
  24105. }, leaveDelay);
  24106. }
  24107. }
  24108. }
  24109. });
  24110. // CONCATENATED MODULE: ./packages/tooltip/index.js
  24111. src_tooltip.install = function (Vue) {
  24112. v_x_e_table._tooltip = 1;
  24113. Vue.component(src_tooltip.name, src_tooltip);
  24114. };
  24115. var Tooltip = src_tooltip;
  24116. /* harmony default export */ var packages_tooltip = (src_tooltip);
  24117. // CONCATENATED MODULE: ./packages/form/src/form.js
  24118. var form_Rule = /*#__PURE__*/function () {
  24119. function Rule(rule) {
  24120. _classCallCheck(this, Rule);
  24121. Object.assign(this, {
  24122. $options: rule,
  24123. required: rule.required,
  24124. min: rule.min,
  24125. max: rule.min,
  24126. type: rule.type,
  24127. pattern: rule.pattern,
  24128. validator: rule.validator,
  24129. trigger: rule.trigger,
  24130. maxWidth: rule.maxWidth
  24131. });
  24132. }
  24133. _createClass(Rule, [{
  24134. key: "content",
  24135. get: function get() {
  24136. return UtilTools.getFuncText(this.$options.content || this.$options.message);
  24137. }
  24138. }, {
  24139. key: "message",
  24140. get: function get() {
  24141. return this.content;
  24142. }
  24143. }]);
  24144. return Rule;
  24145. }();
  24146. function getResetValue(value, resetValue) {
  24147. if (ctor_amd_xe_utils_default.a.isArray(value)) {
  24148. resetValue = [];
  24149. }
  24150. return resetValue;
  24151. }
  24152. function getItemSlots(_vm, item) {
  24153. var $scopedSlots = _vm.$scopedSlots;
  24154. var itemSlots = item.slots;
  24155. var slots = {};
  24156. var $default;
  24157. if (itemSlots) {
  24158. $default = itemSlots.default;
  24159. if ($default && $scopedSlots[$default]) {
  24160. $default = $scopedSlots[$default];
  24161. }
  24162. }
  24163. if ($default) {
  24164. slots.default = $default;
  24165. }
  24166. return slots;
  24167. }
  24168. function renderItems(h, _vm) {
  24169. var items = _vm.items;
  24170. return items ? items.map(function (item) {
  24171. return h('vxe-form-item', {
  24172. props: item,
  24173. scopedSlots: getItemSlots(_vm, item)
  24174. });
  24175. }) : [];
  24176. }
  24177. /* harmony default export */ var src_form = ({
  24178. name: 'VxeForm',
  24179. props: {
  24180. loading: Boolean,
  24181. data: Object,
  24182. size: {
  24183. type: String,
  24184. default: function _default() {
  24185. return conf.form.size || conf.size;
  24186. }
  24187. },
  24188. span: [String, Number],
  24189. align: {
  24190. type: String,
  24191. default: function _default() {
  24192. return conf.form.align;
  24193. }
  24194. },
  24195. titleAlign: {
  24196. type: String,
  24197. default: function _default() {
  24198. return conf.form.titleAlign;
  24199. }
  24200. },
  24201. titleWidth: [String, Number],
  24202. titleColon: {
  24203. type: Boolean,
  24204. default: function _default() {
  24205. return conf.form.titleColon;
  24206. }
  24207. },
  24208. titleAsterisk: {
  24209. type: Boolean,
  24210. default: function _default() {
  24211. return conf.form.titleAsterisk;
  24212. }
  24213. },
  24214. titleOverflow: {
  24215. type: [Boolean, String],
  24216. default: null
  24217. },
  24218. items: Array,
  24219. rules: Object,
  24220. preventSubmit: {
  24221. type: Boolean,
  24222. default: function _default() {
  24223. return conf.form.preventSubmit;
  24224. }
  24225. },
  24226. validConfig: Object
  24227. },
  24228. data: function data() {
  24229. return {
  24230. collapseAll: true,
  24231. invalids: [],
  24232. tooltipTimeout: null,
  24233. tooltipActive: false,
  24234. tooltipStore: {
  24235. item: null,
  24236. visible: false
  24237. }
  24238. };
  24239. },
  24240. provide: function provide() {
  24241. return {
  24242. $vxeform: this
  24243. };
  24244. },
  24245. computed: {
  24246. vSize: function vSize() {
  24247. return this.size || this.$parent.size || this.$parent.vSize;
  24248. },
  24249. validOpts: function validOpts() {
  24250. return Object.assign({}, conf.form.validConfig, this.validConfig);
  24251. },
  24252. tooltipOpts: function tooltipOpts() {
  24253. var opts = Object.assign({
  24254. leaveDelay: 300
  24255. }, conf.form.tooltipConfig, this.tooltipConfig);
  24256. if (opts.enterable) {
  24257. opts.leaveMethod = this.handleTooltipLeaveMethod;
  24258. }
  24259. return opts;
  24260. }
  24261. },
  24262. render: function render(h) {
  24263. var _ref;
  24264. var _e = this._e,
  24265. $slots = this.$slots,
  24266. loading = this.loading,
  24267. vSize = this.vSize,
  24268. tooltipOpts = this.tooltipOpts;
  24269. var hasUseTooltip = v_x_e_table._tooltip;
  24270. return h('form', {
  24271. class: ['vxe-form', 'vxe-row', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--colon', this.titleColon), _defineProperty(_ref, 'is--asterisk', this.titleAsterisk), _defineProperty(_ref, 'is--loading', loading), _ref)],
  24272. on: {
  24273. submit: this.submitEvent,
  24274. reset: this.resetEvent
  24275. }
  24276. }, [].concat($slots.default || renderItems(h, this)).concat([h('div', {
  24277. class: ['vxe-loading', {
  24278. 'is--visible': loading
  24279. }]
  24280. }, [h('div', {
  24281. class: 'vxe-loading--spinner'
  24282. })]),
  24283. /**
  24284. * 工具提示
  24285. */
  24286. hasUseTooltip ? h('vxe-tooltip', _objectSpread2({
  24287. ref: 'tooltip'
  24288. }, tooltipOpts)) : _e()]));
  24289. },
  24290. methods: {
  24291. getItems: function getItems() {
  24292. return this.$children.map(function (_ref2) {
  24293. var field = _ref2.field,
  24294. title = _ref2.title,
  24295. itemRender = _ref2.itemRender;
  24296. return {
  24297. field: field,
  24298. title: title,
  24299. itemRender: itemRender
  24300. };
  24301. });
  24302. },
  24303. toggleCollapse: function toggleCollapse() {
  24304. this.collapseAll = !this.collapseAll;
  24305. return this.$nextTick();
  24306. },
  24307. submitEvent: function submitEvent(evnt) {
  24308. var _this = this;
  24309. evnt.preventDefault();
  24310. if (!this.preventSubmit) {
  24311. this.beginValidate().then(function () {
  24312. _this.$emit('submit', {
  24313. data: _this.data,
  24314. $form: _this,
  24315. $event: evnt
  24316. }, evnt);
  24317. }).catch(function (errMap) {
  24318. _this.$emit('submit-invalid', {
  24319. data: _this.data,
  24320. errMap: errMap,
  24321. $form: _this,
  24322. $event: evnt
  24323. }, evnt);
  24324. });
  24325. }
  24326. },
  24327. reset: function reset() {
  24328. var _this2 = this;
  24329. var data = this.data;
  24330. if (data) {
  24331. this.$children.forEach(function (_ref3) {
  24332. var field = _ref3.field,
  24333. resetValue = _ref3.resetValue,
  24334. itemRender = _ref3.itemRender;
  24335. if (field) {
  24336. ctor_amd_xe_utils_default.a.set(data, field, resetValue === null ? getResetValue(ctor_amd_xe_utils_default.a.get(data, field), undefined) : resetValue);
  24337. var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
  24338. if (compConf && compConf.itemResetMethod) {
  24339. compConf.itemResetMethod({
  24340. data: data,
  24341. property: field,
  24342. $form: _this2
  24343. });
  24344. }
  24345. }
  24346. });
  24347. }
  24348. return this.clearValidate();
  24349. },
  24350. resetEvent: function resetEvent(evnt) {
  24351. evnt.preventDefault();
  24352. this.reset();
  24353. this.$emit('reset', {
  24354. data: this.data,
  24355. $form: this,
  24356. $event: evnt
  24357. }, evnt);
  24358. },
  24359. handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
  24360. var _this3 = this;
  24361. var tooltipOpts = this.tooltipOpts;
  24362. setTimeout(function () {
  24363. if (!_this3.tooltipActive) {
  24364. _this3.closeTooltip();
  24365. }
  24366. }, tooltipOpts.leaveDelay);
  24367. return false;
  24368. },
  24369. closeTooltip: function closeTooltip() {
  24370. var tooltipStore = this.tooltipStore;
  24371. var $tooltip = this.$refs.tooltip;
  24372. if (tooltipStore.visible) {
  24373. Object.assign(tooltipStore, {
  24374. item: null,
  24375. visible: false
  24376. });
  24377. if ($tooltip) {
  24378. $tooltip.close();
  24379. }
  24380. }
  24381. return this.$nextTick();
  24382. },
  24383. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  24384. var item = params.item;
  24385. var tooltipStore = this.tooltipStore;
  24386. var $tooltip = this.$refs.tooltip;
  24387. var overflowElem = evnt.currentTarget;
  24388. var content = (overflowElem.textContent || '').trim();
  24389. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  24390. clearTimeout(this.tooltipTimeout);
  24391. this.tooltipActive = true;
  24392. this.closeTooltip();
  24393. if (content && isCellOverflow) {
  24394. Object.assign(tooltipStore, {
  24395. item: item,
  24396. visible: true
  24397. });
  24398. if ($tooltip) {
  24399. $tooltip.open(overflowElem, content);
  24400. }
  24401. }
  24402. },
  24403. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  24404. var _this4 = this;
  24405. var tooltipOpts = this.tooltipOpts;
  24406. this.tooltipActive = false;
  24407. if (tooltipOpts.enterable) {
  24408. this.tooltipTimeout = setTimeout(function () {
  24409. var $tooltip = _this4.$refs.tooltip;
  24410. if ($tooltip && !$tooltip.isHover) {
  24411. _this4.closeTooltip();
  24412. }
  24413. }, tooltipOpts.leaveDelay);
  24414. } else {
  24415. this.closeTooltip();
  24416. }
  24417. },
  24418. clearValidate: function clearValidate(field) {
  24419. if (field) {
  24420. ctor_amd_xe_utils_default.a.remove(this.invalids, function (_ref4) {
  24421. var property = _ref4.property;
  24422. return property === field;
  24423. });
  24424. } else {
  24425. this.invalids = [];
  24426. }
  24427. return this.$nextTick();
  24428. },
  24429. validate: function validate(callback) {
  24430. return this.beginValidate('', callback);
  24431. },
  24432. beginValidate: function beginValidate(type, callback) {
  24433. var _this5 = this;
  24434. var data = this.data,
  24435. formRules = this.rules,
  24436. validOpts = this.validOpts;
  24437. var validRest = {};
  24438. var validFields = [];
  24439. var itemValids = [];
  24440. this.clearValidate();
  24441. if (data && formRules) {
  24442. this.$children.forEach(function (_ref5) {
  24443. var field = _ref5.field;
  24444. if (field) {
  24445. itemValids.push(_this5.validItemRules(type || 'all', field).catch(function (_ref6) {
  24446. var rule = _ref6.rule,
  24447. rules = _ref6.rules;
  24448. var rest = {
  24449. rule: rule,
  24450. rules: rules,
  24451. data: data,
  24452. property: field,
  24453. $form: _this5
  24454. };
  24455. if (!validRest[field]) {
  24456. validRest[field] = [];
  24457. }
  24458. validRest[field].push(rest);
  24459. validFields.push(field);
  24460. _this5.invalids.push(rest);
  24461. return Promise.reject(rest);
  24462. }));
  24463. }
  24464. });
  24465. return Promise.all(itemValids).then(function () {
  24466. if (callback) {
  24467. callback();
  24468. }
  24469. }).catch(function () {
  24470. if (callback) {
  24471. callback(validRest);
  24472. }
  24473. if (validOpts.autoPos) {
  24474. _this5.$nextTick(function () {
  24475. _this5.handleFocus(validFields);
  24476. });
  24477. }
  24478. return Promise.reject(validRest);
  24479. });
  24480. }
  24481. if (callback) {
  24482. callback();
  24483. }
  24484. return Promise.resolve();
  24485. },
  24486. /**
  24487. * 校验数据
  24488. * 按表格行、列顺序依次校验(同步或异步)
  24489. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  24490. * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
  24491. * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
  24492. *
  24493. * rule 配置:
  24494. * required=Boolean 是否必填
  24495. * min=Number 最小长度
  24496. * max=Number 最大长度
  24497. * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
  24498. * trigger=change 触发方式
  24499. */
  24500. validItemRules: function validItemRules(type, property, val) {
  24501. var _this6 = this;
  24502. var data = this.data,
  24503. formRules = this.rules;
  24504. var errorRules = [];
  24505. var syncVailds = [];
  24506. if (property && formRules) {
  24507. var rules = ctor_amd_xe_utils_default.a.get(formRules, property);
  24508. if (rules) {
  24509. var itemValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(data, property) : val;
  24510. rules.forEach(function (rule) {
  24511. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  24512. if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
  24513. var customValid = rule.validator({
  24514. itemValue: itemValue,
  24515. rule: rule,
  24516. rules: rules,
  24517. data: data,
  24518. property: property,
  24519. $form: _this6
  24520. });
  24521. if (customValid) {
  24522. if (ctor_amd_xe_utils_default.a.isError(customValid)) {
  24523. errorRules.push(new form_Rule({
  24524. type: 'custom',
  24525. trigger: rule.trigger,
  24526. message: customValid.message,
  24527. rule: new form_Rule(rule)
  24528. }));
  24529. } else if (customValid.catch) {
  24530. // 如果为异步校验(注:异步校验是并发无序的)
  24531. syncVailds.push(customValid.catch(function (e) {
  24532. errorRules.push(new form_Rule({
  24533. type: 'custom',
  24534. trigger: rule.trigger,
  24535. message: e ? e.message : rule.content || rule.message,
  24536. rule: new form_Rule(rule)
  24537. }));
  24538. }));
  24539. }
  24540. }
  24541. } else {
  24542. var isNumber = rule.type === 'number';
  24543. var numVal = isNumber ? ctor_amd_xe_utils_default.a.toNumber(itemValue) : ctor_amd_xe_utils_default.a.getSize(itemValue);
  24544. if (itemValue === null || itemValue === undefined || itemValue === '') {
  24545. if (rule.required) {
  24546. errorRules.push(new form_Rule(rule));
  24547. }
  24548. } else if (isNumber && isNaN(itemValue) || !isNaN(rule.min) && numVal < parseFloat(rule.min) || !isNaN(rule.max) && numVal > parseFloat(rule.max) || rule.pattern && !(rule.pattern.test ? rule.pattern : new RegExp(rule.pattern)).test(itemValue)) {
  24549. errorRules.push(new form_Rule(rule));
  24550. }
  24551. }
  24552. }
  24553. });
  24554. }
  24555. }
  24556. return Promise.all(syncVailds).then(function () {
  24557. if (errorRules.length) {
  24558. var rest = {
  24559. rules: errorRules,
  24560. rule: errorRules[0]
  24561. };
  24562. return Promise.reject(rest);
  24563. }
  24564. });
  24565. },
  24566. handleFocus: function handleFocus(fields) {
  24567. var $children = this.$children;
  24568. fields.some(function (property) {
  24569. var comp = ctor_amd_xe_utils_default.a.find($children, function (item) {
  24570. return item.field === property;
  24571. });
  24572. if (comp && comp.itemRender) {
  24573. var $el = comp.$el,
  24574. itemRender = comp.itemRender;
  24575. var compConf = v_x_e_table.renderer.get(itemRender.name);
  24576. var inputElem; // 如果指定了聚焦 class
  24577. if (itemRender.autofocus) {
  24578. inputElem = $el.querySelector(itemRender.autofocus);
  24579. } // 渲染器的聚焦处理
  24580. if (!inputElem && compConf && compConf.autofocus) {
  24581. inputElem = $el.querySelector(compConf.autofocus);
  24582. }
  24583. if (inputElem) {
  24584. inputElem.focus(); // 保持一致行为,光标移到末端
  24585. if (DomTools.browse.msie) {
  24586. var textRange = inputElem.createTextRange();
  24587. textRange.collapse(false);
  24588. textRange.select();
  24589. }
  24590. return true;
  24591. }
  24592. }
  24593. });
  24594. },
  24595. /**
  24596. * 更新项状态
  24597. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
  24598. * 如果单元格配置了校验规则,则会进行校验
  24599. */
  24600. updateStatus: function updateStatus(scope, itemValue) {
  24601. var _this7 = this;
  24602. var property = scope.property;
  24603. if (property) {
  24604. this.validItemRules('change', property, itemValue).then(function () {
  24605. _this7.clearValidate(property);
  24606. }).catch(function (_ref7) {
  24607. var rule = _ref7.rule,
  24608. rules = _ref7.rules;
  24609. var rest = ctor_amd_xe_utils_default.a.find(_this7.invalids, function (rest) {
  24610. return rest.property === property;
  24611. });
  24612. if (rest) {
  24613. rest.rule = rule;
  24614. rest.rules = rules;
  24615. } else {
  24616. _this7.invalids.push({
  24617. rule: rule,
  24618. rules: rules,
  24619. property: property
  24620. });
  24621. }
  24622. });
  24623. }
  24624. }
  24625. }
  24626. });
  24627. // CONCATENATED MODULE: ./packages/form/src/form-item.js
  24628. function renderPrefixIcon(h, titlePrefix) {
  24629. return h('span', {
  24630. class: 'vxe-form--item-title-prefix'
  24631. }, [h('i', {
  24632. class: titlePrefix.icon || conf.icon.FORM_PREFIX
  24633. })]);
  24634. }
  24635. function form_item_renderSuffixIcon(h, titleSuffix) {
  24636. return h('span', {
  24637. class: 'vxe-form--item-title-suffix'
  24638. }, [h('i', {
  24639. class: titleSuffix.icon || conf.icon.FORM_SUFFIX
  24640. })]);
  24641. }
  24642. function renderTitle(h, _vm) {
  24643. var title = _vm.title,
  24644. titlePrefix = _vm.titlePrefix,
  24645. titleSuffix = _vm.titleSuffix;
  24646. var titles = [];
  24647. if (titlePrefix) {
  24648. titles.push(titlePrefix.content || titlePrefix.message ? h('vxe-tooltip', {
  24649. props: {
  24650. content: UtilTools.getFuncText(titlePrefix.content || titlePrefix.message),
  24651. enterable: titlePrefix.enterable,
  24652. theme: titlePrefix.theme
  24653. }
  24654. }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
  24655. }
  24656. titles.push(h('span', {
  24657. class: 'vxe-form--item-title-label'
  24658. }, UtilTools.getFuncText(title)));
  24659. if (titleSuffix) {
  24660. titles.push(titleSuffix.content || titleSuffix.message ? h('vxe-tooltip', {
  24661. props: {
  24662. content: UtilTools.getFuncText(titleSuffix.content || titleSuffix.message),
  24663. enterable: titleSuffix.enterable,
  24664. theme: titleSuffix.theme
  24665. }
  24666. }, [form_item_renderSuffixIcon(h, titleSuffix)]) : form_item_renderSuffixIcon(h, titleSuffix));
  24667. }
  24668. return titles;
  24669. }
  24670. /* harmony default export */ var form_item = ({
  24671. name: 'VxeFormItem',
  24672. props: {
  24673. title: String,
  24674. field: String,
  24675. size: String,
  24676. span: [String, Number],
  24677. align: String,
  24678. titleAlign: String,
  24679. titleWidth: [String, Number],
  24680. className: [String, Function],
  24681. titleOverflow: {
  24682. type: [Boolean, String],
  24683. default: null
  24684. },
  24685. titlePrefix: Object,
  24686. titleSuffix: Object,
  24687. resetValue: {
  24688. default: null
  24689. },
  24690. visible: {
  24691. type: Boolean,
  24692. default: null
  24693. },
  24694. visibleMethod: Function,
  24695. folding: Boolean,
  24696. collapseNode: Boolean,
  24697. itemRender: Object
  24698. },
  24699. inject: {
  24700. $vxeform: {
  24701. default: null
  24702. }
  24703. },
  24704. data: function data() {
  24705. return {
  24706. showError: false,
  24707. showRule: null
  24708. };
  24709. },
  24710. computed: {
  24711. vSize: function vSize() {
  24712. return this.size || this.$parent.size || this.$parent.vSize;
  24713. },
  24714. isRequired: function isRequired() {
  24715. var $vxeform = this.$vxeform,
  24716. field = this.field;
  24717. if ($vxeform && $vxeform.rules) {
  24718. var rules = $vxeform.rules[field];
  24719. if (rules) {
  24720. return rules.some(function (rule) {
  24721. return rule.required;
  24722. });
  24723. }
  24724. }
  24725. return false;
  24726. },
  24727. errRule: function errRule() {
  24728. var $vxeform = this.$vxeform,
  24729. field = this.field;
  24730. if ($vxeform) {
  24731. return ctor_amd_xe_utils_default.a.find($vxeform.invalids, function (_ref) {
  24732. var property = _ref.property;
  24733. return field === property;
  24734. });
  24735. }
  24736. return null;
  24737. }
  24738. },
  24739. watch: {
  24740. errRule: function errRule(value) {
  24741. var _this = this;
  24742. clearTimeout(this.showErrTimeout);
  24743. this.showError = false;
  24744. if (value) {
  24745. this.showRule = value.rule;
  24746. setTimeout(function () {
  24747. _this.showError = true;
  24748. }, 30);
  24749. } else {
  24750. this.showErrTimeout = setTimeout(function () {
  24751. _this.showRule = null;
  24752. }, 350);
  24753. }
  24754. }
  24755. },
  24756. render: function render(h) {
  24757. var _e = this._e,
  24758. $scopedSlots = this.$scopedSlots,
  24759. $vxeform = this.$vxeform,
  24760. title = this.title,
  24761. folding = this.folding,
  24762. visible = this.visible,
  24763. visibleMethod = this.visibleMethod,
  24764. field = this.field,
  24765. className = this.className,
  24766. collapseNode = this.collapseNode,
  24767. itemRender = this.itemRender,
  24768. isRequired = this.isRequired,
  24769. showError = this.showError,
  24770. showRule = this.showRule,
  24771. titleOverflow = this.titleOverflow;
  24772. var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
  24773. var span = this.span || $vxeform.span;
  24774. var align = this.align || $vxeform.align;
  24775. var titleAlign = this.titleAlign || $vxeform.titleAlign;
  24776. var titleWidth = this.titleWidth || $vxeform.titleWidth;
  24777. var collapseAll = $vxeform.collapseAll;
  24778. var itemVisibleMethod = visibleMethod;
  24779. var itemOverflow = ctor_amd_xe_utils_default.a.isUndefined(titleOverflow) || ctor_amd_xe_utils_default.a.isNull(titleOverflow) ? $vxeform.titleOverflow : titleOverflow;
  24780. var showEllipsis = itemOverflow === 'ellipsis';
  24781. var showTitle = itemOverflow === 'title';
  24782. var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
  24783. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  24784. var params = {
  24785. data: $vxeform.data,
  24786. property: field,
  24787. item: this,
  24788. $form: $vxeform
  24789. };
  24790. if (visible === false) {
  24791. return _e();
  24792. }
  24793. if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
  24794. itemVisibleMethod = compConf.itemVisibleMethod;
  24795. }
  24796. var contentVNs = [];
  24797. if (compConf && compConf.renderItemContent) {
  24798. contentVNs = compConf.renderItemContent.call(this, h, itemRender, params);
  24799. } else if (compConf && compConf.renderItem) {
  24800. // 在 v4 中废弃 renderItem
  24801. UtilTools.warn('vxe.error.delFunc', ['renderItem', 'renderItemContent']);
  24802. contentVNs = compConf.renderItem.call(this, h, itemRender, params);
  24803. } else if ($scopedSlots && $scopedSlots.default) {
  24804. contentVNs = $scopedSlots.default.call(this, params, h);
  24805. } else if (field) {
  24806. contentVNs = ["".concat(ctor_amd_xe_utils_default.a.get($vxeform.data, field))];
  24807. }
  24808. var ons = showTooltip && $vxeform ? {
  24809. mouseenter: function mouseenter(evnt) {
  24810. $vxeform.triggerHeaderHelpEvent(evnt, params);
  24811. },
  24812. mouseleave: $vxeform.handleTargetLeaveEvent
  24813. } : {};
  24814. return h('div', {
  24815. class: ['vxe-form--item', span ? "vxe-col--".concat(span, " is--span") : null, className, {
  24816. 'is--title': title,
  24817. 'is--required': isRequired,
  24818. 'is--hidden': folding && collapseAll,
  24819. 'is--active': !itemVisibleMethod || itemVisibleMethod(params),
  24820. 'is--error': showError
  24821. }]
  24822. }, [h('div', {
  24823. class: 'vxe-form--item-inner'
  24824. }, [title ? h('div', {
  24825. class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
  24826. 'is--ellipsis': hasEllipsis
  24827. }],
  24828. style: titleWidth ? {
  24829. width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
  24830. } : null,
  24831. attrs: {
  24832. title: showTitle ? UtilTools.getFuncText(title) : null
  24833. },
  24834. on: ons
  24835. }, renderTitle(h, this)) : null, h('div', {
  24836. class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
  24837. }, contentVNs.concat([collapseNode ? h('div', {
  24838. class: 'vxe-form--item-trigger-node',
  24839. on: {
  24840. click: this.toggleCollapseEvent
  24841. }
  24842. }, [h('span', {
  24843. class: 'vxe-form--item-trigger-text'
  24844. }, collapseAll ? conf.i18n('vxe.form.unfolding') : conf.i18n('vxe.form.folding')), h('i', {
  24845. class: ['vxe-form--item-trigger-icon', collapseAll ? conf.icon.FORM_FOLDING : conf.icon.FORM_UNFOLDING]
  24846. })]) : null, showRule && $vxeform.validOpts.showMessage ? h('div', {
  24847. class: 'vxe-form--item-valid',
  24848. style: showRule.maxWidth ? {
  24849. width: "".concat(showRule.maxWidth, "px")
  24850. } : null
  24851. }, showRule.message) : null]))])]);
  24852. },
  24853. methods: {
  24854. toggleCollapseEvent: function toggleCollapseEvent(evnt) {
  24855. var $form = this.$vxeform;
  24856. $form.toggleCollapse();
  24857. $form.$emit('toggle-collapse', {
  24858. collapse: !$form.collapseAll,
  24859. data: $form.data,
  24860. $form: $form,
  24861. $event: evnt
  24862. }, evnt);
  24863. }
  24864. }
  24865. });
  24866. // CONCATENATED MODULE: ./packages/form/index.js
  24867. src_form.install = function (Vue) {
  24868. Vue.component(src_form.name, src_form);
  24869. Vue.component(form_item.name, form_item);
  24870. };
  24871. var Form = src_form;
  24872. /* harmony default export */ var packages_form = (src_form);
  24873. // CONCATENATED MODULE: ./packages/select/src/select.js
  24874. function isOptionVisible(option) {
  24875. return option.visible !== false;
  24876. }
  24877. function getOptUniqueId() {
  24878. return ctor_amd_xe_utils_default.a.uniqueId('opt_');
  24879. }
  24880. function getOptkey(_vm) {
  24881. return _vm.optionId || _vm.optId || '_XID';
  24882. }
  24883. function getOptid(_vm, option) {
  24884. var optid = option[getOptkey(_vm)];
  24885. return optid ? encodeURIComponent(optid) : '';
  24886. }
  24887. function findOffsetOption(_vm, optionValue, isUpArrow) {
  24888. var isGroup = _vm.isGroup,
  24889. visibleOptionList = _vm.visibleOptionList,
  24890. visibleGroupList = _vm.visibleGroupList,
  24891. valueField = _vm.valueField,
  24892. groupOptionsField = _vm.groupOptionsField;
  24893. var firstOption;
  24894. var prevOption;
  24895. var nextOption;
  24896. var currOption;
  24897. if (isGroup) {
  24898. for (var gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
  24899. var group = visibleGroupList[gIndex];
  24900. var groupOptionList = group[groupOptionsField];
  24901. var isGroupDisabled = group.disabled;
  24902. if (groupOptionList) {
  24903. for (var index = 0; index < groupOptionList.length; index++) {
  24904. var option = groupOptionList[index];
  24905. var isVisible = isOptionVisible(option);
  24906. var isDisabled = isGroupDisabled || option.disabled;
  24907. if (!firstOption && !isDisabled) {
  24908. firstOption = option;
  24909. }
  24910. if (currOption) {
  24911. if (isVisible && !isDisabled) {
  24912. nextOption = option;
  24913. if (!isUpArrow) {
  24914. return {
  24915. offsetOption: nextOption
  24916. };
  24917. }
  24918. }
  24919. }
  24920. if (optionValue === option[valueField]) {
  24921. currOption = option;
  24922. if (isUpArrow) {
  24923. return {
  24924. offsetOption: prevOption
  24925. };
  24926. }
  24927. } else {
  24928. if (isVisible && !isDisabled) {
  24929. prevOption = option;
  24930. }
  24931. }
  24932. }
  24933. }
  24934. }
  24935. } else {
  24936. for (var _index = 0; _index < visibleOptionList.length; _index++) {
  24937. var _option = visibleOptionList[_index];
  24938. var _isDisabled = _option.disabled;
  24939. if (!firstOption && !_isDisabled) {
  24940. firstOption = _option;
  24941. }
  24942. if (currOption) {
  24943. if (!_isDisabled) {
  24944. nextOption = _option;
  24945. if (!isUpArrow) {
  24946. return {
  24947. offsetOption: nextOption
  24948. };
  24949. }
  24950. }
  24951. }
  24952. if (optionValue === _option[valueField]) {
  24953. currOption = _option;
  24954. if (isUpArrow) {
  24955. return {
  24956. offsetOption: prevOption
  24957. };
  24958. }
  24959. } else {
  24960. if (!_isDisabled) {
  24961. prevOption = _option;
  24962. }
  24963. }
  24964. }
  24965. }
  24966. return {
  24967. firstOption: firstOption
  24968. };
  24969. }
  24970. function findOption(_vm, optionValue) {
  24971. var isGroup = _vm.isGroup,
  24972. fullOptionList = _vm.fullOptionList,
  24973. fullGroupList = _vm.fullGroupList,
  24974. valueField = _vm.valueField;
  24975. if (isGroup) {
  24976. for (var gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
  24977. var group = fullGroupList[gIndex];
  24978. if (group.options) {
  24979. for (var index = 0; index < group.options.length; index++) {
  24980. var option = group.options[index];
  24981. if (optionValue === option[valueField]) {
  24982. return option;
  24983. }
  24984. }
  24985. }
  24986. }
  24987. }
  24988. return fullOptionList.find(function (item) {
  24989. return optionValue === item[valueField];
  24990. });
  24991. }
  24992. function getSelectLabel(_vm, value) {
  24993. var item = findOption(_vm, value);
  24994. return ctor_amd_xe_utils_default.a.toString(item ? item[_vm.labelField] : value);
  24995. }
  24996. function renderOption(h, _vm, list, group) {
  24997. var isGroup = _vm.isGroup,
  24998. labelField = _vm.labelField,
  24999. valueField = _vm.valueField,
  25000. optkey = _vm.optkey,
  25001. optionKey = _vm.optionKey,
  25002. value = _vm.value,
  25003. multiple = _vm.multiple,
  25004. currentValue = _vm.currentValue;
  25005. return list.map(function (option, cIndex) {
  25006. var isVisible = !isGroup || isOptionVisible(option);
  25007. var isDisabled = group && group.disabled || option.disabled;
  25008. var optionValue = option[valueField];
  25009. var optid = getOptid(_vm, option);
  25010. return isVisible ? h('div', {
  25011. key: optionKey || optkey ? optid : cIndex,
  25012. class: ['vxe-select-option', {
  25013. 'is--disabled': isDisabled,
  25014. 'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
  25015. 'is--hover': currentValue === optionValue
  25016. }],
  25017. attrs: {
  25018. 'data-optid': optid
  25019. },
  25020. on: {
  25021. mousedown: function mousedown(evnt) {
  25022. var isLeftBtn = evnt.button === 0;
  25023. if (isLeftBtn) {
  25024. evnt.stopPropagation();
  25025. }
  25026. },
  25027. click: function click(evnt) {
  25028. if (!isDisabled) {
  25029. _vm.changeOptionEvent(evnt, optionValue);
  25030. }
  25031. },
  25032. mouseenter: function mouseenter() {
  25033. if (!isDisabled) {
  25034. _vm.setCurrentOption(option);
  25035. }
  25036. }
  25037. }
  25038. }, UtilTools.formatText(UtilTools.getFuncText(option[labelField]))) : null;
  25039. });
  25040. }
  25041. function renderOptgroup(h, _vm) {
  25042. var optionKey = _vm.optionKey,
  25043. optkey = _vm.optkey,
  25044. visibleGroupList = _vm.visibleGroupList,
  25045. groupLabelField = _vm.groupLabelField,
  25046. groupOptionsField = _vm.groupOptionsField;
  25047. return visibleGroupList.map(function (group, gIndex) {
  25048. var optid = getOptid(_vm, group);
  25049. var isGroupDisabled = group.disabled;
  25050. return h('div', {
  25051. key: optionKey || optkey ? optid : gIndex,
  25052. class: ['vxe-optgroup', {
  25053. 'is--disabled': isGroupDisabled
  25054. }],
  25055. attrs: {
  25056. 'data-optid': optid
  25057. }
  25058. }, [h('div', {
  25059. class: 'vxe-optgroup--title'
  25060. }, UtilTools.getFuncText(group[groupLabelField])), h('div', {
  25061. class: 'vxe-optgroup--wrapper'
  25062. }, renderOption(h, _vm, group[groupOptionsField], group))]);
  25063. });
  25064. }
  25065. function select_renderOpts(h, _vm) {
  25066. var isGroup = _vm.isGroup,
  25067. visibleGroupList = _vm.visibleGroupList,
  25068. visibleOptionList = _vm.visibleOptionList;
  25069. if (isGroup) {
  25070. if (visibleGroupList.length) {
  25071. return renderOptgroup(h, _vm);
  25072. }
  25073. } else {
  25074. if (visibleOptionList.length) {
  25075. return renderOption(h, _vm, visibleOptionList);
  25076. }
  25077. }
  25078. return [h('div', {
  25079. class: 'vxe-select--empty-placeholder'
  25080. }, _vm.emptyText || conf.i18n('vxe.select.emptyText'))];
  25081. }
  25082. /* harmony default export */ var src_select = ({
  25083. name: 'VxeSelect',
  25084. props: {
  25085. value: null,
  25086. clearable: Boolean,
  25087. placeholder: String,
  25088. disabled: Boolean,
  25089. multiple: Boolean,
  25090. multiCharOverflow: {
  25091. type: [Number, String],
  25092. default: function _default() {
  25093. return conf.select.multiCharOverflow;
  25094. }
  25095. },
  25096. prefixIcon: String,
  25097. placement: String,
  25098. options: Array,
  25099. optionProps: Object,
  25100. optionGroups: Array,
  25101. optionGroupProps: Object,
  25102. size: {
  25103. type: String,
  25104. default: function _default() {
  25105. return conf.select.size || conf.size;
  25106. }
  25107. },
  25108. emptyText: String,
  25109. optId: {
  25110. type: String,
  25111. default: function _default() {
  25112. return conf.select.optionId;
  25113. }
  25114. },
  25115. optionId: {
  25116. type: String,
  25117. default: function _default() {
  25118. return conf.select.optionId;
  25119. }
  25120. },
  25121. optKey: Boolean,
  25122. optionKey: Boolean,
  25123. transfer: {
  25124. type: Boolean,
  25125. default: function _default() {
  25126. return conf.select.transfer;
  25127. }
  25128. }
  25129. },
  25130. components: {
  25131. VxeInput: input
  25132. },
  25133. provide: function provide() {
  25134. return {
  25135. $xeselect: this
  25136. };
  25137. },
  25138. data: function data() {
  25139. return {
  25140. inited: false,
  25141. collectOption: [],
  25142. fullGroupList: [],
  25143. fullOptionList: [],
  25144. visibleGroupList: [],
  25145. visibleOptionList: [],
  25146. panelIndex: 0,
  25147. panelStyle: null,
  25148. panelPlacement: null,
  25149. currentValue: null,
  25150. visiblePanel: false,
  25151. animatVisible: false,
  25152. isActivated: false
  25153. };
  25154. },
  25155. computed: {
  25156. vSize: function vSize() {
  25157. return this.size || this.$parent.size || this.$parent.vSize;
  25158. },
  25159. propsOpts: function propsOpts() {
  25160. return this.optionProps || {};
  25161. },
  25162. groupPropsOpts: function groupPropsOpts() {
  25163. return this.optionGroupProps || {};
  25164. },
  25165. labelField: function labelField() {
  25166. return this.propsOpts.label || 'label';
  25167. },
  25168. valueField: function valueField() {
  25169. return this.propsOpts.value || 'value';
  25170. },
  25171. groupLabelField: function groupLabelField() {
  25172. return this.groupPropsOpts.label || 'label';
  25173. },
  25174. groupOptionsField: function groupOptionsField() {
  25175. return this.groupPropsOpts.options || 'options';
  25176. },
  25177. isGroup: function isGroup() {
  25178. return this.fullGroupList.some(function (item) {
  25179. return item.options && item.options.length;
  25180. });
  25181. },
  25182. multiMaxCharNum: function multiMaxCharNum() {
  25183. return ctor_amd_xe_utils_default.a.toNumber(this.multiCharOverflow);
  25184. },
  25185. selectLabel: function selectLabel() {
  25186. var _this = this;
  25187. var value = this.value,
  25188. multiple = this.multiple,
  25189. multiMaxCharNum = this.multiMaxCharNum;
  25190. if (value && multiple) {
  25191. return value.map(function (val) {
  25192. var label = getSelectLabel(_this, val);
  25193. if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
  25194. return "".concat(label.substring(0, multiMaxCharNum), "...");
  25195. }
  25196. return label;
  25197. }).join(', ');
  25198. }
  25199. return getSelectLabel(this, value);
  25200. }
  25201. },
  25202. watch: {
  25203. collectOption: function collectOption(value) {
  25204. if (value.some(function (item) {
  25205. return item.options && item.options.length;
  25206. })) {
  25207. this.fullOptionList = [];
  25208. this.fullGroupList = value;
  25209. } else {
  25210. this.fullGroupList = [];
  25211. this.fullOptionList = value;
  25212. }
  25213. this.updateCache();
  25214. },
  25215. options: function options(value) {
  25216. this.fullGroupList = [];
  25217. this.fullOptionList = value;
  25218. this.updateCache();
  25219. },
  25220. optionGroups: function optionGroups(value) {
  25221. this.fullOptionList = [];
  25222. this.fullGroupList = value;
  25223. this.updateCache();
  25224. }
  25225. },
  25226. created: function created() {
  25227. var options = this.options,
  25228. optionGroups = this.optionGroups;
  25229. if (optionGroups) {
  25230. this.fullGroupList = optionGroups;
  25231. } else if (options) {
  25232. this.fullOptionList = options;
  25233. }
  25234. this.updateCache();
  25235. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  25236. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  25237. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  25238. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  25239. },
  25240. beforeDestroy: function beforeDestroy() {
  25241. var panelElem = this.$refs.panel;
  25242. if (panelElem && panelElem.parentNode) {
  25243. panelElem.parentNode.removeChild(panelElem);
  25244. }
  25245. },
  25246. destroyed: function destroyed() {
  25247. GlobalEvent.off(this, 'mousewheel');
  25248. GlobalEvent.off(this, 'mousedown');
  25249. GlobalEvent.off(this, 'keydown');
  25250. GlobalEvent.off(this, 'blur');
  25251. },
  25252. render: function render(h) {
  25253. var _ref, _ref2;
  25254. var vSize = this.vSize,
  25255. inited = this.inited,
  25256. loading = this.loading,
  25257. isActivated = this.isActivated,
  25258. disabled = this.disabled,
  25259. visiblePanel = this.visiblePanel;
  25260. return h('div', {
  25261. class: ['vxe-select', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--active', isActivated), _ref)]
  25262. }, [h('div', {
  25263. class: 'vxe-select-slots',
  25264. ref: 'hideOption'
  25265. }, this.$slots.default), h('vxe-input', {
  25266. ref: 'input',
  25267. props: {
  25268. clearable: this.clearable,
  25269. placeholder: this.placeholder,
  25270. readonly: true,
  25271. disabled: disabled,
  25272. type: 'text',
  25273. prefixIcon: this.prefixIcon,
  25274. suffixIcon: visiblePanel ? conf.icon.SELECT_OPEN : conf.icon.SELECT_CLOSE,
  25275. value: this.selectLabel
  25276. },
  25277. on: {
  25278. clear: this.clearEvent,
  25279. click: this.togglePanelEvent,
  25280. focus: this.focusEvent,
  25281. blur: this.blurEvent,
  25282. 'suffix-click': this.togglePanelEvent
  25283. }
  25284. }), h('div', {
  25285. ref: 'panel',
  25286. class: ['vxe-table--ignore-clear vxe-select--panel', (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, 'is--transfer', this.transfer), _defineProperty(_ref2, 'animat--leave', this.animatVisible), _defineProperty(_ref2, 'animat--enter', visiblePanel), _ref2)],
  25287. attrs: {
  25288. 'data-placement': this.panelPlacement
  25289. },
  25290. style: this.panelStyle
  25291. }, inited ? [h('div', {
  25292. ref: 'optWrapper',
  25293. class: 'vxe-select-option--wrapper'
  25294. }, select_renderOpts(h, this))] : [])]);
  25295. },
  25296. methods: {
  25297. updateCache: function updateCache() {
  25298. var _this2 = this;
  25299. var fullOptionList = this.fullOptionList,
  25300. fullGroupList = this.fullGroupList,
  25301. groupOptionsField = this.groupOptionsField;
  25302. var optkey = getOptkey(this);
  25303. var handleOptis = function handleOptis(item) {
  25304. if (!getOptid(_this2, item)) {
  25305. item[optkey] = getOptUniqueId();
  25306. }
  25307. };
  25308. if (fullGroupList.length) {
  25309. fullGroupList.forEach(function (group) {
  25310. handleOptis(group);
  25311. if (group[groupOptionsField]) {
  25312. group[groupOptionsField].forEach(handleOptis);
  25313. }
  25314. });
  25315. } else if (fullOptionList.length) {
  25316. fullOptionList.forEach(handleOptis);
  25317. }
  25318. this.refreshOption();
  25319. },
  25320. /**
  25321. * 刷新选项,当选项被动态显示/隐藏时可能会用到
  25322. */
  25323. refreshOption: function refreshOption() {
  25324. var isGroup = this.isGroup,
  25325. fullOptionList = this.fullOptionList,
  25326. fullGroupList = this.fullGroupList;
  25327. if (isGroup) {
  25328. this.visibleGroupList = fullGroupList.filter(isOptionVisible);
  25329. } else {
  25330. this.visibleOptionList = fullOptionList.filter(isOptionVisible);
  25331. }
  25332. return this.$nextTick();
  25333. },
  25334. setCurrentOption: function setCurrentOption(option) {
  25335. if (option) {
  25336. this.currentValue = option[this.valueField];
  25337. }
  25338. },
  25339. scrollToOption: function scrollToOption(option, isAlignBottom) {
  25340. var _this3 = this;
  25341. return this.$nextTick().then(function () {
  25342. if (option) {
  25343. var $refs = _this3.$refs;
  25344. var optWrapperElem = $refs.optWrapper;
  25345. var optElem = $refs.panel.querySelector("[data-optid='".concat(getOptid(_this3, option), "']"));
  25346. if (optWrapperElem && optElem) {
  25347. var wrapperHeight = optWrapperElem.offsetHeight;
  25348. var offsetPadding = 5;
  25349. if (isAlignBottom) {
  25350. if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
  25351. optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
  25352. }
  25353. } else {
  25354. if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
  25355. optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
  25356. }
  25357. }
  25358. }
  25359. }
  25360. });
  25361. },
  25362. clearEvent: function clearEvent(params, evnt) {
  25363. this.clearValueEvent(evnt, null);
  25364. this.hideOptionPanel();
  25365. },
  25366. clearValueEvent: function clearValueEvent(evnt, selectValue) {
  25367. this.changeEvent(evnt, selectValue);
  25368. this.$emit('clear', {
  25369. value: selectValue,
  25370. $event: evnt
  25371. }, evnt);
  25372. },
  25373. changeEvent: function changeEvent(evnt, selectValue) {
  25374. if (selectValue !== this.value) {
  25375. this.$emit('input', selectValue);
  25376. this.$emit('change', {
  25377. value: selectValue,
  25378. $event: evnt
  25379. }, evnt);
  25380. }
  25381. },
  25382. changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
  25383. var _this4 = this;
  25384. var value = this.value,
  25385. multiple = this.multiple;
  25386. if (multiple) {
  25387. var multipleValue;
  25388. if (value) {
  25389. if (value.indexOf(selectValue) === -1) {
  25390. multipleValue = value.concat([selectValue]);
  25391. } else {
  25392. multipleValue = value.filter(function (val) {
  25393. return val !== selectValue;
  25394. });
  25395. }
  25396. } else {
  25397. multipleValue = [selectValue];
  25398. }
  25399. this.changeEvent(evnt, multipleValue);
  25400. } else {
  25401. this.changeEvent(evnt, selectValue); // 显示效果
  25402. setTimeout(function () {
  25403. _this4.hideOptionPanel();
  25404. }, 50);
  25405. }
  25406. },
  25407. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  25408. var $refs = this.$refs,
  25409. disabled = this.disabled,
  25410. visiblePanel = this.visiblePanel;
  25411. if (!disabled) {
  25412. if (visiblePanel) {
  25413. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  25414. this.updatePlacement();
  25415. } else {
  25416. this.hideOptionPanel();
  25417. }
  25418. }
  25419. }
  25420. },
  25421. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  25422. var $refs = this.$refs,
  25423. $el = this.$el,
  25424. disabled = this.disabled,
  25425. visiblePanel = this.visiblePanel;
  25426. if (!disabled) {
  25427. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  25428. if (visiblePanel && !this.isActivated) {
  25429. this.hideOptionPanel();
  25430. }
  25431. }
  25432. },
  25433. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  25434. var visiblePanel = this.visiblePanel,
  25435. currentValue = this.currentValue,
  25436. clearable = this.clearable,
  25437. disabled = this.disabled;
  25438. if (!disabled) {
  25439. var keyCode = evnt.keyCode;
  25440. var isTab = keyCode === 9;
  25441. var isEnter = keyCode === 13;
  25442. var isEsc = keyCode === 27;
  25443. var isUpArrow = keyCode === 38;
  25444. var isDwArrow = keyCode === 40;
  25445. var isDel = keyCode === 46;
  25446. var isSpacebar = keyCode === 32;
  25447. if (isTab) {
  25448. this.isActivated = false;
  25449. }
  25450. if (visiblePanel) {
  25451. if (isEsc || isTab) {
  25452. this.hideOptionPanel();
  25453. } else if (isEnter) {
  25454. evnt.preventDefault();
  25455. evnt.stopPropagation();
  25456. this.changeOptionEvent(evnt, currentValue);
  25457. } else if (isUpArrow || isDwArrow) {
  25458. evnt.preventDefault();
  25459. var _findOffsetOption = findOffsetOption(this, currentValue, isUpArrow),
  25460. firstOption = _findOffsetOption.firstOption,
  25461. offsetOption = _findOffsetOption.offsetOption;
  25462. if (!offsetOption && !findOption(this, currentValue)) {
  25463. offsetOption = firstOption;
  25464. }
  25465. this.setCurrentOption(offsetOption);
  25466. this.scrollToOption(offsetOption, isDwArrow);
  25467. } else if (isSpacebar) {
  25468. evnt.preventDefault();
  25469. }
  25470. } else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && this.isActivated) {
  25471. evnt.preventDefault();
  25472. this.showOptionPanel();
  25473. }
  25474. if (this.isActivated) {
  25475. if (isDel && clearable) {
  25476. this.clearValueEvent(evnt, null);
  25477. }
  25478. }
  25479. }
  25480. },
  25481. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  25482. this.hideOptionPanel();
  25483. },
  25484. updateZindex: function updateZindex() {
  25485. if (this.panelIndex < UtilTools.getLastZIndex()) {
  25486. this.panelIndex = UtilTools.nextZIndex();
  25487. }
  25488. },
  25489. focusEvent: function focusEvent() {
  25490. if (!this.disabled) {
  25491. this.isActivated = true;
  25492. }
  25493. },
  25494. blurEvent: function blurEvent() {
  25495. this.isActivated = false;
  25496. },
  25497. isPanelVisible: function isPanelVisible() {
  25498. return this.visiblePanel;
  25499. },
  25500. togglePanelEvent: function togglePanelEvent(params) {
  25501. var $event = params.$event;
  25502. $event.preventDefault();
  25503. if (this.visiblePanel) {
  25504. this.hideOptionPanel();
  25505. } else {
  25506. this.showOptionPanel();
  25507. }
  25508. },
  25509. showOptionPanel: function showOptionPanel() {
  25510. var _this5 = this;
  25511. if (!this.disabled) {
  25512. clearTimeout(this.hidePanelTimeout);
  25513. if (!this.inited) {
  25514. this.inited = true;
  25515. if (this.transfer) {
  25516. document.body.appendChild(this.$refs.panel);
  25517. }
  25518. }
  25519. this.isActivated = true;
  25520. this.animatVisible = true;
  25521. setTimeout(function () {
  25522. var value = _this5.value,
  25523. multiple = _this5.multiple;
  25524. var currOption = findOption(_this5, multiple && value ? value[0] : value);
  25525. _this5.visiblePanel = true;
  25526. if (currOption) {
  25527. _this5.setCurrentOption(currOption);
  25528. _this5.scrollToOption(currOption);
  25529. }
  25530. }, 10);
  25531. this.updateZindex();
  25532. this.updatePlacement();
  25533. }
  25534. },
  25535. hideOptionPanel: function hideOptionPanel() {
  25536. var _this6 = this;
  25537. this.visiblePanel = false;
  25538. this.hidePanelTimeout = setTimeout(function () {
  25539. _this6.animatVisible = false;
  25540. }, 350);
  25541. },
  25542. updatePlacement: function updatePlacement() {
  25543. var _this7 = this;
  25544. return this.$nextTick().then(function () {
  25545. var $refs = _this7.$refs,
  25546. transfer = _this7.transfer,
  25547. placement = _this7.placement,
  25548. panelIndex = _this7.panelIndex;
  25549. var targetElem = $refs.input.$el;
  25550. var panelElem = $refs.panel;
  25551. if (panelElem && targetElem) {
  25552. var targetHeight = targetElem.offsetHeight;
  25553. var targetWidth = targetElem.offsetWidth;
  25554. var panelHeight = panelElem.offsetHeight;
  25555. var panelWidth = panelElem.offsetWidth;
  25556. var marginSize = 5;
  25557. var panelStyle = {
  25558. zIndex: panelIndex
  25559. };
  25560. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  25561. boundingTop = _DomTools$getAbsolute.boundingTop,
  25562. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  25563. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  25564. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  25565. var panelPlacement = 'bottom';
  25566. if (transfer) {
  25567. var left = boundingLeft;
  25568. var top = boundingTop + targetHeight;
  25569. if (placement === 'top') {
  25570. panelPlacement = 'top';
  25571. top = boundingTop - panelHeight;
  25572. } else if (!placement) {
  25573. // 如果下面不够放,则向上
  25574. if (top + panelHeight + marginSize > visibleHeight) {
  25575. panelPlacement = 'top';
  25576. top = boundingTop - panelHeight;
  25577. } // 如果上面不够放,则向下(优先)
  25578. if (top < marginSize) {
  25579. panelPlacement = 'bottom';
  25580. top = boundingTop + targetHeight;
  25581. }
  25582. } // 如果溢出右边
  25583. if (left + panelWidth + marginSize > visibleWidth) {
  25584. left -= left + panelWidth + marginSize - visibleWidth;
  25585. } // 如果溢出左边
  25586. if (left < marginSize) {
  25587. left = marginSize;
  25588. }
  25589. Object.assign(panelStyle, {
  25590. left: "".concat(left, "px"),
  25591. top: "".concat(top, "px"),
  25592. minWidth: "".concat(targetWidth, "px")
  25593. });
  25594. } else {
  25595. if (placement === 'top') {
  25596. panelPlacement = 'top';
  25597. panelStyle.bottom = "".concat(targetHeight, "px");
  25598. } else if (!placement) {
  25599. // 如果下面不够放,则向上
  25600. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  25601. // 如果上面不够放,则向下(优先)
  25602. if (boundingTop - targetHeight - panelHeight > marginSize) {
  25603. panelPlacement = 'top';
  25604. panelStyle.bottom = "".concat(targetHeight, "px");
  25605. }
  25606. }
  25607. }
  25608. }
  25609. _this7.panelStyle = panelStyle;
  25610. _this7.panelPlacement = panelPlacement;
  25611. return _this7.$nextTick();
  25612. }
  25613. });
  25614. },
  25615. focus: function focus() {
  25616. this.isActivated = true;
  25617. this.$refs.input.focus();
  25618. return this.$nextTick();
  25619. },
  25620. blur: function blur() {
  25621. this.$refs.input.blur();
  25622. this.isActivated = false;
  25623. return this.$nextTick();
  25624. }
  25625. }
  25626. });
  25627. // CONCATENATED MODULE: ./packages/select/src/util.js
  25628. var util_OptionConfig = /*#__PURE__*/function () {
  25629. function OptionConfig($xeselect, _vm) {
  25630. _classCallCheck(this, OptionConfig);
  25631. Object.assign(this, {
  25632. value: _vm.value,
  25633. label: _vm.label,
  25634. visible: _vm.visible,
  25635. disabled: _vm.disabled
  25636. });
  25637. }
  25638. _createClass(OptionConfig, [{
  25639. key: "update",
  25640. value: function update(name, value) {
  25641. this[name] = value;
  25642. }
  25643. }]);
  25644. return OptionConfig;
  25645. }();
  25646. function isOption(option) {
  25647. return option instanceof util_OptionConfig;
  25648. }
  25649. function getOptionConfig($xeselect, _vm, options) {
  25650. return isOption(_vm) ? _vm : new util_OptionConfig($xeselect, _vm, options);
  25651. }
  25652. function createOption($xeselect, _vm) {
  25653. return getOptionConfig($xeselect, _vm);
  25654. }
  25655. function destroyOption(_vm) {
  25656. var $xeselect = _vm.$xeselect,
  25657. optionConfig = _vm.optionConfig;
  25658. var matchObj = ctor_amd_xe_utils_default.a.findTree($xeselect.collectOption, function (option) {
  25659. return option === optionConfig;
  25660. });
  25661. if (matchObj) {
  25662. matchObj.items.splice(matchObj.index, 1);
  25663. }
  25664. }
  25665. function assemOption(_vm) {
  25666. var $el = _vm.$el,
  25667. $xeselect = _vm.$xeselect,
  25668. $xeoptgroup = _vm.$xeoptgroup,
  25669. optionConfig = _vm.optionConfig;
  25670. var groupConfig = $xeoptgroup ? $xeoptgroup.optionConfig : null;
  25671. optionConfig.slots = _vm.$scopedSlots;
  25672. if (groupConfig) {
  25673. if (!groupConfig.options) {
  25674. groupConfig.options = [];
  25675. }
  25676. groupConfig.options.splice([].indexOf.call($xeoptgroup.$el.children, $el), 0, optionConfig);
  25677. } else {
  25678. $xeselect.collectOption.splice([].indexOf.call($xeselect.$refs.hideOption.children, $el), 0, optionConfig);
  25679. }
  25680. }
  25681. // CONCATENATED MODULE: ./packages/select/src/option.js
  25682. var option_props = {
  25683. value: null,
  25684. label: {
  25685. type: [String, Number, Boolean],
  25686. default: ''
  25687. },
  25688. visible: {
  25689. type: Boolean,
  25690. default: null
  25691. },
  25692. disabled: Boolean
  25693. };
  25694. var option_watch = {};
  25695. Object.keys(option_props).forEach(function (name) {
  25696. option_watch[name] = function (value) {
  25697. this.optionConfig.update(name, value);
  25698. };
  25699. });
  25700. /* harmony default export */ var src_option = ({
  25701. name: 'VxeOption',
  25702. props: option_props,
  25703. inject: {
  25704. $xeselect: {
  25705. default: null
  25706. },
  25707. $xeoptgroup: {
  25708. default: null
  25709. }
  25710. },
  25711. watch: option_watch,
  25712. mounted: function mounted() {
  25713. assemOption(this);
  25714. },
  25715. created: function created() {
  25716. this.optionConfig = createOption(this.$xeselect, this);
  25717. },
  25718. destroyed: function destroyed() {
  25719. destroyOption(this);
  25720. },
  25721. render: function render(h) {
  25722. return h('div');
  25723. }
  25724. });
  25725. // CONCATENATED MODULE: ./packages/select/src/optgroup.js
  25726. var optgroup_props = {
  25727. label: {
  25728. type: [String, Number, Boolean],
  25729. default: ''
  25730. },
  25731. visible: {
  25732. type: Boolean,
  25733. default: null
  25734. },
  25735. disabled: Boolean
  25736. };
  25737. var optgroup_watch = {};
  25738. Object.keys(optgroup_props).forEach(function (name) {
  25739. optgroup_watch[name] = function (value) {
  25740. this.optionConfig.update(name, value);
  25741. };
  25742. });
  25743. /* harmony default export */ var optgroup = ({
  25744. name: 'VxeOptgroup',
  25745. props: optgroup_props,
  25746. provide: function provide() {
  25747. return {
  25748. $xeoptgroup: this
  25749. };
  25750. },
  25751. inject: {
  25752. $xeselect: {
  25753. default: null
  25754. }
  25755. },
  25756. computed: {
  25757. vSize: function vSize() {
  25758. return this.size || this.$parent.size || this.$parent.vSize;
  25759. }
  25760. },
  25761. watch: optgroup_watch,
  25762. mounted: function mounted() {
  25763. assemOption(this);
  25764. },
  25765. created: function created() {
  25766. this.optionConfig = createOption(this.$xeselect, this);
  25767. },
  25768. destroyed: function destroyed() {
  25769. destroyOption(this);
  25770. },
  25771. render: function render(h) {
  25772. return h('div', this.$slots.default);
  25773. }
  25774. });
  25775. // CONCATENATED MODULE: ./packages/select/index.js
  25776. src_select.install = function (Vue) {
  25777. Vue.component(src_select.name, src_select);
  25778. Vue.component(src_option.name, src_option);
  25779. Vue.component(optgroup.name, optgroup);
  25780. };
  25781. var Select = src_select;
  25782. /* harmony default export */ var packages_select = (src_select);
  25783. // CONCATENATED MODULE: ./packages/switch/src/switch.js
  25784. var switch_browse = DomTools.browse;
  25785. /* harmony default export */ var src_switch = ({
  25786. name: 'VxeSwitch',
  25787. props: {
  25788. value: [String, Number, Boolean],
  25789. disabled: Boolean,
  25790. size: {
  25791. type: String,
  25792. default: function _default() {
  25793. return conf.switch.size || conf.size;
  25794. }
  25795. },
  25796. openLabel: String,
  25797. closeLabel: String,
  25798. openValue: {
  25799. type: [String, Number, Boolean],
  25800. default: true
  25801. },
  25802. closeValue: {
  25803. type: [String, Number, Boolean],
  25804. default: false
  25805. },
  25806. openIcon: String,
  25807. closeIcon: String,
  25808. // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
  25809. onLabel: String,
  25810. offLabel: String,
  25811. onValue: {
  25812. type: [String, Number, Boolean],
  25813. default: true
  25814. },
  25815. offValue: {
  25816. type: [String, Number, Boolean],
  25817. default: false
  25818. },
  25819. onIcon: String,
  25820. offIcon: String
  25821. },
  25822. data: function data() {
  25823. return {
  25824. isActivated: false,
  25825. hasAnimat: false,
  25826. offsetLeft: 0
  25827. };
  25828. },
  25829. computed: {
  25830. vSize: function vSize() {
  25831. return this.size || this.$parent.size || this.$parent.vSize;
  25832. },
  25833. isChecked: function isChecked() {
  25834. return ctor_amd_xe_utils_default.a.isBoolean(this.onValue) ? this.value === this.openValue : this.value === this.onValue;
  25835. },
  25836. onShowLabel: function onShowLabel() {
  25837. return UtilTools.getFuncText(this.openLabel || this.onLabel);
  25838. },
  25839. offShowLabel: function offShowLabel() {
  25840. return UtilTools.getFuncText(this.closeLabel || this.offLabel);
  25841. },
  25842. styles: function styles() {
  25843. return switch_browse.msie && this.isChecked ? {
  25844. left: "".concat(this.offsetLeft, "px")
  25845. } : null;
  25846. }
  25847. },
  25848. created: function created() {
  25849. var _this = this;
  25850. // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
  25851. var propsData = this.$options.propsData;
  25852. if (propsData.onLabel) {
  25853. UtilTools.warn('vxe.error.delProp', ['on-label', 'open-label']);
  25854. }
  25855. if (propsData.offLabel) {
  25856. UtilTools.warn('vxe.error.delProp', ['off-label', 'close-label']);
  25857. }
  25858. if (propsData.onValue) {
  25859. UtilTools.warn('vxe.error.delProp', ['on-value', 'open-value']);
  25860. }
  25861. if (propsData.offValue) {
  25862. UtilTools.warn('vxe.error.delProp', ['off-value', 'close-value']);
  25863. }
  25864. if (propsData.onIcon) {
  25865. UtilTools.warn('vxe.error.delProp', ['on-icon', 'open-icon']);
  25866. }
  25867. if (propsData.offIcon) {
  25868. UtilTools.warn('vxe.error.delProp', ['off-icon', 'close-icon']);
  25869. }
  25870. if (switch_browse.msie) {
  25871. this.$nextTick(function () {
  25872. return _this.updateStyle();
  25873. });
  25874. }
  25875. },
  25876. render: function render(h) {
  25877. var _ref;
  25878. var isChecked = this.isChecked,
  25879. vSize = this.vSize,
  25880. disabled = this.disabled,
  25881. openIcon = this.openIcon,
  25882. onIcon = this.onIcon,
  25883. closeIcon = this.closeIcon,
  25884. offIcon = this.offIcon;
  25885. return h('div', {
  25886. class: ['vxe-switch', isChecked ? 'is--on' : 'is--off', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--animat', this.hasAnimat), _ref)]
  25887. }, [h('button', {
  25888. ref: 'btn',
  25889. class: 'vxe-switch--button',
  25890. attrs: {
  25891. type: 'button',
  25892. disabled: disabled
  25893. },
  25894. on: {
  25895. click: this.clickEvent
  25896. }
  25897. }, [h('span', {
  25898. class: 'vxe-switch--label vxe-switch--label-on'
  25899. }, [openIcon || onIcon ? h('i', {
  25900. class: ['vxe-switch--label-icon', openIcon || onIcon]
  25901. }) : null, this.onShowLabel]), h('span', {
  25902. class: 'vxe-switch--label vxe-switch--label-off'
  25903. }, [closeIcon || offIcon ? h('i', {
  25904. class: ['vxe-switch--label-icon', closeIcon || offIcon]
  25905. }) : null, this.offShowLabel]), h('span', {
  25906. class: 'vxe-switch--icon',
  25907. style: this.styles
  25908. })])]);
  25909. },
  25910. methods: {
  25911. updateStyle: function updateStyle() {
  25912. // 兼容 IE
  25913. this.hasAnimat = true;
  25914. this.offsetLeft = this.$refs.btn.offsetWidth;
  25915. },
  25916. clickEvent: function clickEvent(evnt) {
  25917. var _this2 = this;
  25918. if (!this.disabled) {
  25919. clearTimeout(this.activeTimeout);
  25920. var value = this.isChecked ? ctor_amd_xe_utils_default.a.isBoolean(this.offValue) ? this.closeValue : this.offValue : ctor_amd_xe_utils_default.a.isBoolean(this.onValue) ? this.openValue : this.onValue;
  25921. this.hasAnimat = true;
  25922. if (switch_browse.msie) {
  25923. this.updateStyle();
  25924. }
  25925. this.$emit('input', value);
  25926. this.$emit('change', {
  25927. value: value,
  25928. $event: evnt
  25929. });
  25930. this.activeTimeout = setTimeout(function () {
  25931. _this2.hasAnimat = false;
  25932. }, 400);
  25933. }
  25934. }
  25935. }
  25936. });
  25937. // CONCATENATED MODULE: ./packages/switch/index.js
  25938. src_switch.install = function (Vue) {
  25939. Vue.component(src_switch.name, src_switch);
  25940. };
  25941. var Switch = src_switch;
  25942. /* harmony default export */ var packages_switch = (src_switch);
  25943. // CONCATENATED MODULE: ./packages/list/src/list.js
  25944. /* harmony default export */ var src_list = ({
  25945. name: 'VxeList',
  25946. props: {
  25947. data: Array,
  25948. height: [Number, String],
  25949. maxHeight: [Number, String],
  25950. loading: Boolean,
  25951. size: {
  25952. type: String,
  25953. default: function _default() {
  25954. return conf.list.size || conf.size;
  25955. }
  25956. },
  25957. autoResize: {
  25958. type: Boolean,
  25959. default: function _default() {
  25960. return conf.list.autoResize;
  25961. }
  25962. },
  25963. syncResize: [Boolean, String, Number],
  25964. scrollY: Object
  25965. },
  25966. data: function data() {
  25967. return {
  25968. scrollYLoad: false,
  25969. bodyHeight: 0,
  25970. topSpaceHeight: 0,
  25971. items: []
  25972. };
  25973. },
  25974. computed: {
  25975. vSize: function vSize() {
  25976. return this.size || this.$parent.size || this.$parent.vSize;
  25977. },
  25978. sYOpts: function sYOpts() {
  25979. return Object.assign({}, conf.list.scrollY, this.scrollY);
  25980. },
  25981. styles: function styles() {
  25982. var height = this.height,
  25983. maxHeight = this.maxHeight;
  25984. var style = {};
  25985. if (height) {
  25986. style.height = isNaN(height) ? height : "".concat(height, "px");
  25987. } else if (maxHeight) {
  25988. style.height = 'auto';
  25989. style.maxHeight = isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px");
  25990. }
  25991. return style;
  25992. }
  25993. },
  25994. watch: {
  25995. data: function data(value) {
  25996. this.loadData(value);
  25997. },
  25998. syncResize: function syncResize(value) {
  25999. var _this = this;
  26000. if (value) {
  26001. this.recalculate();
  26002. this.$nextTick(function () {
  26003. return setTimeout(function () {
  26004. return _this.recalculate();
  26005. });
  26006. });
  26007. }
  26008. }
  26009. },
  26010. created: function created() {
  26011. Object.assign(this, {
  26012. fullData: [],
  26013. lastScrollLeft: 0,
  26014. lastScrollTop: 0,
  26015. scrollYStore: {
  26016. startIndex: 0,
  26017. visibleIndex: 0,
  26018. renderSize: 0
  26019. }
  26020. });
  26021. this.loadData(this.data);
  26022. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  26023. },
  26024. mounted: function mounted() {
  26025. var _this2 = this;
  26026. if (this.autoResize) {
  26027. var resizeObserver = new ResizeEvent(function () {
  26028. return _this2.recalculate();
  26029. });
  26030. resizeObserver.observe(this.$el);
  26031. this.$resize = resizeObserver;
  26032. }
  26033. },
  26034. beforeDestroy: function beforeDestroy() {
  26035. if (this.$resize) {
  26036. this.$resize.disconnect();
  26037. }
  26038. },
  26039. destroyed: function destroyed() {
  26040. GlobalEvent.off(this, 'resize');
  26041. },
  26042. render: function render(h) {
  26043. var $scopedSlots = this.$scopedSlots,
  26044. styles = this.styles,
  26045. bodyHeight = this.bodyHeight,
  26046. topSpaceHeight = this.topSpaceHeight,
  26047. items = this.items,
  26048. loading = this.loading;
  26049. return h('div', {
  26050. class: ['vxe-list', {
  26051. 'is--loading': loading
  26052. }]
  26053. }, [h('div', {
  26054. ref: 'virtualWrapper',
  26055. class: 'vxe-list--virtual-wrapper',
  26056. style: styles,
  26057. on: {
  26058. scroll: this.scrollEvent
  26059. }
  26060. }, [h('div', {
  26061. ref: 'ySpace',
  26062. class: 'vxe-list--y-space',
  26063. style: {
  26064. height: bodyHeight ? "".concat(bodyHeight, "px") : ''
  26065. }
  26066. }), h('div', {
  26067. ref: 'virtualBody',
  26068. class: 'vxe-list--body',
  26069. style: {
  26070. marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
  26071. }
  26072. }, $scopedSlots.default ? $scopedSlots.default.call(this, {
  26073. items: items,
  26074. $list: this
  26075. }, h) : [])]), h('div', {
  26076. class: ['vxe-list--loading vxe-loading', {
  26077. 'is--visible': loading
  26078. }]
  26079. }, [h('div', {
  26080. class: 'vxe-loading--spinner'
  26081. })])]);
  26082. },
  26083. methods: {
  26084. getParentElem: function getParentElem() {
  26085. return this.$el.parentNode;
  26086. },
  26087. /**
  26088. * 加载数据
  26089. * @param {Array} datas 数据
  26090. */
  26091. loadData: function loadData(datas) {
  26092. var _this3 = this;
  26093. var sYOpts = this.sYOpts,
  26094. scrollYStore = this.scrollYStore;
  26095. var fullData = datas || [];
  26096. Object.assign(scrollYStore, {
  26097. startIndex: 0,
  26098. endIndex: 1,
  26099. visibleSize: 0,
  26100. visibleIndex: 0
  26101. });
  26102. this.fullData = fullData;
  26103. this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && fullData.length > sYOpts.gt;
  26104. this.handleData();
  26105. return this.computeScrollLoad().then(function () {
  26106. _this3.refreshScroll();
  26107. });
  26108. },
  26109. /**
  26110. * 重新加载数据
  26111. * @param {Array} datas 数据
  26112. */
  26113. reloadData: function reloadData(datas) {
  26114. this.clearScroll();
  26115. return this.loadData(datas);
  26116. },
  26117. handleData: function handleData() {
  26118. var fullData = this.fullData,
  26119. scrollYLoad = this.scrollYLoad,
  26120. scrollYStore = this.scrollYStore;
  26121. this.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
  26122. return this.$nextTick();
  26123. },
  26124. /**
  26125. * 重新计算列表
  26126. */
  26127. recalculate: function recalculate() {
  26128. var $el = this.$el;
  26129. if ($el.clientWidth && $el.clientHeight) {
  26130. return this.computeScrollLoad();
  26131. }
  26132. return Promise.resolve();
  26133. },
  26134. /**
  26135. * 清除滚动条
  26136. */
  26137. clearScroll: function clearScroll() {
  26138. var scrollBodyElem = this.$refs.virtualWrapper;
  26139. if (scrollBodyElem) {
  26140. scrollBodyElem.scrollTop = 0;
  26141. }
  26142. return this.$nextTick();
  26143. },
  26144. /**
  26145. * 刷新滚动条
  26146. */
  26147. refreshScroll: function refreshScroll() {
  26148. var _this4 = this;
  26149. var lastScrollLeft = this.lastScrollLeft,
  26150. lastScrollTop = this.lastScrollTop;
  26151. this.clearScroll();
  26152. return this.$nextTick().then(function () {
  26153. if (lastScrollLeft || lastScrollTop) {
  26154. _this4.lastScrollLeft = 0;
  26155. _this4.lastScrollTop = 0;
  26156. return _this4.scrollTo(lastScrollLeft, lastScrollTop);
  26157. }
  26158. });
  26159. },
  26160. /**
  26161. * 如果有滚动条,则滚动到对应的位置
  26162. * @param {Number} scrollLeft 左距离
  26163. * @param {Number} scrollTop 上距离
  26164. */
  26165. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  26166. var _this5 = this;
  26167. var scrollBodyElem = this.$refs.virtualWrapper;
  26168. if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  26169. scrollBodyElem.scrollLeft = scrollLeft;
  26170. }
  26171. if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
  26172. scrollBodyElem.scrollTop = scrollTop;
  26173. }
  26174. DomTools.triggerEvent(scrollBodyElem, 'scroll');
  26175. if (this.scrollYLoad) {
  26176. return new Promise(function (resolve) {
  26177. return setTimeout(function () {
  26178. return resolve(_this5.$nextTick());
  26179. }, 50);
  26180. });
  26181. }
  26182. return this.$nextTick();
  26183. },
  26184. computeScrollLoad: function computeScrollLoad() {
  26185. var _this6 = this;
  26186. return this.$nextTick().then(function () {
  26187. var $refs = _this6.$refs,
  26188. sYOpts = _this6.sYOpts,
  26189. scrollYLoad = _this6.scrollYLoad,
  26190. scrollYStore = _this6.scrollYStore;
  26191. if (scrollYLoad) {
  26192. var rHeight = 48;
  26193. if (sYOpts.rHeight) {
  26194. rHeight = sYOpts.rHeight;
  26195. } else {
  26196. var firstItemElem;
  26197. if ($refs.virtualBody) {
  26198. if (sYOpts.sItem) {
  26199. firstItemElem = $refs.virtualBody.querySelector(sYOpts.sItem);
  26200. }
  26201. if (!firstItemElem) {
  26202. firstItemElem = $refs.virtualBody.children[0];
  26203. }
  26204. }
  26205. if (firstItemElem) {
  26206. rHeight = firstItemElem.offsetHeight;
  26207. }
  26208. }
  26209. var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil($refs.virtualWrapper.clientHeight / rHeight));
  26210. scrollYStore.visibleSize = visibleYSize;
  26211. scrollYStore.rowHeight = rHeight;
  26212. if (!sYOpts.oSize) {
  26213. scrollYStore.offsetSize = visibleYSize;
  26214. }
  26215. if (!sYOpts.rSize) {
  26216. scrollYStore.renderSize = Math.max(6, visibleYSize + 2);
  26217. }
  26218. _this6.updateYData();
  26219. } else {
  26220. _this6.updateYSpace();
  26221. }
  26222. });
  26223. },
  26224. scrollEvent: function scrollEvent(evnt) {
  26225. var scrollBodyElem = evnt.target;
  26226. var scrollTop = scrollBodyElem.scrollTop;
  26227. var scrollLeft = scrollBodyElem.scrollLeft;
  26228. var isX = scrollLeft !== this.lastScrollLeft;
  26229. var isY = scrollTop !== this.lastScrollTop;
  26230. this.lastScrollTop = scrollTop;
  26231. this.lastScrollLeft = scrollLeft;
  26232. if (this.scrollYLoad) {
  26233. this.loadYData(evnt);
  26234. }
  26235. this.$emit('scroll', {
  26236. scrollLeft: scrollLeft,
  26237. scrollTop: scrollTop,
  26238. isX: isX,
  26239. isY: isY,
  26240. $event: evnt
  26241. });
  26242. },
  26243. loadYData: function loadYData(evnt) {
  26244. var fullData = this.fullData,
  26245. scrollYStore = this.scrollYStore,
  26246. isLoadData = this.isLoadData;
  26247. var startIndex = scrollYStore.startIndex,
  26248. renderSize = scrollYStore.renderSize,
  26249. offsetSize = scrollYStore.offsetSize,
  26250. visibleSize = scrollYStore.visibleSize,
  26251. rowHeight = scrollYStore.rowHeight;
  26252. var scrollBodyElem = evnt.target;
  26253. var scrollTop = scrollBodyElem.scrollTop;
  26254. var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
  26255. var preload = false;
  26256. if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
  26257. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  26258. if (scrollYStore.visibleIndex > toVisibleIndex) {
  26259. preload = toVisibleIndex - offsetSize <= startIndex;
  26260. if (preload) {
  26261. scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
  26262. }
  26263. } else {
  26264. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  26265. if (preload) {
  26266. scrollYStore.startIndex = Math.max(0, Math.min(fullData.length - renderSize, toVisibleIndex - marginSize));
  26267. }
  26268. }
  26269. if (preload) {
  26270. this.updateYData();
  26271. }
  26272. scrollYStore.visibleIndex = toVisibleIndex;
  26273. this.isLoadData = false;
  26274. }
  26275. },
  26276. updateYData: function updateYData() {
  26277. this.handleData();
  26278. this.updateYSpace();
  26279. },
  26280. updateYSpace: function updateYSpace() {
  26281. var scrollYStore = this.scrollYStore,
  26282. scrollYLoad = this.scrollYLoad,
  26283. fullData = this.fullData;
  26284. this.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
  26285. this.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
  26286. },
  26287. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  26288. this.recalculate();
  26289. }
  26290. }
  26291. });
  26292. // CONCATENATED MODULE: ./packages/list/index.js
  26293. src_list.install = function (Vue) {
  26294. Vue.component(src_list.name, src_list);
  26295. };
  26296. var List = src_list;
  26297. /* harmony default export */ var packages_list = (src_list);
  26298. // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
  26299. /* harmony default export */ var pulldown = ({
  26300. name: 'VxePulldown',
  26301. props: {
  26302. disabled: Boolean,
  26303. placement: String,
  26304. size: {
  26305. type: String,
  26306. default: function _default() {
  26307. return conf.size;
  26308. }
  26309. },
  26310. destroyOnClose: Boolean,
  26311. transfer: Boolean
  26312. },
  26313. data: function data() {
  26314. return {
  26315. inited: false,
  26316. panelIndex: 0,
  26317. panelStyle: null,
  26318. panelPlacement: null,
  26319. currentValue: null,
  26320. visiblePanel: false,
  26321. animatVisible: false,
  26322. isActivated: false
  26323. };
  26324. },
  26325. computed: {
  26326. vSize: function vSize() {
  26327. return this.size || this.$parent.size || this.$parent.vSize;
  26328. }
  26329. },
  26330. created: function created() {
  26331. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  26332. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  26333. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  26334. },
  26335. beforeDestroy: function beforeDestroy() {
  26336. var panelElem = this.$refs.panel;
  26337. if (panelElem && panelElem.parentNode) {
  26338. panelElem.parentNode.removeChild(panelElem);
  26339. }
  26340. },
  26341. destroyed: function destroyed() {
  26342. GlobalEvent.off(this, 'mousewheel');
  26343. GlobalEvent.off(this, 'mousedown');
  26344. GlobalEvent.off(this, 'blur');
  26345. },
  26346. render: function render(h) {
  26347. var _ref, _ref2;
  26348. var $scopedSlots = this.$scopedSlots,
  26349. inited = this.inited,
  26350. vSize = this.vSize,
  26351. destroyOnClose = this.destroyOnClose,
  26352. transfer = this.transfer,
  26353. isActivated = this.isActivated,
  26354. disabled = this.disabled,
  26355. animatVisible = this.animatVisible,
  26356. visiblePanel = this.visiblePanel,
  26357. panelStyle = this.panelStyle,
  26358. panelPlacement = this.panelPlacement;
  26359. var defaultSlot = $scopedSlots.default;
  26360. var downSlot = $scopedSlots.dropdown;
  26361. return h('div', {
  26362. class: ['vxe-pulldown', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--active', isActivated), _ref)]
  26363. }, [h('div', {
  26364. ref: 'content',
  26365. class: 'vxe-pulldown--content'
  26366. }, defaultSlot ? defaultSlot.call(this, {
  26367. $pulldown: this
  26368. }, h) : []), h('div', {
  26369. ref: 'panel',
  26370. class: ['vxe-table--ignore-clear vxe-pulldown--panel', (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, 'is--transfer', transfer), _defineProperty(_ref2, 'animat--leave', animatVisible), _defineProperty(_ref2, 'animat--enter', visiblePanel), _ref2)],
  26371. attrs: {
  26372. 'data-placement': panelPlacement
  26373. },
  26374. style: panelStyle
  26375. }, downSlot ? !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : downSlot.call(this, {
  26376. $pulldown: this
  26377. }, h) : [])]);
  26378. },
  26379. methods: {
  26380. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  26381. var $refs = this.$refs,
  26382. disabled = this.disabled,
  26383. visiblePanel = this.visiblePanel;
  26384. if (!disabled) {
  26385. if (visiblePanel) {
  26386. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  26387. this.updatePlacement();
  26388. } else {
  26389. this.hidePanel();
  26390. this.$emit('hide-panel', {
  26391. $event: evnt
  26392. });
  26393. }
  26394. }
  26395. }
  26396. },
  26397. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  26398. var $refs = this.$refs,
  26399. $el = this.$el,
  26400. disabled = this.disabled,
  26401. visiblePanel = this.visiblePanel;
  26402. if (!disabled) {
  26403. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  26404. if (visiblePanel && !this.isActivated) {
  26405. this.hidePanel();
  26406. this.$emit('hide-panel', {
  26407. $event: evnt
  26408. });
  26409. }
  26410. }
  26411. },
  26412. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  26413. if (this.visiblePanel) {
  26414. this.hidePanel();
  26415. this.$emit('hide-panel', {
  26416. $event: evnt
  26417. });
  26418. }
  26419. },
  26420. updateZindex: function updateZindex() {
  26421. if (this.panelIndex < UtilTools.getLastZIndex()) {
  26422. this.panelIndex = UtilTools.nextZIndex();
  26423. }
  26424. },
  26425. isPanelVisible: function isPanelVisible() {
  26426. return this.visiblePanel;
  26427. },
  26428. /**
  26429. * 切换下拉面板
  26430. */
  26431. togglePanel: function togglePanel() {
  26432. if (this.visiblePanel) {
  26433. return this.hidePanel();
  26434. }
  26435. return this.showPanel();
  26436. },
  26437. /**
  26438. * 显示下拉面板
  26439. */
  26440. showPanel: function showPanel() {
  26441. var _this = this;
  26442. if (!this.inited) {
  26443. this.inited = true;
  26444. if (this.transfer) {
  26445. document.body.appendChild(this.$refs.panel);
  26446. }
  26447. }
  26448. return new Promise(function (resolve) {
  26449. if (!_this.disabled) {
  26450. clearTimeout(_this.hidePanelTimeout);
  26451. _this.isActivated = true;
  26452. _this.animatVisible = true;
  26453. setTimeout(function () {
  26454. _this.visiblePanel = true;
  26455. _this.updatePlacement();
  26456. setTimeout(function () {
  26457. resolve(_this.updatePlacement());
  26458. }, 40);
  26459. }, 10);
  26460. _this.updateZindex();
  26461. } else {
  26462. resolve(_this.$nextTick());
  26463. }
  26464. });
  26465. },
  26466. /**
  26467. * 隐藏下拉面板
  26468. */
  26469. hidePanel: function hidePanel() {
  26470. var _this2 = this;
  26471. this.visiblePanel = false;
  26472. return new Promise(function (resolve) {
  26473. if (_this2.animatVisible) {
  26474. _this2.hidePanelTimeout = setTimeout(function () {
  26475. _this2.animatVisible = false;
  26476. resolve(_this2.$nextTick());
  26477. }, 350);
  26478. } else {
  26479. resolve(_this2.$nextTick());
  26480. }
  26481. });
  26482. },
  26483. /**
  26484. * 手动更新位置
  26485. */
  26486. updatePlacement: function updatePlacement() {
  26487. var _this3 = this;
  26488. return this.$nextTick().then(function () {
  26489. var $refs = _this3.$refs,
  26490. transfer = _this3.transfer,
  26491. placement = _this3.placement,
  26492. panelIndex = _this3.panelIndex,
  26493. visiblePanel = _this3.visiblePanel;
  26494. if (visiblePanel) {
  26495. var panelElem = $refs.panel;
  26496. var targetElem = $refs.content;
  26497. if (panelElem && targetElem) {
  26498. var targetHeight = targetElem.offsetHeight;
  26499. var targetWidth = targetElem.offsetWidth;
  26500. var panelHeight = panelElem.offsetHeight;
  26501. var panelWidth = panelElem.offsetWidth;
  26502. var marginSize = 5;
  26503. var panelStyle = {
  26504. zIndex: panelIndex
  26505. };
  26506. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  26507. boundingTop = _DomTools$getAbsolute.boundingTop,
  26508. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  26509. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  26510. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  26511. var panelPlacement = 'bottom';
  26512. if (transfer) {
  26513. var left = boundingLeft;
  26514. var top = boundingTop + targetHeight;
  26515. if (placement === 'top') {
  26516. panelPlacement = 'top';
  26517. top = boundingTop - panelHeight;
  26518. } else if (!placement) {
  26519. // 如果下面不够放,则向上
  26520. if (top + panelHeight + marginSize > visibleHeight) {
  26521. panelPlacement = 'top';
  26522. top = boundingTop - panelHeight;
  26523. } // 如果上面不够放,则向下(优先)
  26524. if (top < marginSize) {
  26525. panelPlacement = 'bottom';
  26526. top = boundingTop + targetHeight;
  26527. }
  26528. } // 如果溢出右边
  26529. if (left + panelWidth + marginSize > visibleWidth) {
  26530. left -= left + panelWidth + marginSize - visibleWidth;
  26531. } // 如果溢出左边
  26532. if (left < marginSize) {
  26533. left = marginSize;
  26534. }
  26535. Object.assign(panelStyle, {
  26536. left: "".concat(left, "px"),
  26537. top: "".concat(top, "px"),
  26538. minWidth: "".concat(targetWidth, "px")
  26539. });
  26540. } else {
  26541. if (placement === 'top') {
  26542. panelPlacement = 'top';
  26543. panelStyle.bottom = "".concat(targetHeight, "px");
  26544. } else if (!placement) {
  26545. // 如果下面不够放,则向上
  26546. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  26547. // 如果上面不够放,则向下(优先)
  26548. if (boundingTop - targetHeight - panelHeight > marginSize) {
  26549. panelPlacement = 'top';
  26550. panelStyle.bottom = "".concat(targetHeight, "px");
  26551. }
  26552. }
  26553. }
  26554. }
  26555. _this3.panelStyle = panelStyle;
  26556. _this3.panelPlacement = panelPlacement;
  26557. }
  26558. }
  26559. return _this3.$nextTick();
  26560. });
  26561. }
  26562. }
  26563. });
  26564. // CONCATENATED MODULE: ./packages/pulldown/index.js
  26565. pulldown.install = function (Vue) {
  26566. Vue.component(pulldown.name, pulldown);
  26567. };
  26568. var Pulldown = pulldown;
  26569. /* harmony default export */ var packages_pulldown = (pulldown);
  26570. // CONCATENATED MODULE: ./packages/edit/src/mixin.js
  26571. /* harmony default export */ var edit_src_mixin = ({
  26572. methods: {
  26573. /**
  26574. * 往表格中插入临时数据
  26575. *
  26576. * @param {*} records
  26577. */
  26578. _insert: function _insert(records) {
  26579. return this.insertAt(records);
  26580. },
  26581. /**
  26582. * 往表格指定行中插入临时数据
  26583. * 如果 row 为空则从插入到顶部
  26584. * 如果 row 为 -1 则从插入到底部
  26585. * 如果 row 为有效行则插入到该行的位置
  26586. * @param {Object/Array} records 新的数据
  26587. * @param {Row} row 指定行
  26588. */
  26589. _insertAt: function _insertAt(records, row) {
  26590. var _this = this,
  26591. _editStore$insertList;
  26592. var mergeList = this.mergeList,
  26593. afterFullData = this.afterFullData,
  26594. editStore = this.editStore,
  26595. sYOpts = this.sYOpts,
  26596. scrollYLoad = this.scrollYLoad,
  26597. tableFullData = this.tableFullData,
  26598. treeConfig = this.treeConfig;
  26599. if (!ctor_amd_xe_utils_default.a.isArray(records)) {
  26600. records = [records];
  26601. }
  26602. var newRecords = records.map(function (record) {
  26603. return _this.defineField(Object.assign({}, record));
  26604. });
  26605. if (!row) {
  26606. afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
  26607. tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  26608. mergeList.forEach(function (mergeItem) {
  26609. var mergeRowIndex = mergeItem.row;
  26610. if (mergeRowIndex > 0) {
  26611. mergeItem.row = mergeRowIndex + newRecords.length;
  26612. }
  26613. });
  26614. } else {
  26615. if (row === -1) {
  26616. afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
  26617. tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  26618. mergeList.forEach(function (mergeItem) {
  26619. var mergeRowIndex = mergeItem.row,
  26620. mergeRowspan = mergeItem.rowspan;
  26621. if (mergeRowIndex + mergeRowspan > afterFullData.length) {
  26622. mergeItem.rowspan = mergeRowspan + newRecords.length;
  26623. }
  26624. });
  26625. } else {
  26626. if (treeConfig) {
  26627. throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
  26628. }
  26629. var afIndex = afterFullData.indexOf(row);
  26630. if (afIndex === -1) {
  26631. throw new Error(UtilTools.error('vxe.error.unableInsert'));
  26632. }
  26633. afterFullData.splice.apply(afterFullData, _toConsumableArray([afIndex, 0].concat(newRecords)));
  26634. tableFullData.splice.apply(tableFullData, _toConsumableArray([tableFullData.indexOf(row), 0].concat(newRecords))); // 刷新单元格合并
  26635. mergeList.forEach(function (mergeItem) {
  26636. var mergeRowIndex = mergeItem.row,
  26637. mergeRowspan = mergeItem.rowspan;
  26638. if (mergeRowIndex > afIndex) {
  26639. mergeItem.row = mergeRowIndex + newRecords.length;
  26640. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  26641. mergeItem.rowspan = mergeRowspan + newRecords.length;
  26642. }
  26643. });
  26644. }
  26645. }
  26646. (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
  26647. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  26648. this.handleTableData();
  26649. this.updateFooter();
  26650. this.updateCache();
  26651. this.checkSelectionStatus();
  26652. if (scrollYLoad) {
  26653. this.updateScrollYSpace();
  26654. }
  26655. return this.$nextTick().then(function () {
  26656. _this.recalculate();
  26657. _this.updateCellAreas();
  26658. return {
  26659. row: newRecords.length ? newRecords[newRecords.length - 1] : null,
  26660. rows: newRecords
  26661. };
  26662. });
  26663. },
  26664. /**
  26665. * 删除指定行数据
  26666. * 如果传 row 则删除一行
  26667. * 如果传 rows 则删除多行
  26668. * 如果为空则删除所有
  26669. */
  26670. _remove: function _remove(rows) {
  26671. var _this2 = this;
  26672. var afterFullData = this.afterFullData,
  26673. tableFullData = this.tableFullData,
  26674. treeConfig = this.treeConfig,
  26675. mergeList = this.mergeList,
  26676. editStore = this.editStore,
  26677. checkboxOpts = this.checkboxOpts,
  26678. selection = this.selection,
  26679. isInsertByRow = this.isInsertByRow,
  26680. sYOpts = this.sYOpts,
  26681. scrollYLoad = this.scrollYLoad;
  26682. var actived = editStore.actived,
  26683. removeList = editStore.removeList,
  26684. insertList = editStore.insertList;
  26685. var property = checkboxOpts.checkField;
  26686. var rest = [];
  26687. if (!rows) {
  26688. rows = tableFullData;
  26689. } else if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  26690. rows = [rows];
  26691. } // 如果是新增,则保存记录
  26692. rows.forEach(function (row) {
  26693. if (!isInsertByRow(row)) {
  26694. removeList.push(row);
  26695. }
  26696. }); // 如果绑定了多选属性,则更新状态
  26697. if (!property) {
  26698. rows.forEach(function (row) {
  26699. var sIndex = selection.indexOf(row);
  26700. if (sIndex > -1) {
  26701. selection.splice(sIndex, 1);
  26702. }
  26703. });
  26704. } // 从数据源中移除
  26705. if (tableFullData === rows) {
  26706. rows = rest = tableFullData.slice(0);
  26707. this.tableFullData = [];
  26708. this.afterFullData = [];
  26709. this.clearMergeCells();
  26710. } else {
  26711. rows.forEach(function (row) {
  26712. var tfIndex = tableFullData.indexOf(row);
  26713. if (tfIndex > -1) {
  26714. var rItems = tableFullData.splice(tfIndex, 1);
  26715. rest.push(rItems[0]);
  26716. }
  26717. var afIndex = afterFullData.indexOf(row);
  26718. if (afIndex > -1) {
  26719. // 刷新单元格合并
  26720. mergeList.forEach(function (mergeItem) {
  26721. var mergeRowIndex = mergeItem.row,
  26722. mergeRowspan = mergeItem.rowspan;
  26723. if (mergeRowIndex > afIndex) {
  26724. mergeItem.row = mergeRowIndex - 1;
  26725. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  26726. mergeItem.rowspan = mergeRowspan - 1;
  26727. }
  26728. });
  26729. afterFullData.splice(afIndex, 1);
  26730. }
  26731. });
  26732. } // 如果当前行被激活编辑,则清除激活状态
  26733. if (actived.row && rows.indexOf(actived.row) > -1) {
  26734. this.clearActived();
  26735. } // 从新增中移除已删除的数据
  26736. rows.forEach(function (row) {
  26737. var iIndex = insertList.indexOf(row);
  26738. if (iIndex > -1) {
  26739. insertList.splice(iIndex, 1);
  26740. }
  26741. });
  26742. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  26743. this.handleTableData();
  26744. this.updateFooter();
  26745. this.updateCache();
  26746. this.checkSelectionStatus();
  26747. if (scrollYLoad) {
  26748. this.updateScrollYSpace();
  26749. }
  26750. return this.$nextTick().then(function () {
  26751. _this2.recalculate();
  26752. _this2.updateCellAreas();
  26753. return {
  26754. row: rest.length ? rest[rest.length - 1] : null,
  26755. rows: rest
  26756. };
  26757. });
  26758. },
  26759. _removeSelecteds: function _removeSelecteds() {
  26760. // 在 v3 中废弃 removeSelecteds
  26761. UtilTools.warn('vxe.error.delFunc', ['removeSelecteds', 'removeCheckboxRow']);
  26762. return this.removeCheckboxRow();
  26763. },
  26764. /**
  26765. * 删除复选框选中的数据
  26766. */
  26767. _removeCheckboxRow: function _removeCheckboxRow() {
  26768. var _this3 = this;
  26769. return this.remove(this.getCheckboxRecords()).then(function (params) {
  26770. _this3.clearCheckboxRow();
  26771. return params;
  26772. });
  26773. },
  26774. /**
  26775. * 删除单选框选中的数据
  26776. */
  26777. _removeRadioRow: function _removeRadioRow() {
  26778. var _this4 = this;
  26779. var radioRecord = this.getRadioRecord();
  26780. return this.remove(radioRecord || []).then(function (params) {
  26781. _this4.clearRadioRow();
  26782. return params;
  26783. });
  26784. },
  26785. /**
  26786. * 删除当前行选中的数据
  26787. */
  26788. _removeCurrentRow: function _removeCurrentRow() {
  26789. var _this5 = this;
  26790. var currentRecord = this.getCurrentRecord();
  26791. return this.remove(currentRecord || []).then(function (params) {
  26792. _this5.clearCurrentRow();
  26793. return params;
  26794. });
  26795. },
  26796. /**
  26797. * 获取表格数据集,包含新增、删除、修改
  26798. */
  26799. _getRecordset: function _getRecordset() {
  26800. return {
  26801. insertRecords: this.getInsertRecords(),
  26802. removeRecords: this.getRemoveRecords(),
  26803. updateRecords: this.getUpdateRecords()
  26804. };
  26805. },
  26806. /**
  26807. * 获取新增的临时数据
  26808. */
  26809. _getInsertRecords: function _getInsertRecords() {
  26810. var insertList = this.editStore.insertList;
  26811. var insertRecords = [];
  26812. if (insertList.length) {
  26813. this.tableFullData.forEach(function (row) {
  26814. if (insertList.indexOf(row) > -1) {
  26815. insertRecords.push(row);
  26816. }
  26817. });
  26818. }
  26819. return insertRecords;
  26820. },
  26821. /**
  26822. * 获取已删除的数据
  26823. */
  26824. _getRemoveRecords: function _getRemoveRecords() {
  26825. return this.editStore.removeList;
  26826. },
  26827. /**
  26828. * 获取更新数据
  26829. * 只精准匹配 row 的更改
  26830. * 如果是树表格,子节点更改状态不会影响父节点的更新状态
  26831. */
  26832. _getUpdateRecords: function _getUpdateRecords() {
  26833. var keepSource = this.keepSource,
  26834. tableFullData = this.tableFullData,
  26835. isUpdateByRow = this.isUpdateByRow,
  26836. treeConfig = this.treeConfig,
  26837. treeOpts = this.treeOpts,
  26838. editStore = this.editStore; // 在 v3 中必须要开启 keep-source
  26839. if (!keepSource) {
  26840. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  26841. }
  26842. if (keepSource) {
  26843. var actived = editStore.actived;
  26844. var row = actived.row,
  26845. column = actived.column;
  26846. if (row || column) {
  26847. this._syncActivedCell();
  26848. }
  26849. if (treeConfig) {
  26850. return ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  26851. return isUpdateByRow(row);
  26852. }, treeOpts);
  26853. }
  26854. return tableFullData.filter(function (row) {
  26855. return isUpdateByRow(row);
  26856. });
  26857. }
  26858. return [];
  26859. },
  26860. /**
  26861. * 处理激活编辑
  26862. */
  26863. handleActived: function handleActived(params, evnt) {
  26864. var _this6 = this;
  26865. var editStore = this.editStore,
  26866. editOpts = this.editOpts,
  26867. tableColumn = this.tableColumn,
  26868. mouseConfig = this.mouseConfig;
  26869. var mode = editOpts.mode,
  26870. activeMethod = editOpts.activeMethod;
  26871. var actived = editStore.actived;
  26872. var row = params.row,
  26873. column = params.column;
  26874. var editRender = column.editRender;
  26875. var cell = params.cell = params.cell || this.getCell(row, column);
  26876. if (UtilTools.isEnableConf(editRender) && cell) {
  26877. if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
  26878. // 判断是否禁用编辑
  26879. var type = 'edit-disabled';
  26880. if (!activeMethod || activeMethod(params)) {
  26881. if (mouseConfig) {
  26882. this.clearCopyed(evnt);
  26883. this.clearChecked();
  26884. this.clearSelected(evnt);
  26885. this.clearCellAreas(evnt);
  26886. this.clearCopyCellArea(evnt);
  26887. }
  26888. this.closeTooltip();
  26889. this.clearActived(evnt);
  26890. type = 'edit-actived';
  26891. column.renderHeight = cell.offsetHeight;
  26892. actived.args = params;
  26893. actived.row = row;
  26894. actived.column = column;
  26895. if (mode === 'row') {
  26896. tableColumn.forEach(function (column) {
  26897. return _this6._getColumnModel(row, column);
  26898. });
  26899. } else {
  26900. this._getColumnModel(row, column);
  26901. }
  26902. this.$nextTick(function () {
  26903. _this6.handleFocus(params, evnt);
  26904. });
  26905. }
  26906. this.emitEvent(type, Object.assign({}, params, {
  26907. row: row,
  26908. rowIndex: this.getRowIndex(row),
  26909. $rowIndex: this.getVMRowIndex(row),
  26910. column: column,
  26911. columnIndex: this.getColumnIndex(column),
  26912. $columnIndex: this.getVMColumnIndex(column)
  26913. }), evnt);
  26914. } else {
  26915. var oldColumn = actived.column;
  26916. if (mouseConfig) {
  26917. this.clearCopyed(evnt);
  26918. this.clearChecked();
  26919. this.clearSelected(evnt);
  26920. this.clearCellAreas(evnt);
  26921. this.clearCopyCellArea(evnt);
  26922. }
  26923. if (oldColumn !== column) {
  26924. var oldModel = oldColumn.model;
  26925. if (oldModel.update) {
  26926. UtilTools.setCellValue(row, oldColumn, oldModel.value);
  26927. }
  26928. this.clearValidate();
  26929. }
  26930. column.renderHeight = cell.offsetHeight;
  26931. actived.args = params;
  26932. actived.column = column;
  26933. setTimeout(function () {
  26934. _this6.handleFocus(params, evnt);
  26935. });
  26936. }
  26937. this.focus();
  26938. }
  26939. return this.$nextTick();
  26940. },
  26941. _getColumnModel: function _getColumnModel(row, column) {
  26942. var model = column.model,
  26943. editRender = column.editRender;
  26944. if (editRender) {
  26945. model.value = UtilTools.getCellValue(row, column);
  26946. model.update = false;
  26947. }
  26948. },
  26949. _setColumnModel: function _setColumnModel(row, column) {
  26950. var model = column.model,
  26951. editRender = column.editRender;
  26952. if (editRender && model.update) {
  26953. UtilTools.setCellValue(row, column, model.value);
  26954. model.update = false;
  26955. model.value = null;
  26956. }
  26957. },
  26958. _syncActivedCell: function _syncActivedCell() {
  26959. var _this7 = this;
  26960. var tableColumn = this.tableColumn,
  26961. editStore = this.editStore,
  26962. editOpts = this.editOpts;
  26963. var actived = editStore.actived;
  26964. var row = actived.row,
  26965. column = actived.column;
  26966. if (row || column) {
  26967. if (editOpts.mode === 'row') {
  26968. tableColumn.forEach(function (column) {
  26969. return _this7._setColumnModel(row, column);
  26970. });
  26971. } else {
  26972. this._setColumnModel(row, column);
  26973. }
  26974. }
  26975. },
  26976. /**
  26977. * 清除激活的编辑
  26978. */
  26979. _clearActived: function _clearActived(evnt) {
  26980. var editStore = this.editStore;
  26981. var actived = editStore.actived;
  26982. var args = actived.args,
  26983. row = actived.row,
  26984. column = actived.column;
  26985. if (row || column) {
  26986. this._syncActivedCell();
  26987. actived.args = null;
  26988. actived.row = null;
  26989. actived.column = null;
  26990. this.updateFooter();
  26991. this.emitEvent('edit-closed', Object.assign({}, args, {
  26992. row: row,
  26993. rowIndex: this.getRowIndex(row),
  26994. $rowIndex: this.getVMRowIndex(row),
  26995. column: column,
  26996. columnIndex: this.getColumnIndex(column),
  26997. $columnIndex: this.getVMColumnIndex(column)
  26998. }), evnt);
  26999. }
  27000. return (v_x_e_table._valid ? this.clearValidate() : this.$nextTick()).then(this.recalculate);
  27001. },
  27002. // 在 v3.0 中废弃 getActiveRow
  27003. _getActiveRow: function _getActiveRow() {
  27004. UtilTools.warn('vxe.error.delFunc', ['getActiveRow', 'getActiveRecord']);
  27005. return this.getActiveRecord();
  27006. },
  27007. _getActiveRecord: function _getActiveRecord() {
  27008. var $el = this.$el,
  27009. editStore = this.editStore,
  27010. afterFullData = this.afterFullData;
  27011. var _editStore$actived = editStore.actived,
  27012. args = _editStore$actived.args,
  27013. row = _editStore$actived.row;
  27014. if (args && afterFullData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
  27015. return Object.assign({}, args);
  27016. }
  27017. return null;
  27018. },
  27019. // 在 v3.0 中废弃 hasActiveRow
  27020. _hasActiveRow: function _hasActiveRow(row) {
  27021. UtilTools.warn('vxe.error.delFunc', ['hasActiveRow', 'isActiveByRow']);
  27022. return this.isActiveByRow(row);
  27023. },
  27024. /**
  27025. * 判断行是否为激活编辑状态
  27026. * @param {Row} row 行对象
  27027. */
  27028. _isActiveByRow: function _isActiveByRow(row) {
  27029. return this.editStore.actived.row === row;
  27030. },
  27031. /**
  27032. * 处理聚焦
  27033. */
  27034. handleFocus: function handleFocus(params) {
  27035. var row = params.row,
  27036. column = params.column,
  27037. cell = params.cell;
  27038. var editRender = column.editRender;
  27039. if (UtilTools.isEnableConf(editRender)) {
  27040. var compRender = v_x_e_table.renderer.get(editRender.name);
  27041. var autofocus = editRender.autofocus,
  27042. autoselect = editRender.autoselect;
  27043. var inputElem; // 如果指定了聚焦 class
  27044. if (autofocus) {
  27045. inputElem = cell.querySelector(autofocus);
  27046. } // 渲染器的聚焦处理
  27047. if (!inputElem && compRender && compRender.autofocus) {
  27048. inputElem = cell.querySelector(compRender.autofocus);
  27049. }
  27050. if (inputElem) {
  27051. inputElem.focus();
  27052. if (autoselect) {
  27053. inputElem.select();
  27054. } else {
  27055. // 保持一致行为,光标移到末端
  27056. if (DomTools.browse.msie) {
  27057. var textRange = inputElem.createTextRange();
  27058. textRange.collapse(false);
  27059. textRange.select();
  27060. }
  27061. }
  27062. } else {
  27063. // 显示到可视区中
  27064. this.scrollToRow(row, column);
  27065. }
  27066. }
  27067. },
  27068. /**
  27069. * 激活行编辑
  27070. */
  27071. _setActiveRow: function _setActiveRow(row) {
  27072. return this.setActiveCell(row, ctor_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
  27073. return UtilTools.isEnableConf(column.editRender);
  27074. }));
  27075. },
  27076. /**
  27077. * 激活单元格编辑
  27078. */
  27079. _setActiveCell: function _setActiveCell(row, fieldOrColumn) {
  27080. var _this8 = this;
  27081. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  27082. if (row && column && UtilTools.isEnableConf(column.editRender)) {
  27083. return this.scrollToRow(row, true).then(function () {
  27084. var cell = _this8.getCell(row, column);
  27085. if (cell) {
  27086. _this8.handleActived({
  27087. row: row,
  27088. rowIndex: _this8.getRowIndex(row),
  27089. column: column,
  27090. columnIndex: _this8.getColumnIndex(column),
  27091. cell: cell,
  27092. $table: _this8
  27093. });
  27094. _this8.lastCallTime = Date.now();
  27095. }
  27096. });
  27097. }
  27098. return this.$nextTick();
  27099. },
  27100. /**
  27101. * 只对 trigger=dblclick 有效,选中单元格
  27102. */
  27103. _setSelectCell: function _setSelectCell(row, fieldOrColumn) {
  27104. var tableData = this.tableData,
  27105. editOpts = this.editOpts,
  27106. visibleColumn = this.visibleColumn;
  27107. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  27108. if (row && column && editOpts.trigger !== 'manual') {
  27109. var rowIndex = tableData.indexOf(row);
  27110. if (rowIndex > -1 && column) {
  27111. var cell = this.getCell(row, column);
  27112. var params = {
  27113. row: row,
  27114. rowIndex: rowIndex,
  27115. column: column,
  27116. columnIndex: visibleColumn.indexOf(column),
  27117. cell: cell
  27118. };
  27119. this.handleSelected(params, {});
  27120. }
  27121. }
  27122. return this.$nextTick();
  27123. },
  27124. /**
  27125. * 处理选中源
  27126. */
  27127. handleSelected: function handleSelected(params, evnt) {
  27128. var _this9 = this;
  27129. var mouseConfig = this.mouseConfig,
  27130. mouseOpts = this.mouseOpts,
  27131. editOpts = this.editOpts,
  27132. editStore = this.editStore,
  27133. elemStore = this.elemStore;
  27134. var actived = editStore.actived,
  27135. selected = editStore.selected;
  27136. var row = params.row,
  27137. column = params.column,
  27138. cell = params.cell;
  27139. var isMouseSelected = mouseConfig && mouseOpts.selected; // 在 v3.0 中废弃 mouse-config.checked
  27140. var isMouseChecked = mouseConfig && mouseOpts.checked;
  27141. var selectMethod = function selectMethod() {
  27142. if ((isMouseSelected || isMouseChecked) && (selected.row !== row || selected.column !== column)) {
  27143. if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
  27144. if (_this9.keyboardConfig) {
  27145. _this9.clearChecked(evnt);
  27146. _this9.clearIndexChecked();
  27147. _this9.clearHeaderChecked();
  27148. }
  27149. _this9.clearActived(evnt);
  27150. _this9.clearSelected(evnt);
  27151. _this9.clearCellAreas(evnt);
  27152. _this9.clearCopyCellArea(evnt);
  27153. selected.args = params;
  27154. selected.row = row;
  27155. selected.column = column;
  27156. if (isMouseSelected) {
  27157. _this9.addColSdCls();
  27158. } // 如果配置了批量选中功能,则为批量选中状态
  27159. if (isMouseChecked) {
  27160. var headerElem = elemStore['main-header-list'];
  27161. _this9.handleChecked([[cell]]);
  27162. if (headerElem) {
  27163. _this9.handleHeaderChecked([[headerElem.querySelector(".".concat(column.id))]]);
  27164. }
  27165. _this9.handleIndexChecked([[cell.parentNode.querySelector('.col--seq')]]);
  27166. }
  27167. _this9.focus();
  27168. if (evnt) {
  27169. _this9.emitEvent('cell-selected', params, evnt);
  27170. }
  27171. }
  27172. }
  27173. return _this9.$nextTick();
  27174. };
  27175. return selectMethod();
  27176. },
  27177. /**
  27178. * 清除所选中源状态
  27179. */
  27180. _clearSelected: function _clearSelected() {
  27181. var selected = this.editStore.selected;
  27182. selected.row = null;
  27183. selected.column = null;
  27184. this.reColTitleSdCls();
  27185. this.reColSdCls();
  27186. return this.$nextTick();
  27187. },
  27188. reColTitleSdCls: function reColTitleSdCls() {
  27189. var headerElem = this.elemStore['main-header-list'];
  27190. if (headerElem) {
  27191. ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) {
  27192. return DomTools.removeClass(elem, 'col--title-selected');
  27193. });
  27194. }
  27195. },
  27196. reColSdCls: function reColSdCls() {
  27197. var cell = this.$el.querySelector('.col--selected');
  27198. if (cell) {
  27199. DomTools.removeClass(cell, 'col--selected');
  27200. }
  27201. },
  27202. addColSdCls: function addColSdCls() {
  27203. var selected = this.editStore.selected;
  27204. var row = selected.row,
  27205. column = selected.column;
  27206. this.reColSdCls();
  27207. if (row && column) {
  27208. var cell = this.getCell(row, column);
  27209. if (cell) {
  27210. DomTools.addClass(cell, 'col--selected');
  27211. }
  27212. }
  27213. }
  27214. }
  27215. });
  27216. // CONCATENATED MODULE: ./packages/edit/index.js
  27217. var Edit = {
  27218. install: function install() {
  27219. v_x_e_table.reg('edit');
  27220. packages_table.mixins.push(edit_src_mixin);
  27221. }
  27222. };
  27223. /* harmony default export */ var edit = (Edit);
  27224. // CONCATENATED MODULE: ./packages/export/src/export-panel.js
  27225. /* harmony default export */ var export_panel = ({
  27226. name: 'VxeExportPanel',
  27227. props: {
  27228. defaultOptions: Object,
  27229. storeData: Object
  27230. },
  27231. components: {
  27232. VxeModal: modal,
  27233. VxeInput: input,
  27234. VxeCheckbox: src_checkbox,
  27235. VxeSelect: src_select,
  27236. VxeOption: src_option
  27237. },
  27238. data: function data() {
  27239. return {
  27240. isAll: false,
  27241. isIndeterminate: false,
  27242. loading: false
  27243. };
  27244. },
  27245. computed: {
  27246. vSize: function vSize() {
  27247. return this.size || this.$parent.size || this.$parent.vSize;
  27248. },
  27249. showSheet: function showSheet() {
  27250. return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
  27251. }
  27252. },
  27253. render: function render(h) {
  27254. var _this = this;
  27255. var _e = this._e,
  27256. isAll = this.isAll,
  27257. isIndeterminate = this.isIndeterminate,
  27258. showSheet = this.showSheet,
  27259. defaultOptions = this.defaultOptions,
  27260. storeData = this.storeData;
  27261. var cols = [];
  27262. ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  27263. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  27264. var isColGroup = column.children && column.children.length;
  27265. cols.push(h('li', {
  27266. class: ['vxe-export--panel-column-option', "level--".concat(column.level), {
  27267. 'is--group': isColGroup,
  27268. 'is--checked': column.checked,
  27269. 'is--indeterminate': column.halfChecked,
  27270. 'is--disabled': column.disabled
  27271. }],
  27272. attrs: {
  27273. title: colTitle
  27274. },
  27275. on: {
  27276. click: function click() {
  27277. if (!column.disabled) {
  27278. _this.changeOption(column);
  27279. }
  27280. }
  27281. }
  27282. }, [h('span', {
  27283. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  27284. }), h('span', {
  27285. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  27286. }), h('span', {
  27287. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  27288. }), h('span', {
  27289. class: 'vxe-checkbox--label'
  27290. }, colTitle)]));
  27291. });
  27292. return h('vxe-modal', {
  27293. res: 'modal',
  27294. props: {
  27295. value: storeData.visible,
  27296. title: conf.i18n('vxe.export.expTitle'),
  27297. width: 660,
  27298. mask: true,
  27299. lockView: true,
  27300. showFooter: false,
  27301. escClosable: true,
  27302. maskClosable: true,
  27303. loading: this.loading
  27304. },
  27305. on: {
  27306. input: function input(value) {
  27307. storeData.visible = value;
  27308. },
  27309. show: this.showEvent
  27310. }
  27311. }, [h('div', {
  27312. class: 'vxe-export--panel'
  27313. }, [h('table', {
  27314. attrs: {
  27315. cellspacing: 0,
  27316. cellpadding: 0,
  27317. border: 0
  27318. }
  27319. }, [h('tbody', [[h('tr', [h('td', conf.i18n('vxe.export.expName')), h('td', [h('vxe-input', {
  27320. ref: 'filename',
  27321. props: {
  27322. value: defaultOptions.filename,
  27323. type: 'text',
  27324. clearable: true,
  27325. placeholder: conf.i18n('vxe.export.expNamePlaceholder')
  27326. },
  27327. on: {
  27328. input: function input(value) {
  27329. defaultOptions.filename = value;
  27330. }
  27331. }
  27332. })])]), h('tr', [h('td', conf.i18n('vxe.export.expType')), h('td', [h('vxe-select', {
  27333. props: {
  27334. value: defaultOptions.type
  27335. },
  27336. on: {
  27337. input: function input(value) {
  27338. defaultOptions.type = value;
  27339. }
  27340. }
  27341. }, storeData.typeList.map(function (item) {
  27342. return h('vxe-option', {
  27343. props: {
  27344. value: item.value,
  27345. label: conf.i18n(item.label)
  27346. }
  27347. });
  27348. }))])]), showSheet ? h('tr', [h('td', conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
  27349. props: {
  27350. value: defaultOptions.sheetName,
  27351. type: 'text',
  27352. clearable: true,
  27353. placeholder: conf.i18n('vxe.export.expSheetNamePlaceholder')
  27354. },
  27355. on: {
  27356. input: function input(value) {
  27357. defaultOptions.sheetName = value;
  27358. }
  27359. }
  27360. })])]) : _e(), h('tr', [h('td', conf.i18n('vxe.export.expMode')), h('td', [h('vxe-select', {
  27361. props: {
  27362. value: defaultOptions.mode
  27363. },
  27364. on: {
  27365. input: function input(value) {
  27366. defaultOptions.mode = value;
  27367. }
  27368. }
  27369. }, storeData.modeList.map(function (item) {
  27370. return h('vxe-option', {
  27371. props: {
  27372. value: item.value,
  27373. label: conf.i18n(item.label)
  27374. }
  27375. });
  27376. }))])]), h('tr', [h('td', [conf.i18n('vxe.export.expColumn')]), h('td', [h('div', {
  27377. class: 'vxe-export--panel-column'
  27378. }, [h('ul', {
  27379. class: 'vxe-export--panel-column-header'
  27380. }, [h('li', {
  27381. class: ['vxe-export--panel-column-option', {
  27382. 'is--checked': isAll,
  27383. 'is--indeterminate': isIndeterminate
  27384. }],
  27385. attrs: {
  27386. title: conf.i18n('vxe.table.allTitle')
  27387. },
  27388. on: {
  27389. click: this.allColumnEvent
  27390. }
  27391. }, [h('span', {
  27392. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  27393. }), h('span', {
  27394. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  27395. }), h('span', {
  27396. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  27397. }), h('span', {
  27398. class: 'vxe-checkbox--label'
  27399. }, conf.i18n('vxe.export.expCurrentColumn'))])]), h('ul', {
  27400. class: 'vxe-export--panel-column-body'
  27401. }, cols)])])]), h('tr', [h('td', conf.i18n('vxe.export.expOpts')), h('td', [h('vxe-checkbox', {
  27402. props: {
  27403. value: defaultOptions.isHeader,
  27404. title: conf.i18n('vxe.export.expHeaderTitle')
  27405. },
  27406. on: {
  27407. input: function input(value) {
  27408. defaultOptions.isHeader = value;
  27409. }
  27410. }
  27411. }, conf.i18n('vxe.export.expOptHeader')), h('vxe-checkbox', {
  27412. props: {
  27413. value: defaultOptions.isFooter,
  27414. disabled: !storeData.hasFooter,
  27415. title: conf.i18n('vxe.export.expFooterTitle')
  27416. },
  27417. on: {
  27418. input: function input(value) {
  27419. defaultOptions.isFooter = value;
  27420. }
  27421. }
  27422. }, conf.i18n('vxe.export.expOptFooter')), h('vxe-checkbox', {
  27423. props: {
  27424. value: defaultOptions.original,
  27425. title: conf.i18n('vxe.export.expOriginalTitle')
  27426. },
  27427. on: {
  27428. input: function input(value) {
  27429. defaultOptions.original = value;
  27430. }
  27431. }
  27432. }, conf.i18n('vxe.export.expOptOriginal'))])])]])]), h('div', {
  27433. class: 'vxe-export--panel-btns'
  27434. }, [defaultOptions.isPrint ? h('vxe-button', {
  27435. on: {
  27436. click: this.printEvent
  27437. }
  27438. }, conf.i18n('vxe.export.expPrint')) : null, h('vxe-button', {
  27439. props: {
  27440. status: 'primary'
  27441. },
  27442. on: {
  27443. click: this.exportEvent
  27444. }
  27445. }, conf.i18n('vxe.export.expConfirm'))])])]);
  27446. },
  27447. methods: {
  27448. changeOption: function changeOption(column) {
  27449. var isChecked = !column.checked;
  27450. ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
  27451. item.checked = isChecked;
  27452. item.halfChecked = false;
  27453. });
  27454. this.handleOptionCheck(column);
  27455. this.checkStatus();
  27456. },
  27457. handleOptionCheck: function handleOptionCheck(column) {
  27458. var matchObj = ctor_amd_xe_utils_default.a.findTree(this.storeData.columns, function (item) {
  27459. return item === column;
  27460. });
  27461. if (matchObj && matchObj.parent) {
  27462. var parent = matchObj.parent;
  27463. if (parent.children && parent.children.length) {
  27464. parent.checked = parent.children.every(function (column) {
  27465. return column.checked;
  27466. });
  27467. parent.halfChecked = !parent.checked && parent.children.some(function (column) {
  27468. return column.checked || column.halfChecked;
  27469. });
  27470. this.handleOptionCheck(parent);
  27471. }
  27472. }
  27473. },
  27474. checkStatus: function checkStatus() {
  27475. var columns = this.storeData.columns;
  27476. this.isAll = columns.every(function (column) {
  27477. return column.disabled || column.checked;
  27478. });
  27479. this.isIndeterminate = !this.isAll && columns.some(function (column) {
  27480. return !column.disabled && (column.checked || column.halfChecked);
  27481. });
  27482. },
  27483. allColumnEvent: function allColumnEvent() {
  27484. var isAll = !this.isAll;
  27485. ctor_amd_xe_utils_default.a.eachTree(this.storeData.columns, function (column) {
  27486. if (!column.disabled) {
  27487. column.checked = isAll;
  27488. column.halfChecked = false;
  27489. }
  27490. });
  27491. this.isAll = isAll;
  27492. this.checkStatus();
  27493. },
  27494. showEvent: function showEvent() {
  27495. var _this2 = this;
  27496. this.$nextTick(function () {
  27497. _this2.$refs.filename.focus();
  27498. });
  27499. this.checkStatus();
  27500. },
  27501. getExportOption: function getExportOption() {
  27502. var storeData = this.storeData,
  27503. defaultOptions = this.defaultOptions;
  27504. var checkColumns = [];
  27505. ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  27506. var isColGroup = column.children && column.children.length;
  27507. if (!isColGroup && column.checked) {
  27508. checkColumns.push(column);
  27509. }
  27510. });
  27511. return Object.assign({}, defaultOptions, {
  27512. columns: checkColumns
  27513. });
  27514. },
  27515. printEvent: function printEvent() {
  27516. var $xetable = this.$parent;
  27517. this.storeData.visible = false;
  27518. $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
  27519. },
  27520. exportEvent: function exportEvent() {
  27521. var _this3 = this;
  27522. var $xetable = this.$parent;
  27523. this.loading = true;
  27524. $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(function () {
  27525. _this3.loading = false;
  27526. _this3.storeData.visible = false;
  27527. }).catch(function () {
  27528. _this3.loading = false;
  27529. });
  27530. }
  27531. }
  27532. });
  27533. // CONCATENATED MODULE: ./packages/export/src/import-panel.js
  27534. /* harmony default export */ var import_panel = ({
  27535. name: 'VxeImportPanel',
  27536. props: {
  27537. defaultOptions: Object,
  27538. storeData: Object
  27539. },
  27540. components: {
  27541. VxeModal: modal,
  27542. VxeRadio: src_radio
  27543. },
  27544. data: function data() {
  27545. return {
  27546. loading: false
  27547. };
  27548. },
  27549. computed: {
  27550. vSize: function vSize() {
  27551. return this.size || this.$parent.size || this.$parent.vSize;
  27552. },
  27553. selectName: function selectName() {
  27554. return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
  27555. },
  27556. hasFile: function hasFile() {
  27557. return this.storeData.file && this.storeData.type;
  27558. },
  27559. parseTypeLabel: function parseTypeLabel() {
  27560. var storeData = this.storeData;
  27561. var type = storeData.type,
  27562. typeList = storeData.typeList;
  27563. if (type) {
  27564. var selectItem = ctor_amd_xe_utils_default.a.find(typeList, function (item) {
  27565. return type === item.value;
  27566. });
  27567. return selectItem ? conf.i18n(selectItem.label) : '*.*';
  27568. }
  27569. return "*.".concat(typeList.map(function (item) {
  27570. return item.value;
  27571. }).join(', *.'));
  27572. }
  27573. },
  27574. render: function render(h) {
  27575. var hasFile = this.hasFile,
  27576. parseTypeLabel = this.parseTypeLabel,
  27577. defaultOptions = this.defaultOptions,
  27578. storeData = this.storeData,
  27579. selectName = this.selectName;
  27580. return h('vxe-modal', {
  27581. res: 'modal',
  27582. props: {
  27583. value: storeData.visible,
  27584. title: conf.i18n('vxe.import.impTitle'),
  27585. width: 440,
  27586. mask: true,
  27587. lockView: true,
  27588. showFooter: false,
  27589. escClosable: true,
  27590. maskClosable: true,
  27591. loading: this.loading
  27592. },
  27593. on: {
  27594. input: function input(value) {
  27595. storeData.visible = value;
  27596. }
  27597. }
  27598. }, [h('div', {
  27599. class: 'vxe-export--panel'
  27600. }, [h('table', {
  27601. attrs: {
  27602. cellspacing: 0,
  27603. cellpadding: 0,
  27604. border: 0
  27605. }
  27606. }, [h('tbody', [h('tr', [h('td', conf.i18n('vxe.import.impFile')), h('td', [hasFile ? h('div', {
  27607. class: 'vxe-import-selected--file',
  27608. attrs: {
  27609. title: selectName
  27610. }
  27611. }, [h('span', selectName), h('i', {
  27612. class: conf.icon.INPUT_CLEAR,
  27613. on: {
  27614. click: this.clearFileEvent
  27615. }
  27616. })]) : h('span', {
  27617. class: 'vxe-import-select--file',
  27618. on: {
  27619. click: this.selectFileEvent
  27620. }
  27621. }, conf.i18n('vxe.import.impSelect'))])]), h('tr', [h('td', conf.i18n('vxe.import.impType')), h('td', parseTypeLabel)]), h('tr', [h('td', conf.i18n('vxe.import.impOpts')), h('td', [h('vxe-radio-group', {
  27622. props: {
  27623. value: defaultOptions.mode
  27624. },
  27625. on: {
  27626. input: function input(value) {
  27627. defaultOptions.mode = value;
  27628. }
  27629. }
  27630. }, storeData.modeList.map(function (item) {
  27631. return h('vxe-radio', {
  27632. props: {
  27633. label: item.value
  27634. }
  27635. }, conf.i18n(item.label));
  27636. }))])])])]), h('div', {
  27637. class: 'vxe-export--panel-btns'
  27638. }, [h('vxe-button', {
  27639. props: {
  27640. status: 'primary',
  27641. disabled: !hasFile
  27642. },
  27643. on: {
  27644. click: this.importEvent
  27645. }
  27646. }, conf.i18n('vxe.import.impConfirm'))])])]);
  27647. },
  27648. methods: {
  27649. clearFileEvent: function clearFileEvent() {
  27650. Object.assign(this.storeData, {
  27651. filename: '',
  27652. sheetName: '',
  27653. type: ''
  27654. });
  27655. },
  27656. selectFileEvent: function selectFileEvent() {
  27657. var _this = this;
  27658. var $xetable = this.$parent;
  27659. $xetable.readFile(this.defaultOptions).then(function (params) {
  27660. var file = params.file;
  27661. Object.assign(_this.storeData, UtilTools.parseFile(file), {
  27662. file: file
  27663. });
  27664. }).catch(function (e) {
  27665. return e;
  27666. });
  27667. },
  27668. importEvent: function importEvent() {
  27669. var _this2 = this;
  27670. var $xetable = this.$parent;
  27671. this.loading = true;
  27672. $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
  27673. _this2.loading = false;
  27674. _this2.storeData.visible = false;
  27675. }).catch(function () {
  27676. _this2.loading = false;
  27677. });
  27678. }
  27679. }
  27680. });
  27681. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
  27682. var es_array_includes = __webpack_require__("caad");
  27683. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
  27684. var es_string_includes = __webpack_require__("2532");
  27685. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
  27686. var web_url = __webpack_require__("2b3d");
  27687. // CONCATENATED MODULE: ./packages/export/src/mixin.js
  27688. // 默认导出或打印的 HTML 样式
  27689. var defaultHtmlStyle = 'body{margin:0;color:#333333;font-size:14px;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}';
  27690. var htmlCellElem; // 导入
  27691. var fileForm;
  27692. var fileInput; // 打印
  27693. var printFrame;
  27694. var csvBOM = "\uFEFF";
  27695. var enterSymbol = '\r\n';
  27696. function createFrame() {
  27697. var frame = document.createElement('iframe');
  27698. frame.className = 'vxe-table--print-frame';
  27699. return frame;
  27700. }
  27701. function getExportBlobByContent(content, options) {
  27702. if (window.Blob) {
  27703. return new Blob([content], {
  27704. type: "text/".concat(options.type)
  27705. });
  27706. }
  27707. return null;
  27708. }
  27709. function hasTreeChildren($xetable, row) {
  27710. var treeOpts = $xetable.treeOpts;
  27711. return row[treeOpts.children] && row[treeOpts.children].length;
  27712. }
  27713. function getSeq($xetable, row, rowIndex, column, columnIndex) {
  27714. // 在 v3.0 中废弃 startIndex、indexMethod
  27715. var seqOpts = $xetable.seqOpts;
  27716. var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
  27717. return seqMethod ? seqMethod({
  27718. row: row,
  27719. rowIndex: rowIndex,
  27720. column: column,
  27721. columnIndex: columnIndex
  27722. }) : (seqOpts.startIndex || $xetable.startIndex) + rowIndex + 1;
  27723. }
  27724. function defaultFilterExportColumn(column) {
  27725. return column.property || ['seq', 'index', 'checkbox', 'selection', 'radio'].indexOf(column.type) > -1;
  27726. }
  27727. function toTableBorder(border) {
  27728. if (border === true) {
  27729. return 'full';
  27730. }
  27731. if (border) {
  27732. return border;
  27733. }
  27734. return 'default';
  27735. }
  27736. function toBooleanValue(cellValue) {
  27737. return ctor_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
  27738. }
  27739. function getLabelData($xetable, opts, columns, datas) {
  27740. var treeConfig = $xetable.treeConfig,
  27741. treeOpts = $xetable.treeOpts,
  27742. radioOpts = $xetable.radioOpts,
  27743. checkboxOpts = $xetable.checkboxOpts;
  27744. if (!htmlCellElem) {
  27745. htmlCellElem = document.createElement('div');
  27746. }
  27747. if (treeConfig) {
  27748. // 如果是树表格只允许导出数据源
  27749. var rest = [];
  27750. ctor_amd_xe_utils_default.a.eachTree(datas, function (row, rowIndex, items, path, parent, nodes) {
  27751. var item = {
  27752. _level: nodes.length - 1,
  27753. _hasChild: hasTreeChildren($xetable, row)
  27754. };
  27755. columns.forEach(function (column, columnIndex) {
  27756. var cellValue = '';
  27757. var renderOpts = column.editRender || column.cellRender;
  27758. var exportLabelMethod = column.exportMethod;
  27759. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27760. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27761. if (compConf) {
  27762. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  27763. }
  27764. }
  27765. if (exportLabelMethod) {
  27766. cellValue = exportLabelMethod({
  27767. $table: $xetable,
  27768. row: row,
  27769. column: column,
  27770. options: opts
  27771. });
  27772. } else {
  27773. switch (column.type) {
  27774. // v3.0 废弃 type=index
  27775. case 'seq':
  27776. case 'index':
  27777. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  27778. break;
  27779. // v3.0 废弃 type=selection
  27780. case 'selection':
  27781. case 'checkbox':
  27782. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  27783. item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  27784. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  27785. row: row
  27786. });
  27787. break;
  27788. case 'radio':
  27789. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  27790. item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  27791. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  27792. row: row
  27793. });
  27794. break;
  27795. default:
  27796. if (opts.original) {
  27797. cellValue = UtilTools.getCellValue(row, column);
  27798. } else {
  27799. cellValue = $xetable.getCellLabel(row, column);
  27800. if (column.type === 'html') {
  27801. htmlCellElem.innerHTML = cellValue;
  27802. cellValue = htmlCellElem.innerText.trim();
  27803. }
  27804. }
  27805. }
  27806. }
  27807. item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
  27808. });
  27809. rest.push(Object.assign(item, row));
  27810. }, treeOpts);
  27811. return rest;
  27812. }
  27813. return datas.map(function (row, rowIndex) {
  27814. var item = {};
  27815. columns.forEach(function (column, columnIndex) {
  27816. var cellValue = '';
  27817. var renderOpts = column.editRender || column.cellRender;
  27818. var exportLabelMethod = column.exportMethod;
  27819. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27820. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27821. if (compConf) {
  27822. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  27823. }
  27824. }
  27825. if (exportLabelMethod) {
  27826. cellValue = exportLabelMethod({
  27827. $table: $xetable,
  27828. row: row,
  27829. column: column,
  27830. options: opts
  27831. });
  27832. } else {
  27833. switch (column.type) {
  27834. // v3.0 废弃 type=index
  27835. case 'seq':
  27836. case 'index':
  27837. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  27838. break;
  27839. // v3.0 废弃 type=selection
  27840. case 'selection':
  27841. case 'checkbox':
  27842. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  27843. item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  27844. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  27845. row: row
  27846. });
  27847. break;
  27848. case 'radio':
  27849. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  27850. item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  27851. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  27852. row: row
  27853. });
  27854. break;
  27855. default:
  27856. if (opts.original) {
  27857. cellValue = UtilTools.getCellValue(row, column);
  27858. } else {
  27859. cellValue = $xetable.getCellLabel(row, column);
  27860. if (column.type === 'html') {
  27861. htmlCellElem.innerHTML = cellValue;
  27862. cellValue = htmlCellElem.innerText.trim();
  27863. }
  27864. }
  27865. }
  27866. }
  27867. item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
  27868. });
  27869. return item;
  27870. });
  27871. }
  27872. function getExportData($xetable, opts) {
  27873. var columnFilterMethod = opts.columnFilterMethod,
  27874. dataFilterMethod = opts.dataFilterMethod;
  27875. var columns = opts.columns;
  27876. var datas = opts.data;
  27877. if (columnFilterMethod) {
  27878. columns = columns.filter(function (column, index) {
  27879. return columnFilterMethod({
  27880. column: column,
  27881. $columnIndex: index
  27882. });
  27883. });
  27884. }
  27885. if (dataFilterMethod) {
  27886. datas = datas.filter(function (row, index) {
  27887. return dataFilterMethod({
  27888. row: row,
  27889. $rowIndex: index
  27890. });
  27891. });
  27892. }
  27893. return {
  27894. columns: columns,
  27895. datas: getLabelData($xetable, opts, columns, datas)
  27896. };
  27897. }
  27898. function getBooleanValue(cellValue) {
  27899. return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
  27900. }
  27901. function getHeaderTitle(opts, column) {
  27902. return (opts.original ? column.property : column.getTitle()) || '';
  27903. }
  27904. function getFooterCellValue($xetable, opts, items, column) {
  27905. var renderOpts = column.editRender || column.cellRender;
  27906. var exportLabelMethod = column.footerExportMethod;
  27907. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27908. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27909. if (compConf) {
  27910. exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
  27911. }
  27912. }
  27913. var _columnIndex = $xetable.getVTColumnIndex(column);
  27914. var cellValue = exportLabelMethod ? exportLabelMethod({
  27915. $table: $xetable,
  27916. items: items,
  27917. itemIndex: _columnIndex,
  27918. _columnIndex: _columnIndex,
  27919. column: column,
  27920. options: opts
  27921. }) : ctor_amd_xe_utils_default.a.toString(items[_columnIndex]);
  27922. return cellValue;
  27923. }
  27924. function getFooterData(opts, footerTableData) {
  27925. var footerFilterMethod = opts.footerFilterMethod;
  27926. return footerFilterMethod ? footerTableData.filter(function (items, index) {
  27927. return footerFilterMethod({
  27928. items: items,
  27929. $rowIndex: index
  27930. });
  27931. }) : footerTableData;
  27932. }
  27933. function toCsv($xetable, opts, columns, datas) {
  27934. var content = csvBOM;
  27935. if (opts.isHeader) {
  27936. content += columns.map(function (column) {
  27937. return "\"".concat(getHeaderTitle(opts, column), "\"");
  27938. }).join(',') + enterSymbol;
  27939. }
  27940. datas.forEach(function (row) {
  27941. content += columns.map(function (column) {
  27942. return "\"".concat(row[column.id], "\"");
  27943. }).join(',') + enterSymbol;
  27944. });
  27945. if (opts.isFooter) {
  27946. var footerTableData = $xetable.footerTableData;
  27947. var footers = getFooterData(opts, footerTableData);
  27948. footers.forEach(function (rows) {
  27949. content += columns.map(function (column) {
  27950. return "\"".concat(getFooterCellValue($xetable, opts, rows, column), "\"");
  27951. }).join(',') + enterSymbol;
  27952. });
  27953. }
  27954. return content;
  27955. }
  27956. function toTxt($xetable, opts, columns, datas) {
  27957. var content = '';
  27958. if (opts.isHeader) {
  27959. content += columns.map(function (column) {
  27960. return "".concat(getHeaderTitle(opts, column));
  27961. }).join('\t') + enterSymbol;
  27962. }
  27963. datas.forEach(function (row) {
  27964. content += columns.map(function (column) {
  27965. return "".concat(row[column.id]);
  27966. }).join('\t') + enterSymbol;
  27967. });
  27968. if (opts.isFooter) {
  27969. var footerTableData = $xetable.footerTableData;
  27970. var footers = getFooterData(opts, footerTableData);
  27971. footers.forEach(function (rows) {
  27972. content += columns.map(function (column) {
  27973. return "".concat(getFooterCellValue($xetable, opts, rows, column));
  27974. }).join(',') + enterSymbol;
  27975. });
  27976. }
  27977. return content;
  27978. }
  27979. function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
  27980. var columnOverflow = column[property];
  27981. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(columnOverflow) || ctor_amd_xe_utils_default.a.isNull(columnOverflow) ? allColumnOverflow : columnOverflow;
  27982. var showEllipsis = headOverflow === 'ellipsis';
  27983. var showTitle = headOverflow === 'title';
  27984. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  27985. var isEllipsis = showTitle || showTooltip || showEllipsis; // 虚拟滚动不支持动态高度
  27986. if (($xetable.scrollXLoad || $xetable.scrollYLoad) && !isEllipsis) {
  27987. isEllipsis = true;
  27988. }
  27989. return isEllipsis;
  27990. }
  27991. function createHtmlPage(opts, content) {
  27992. var style = opts.style;
  27993. return ['<!DOCTYPE html><html>', '<head>', '<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">', "<title>".concat(opts.sheetName, "</title>"), "<style>".concat(defaultHtmlStyle, "</style>"), style ? "<style>".concat(style, "</style>") : '', '</head>', "<body>".concat(ctor_amd_xe_utils_default.a.toString(content), "</body>"), '</html>'].join('');
  27994. }
  27995. function toHtml($xetable, opts, columns, datas) {
  27996. var id = $xetable.id,
  27997. border = $xetable.border,
  27998. treeConfig = $xetable.treeConfig,
  27999. treeOpts = $xetable.treeOpts,
  28000. isAllSelected = $xetable.isAllSelected,
  28001. isIndeterminate = $xetable.isIndeterminate,
  28002. allHeaderAlign = $xetable.headerAlign,
  28003. allAlign = $xetable.align,
  28004. allFooterAlign = $xetable.footerAlign,
  28005. allColumnOverflow = $xetable.showOverflow,
  28006. allColumnHeaderOverflow = $xetable.showHeaderOverflow;
  28007. var isPrint = opts.print,
  28008. isHeader = opts.isHeader,
  28009. isFooter = opts.isFooter;
  28010. var allCls = 'check-all';
  28011. var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'show--head' : ''].filter(function (cls) {
  28012. return cls;
  28013. });
  28014. var body = ["<table class=\"".concat(clss.join(' '), "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"), "<colgroup>".concat(columns.map(function (column) {
  28015. return "<col style=\"width:".concat(column.renderWidth, "px\">");
  28016. }).join(''), "</colgroup>")].join('');
  28017. if (isHeader) {
  28018. body += "<thead><tr>".concat(columns.map(function (column) {
  28019. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  28020. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  28021. var cellTitle = getHeaderTitle(opts, column);
  28022. if (headAlign) {
  28023. classNames.push("col--".concat(headAlign));
  28024. }
  28025. if (column.type === 'checkbox' || column.type === 'selection') {
  28026. return "<th class=\"".concat(classNames.join(' '), "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"checkbox\" class=\"").concat(allCls, "\" ").concat(isAllSelected ? 'checked' : '', "><span>").concat(cellTitle, "</span></div></th>");
  28027. }
  28028. return "<th class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellTitle, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><span>").concat(UtilTools.formatText(cellTitle, true), "</span></div></th>");
  28029. }).join(''), "</tr></thead>");
  28030. }
  28031. if (datas.length) {
  28032. body += '<tbody>';
  28033. if (treeConfig) {
  28034. datas.forEach(function (item) {
  28035. body += '<tr>' + columns.map(function (column) {
  28036. var cellAlign = column.align || allAlign;
  28037. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28038. var cellValue = item[column.id];
  28039. if (cellAlign) {
  28040. classNames.push("col--".concat(cellAlign));
  28041. }
  28042. if (column.treeNode) {
  28043. var treeIcon = '';
  28044. if (item._hasChild) {
  28045. treeIcon = "<i class=\"".concat(item._expand ? 'vxe-table--tree-fold-icon' : 'vxe-table--tree-unfold-icon', "\"></i>");
  28046. }
  28047. classNames.push('vxe-table--tree-node');
  28048. if (column.type === 'radio') {
  28049. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><div class=\"vxe-table--tree-node-wrapper\" style=\"padding-left: ").concat(item._level * treeOpts.indent, "px\"><div class=\"vxe-table--tree-icon-wrapper\">").concat(treeIcon, "</div><div class=\"vxe-table--tree-cell\"><input type=\"radio\" name=\"radio_").concat(id, "\" ").concat(item._radioDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._radioLabel, "</span></div></div></div></td>");
  28050. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28051. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><div class=\"vxe-table--tree-node-wrapper\" style=\"padding-left: ").concat(item._level * treeOpts.indent, "px\"><div class=\"vxe-table--tree-icon-wrapper\">").concat(treeIcon, "</div><div class=\"vxe-table--tree-cell\"><input type=\"checkbox\" ").concat(item._checkboxDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._checkboxLabel, "</span></div></div></div></td>");
  28052. }
  28053. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><div class=\"vxe-table--tree-node-wrapper\" style=\"padding-left: ").concat(item._level * treeOpts.indent, "px\"><div class=\"vxe-table--tree-icon-wrapper\">").concat(treeIcon, "</div><div class=\"vxe-table--tree-cell\">").concat(cellValue, "</div></div></div></td>");
  28054. }
  28055. if (column.type === 'radio') {
  28056. return "<td class=\"".concat(classNames.join(' '), "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"radio\" name=\"radio_").concat(id, "\" ").concat(item._radioDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._radioLabel, "</span></div></td>");
  28057. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28058. return "<td class=\"".concat(classNames.join(' '), "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"checkbox\" ").concat(item._checkboxDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._checkboxLabel, "</span></div></td>");
  28059. }
  28060. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
  28061. }).join('') + '</tr>';
  28062. });
  28063. } else {
  28064. datas.forEach(function (item) {
  28065. body += '<tr>' + columns.map(function (column) {
  28066. var cellAlign = column.align || allAlign;
  28067. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28068. var cellValue = item[column.id];
  28069. if (cellAlign) {
  28070. classNames.push("col--".concat(cellAlign));
  28071. }
  28072. if (column.type === 'radio') {
  28073. return "<td class=\"".concat(classNames.join(' '), "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"radio\" name=\"radio_").concat(id, "\" ").concat(item._radioDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._radioLabel, "</span></div></td>");
  28074. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28075. return "<td class=\"".concat(classNames.join(' '), "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"checkbox\" ").concat(item._checkboxDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._checkboxLabel, "</span></div></td>");
  28076. }
  28077. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
  28078. }).join('') + '</tr>';
  28079. });
  28080. }
  28081. body += '</tbody>';
  28082. }
  28083. if (isFooter) {
  28084. var footerTableData = $xetable.footerTableData;
  28085. var footers = getFooterData(opts, footerTableData);
  28086. if (footers.length) {
  28087. body += '<tfoot>';
  28088. footers.forEach(function (rows) {
  28089. body += "<tr>".concat(columns.map(function (column) {
  28090. var footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
  28091. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28092. var cellValue = getFooterCellValue($xetable, opts, rows, column);
  28093. if (footAlign) {
  28094. classNames.push("col--".concat(footAlign));
  28095. }
  28096. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
  28097. }).join(''), "</tr>");
  28098. });
  28099. body += '</tfoot>';
  28100. }
  28101. } // 是否半选状态
  28102. var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
  28103. body += '</table>' + script;
  28104. return isPrint ? body : createHtmlPage(opts, body);
  28105. }
  28106. function toXML($xetable, opts, columns, datas) {
  28107. var xml = ['<?xml version="1.0"?>', '<?mso-application progid="Excel.Sheet"?>', '<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">', '<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">', '<Version>16.00</Version>', '</DocumentProperties>', '<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">', '<WindowHeight>7920</WindowHeight>', '<WindowWidth>21570</WindowWidth>', '<WindowTopX>32767</WindowTopX>', '<WindowTopY>32767</WindowTopY>', '<ProtectStructure>False</ProtectStructure>', '<ProtectWindows>False</ProtectWindows>', '</ExcelWorkbook>', "<Worksheet ss:Name=\"".concat(opts.sheetName, "\">"), '<Table>', columns.map(function (column) {
  28108. return "<Column ss:Width=\"".concat(column.renderWidth, "\"/>");
  28109. }).join('')].join('');
  28110. if (opts.isHeader) {
  28111. xml += "<Row>".concat(columns.map(function (column) {
  28112. return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
  28113. }).join(''), "</Row>");
  28114. }
  28115. datas.forEach(function (row) {
  28116. xml += '<Row>' + columns.map(function (column) {
  28117. return "<Cell><Data ss:Type=\"String\">".concat(row[column.id], "</Data></Cell>");
  28118. }).join('') + '</Row>';
  28119. });
  28120. if (opts.isFooter) {
  28121. var footerTableData = $xetable.footerTableData;
  28122. var footers = getFooterData(opts, footerTableData);
  28123. footers.forEach(function (rows) {
  28124. xml += "<Row>".concat(columns.map(function (column) {
  28125. return "<Cell><Data ss:Type=\"String\">".concat(getFooterCellValue($xetable, opts, rows, column), "</Data></Cell>");
  28126. }).join(''), "</Row>");
  28127. });
  28128. }
  28129. return "".concat(xml, "</Table></Worksheet></Workbook>");
  28130. }
  28131. function getContent($xetable, opts, columns, datas) {
  28132. if (columns.length) {
  28133. switch (opts.type) {
  28134. case 'csv':
  28135. return toCsv($xetable, opts, columns, datas);
  28136. case 'txt':
  28137. return toTxt($xetable, opts, columns, datas);
  28138. case 'html':
  28139. return toHtml($xetable, opts, columns, datas);
  28140. case 'xml':
  28141. return toXML($xetable, opts, columns, datas);
  28142. }
  28143. }
  28144. return '';
  28145. }
  28146. /**
  28147. * 保存文件到本地
  28148. * @param {*} options 参数
  28149. */
  28150. function saveLocalFile(options) {
  28151. var filename = options.filename,
  28152. type = options.type,
  28153. content = options.content;
  28154. var name = "".concat(filename, ".").concat(type);
  28155. if (window.Blob) {
  28156. var blob = content instanceof Blob ? content : getExportBlobByContent(ctor_amd_xe_utils_default.a.toString(content), options);
  28157. if (navigator.msSaveBlob) {
  28158. navigator.msSaveBlob(blob, name);
  28159. } else {
  28160. var linkElem = document.createElement('a');
  28161. linkElem.target = '_blank';
  28162. linkElem.download = name;
  28163. linkElem.href = URL.createObjectURL(blob);
  28164. document.body.appendChild(linkElem);
  28165. linkElem.click();
  28166. document.body.removeChild(linkElem);
  28167. }
  28168. return Promise.resolve();
  28169. }
  28170. return Promise.reject(new Error(UtilTools.getLog('vxe.error.notExp')));
  28171. }
  28172. function downloadFile($xetable, opts, content) {
  28173. var filename = opts.filename,
  28174. type = opts.type,
  28175. download = opts.download;
  28176. if (!download) {
  28177. var blob = getExportBlobByContent(content, opts);
  28178. return Promise.resolve({
  28179. type: type,
  28180. content: content,
  28181. blob: blob
  28182. });
  28183. }
  28184. saveLocalFile({
  28185. filename: filename,
  28186. type: type,
  28187. content: content
  28188. }).then(function () {
  28189. if (opts.message !== false) {
  28190. v_x_e_table.modal.message({
  28191. message: conf.i18n('vxe.table.expSuccess'),
  28192. status: 'success'
  28193. });
  28194. }
  28195. });
  28196. }
  28197. function handleExport($xetable, opts) {
  28198. if (opts.remote) {
  28199. var params = {
  28200. options: opts,
  28201. $table: $xetable,
  28202. $grid: $xetable.$xegrid
  28203. };
  28204. if (opts.exportMethod) {
  28205. return opts.exportMethod(params);
  28206. }
  28207. return Promise.resolve(params);
  28208. }
  28209. var _getExportData = getExportData($xetable, opts),
  28210. columns = _getExportData.columns,
  28211. datas = _getExportData.datas;
  28212. return Promise.resolve($xetable.preventEvent(null, 'event.export', {
  28213. options: opts,
  28214. columns: columns,
  28215. datas: datas
  28216. }, function () {
  28217. return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
  28218. }));
  28219. }
  28220. function getElementsByTagName(elem, qualifiedName) {
  28221. return elem.getElementsByTagName(qualifiedName);
  28222. }
  28223. function replaceDoubleQuotation(val) {
  28224. return val.replace(/^"/, '').replace(/"$/, '');
  28225. }
  28226. function parseCsv(columns, content) {
  28227. var list = content.split(enterSymbol);
  28228. var rows = [];
  28229. var fields = [];
  28230. if (list.length) {
  28231. var rList = list.slice(1);
  28232. fields = list[0].split(',').map(replaceDoubleQuotation);
  28233. rList.forEach(function (r) {
  28234. if (r) {
  28235. var item = {};
  28236. r.split(',').forEach(function (val, colIndex) {
  28237. if (fields[colIndex]) {
  28238. item[fields[colIndex]] = replaceDoubleQuotation(val);
  28239. }
  28240. });
  28241. rows.push(item);
  28242. }
  28243. });
  28244. }
  28245. return {
  28246. fields: fields,
  28247. rows: rows
  28248. };
  28249. }
  28250. function parseTxt(columns, content) {
  28251. var list = content.split('\n');
  28252. var rows = [];
  28253. var fields = [];
  28254. if (list.length) {
  28255. var rList = list.slice(1);
  28256. fields = list[0].split('\t');
  28257. rList.forEach(function (r) {
  28258. if (r) {
  28259. var item = {};
  28260. r.split('\t').forEach(function (val, colIndex) {
  28261. if (fields[colIndex]) {
  28262. item[fields[colIndex]] = replaceDoubleQuotation(val);
  28263. }
  28264. });
  28265. rows.push(item);
  28266. }
  28267. });
  28268. }
  28269. return {
  28270. fields: fields,
  28271. rows: rows
  28272. };
  28273. }
  28274. function parseHTML(columns, content) {
  28275. var domParser = new DOMParser();
  28276. var xmlDoc = domParser.parseFromString(content, 'text/html');
  28277. var bodyNodes = getElementsByTagName(xmlDoc, 'body');
  28278. var rows = [];
  28279. var fields = [];
  28280. if (bodyNodes.length) {
  28281. var tableNodes = getElementsByTagName(bodyNodes[0], 'table');
  28282. if (tableNodes.length) {
  28283. var theadNodes = getElementsByTagName(tableNodes[0], 'thead');
  28284. if (theadNodes.length) {
  28285. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
  28286. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
  28287. fields.push(cellNode.textContent);
  28288. });
  28289. });
  28290. var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
  28291. if (tbodyNodes.length) {
  28292. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
  28293. var item = {};
  28294. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'td'), function (cellNode, colIndex) {
  28295. if (fields[colIndex]) {
  28296. item[fields[colIndex]] = cellNode.textContent || '';
  28297. }
  28298. });
  28299. rows.push(item);
  28300. });
  28301. }
  28302. }
  28303. }
  28304. }
  28305. return {
  28306. fields: fields,
  28307. rows: rows
  28308. };
  28309. }
  28310. function parseXML(columns, content) {
  28311. var domParser = new DOMParser();
  28312. var xmlDoc = domParser.parseFromString(content, 'application/xml');
  28313. var sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
  28314. var rows = [];
  28315. var fields = [];
  28316. if (sheetNodes.length) {
  28317. var tableNodes = getElementsByTagName(sheetNodes[0], 'Table');
  28318. if (tableNodes.length) {
  28319. var rowNodes = getElementsByTagName(tableNodes[0], 'Row');
  28320. if (rowNodes.length) {
  28321. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
  28322. fields.push(cellNode.textContent);
  28323. });
  28324. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
  28325. if (index) {
  28326. var item = {};
  28327. var cellNodes = getElementsByTagName(rowNode, 'Cell');
  28328. ctor_amd_xe_utils_default.a.arrayEach(cellNodes, function (cellNode, colIndex) {
  28329. if (fields[colIndex]) {
  28330. item[fields[colIndex]] = cellNode.textContent;
  28331. }
  28332. });
  28333. rows.push(item);
  28334. }
  28335. });
  28336. }
  28337. }
  28338. }
  28339. return {
  28340. fields: fields,
  28341. rows: rows
  28342. };
  28343. }
  28344. /**
  28345. * 检查导入的列是否完整
  28346. * @param {Array} fields 字段名列表
  28347. * @param {Array} rows 数据列表
  28348. */
  28349. function checkImportData(columns, fields) {
  28350. var tableFields = [];
  28351. columns.forEach(function (column) {
  28352. var field = column.property;
  28353. if (field) {
  28354. tableFields.push(field);
  28355. }
  28356. });
  28357. return tableFields.every(function (field) {
  28358. return fields.indexOf(field) > -1;
  28359. });
  28360. }
  28361. function handleImport($xetable, content, opts) {
  28362. var tableFullColumn = $xetable.tableFullColumn,
  28363. _importResolve = $xetable._importResolve;
  28364. var rest = {
  28365. fields: [],
  28366. rows: []
  28367. };
  28368. switch (opts.type) {
  28369. case 'csv':
  28370. rest = parseCsv(tableFullColumn, content);
  28371. break;
  28372. case 'txt':
  28373. rest = parseTxt(tableFullColumn, content);
  28374. break;
  28375. case 'html':
  28376. rest = parseHTML(tableFullColumn, content);
  28377. break;
  28378. case 'xml':
  28379. rest = parseXML(tableFullColumn, content);
  28380. break;
  28381. }
  28382. var _rest = rest,
  28383. fields = _rest.fields,
  28384. rows = _rest.rows;
  28385. var status = checkImportData(tableFullColumn, fields);
  28386. if (status) {
  28387. $xetable.createData(rows).then(function (data) {
  28388. if (opts.mode === 'insert') {
  28389. $xetable.insert(data);
  28390. } else {
  28391. $xetable.reloadData(data);
  28392. }
  28393. });
  28394. if (opts.message !== false) {
  28395. v_x_e_table.modal.message({
  28396. message: conf.i18n('vxe.table.impSuccess', [rows.length]),
  28397. status: 'success'
  28398. });
  28399. }
  28400. } else if (opts.message !== false) {
  28401. v_x_e_table.modal.message({
  28402. message: conf.i18n('vxe.error.impFields'),
  28403. status: 'error'
  28404. });
  28405. }
  28406. if (_importResolve) {
  28407. _importResolve(status);
  28408. $xetable._importResolve = null;
  28409. }
  28410. }
  28411. function afterPrintEvent() {
  28412. if (printFrame && printFrame.parentNode) {
  28413. printFrame.parentNode.removeChild(printFrame);
  28414. }
  28415. }
  28416. function handlePrint($xetable, opts, content) {
  28417. var beforePrintMethod = opts.beforePrintMethod;
  28418. if (beforePrintMethod) {
  28419. content = beforePrintMethod({
  28420. content: content,
  28421. options: opts,
  28422. $table: $xetable
  28423. }) || '';
  28424. }
  28425. content = createHtmlPage(opts, content);
  28426. var blob = getExportBlobByContent(content, opts);
  28427. if (DomTools.browse.msie) {
  28428. if (printFrame) {
  28429. try {
  28430. printFrame.contentDocument.write('');
  28431. printFrame.contentDocument.clear();
  28432. } catch (e) {}
  28433. document.body.removeChild(printFrame);
  28434. }
  28435. printFrame = createFrame();
  28436. document.body.appendChild(printFrame);
  28437. printFrame.contentDocument.write(content);
  28438. printFrame.contentDocument.execCommand('print');
  28439. } else {
  28440. if (!printFrame) {
  28441. printFrame = createFrame();
  28442. printFrame.onload = function (evnt) {
  28443. if (evnt.target.src) {
  28444. evnt.target.contentWindow.onafterprint = afterPrintEvent;
  28445. evnt.target.contentWindow.print();
  28446. }
  28447. };
  28448. }
  28449. if (!printFrame.parentNode) {
  28450. document.body.appendChild(printFrame);
  28451. }
  28452. printFrame.src = URL.createObjectURL(blob);
  28453. }
  28454. }
  28455. /* harmony default export */ var export_src_mixin = ({
  28456. methods: {
  28457. // 在 v3.0 中废弃 exportCsv 方法
  28458. _exportCsv: function _exportCsv(options) {
  28459. UtilTools.warn('vxe.error.delFunc', ['exportCsv', 'exportData']);
  28460. return this.exportData(options);
  28461. },
  28462. /**
  28463. * 导出文件,支持 csv/html/xml/txt
  28464. * 如果是树表格,则默认是导出所有节点
  28465. * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
  28466. * @param {Object} options 参数
  28467. */
  28468. _exportData: function _exportData(options) {
  28469. var _this = this;
  28470. var $xegrid = this.$xegrid,
  28471. visibleColumn = this.visibleColumn,
  28472. tableFullColumn = this.tableFullColumn,
  28473. afterFullData = this.afterFullData,
  28474. treeConfig = this.treeConfig,
  28475. treeOpts = this.treeOpts,
  28476. exportOpts = this.exportOpts;
  28477. var columns = options && options.columns;
  28478. var expColumns = [];
  28479. if (columns && columns.length) {
  28480. columns.forEach(function (item) {
  28481. var targetColumn;
  28482. if (item) {
  28483. if (UtilTools.isColumn(item)) {
  28484. targetColumn = item;
  28485. } else if (ctor_amd_xe_utils_default.a.isString(item)) {
  28486. targetColumn = _this.getColumnByField(item);
  28487. } else {
  28488. var type = item.type;
  28489. var field = item.property || item.field;
  28490. if (field && type) {
  28491. targetColumn = tableFullColumn.find(function (column) {
  28492. return column.property === field && column.type === type;
  28493. });
  28494. } else if (field) {
  28495. targetColumn = _this.getColumnByField(field);
  28496. } else if (type) {
  28497. targetColumn = tableFullColumn.find(function (column) {
  28498. return column.type === type;
  28499. });
  28500. }
  28501. }
  28502. if (targetColumn) {
  28503. expColumns.push(targetColumn);
  28504. }
  28505. }
  28506. });
  28507. } else {
  28508. expColumns = visibleColumn;
  28509. }
  28510. var opts = Object.assign({
  28511. // filename: '',
  28512. // sheetName: '',
  28513. // original: false,
  28514. // message: false,
  28515. isHeader: true,
  28516. isFooter: true,
  28517. download: true,
  28518. type: 'csv',
  28519. mode: 'current',
  28520. // data: null,
  28521. // remote: false,
  28522. // dataFilterMethod: null,
  28523. // footerFilterMethod: null,
  28524. // exportMethod: null,
  28525. columnFilterMethod: columns && columns.length ? null : function (_ref) {
  28526. var column = _ref.column;
  28527. return defaultFilterExportColumn(column);
  28528. }
  28529. }, exportOpts, {
  28530. print: false
  28531. }, options, {
  28532. columns: expColumns
  28533. });
  28534. if (!opts.filename) {
  28535. opts.filename = conf.i18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [ctor_amd_xe_utils_default.a.toDateString(Date.now(), 'yyyyMMddHHmmss')]);
  28536. }
  28537. if (!opts.sheetName) {
  28538. opts.sheetName = document.title;
  28539. }
  28540. if (v_x_e_table.exportTypes.indexOf(opts.type) === -1) {
  28541. throw new Error(UtilTools.getLog('vxe.error.notType', [opts.type]));
  28542. }
  28543. if (!opts.data) {
  28544. opts.data = afterFullData;
  28545. if (opts.mode === 'selected') {
  28546. var selectRecords = this.getCheckboxRecords();
  28547. if (['html', 'pdf'].indexOf(opts.type) > -1 && treeConfig) {
  28548. opts.data = ctor_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
  28549. return selectRecords.indexOf(item) > -1;
  28550. }, treeOpts);
  28551. } else {
  28552. opts.data = selectRecords;
  28553. }
  28554. } else if (opts.mode === 'all') {
  28555. if ($xegrid && !opts.remote) {
  28556. var _$xegrid$proxyOpts = $xegrid.proxyOpts,
  28557. beforeQueryAll = _$xegrid$proxyOpts.beforeQueryAll,
  28558. afterQueryAll = _$xegrid$proxyOpts.afterQueryAll,
  28559. _$xegrid$proxyOpts$aj = _$xegrid$proxyOpts.ajax,
  28560. ajax = _$xegrid$proxyOpts$aj === void 0 ? {} : _$xegrid$proxyOpts$aj,
  28561. _$xegrid$proxyOpts$pr = _$xegrid$proxyOpts.props,
  28562. props = _$xegrid$proxyOpts$pr === void 0 ? {} : _$xegrid$proxyOpts$pr;
  28563. var ajaxMethods = ajax.queryAll;
  28564. if (ajaxMethods) {
  28565. var params = {
  28566. $table: this,
  28567. $grid: $xegrid,
  28568. sort: $xegrid.sortData,
  28569. filters: $xegrid.filterData,
  28570. form: $xegrid.formData,
  28571. target: ajaxMethods,
  28572. options: opts
  28573. };
  28574. return Promise.resolve((beforeQueryAll || ajaxMethods)(params)).catch(function (e) {
  28575. return e;
  28576. }).then(function (rest) {
  28577. opts.data = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  28578. if (afterQueryAll) {
  28579. afterQueryAll(params);
  28580. }
  28581. return handleExport(_this, opts);
  28582. });
  28583. }
  28584. }
  28585. }
  28586. }
  28587. return handleExport(this, opts);
  28588. },
  28589. _importByFile: function _importByFile(file, opts) {
  28590. var _this2 = this;
  28591. if (window.FileReader) {
  28592. var _UtilTools$parseFile = UtilTools.parseFile(file),
  28593. type = _UtilTools$parseFile.type,
  28594. filename = _UtilTools$parseFile.filename;
  28595. var options = Object.assign({
  28596. mode: 'insert'
  28597. }, opts, {
  28598. type: type,
  28599. filename: filename
  28600. });
  28601. var types = options.types || v_x_e_table.importTypes;
  28602. if (types.indexOf(type) > -1) {
  28603. if (options.remote) {
  28604. var params = {
  28605. file: file,
  28606. options: options,
  28607. $table: this
  28608. };
  28609. if (options.importMethod) {
  28610. return options.importMethod(params);
  28611. }
  28612. return Promise.resolve(params);
  28613. }
  28614. this.preventEvent(null, 'event.import', {
  28615. file: file,
  28616. options: options,
  28617. columns: this.tableFullColumn
  28618. }, function () {
  28619. var reader = new FileReader();
  28620. reader.onerror = function () {
  28621. UtilTools.error('vxe.error.notType', [type]);
  28622. };
  28623. reader.onload = function (e) {
  28624. handleImport(_this2, e.target.result.trim(), options);
  28625. };
  28626. reader.readAsText(file, 'UTF-8');
  28627. });
  28628. } else {
  28629. UtilTools.error('vxe.error.notType', [type]);
  28630. }
  28631. } else {
  28632. UtilTools.error('vxe.error.notExp');
  28633. }
  28634. return Promise.resolve();
  28635. },
  28636. _importData: function _importData(options) {
  28637. var _this3 = this;
  28638. var opts = Object.assign({
  28639. types: v_x_e_table.importTypes
  28640. }, this.importOpts, options);
  28641. var rest = new Promise(function (resolve, reject) {
  28642. var _importResolve = function _importResolve(params) {
  28643. resolve(params);
  28644. _this3._importResolve = null;
  28645. _this3._importReject = null;
  28646. };
  28647. var _importReject = function _importReject(params) {
  28648. reject(params);
  28649. _this3._importResolve = null;
  28650. _this3._importReject = null;
  28651. };
  28652. _this3._importResolve = _importResolve;
  28653. _this3._importReject = _importReject;
  28654. });
  28655. this.readFile(opts).then(function (params) {
  28656. var file = params.file;
  28657. _this3.importByFile(file, opts);
  28658. }).catch(function (params) {
  28659. _this3._importReject(params);
  28660. _this3._importReject = null;
  28661. });
  28662. return rest;
  28663. },
  28664. _saveFile: function _saveFile(options) {
  28665. return saveLocalFile(options);
  28666. },
  28667. _readFile: function _readFile() {
  28668. var _this4 = this;
  28669. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  28670. if (!fileForm) {
  28671. fileForm = document.createElement('form');
  28672. fileInput = document.createElement('input');
  28673. fileForm.className = 'vxe-table--file-form';
  28674. fileInput.name = 'file';
  28675. fileInput.type = 'file';
  28676. fileForm.appendChild(fileInput);
  28677. document.body.appendChild(fileForm);
  28678. }
  28679. var types = options.types || [];
  28680. var isAllType = !types.length || types.some(function (type) {
  28681. return type === '*';
  28682. });
  28683. fileInput.multiple = !!options.multiple;
  28684. fileInput.accept = isAllType ? '' : ".".concat(types.join(', .'));
  28685. fileInput.onchange = function (evnt) {
  28686. var files = evnt.target.files;
  28687. var file = files[0];
  28688. var errType; // 校验类型
  28689. if (!isAllType) {
  28690. for (var fIndex = 0; fIndex < files.length; fIndex++) {
  28691. var _UtilTools$parseFile2 = UtilTools.parseFile(files[fIndex]),
  28692. type = _UtilTools$parseFile2.type;
  28693. if (!ctor_amd_xe_utils_default.a.includes(types, type)) {
  28694. errType = type;
  28695. break;
  28696. }
  28697. }
  28698. }
  28699. if (!errType) {
  28700. _this4._fileResolve({
  28701. files: files,
  28702. file: file,
  28703. target: evnt.target
  28704. });
  28705. } else {
  28706. if (options.message !== false) {
  28707. v_x_e_table.modal.message({
  28708. message: ctor_amd_xe_utils_default.a.template(conf.i18n('vxe.error.notType'), [errType]),
  28709. status: 'error'
  28710. });
  28711. }
  28712. _this4._fileReject({
  28713. files: files,
  28714. file: file
  28715. });
  28716. }
  28717. _this4._fileResolve = null;
  28718. };
  28719. fileForm.reset();
  28720. fileInput.click();
  28721. return new Promise(function (resolve, reject) {
  28722. _this4._fileResolve = resolve;
  28723. _this4._fileReject = reject;
  28724. });
  28725. },
  28726. _print: function _print(options) {
  28727. var _this5 = this;
  28728. var opts = Object.assign({
  28729. original: false
  28730. }, this.printOpts, options, {
  28731. type: 'html',
  28732. download: false,
  28733. remote: false,
  28734. print: true
  28735. });
  28736. if (!opts.sheetName) {
  28737. opts.sheetName = document.title;
  28738. }
  28739. if (opts.content) {
  28740. handlePrint(this, opts, opts.content);
  28741. } else {
  28742. this.exportData(opts).then(function (_ref2) {
  28743. var content = _ref2.content;
  28744. handlePrint(_this5, opts, content);
  28745. });
  28746. }
  28747. },
  28748. _openImport: function _openImport(options) {
  28749. var defOpts = Object.assign({
  28750. mode: 'insert',
  28751. message: true
  28752. }, options, this.importOpts);
  28753. var types = defOpts.types || v_x_e_table.exportTypes;
  28754. var isTree = !!this.getTreeStatus();
  28755. if (isTree) {
  28756. if (defOpts.message) {
  28757. v_x_e_table.modal.message({
  28758. message: conf.i18n('vxe.error.treeNotImp'),
  28759. status: 'error'
  28760. });
  28761. }
  28762. return;
  28763. }
  28764. if (!this.importConfig) {
  28765. UtilTools.error('vxe.error.reqProp', ['import-config']);
  28766. } // 处理类型
  28767. var typeList = types.map(function (value) {
  28768. return {
  28769. value: value,
  28770. label: "vxe.export.types.".concat(value)
  28771. };
  28772. });
  28773. var modeList = defOpts.modes.map(function (value) {
  28774. return {
  28775. value: value,
  28776. label: "vxe.import.modes.".concat(value)
  28777. };
  28778. });
  28779. Object.assign(this.importStore, {
  28780. file: null,
  28781. type: '',
  28782. filename: '',
  28783. modeList: modeList,
  28784. typeList: typeList,
  28785. visible: true
  28786. });
  28787. Object.assign(this.importParams, defOpts);
  28788. },
  28789. _openExport: function _openExport(options) {
  28790. var $toolbar = this.$toolbar,
  28791. exportConfig = this.exportConfig,
  28792. customOpts = this.customOpts,
  28793. exportOpts = this.exportOpts,
  28794. collectColumn = this.collectColumn,
  28795. footerTableData = this.footerTableData;
  28796. var selectRecords = this.getCheckboxRecords();
  28797. var hasFooter = !!footerTableData.length;
  28798. var defOpts = Object.assign({
  28799. message: true,
  28800. isHeader: true
  28801. }, exportOpts, options);
  28802. var types = defOpts.types || v_x_e_table.exportTypes;
  28803. var checkMethod = customOpts.checkMethod || ($toolbar ? $toolbar.customOpts.checkMethod : null);
  28804. var exportColumns = collectColumn.slice(0);
  28805. var columns = defOpts.columns;
  28806. if (!exportConfig) {
  28807. UtilTools.error('vxe.error.reqProp', ['export-config']);
  28808. } // 处理类型
  28809. var typeList = types.map(function (value) {
  28810. return {
  28811. value: value,
  28812. label: "vxe.export.types.".concat(value)
  28813. };
  28814. });
  28815. var modeList = defOpts.modes.map(function (value) {
  28816. return {
  28817. value: value,
  28818. label: "vxe.export.modes.".concat(value)
  28819. };
  28820. }); // 默认选中
  28821. ctor_amd_xe_utils_default.a.eachTree(exportColumns, function (column, index, items, path, parent) {
  28822. var isColGroup = column.children && column.children.length;
  28823. if (isColGroup || defaultFilterExportColumn(column)) {
  28824. column.checked = columns ? columns.some(function (item) {
  28825. if (UtilTools.isColumn(item)) {
  28826. return column === item;
  28827. } else if (ctor_amd_xe_utils_default.a.isString(item)) {
  28828. return column.field === item;
  28829. } else {
  28830. var colid = item.id;
  28831. var type = item.type;
  28832. var field = item.property || item.field;
  28833. if (colid) {
  28834. return column.id === colid;
  28835. } else if (field && type) {
  28836. return column.property === field && column.type === type;
  28837. } else if (field) {
  28838. return column.property === field;
  28839. } else if (type) {
  28840. return column.type === type;
  28841. }
  28842. }
  28843. }) : column.visible;
  28844. column.halfChecked = false;
  28845. column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
  28846. column: column
  28847. }) : false);
  28848. }
  28849. }); // 更新条件
  28850. Object.assign(this.exportStore, {
  28851. columns: exportColumns,
  28852. typeList: typeList,
  28853. modeList: modeList,
  28854. hasFooter: hasFooter,
  28855. visible: true
  28856. }); // 重置参数
  28857. Object.assign(this.exportParams, {
  28858. filename: defOpts.filename || '',
  28859. sheetName: defOpts.sheetName || '',
  28860. type: defOpts.type || typeList[0].value,
  28861. mode: selectRecords.length ? 'selected' : 'current',
  28862. original: defOpts.original,
  28863. message: defOpts.message,
  28864. isHeader: defOpts.isHeader,
  28865. isFooter: hasFooter && (ctor_amd_xe_utils_default.a.isBoolean(exportOpts.isFooter) ? exportOpts.isFooter : true),
  28866. isPrint: defOpts.isPrint
  28867. });
  28868. return this.$nextTick();
  28869. }
  28870. }
  28871. });
  28872. // CONCATENATED MODULE: ./packages/export/index.js
  28873. function print(options) {
  28874. var opts = Object.assign({}, options, {
  28875. type: 'html'
  28876. });
  28877. handlePrint(null, opts, opts.content);
  28878. }
  28879. var Export = {
  28880. install: function install(Vue) {
  28881. v_x_e_table.reg('export');
  28882. v_x_e_table.saveFile = saveLocalFile;
  28883. v_x_e_table.print = print;
  28884. v_x_e_table.setup({
  28885. export: {
  28886. types: {
  28887. csv: 0,
  28888. html: 0,
  28889. xml: 0,
  28890. txt: 0
  28891. }
  28892. }
  28893. });
  28894. packages_table.mixins.push(export_src_mixin);
  28895. Vue.component(export_panel.name, export_panel);
  28896. Vue.component(import_panel.name, import_panel);
  28897. }
  28898. };
  28899. /* harmony default export */ var packages_export = (Export);
  28900. // CONCATENATED MODULE: ./packages/keyboard/src/mixin.js
  28901. var mixin_browse = DomTools.browse;
  28902. function getTargetOffset(target, container) {
  28903. var offsetTop = 0;
  28904. var offsetLeft = 0;
  28905. var triggerCheckboxLabel = !mixin_browse.firefox && DomTools.hasClass(target, 'vxe-checkbox--label');
  28906. if (triggerCheckboxLabel) {
  28907. var checkboxLabelStyle = getComputedStyle(target);
  28908. offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
  28909. offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingLeft);
  28910. }
  28911. while (target && target !== container) {
  28912. offsetTop += target.offsetTop;
  28913. offsetLeft += target.offsetLeft;
  28914. target = target.offsetParent;
  28915. if (triggerCheckboxLabel) {
  28916. var checkboxStyle = getComputedStyle(target);
  28917. offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
  28918. offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingLeft);
  28919. }
  28920. }
  28921. return {
  28922. offsetTop: offsetTop,
  28923. offsetLeft: offsetLeft
  28924. };
  28925. }
  28926. function getCheckboxRangeRows(_vm, params, targetTrElem, moveRange) {
  28927. var countHeight = 0;
  28928. var rangeRows = [];
  28929. var isDown = moveRange > 0;
  28930. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  28931. var afterFullData = _vm.afterFullData,
  28932. scrollYStore = _vm.scrollYStore,
  28933. scrollYLoad = _vm.scrollYLoad;
  28934. if (scrollYLoad) {
  28935. var _rowIndex = _vm.getVTRowIndex(params.row);
  28936. if (isDown) {
  28937. rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
  28938. } else {
  28939. rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
  28940. }
  28941. } else {
  28942. var siblingProp = isDown ? 'next' : 'previous';
  28943. while (targetTrElem && countHeight < moveSize) {
  28944. rangeRows.push(_vm.getRowNode(targetTrElem).item);
  28945. countHeight += targetTrElem.offsetHeight;
  28946. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  28947. }
  28948. }
  28949. return rangeRows;
  28950. }
  28951. /* harmony default export */ var keyboard_src_mixin = ({
  28952. methods: {
  28953. // 处理 Tab 键移动
  28954. moveTabSelected: function moveTabSelected(args, isLeft, evnt) {
  28955. var _this = this;
  28956. var afterFullData = this.afterFullData,
  28957. visibleColumn = this.visibleColumn,
  28958. editConfig = this.editConfig,
  28959. editOpts = this.editOpts,
  28960. isSeqColumn = this.isSeqColumn;
  28961. var targetRow;
  28962. var targetRowIndex;
  28963. var targetColumn;
  28964. var targetColumnIndex;
  28965. var params = Object.assign({}, args);
  28966. var rowIndex = afterFullData.indexOf(params.row);
  28967. var columnIndex = visibleColumn.indexOf(params.column);
  28968. evnt.preventDefault();
  28969. if (isLeft) {
  28970. // 向左
  28971. for (var len = columnIndex - 1; len >= 0; len--) {
  28972. if (!isSeqColumn(visibleColumn[len])) {
  28973. targetColumnIndex = len;
  28974. targetColumn = visibleColumn[len];
  28975. break;
  28976. }
  28977. }
  28978. if (!targetColumn && rowIndex > 0) {
  28979. // 如果找不到从上一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
  28980. targetRowIndex = rowIndex - 1;
  28981. targetRow = afterFullData[targetRowIndex];
  28982. for (var _len = visibleColumn.length - 1; _len >= 0; _len--) {
  28983. if (!isSeqColumn(visibleColumn[_len])) {
  28984. targetColumnIndex = _len;
  28985. targetColumn = visibleColumn[_len];
  28986. break;
  28987. }
  28988. }
  28989. }
  28990. } else {
  28991. // 向右
  28992. for (var index = columnIndex + 1; index < visibleColumn.length; index++) {
  28993. if (!isSeqColumn(visibleColumn[index])) {
  28994. targetColumnIndex = index;
  28995. targetColumn = visibleColumn[index];
  28996. break;
  28997. }
  28998. }
  28999. if (!targetColumn && rowIndex < afterFullData.length - 1) {
  29000. // 如果找不到从下一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
  29001. targetRowIndex = rowIndex + 1;
  29002. targetRow = afterFullData[targetRowIndex];
  29003. for (var _index = 0; _index < visibleColumn.length; _index++) {
  29004. if (!isSeqColumn(visibleColumn[_index])) {
  29005. targetColumnIndex = _index;
  29006. targetColumn = visibleColumn[_index];
  29007. break;
  29008. }
  29009. }
  29010. }
  29011. }
  29012. if (targetColumn) {
  29013. if (targetRow) {
  29014. params.rowIndex = targetRowIndex;
  29015. params.row = targetRow;
  29016. } else {
  29017. params.rowIndex = rowIndex;
  29018. }
  29019. params.columnIndex = targetColumnIndex;
  29020. params.column = targetColumn;
  29021. params.cell = this.getCell(params.row, params.column);
  29022. if (editConfig) {
  29023. if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
  29024. if (editOpts.mode === 'row') {
  29025. this.handleActived(params, evnt);
  29026. } else {
  29027. this.scrollToRow(params.row, params.column).then(function () {
  29028. return _this.handleSelected(params, evnt);
  29029. });
  29030. }
  29031. }
  29032. }
  29033. }
  29034. },
  29035. // 处理当前行方向键移动
  29036. moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) {
  29037. var _this2 = this;
  29038. var currentRow = this.currentRow,
  29039. treeConfig = this.treeConfig,
  29040. treeOpts = this.treeOpts,
  29041. afterFullData = this.afterFullData;
  29042. var targetRow;
  29043. evnt.preventDefault();
  29044. if (currentRow) {
  29045. if (treeConfig) {
  29046. var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  29047. return item === currentRow;
  29048. }, treeOpts),
  29049. index = _XEUtils$findTree.index,
  29050. items = _XEUtils$findTree.items;
  29051. if (isUpArrow && index > 0) {
  29052. targetRow = items[index - 1];
  29053. } else if (isDwArrow && index < items.length - 1) {
  29054. targetRow = items[index + 1];
  29055. }
  29056. } else {
  29057. var _rowIndex = this.getVTRowIndex(currentRow);
  29058. if (isUpArrow && _rowIndex > 0) {
  29059. targetRow = afterFullData[_rowIndex - 1];
  29060. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  29061. targetRow = afterFullData[_rowIndex + 1];
  29062. }
  29063. }
  29064. } else {
  29065. targetRow = afterFullData[0];
  29066. }
  29067. if (targetRow) {
  29068. var params = {
  29069. $table: this,
  29070. row: targetRow
  29071. };
  29072. this.scrollToRow(targetRow).then(function () {
  29073. return _this2.triggerCurrentRowEvent(evnt, params);
  29074. });
  29075. }
  29076. },
  29077. // 处理可编辑方向键移动
  29078. moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
  29079. var _this3 = this;
  29080. var afterFullData = this.afterFullData,
  29081. visibleColumn = this.visibleColumn,
  29082. isSeqColumn = this.isSeqColumn;
  29083. var params = Object.assign({}, args);
  29084. var _rowIndex = this.getVTRowIndex(params.row);
  29085. var _columnIndex = this.getVTColumnIndex(params.column);
  29086. evnt.preventDefault();
  29087. if (isUpArrow && _rowIndex > 0) {
  29088. // 移动到上一行
  29089. params.rowIndex = _rowIndex - 1;
  29090. params.row = afterFullData[params.rowIndex];
  29091. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  29092. // 移动到下一行
  29093. params.rowIndex = _rowIndex + 1;
  29094. params.row = afterFullData[params.rowIndex];
  29095. } else if (isLeftArrow && _columnIndex) {
  29096. for (var len = _columnIndex - 1; len >= 0; len--) {
  29097. if (!isSeqColumn(visibleColumn[len])) {
  29098. params.columnIndex = len;
  29099. params.column = visibleColumn[len];
  29100. break;
  29101. }
  29102. }
  29103. } else if (isRightArrow) {
  29104. for (var index = _columnIndex + 1; index < visibleColumn.length; index++) {
  29105. if (!isSeqColumn(visibleColumn[index])) {
  29106. params.columnIndex = index;
  29107. params.column = visibleColumn[index];
  29108. break;
  29109. }
  29110. }
  29111. }
  29112. this.scrollToRow(params.row, params.column).then(function () {
  29113. params.cell = _this3.getCell(params.row, params.column);
  29114. _this3.handleSelected(params, evnt);
  29115. });
  29116. },
  29117. /**
  29118. * 表头按下事件
  29119. */
  29120. triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) {
  29121. var mouseConfig = this.mouseConfig,
  29122. mouseOpts = this.mouseOpts;
  29123. var cell = evnt.currentTarget;
  29124. var triggerSort = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  29125. var triggerFilter = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  29126. if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
  29127. this.handleHeaderCellAreaEvent(evnt, Object.assign({
  29128. cell: cell,
  29129. triggerSort: triggerSort,
  29130. triggerFilter: triggerFilter
  29131. }, params));
  29132. } else if (mouseConfig && mouseOpts.checked) {
  29133. this.handleHeaderCellCheckedEvent(evnt, Object.assign({
  29134. cell: cell,
  29135. triggerSort: triggerSort,
  29136. triggerFilter: triggerFilter
  29137. }, params));
  29138. }
  29139. this.focus();
  29140. this.closeMenu();
  29141. },
  29142. /**
  29143. * 单元格按下事件
  29144. */
  29145. triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) {
  29146. var cell = evnt.currentTarget;
  29147. params.cell = cell;
  29148. this.handleCellMousedownEvent(evnt, params);
  29149. this.focus();
  29150. this.closeFilter();
  29151. this.closeMenu();
  29152. },
  29153. handleCellMousedownEvent: function handleCellMousedownEvent(evnt, params) {
  29154. var mouseConfig = this.mouseConfig,
  29155. mouseOpts = this.mouseOpts,
  29156. checkboxConfig = this.checkboxConfig,
  29157. checkboxOpts = this.checkboxOpts,
  29158. editConfig = this.editConfig,
  29159. editOpts = this.editOpts;
  29160. var column = params.column;
  29161. if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
  29162. this.handleCellAreaEvent(evnt, params);
  29163. } else if (mouseConfig && mouseOpts.checked) {
  29164. // 在 v3.0 中废弃 mouse-config.checked
  29165. this.handleCheckedRangeEvent(evnt, params);
  29166. } else {
  29167. if (checkboxConfig && checkboxOpts.range) {
  29168. this.handleCheckboxRangeEvent(evnt, params);
  29169. }
  29170. if (mouseConfig && mouseOpts.selected) {
  29171. // v3.0 废弃 type=index
  29172. if (!(column.type === 'seq' || column.type === 'index') && (!editConfig || editOpts.mode === 'cell')) {
  29173. this.handleSelected(params, evnt);
  29174. }
  29175. }
  29176. }
  29177. },
  29178. handleHeaderCellCheckedEvent: function handleHeaderCellCheckedEvent(evnt, params) {
  29179. var $el = this.$el,
  29180. tableData = this.tableData,
  29181. mouseConfig = this.mouseConfig,
  29182. mouseOpts = this.mouseOpts,
  29183. elemStore = this.elemStore,
  29184. handleChecked = this.handleChecked,
  29185. handleHeaderChecked = this.handleHeaderChecked;
  29186. var button = evnt.button;
  29187. var column = params.column;
  29188. var cell = evnt.currentTarget;
  29189. var isLeftBtn = button === 0; // v3.0 废弃 type=index
  29190. var isIndex = column.type === 'seq' || column.type === 'index';
  29191. if (mouseConfig) {
  29192. // 在 v3.0 中废弃 mouse-config.checked
  29193. if (mouseOpts.checked) {
  29194. var headerList = elemStore['main-header-list'].children;
  29195. var bodyList = elemStore['main-body-list'].children;
  29196. if (isIndex) {
  29197. this.handleAllChecked(evnt);
  29198. } else {
  29199. this.clearSelected(evnt);
  29200. this.clearHeaderChecked();
  29201. this.clearIndexChecked();
  29202. var startCell = bodyList[0].querySelector(".".concat(column.id));
  29203. if (isLeftBtn) {
  29204. var domMousemove = document.onmousemove;
  29205. var domMouseup = document.onmouseup;
  29206. var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
  29207. var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, $el, 'vxe-header--column'),
  29208. flag = _DomTools$getEventTar.flag,
  29209. targetElem = _DomTools$getEventTar.targetElem;
  29210. if (!flag) {
  29211. var nodeRest = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column');
  29212. flag = nodeRest.flag;
  29213. targetElem = nodeRest.targetElem;
  29214. }
  29215. if (flag && !DomTools.hasClass(targetElem, 'col--seq')) {
  29216. var colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
  29217. var endCell = bodyList[bodyList.length - 1].children[colIndex];
  29218. var head = headerList[0].children[colIndex];
  29219. handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(cell)));
  29220. handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
  29221. }
  29222. }, 80, {
  29223. leading: true,
  29224. trailing: true
  29225. });
  29226. DomTools.addClass($el, 'c--checked');
  29227. document.onmousemove = function (evnt) {
  29228. evnt.preventDefault();
  29229. evnt.stopPropagation();
  29230. updateEvent(evnt);
  29231. };
  29232. document.onmouseup = function () {
  29233. DomTools.removeClass($el, 'c--checked');
  29234. document.onmousemove = domMousemove;
  29235. document.onmouseup = domMouseup;
  29236. };
  29237. }
  29238. handleHeaderChecked([[cell]]);
  29239. if (bodyList.length) {
  29240. var endCell = bodyList[bodyList.length - 1].querySelector(".".concat(column.id));
  29241. var firstTrElem = bodyList[0];
  29242. var lastTrElem = bodyList[bodyList.length - 1];
  29243. var firstCell = firstTrElem.querySelector('.col--seq');
  29244. params.rowIndex = 0;
  29245. params.row = tableData[0];
  29246. params.cell = this.getCell(params.row, params.column);
  29247. this.handleSelected(params, evnt);
  29248. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector('.col--seq'))));
  29249. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
  29250. }
  29251. }
  29252. }
  29253. }
  29254. },
  29255. getCheckboxRangeRows: function getCheckboxRangeRows(targetTrElem, moveRange) {
  29256. var countHeight = 0;
  29257. var rangeRows = [];
  29258. var siblingProp = moveRange > 0 ? 'next' : 'previous';
  29259. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  29260. while (targetTrElem && countHeight < moveSize) {
  29261. rangeRows.push(this.getRowNode(targetTrElem).item);
  29262. countHeight += targetTrElem.offsetHeight;
  29263. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  29264. }
  29265. return rangeRows;
  29266. },
  29267. handleCheckedRangeEvent: function handleCheckedRangeEvent(evnt, params) {
  29268. var _this4 = this;
  29269. var $el = this.$el,
  29270. visibleColumn = this.visibleColumn,
  29271. editStore = this.editStore,
  29272. mouseOpts = this.mouseOpts,
  29273. elemStore = this.elemStore;
  29274. var checked = editStore.checked;
  29275. var column = params.column;
  29276. var button = evnt.button;
  29277. var cell = evnt.currentTarget;
  29278. var isLeftBtn = button === 0; // v3.0 废弃 type=index
  29279. var isIndex = column.type === 'seq' || column.type === 'index';
  29280. this.clearHeaderChecked();
  29281. this.clearIndexChecked();
  29282. var bodyList = elemStore['main-body-list'].children;
  29283. var headerList = elemStore['main-header-list'].children;
  29284. var cellLastElementChild = cell.parentNode.lastElementChild;
  29285. var cellFirstElementChild = cell.parentNode.firstElementChild;
  29286. if (isLeftBtn) {
  29287. var domMousemove = document.onmousemove;
  29288. var domMouseup = document.onmouseup;
  29289. var startCellNode = DomTools.getCellNodeIndex(cell);
  29290. var colIndex = [].indexOf.call(cell.parentNode.children, cell);
  29291. var headStart = headerList[0].children[colIndex];
  29292. var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
  29293. var _DomTools$getEventTar2 = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column'),
  29294. flag = _DomTools$getEventTar2.flag,
  29295. targetElem = _DomTools$getEventTar2.targetElem;
  29296. if (flag) {
  29297. if (isIndex) {
  29298. var firstCell = targetElem.parentNode.firstElementChild;
  29299. _this4.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
  29300. _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
  29301. } else if (!DomTools.hasClass(targetElem, 'col--seq')) {
  29302. var _firstCell = targetElem.parentNode.firstElementChild;
  29303. var _colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
  29304. var head = headerList[0].children[_colIndex];
  29305. _this4.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(headStart)));
  29306. _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(_firstCell), DomTools.getCellNodeIndex(cellFirstElementChild)));
  29307. _this4.handleChecked(DomTools.getRowNodes(bodyList, startCellNode, DomTools.getCellNodeIndex(targetElem)));
  29308. }
  29309. }
  29310. }, 80, {
  29311. leading: true,
  29312. trailing: true
  29313. });
  29314. document.onmousemove = function (evnt) {
  29315. evnt.preventDefault();
  29316. evnt.stopPropagation();
  29317. updateEvent(evnt);
  29318. };
  29319. document.onmouseup = function () {
  29320. document.onmousemove = domMousemove;
  29321. document.onmouseup = domMouseup;
  29322. };
  29323. }
  29324. if (isIndex) {
  29325. var firstCell = cell.parentNode.firstElementChild;
  29326. params.columnIndex++;
  29327. params.column = visibleColumn[params.columnIndex];
  29328. params.cell = cell.nextElementSibling;
  29329. this.handleSelected(params, evnt);
  29330. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
  29331. this.handleHeaderChecked([headerList[0].querySelectorAll('.vxe-header--column:not(.col--seq)')]);
  29332. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
  29333. } else {
  29334. if (isLeftBtn) {
  29335. var _firstCell2 = cell.parentNode.firstElementChild;
  29336. this.handleSelected(params, evnt);
  29337. this.handleHeaderChecked([[headerList[0].querySelector(".".concat(column.id))]]);
  29338. this.handleIndexChecked([[_firstCell2]]);
  29339. } else {
  29340. if (mouseOpts.selected) {
  29341. // 如果右键单元格不在所有选中的范围之内则重新选中
  29342. if (!checked.rowNodes || !checked.rowNodes.some(function (list) {
  29343. return list.indexOf(cell) > -1;
  29344. })) {
  29345. this.handleSelected(params, evnt);
  29346. }
  29347. }
  29348. }
  29349. }
  29350. },
  29351. handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
  29352. var _this5 = this;
  29353. var column = params.column,
  29354. cell = params.cell;
  29355. var isLeftBtn = evnt.button === 0; // 在 v3.0 中废弃 type=selection
  29356. if (isLeftBtn && ['checkbox', 'selection'].indexOf(column.type) > -1) {
  29357. var $el = this.$el,
  29358. elemStore = this.elemStore;
  29359. var disX = evnt.clientX;
  29360. var disY = evnt.clientY;
  29361. var bodyWrapperElem = elemStore["".concat(column.fixed || 'main', "-body-wrapper")] || elemStore['main-body-wrapper'];
  29362. var checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
  29363. var domMousemove = document.onmousemove;
  29364. var domMouseup = document.onmouseup;
  29365. var trElem = cell.parentNode;
  29366. var selectRecords = this.getCheckboxRecords();
  29367. var lastRangeRows = [];
  29368. var marginSize = 1;
  29369. var offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
  29370. var startTop = offsetRest.offsetTop + evnt.offsetY;
  29371. var startLeft = offsetRest.offsetLeft + evnt.offsetX;
  29372. var startScrollTop = bodyWrapperElem.scrollTop;
  29373. var rowHeight = trElem.offsetHeight;
  29374. var mouseScrollTimeout = null;
  29375. var isMouseScrollDown = false;
  29376. var mouseScrollSpaceSize = 1;
  29377. var triggerEvent = function triggerEvent(type, evnt) {
  29378. _this5.emitEvent("checkbox-range-".concat(type), {
  29379. records: _this5.getCheckboxRecords(),
  29380. reserves: _this5.getCheckboxReserveRecords()
  29381. }, evnt);
  29382. };
  29383. var handleChecked = function handleChecked(evnt) {
  29384. var clientX = evnt.clientX,
  29385. clientY = evnt.clientY;
  29386. var offsetLeft = clientX - disX;
  29387. var offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
  29388. var rangeHeight = Math.abs(offsetTop);
  29389. var rangeWidth = Math.abs(offsetLeft);
  29390. var rangeTop = startTop;
  29391. var rangeLeft = startLeft;
  29392. if (offsetTop < marginSize) {
  29393. // 向上
  29394. rangeTop += offsetTop;
  29395. if (rangeTop < marginSize) {
  29396. rangeTop = marginSize;
  29397. rangeHeight = startTop;
  29398. }
  29399. } else {
  29400. // 向下
  29401. rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
  29402. }
  29403. if (offsetLeft < marginSize) {
  29404. // 向左
  29405. rangeLeft += offsetLeft;
  29406. if (rangeWidth > startLeft) {
  29407. rangeLeft = marginSize;
  29408. rangeWidth = startLeft;
  29409. }
  29410. } else {
  29411. // 向右
  29412. rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
  29413. }
  29414. checkboxRangeElem.style.height = "".concat(rangeHeight, "px");
  29415. checkboxRangeElem.style.width = "".concat(rangeWidth, "px");
  29416. checkboxRangeElem.style.left = "".concat(rangeLeft, "px");
  29417. checkboxRangeElem.style.top = "".concat(rangeTop, "px");
  29418. checkboxRangeElem.style.display = 'block';
  29419. var rangeRows = getCheckboxRangeRows(_this5, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
  29420. if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
  29421. lastRangeRows = rangeRows;
  29422. if (evnt.ctrlKey) {
  29423. rangeRows.forEach(function (row) {
  29424. _this5.handleSelectRow({
  29425. row: row
  29426. }, selectRecords.indexOf(row) === -1);
  29427. });
  29428. } else {
  29429. _this5.setAllCheckboxRow(false);
  29430. _this5.setCheckboxRow(rangeRows, true);
  29431. }
  29432. triggerEvent('change', evnt);
  29433. }
  29434. }; // 停止鼠标滚动
  29435. var stopMouseScroll = function stopMouseScroll() {
  29436. clearTimeout(mouseScrollTimeout);
  29437. mouseScrollTimeout = null;
  29438. }; // 开始鼠标滚动
  29439. var startMouseScroll = function startMouseScroll(evnt) {
  29440. stopMouseScroll();
  29441. mouseScrollTimeout = setTimeout(function () {
  29442. if (mouseScrollTimeout) {
  29443. var scrollLeft = bodyWrapperElem.scrollLeft,
  29444. scrollTop = bodyWrapperElem.scrollTop,
  29445. clientHeight = bodyWrapperElem.clientHeight,
  29446. scrollHeight = bodyWrapperElem.scrollHeight;
  29447. var topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
  29448. if (isMouseScrollDown) {
  29449. if (scrollTop + clientHeight < scrollHeight) {
  29450. _this5.scrollTo(scrollLeft, scrollTop + topSize);
  29451. startMouseScroll(evnt);
  29452. handleChecked(evnt);
  29453. } else {
  29454. stopMouseScroll();
  29455. }
  29456. } else {
  29457. if (scrollTop) {
  29458. _this5.scrollTo(scrollLeft, scrollTop - topSize);
  29459. startMouseScroll(evnt);
  29460. handleChecked(evnt);
  29461. } else {
  29462. stopMouseScroll();
  29463. }
  29464. }
  29465. }
  29466. }, 50);
  29467. };
  29468. DomTools.addClass($el, 'drag--area');
  29469. document.onmousemove = function (evnt) {
  29470. evnt.preventDefault();
  29471. evnt.stopPropagation();
  29472. var clientY = evnt.clientY;
  29473. var _DomTools$getAbsolute = DomTools.getAbsolutePos(bodyWrapperElem),
  29474. boundingTop = _DomTools$getAbsolute.boundingTop; // 如果超过可视区,触发滚动
  29475. if (clientY < boundingTop) {
  29476. isMouseScrollDown = false;
  29477. mouseScrollSpaceSize = boundingTop - clientY;
  29478. if (!mouseScrollTimeout) {
  29479. startMouseScroll(evnt);
  29480. }
  29481. } else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
  29482. isMouseScrollDown = true;
  29483. mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
  29484. if (!mouseScrollTimeout) {
  29485. startMouseScroll(evnt);
  29486. }
  29487. } else if (mouseScrollTimeout) {
  29488. stopMouseScroll();
  29489. }
  29490. handleChecked(evnt);
  29491. };
  29492. document.onmouseup = function (evnt) {
  29493. stopMouseScroll();
  29494. DomTools.removeClass($el, 'drag--area');
  29495. checkboxRangeElem.removeAttribute('style');
  29496. document.onmousemove = domMousemove;
  29497. document.onmouseup = domMouseup;
  29498. triggerEvent('end', evnt);
  29499. };
  29500. triggerEvent('start', evnt);
  29501. }
  29502. },
  29503. /**
  29504. * 清除所有选中状态
  29505. */
  29506. _clearChecked: function _clearChecked() {
  29507. var $refs = this.$refs,
  29508. editStore = this.editStore,
  29509. mouseConfig = this.mouseConfig,
  29510. mouseOpts = this.mouseOpts;
  29511. var checked = editStore.checked; // 在 v3.0 中废弃 mouse-config.checked
  29512. if (mouseConfig && mouseOpts.checked) {
  29513. var tableBody = $refs.tableBody;
  29514. checked.rows = [];
  29515. checked.columns = [];
  29516. checked.tRows = [];
  29517. checked.tColumns = [];
  29518. var checkBorders = tableBody.$refs.checkBorders;
  29519. checkBorders.style.display = 'none';
  29520. ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--checked'), function (elem) {
  29521. return DomTools.removeClass(elem, 'col--checked');
  29522. });
  29523. }
  29524. return this.$nextTick();
  29525. },
  29526. _getMouseSelecteds: function _getMouseSelecteds() {
  29527. UtilTools.warn('vxe.error.delFunc', ['getMouseSelecteds', 'getSelectedCell']);
  29528. return this.getSelectedCell();
  29529. },
  29530. _getMouseCheckeds: function _getMouseCheckeds() {
  29531. // UtilTools.warn('vxe.error.delFunc', ['getMouseCheckeds', 'getSelectedRanges'])
  29532. return this.getSelectedRanges();
  29533. },
  29534. /**
  29535. * 获取选中的单元格
  29536. */
  29537. _getSelectedCell: function _getSelectedCell() {
  29538. var _this$editStore$selec = this.editStore.selected,
  29539. args = _this$editStore$selec.args,
  29540. column = _this$editStore$selec.column;
  29541. if (args && column) {
  29542. return Object.assign({}, args);
  29543. }
  29544. return null;
  29545. },
  29546. /**
  29547. * 获取所有选中的单元格
  29548. */
  29549. _getSelectedRanges: function _getSelectedRanges() {
  29550. var _this6 = this;
  29551. var checked = this.editStore.checked;
  29552. var _checked$rowNodes = checked.rowNodes,
  29553. rowNodes = _checked$rowNodes === void 0 ? [] : _checked$rowNodes;
  29554. var columns = [];
  29555. var rows = [];
  29556. if (rowNodes && rowNodes.length) {
  29557. rows = rowNodes.map(function (list) {
  29558. return _this6.getRowNode(list[0].parentNode).item;
  29559. });
  29560. columns = rowNodes[0].map(function (cell) {
  29561. return _this6.getColumnNode(cell).item;
  29562. });
  29563. }
  29564. return {
  29565. columns: columns,
  29566. rows: rows,
  29567. rowNodes: rowNodes
  29568. };
  29569. },
  29570. /**
  29571. * 处理所有选中
  29572. */
  29573. handleChecked: function handleChecked(rowNodes) {
  29574. var checked = this.editStore.checked;
  29575. this.clearChecked();
  29576. var cWidth = -2;
  29577. var cHeight = -2;
  29578. var offsetTop = 0;
  29579. var offsetLeft = 0;
  29580. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
  29581. var isTop = rowIndex === 0;
  29582. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
  29583. var isLeft = colIndex === 0;
  29584. if (isLeft && isTop) {
  29585. offsetTop = elem.offsetTop;
  29586. offsetLeft = elem.offsetLeft;
  29587. }
  29588. if (isTop) {
  29589. cWidth += elem.offsetWidth;
  29590. }
  29591. if (isLeft) {
  29592. cHeight += elem.offsetHeight;
  29593. }
  29594. DomTools.addClass(elem, 'col--checked');
  29595. });
  29596. });
  29597. var _this$$refs$tableBody = this.$refs.tableBody.$refs,
  29598. checkBorders = _this$$refs$tableBody.checkBorders,
  29599. checkTop = _this$$refs$tableBody.checkTop,
  29600. checkRight = _this$$refs$tableBody.checkRight,
  29601. checkBottom = _this$$refs$tableBody.checkBottom,
  29602. checkLeft = _this$$refs$tableBody.checkLeft;
  29603. checkBorders.style.display = 'block';
  29604. Object.assign(checkTop.style, {
  29605. top: "".concat(offsetTop, "px"),
  29606. left: "".concat(offsetLeft, "px"),
  29607. width: "".concat(cWidth, "px")
  29608. });
  29609. Object.assign(checkRight.style, {
  29610. top: "".concat(offsetTop, "px"),
  29611. left: "".concat(offsetLeft + cWidth, "px"),
  29612. height: "".concat(cHeight, "px")
  29613. });
  29614. Object.assign(checkBottom.style, {
  29615. top: "".concat(offsetTop + cHeight, "px"),
  29616. left: "".concat(offsetLeft, "px"),
  29617. width: "".concat(cWidth, "px")
  29618. });
  29619. Object.assign(checkLeft.style, {
  29620. top: "".concat(offsetTop, "px"),
  29621. left: "".concat(offsetLeft, "px"),
  29622. height: "".concat(cHeight, "px")
  29623. });
  29624. checked.rowNodes = rowNodes;
  29625. },
  29626. handleAllChecked: function handleAllChecked(evnt) {
  29627. var tableData = this.tableData,
  29628. visibleColumn = this.visibleColumn,
  29629. mouseConfig = this.mouseConfig,
  29630. mouseOpts = this.mouseOpts,
  29631. elemStore = this.elemStore; // 在 v3.0 中废弃 mouse-config.checked
  29632. if (mouseConfig && mouseOpts.checked) {
  29633. evnt.preventDefault();
  29634. var headerListElem = elemStore['main-header-list'];
  29635. var headerList = headerListElem.children;
  29636. var bodyList = elemStore['main-body-list'].children; // v3.0 废弃 type=index
  29637. var column = ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
  29638. return column.type === 'seq' || column.type === 'index';
  29639. }) || visibleColumn[0];
  29640. var cell = headerListElem.querySelector(".".concat(column.id));
  29641. var firstTrElem = bodyList[0];
  29642. var lastTrElem = bodyList[bodyList.length - 1];
  29643. var firstCell = firstTrElem.querySelector(".".concat(column.id));
  29644. var params = {
  29645. $table: this,
  29646. rowIndex: 0,
  29647. row: tableData[0],
  29648. column: ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
  29649. return column.property;
  29650. })
  29651. };
  29652. params.columnIndex = this.getColumnIndex(params.column);
  29653. params.cell = this.getCell(params.row, params.column);
  29654. this.handleSelected(params, evnt);
  29655. this.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(cell.nextElementSibling), DomTools.getCellNodeIndex(cell.parentNode.lastElementChild)));
  29656. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector(".".concat(column.id)))));
  29657. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(lastTrElem.lastElementChild)));
  29658. }
  29659. },
  29660. handleIndexChecked: function handleIndexChecked(rowNodes) {
  29661. var indexs = this.editStore.indexs;
  29662. this.clearIndexChecked();
  29663. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
  29664. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
  29665. DomTools.addClass(elem, 'col--seq-checked');
  29666. });
  29667. });
  29668. indexs.rowNodes = rowNodes;
  29669. },
  29670. _clearIndexChecked: function _clearIndexChecked() {
  29671. var elemStore = this.elemStore;
  29672. var bodyElem = elemStore['main-body-list'];
  29673. ctor_amd_xe_utils_default.a.arrayEach(bodyElem.querySelectorAll('.col--seq-checked'), function (elem) {
  29674. return DomTools.removeClass(elem, 'col--seq-checked');
  29675. });
  29676. return this.$nextTick();
  29677. },
  29678. handleHeaderChecked: function handleHeaderChecked(rowNodes) {
  29679. var titles = this.editStore.titles;
  29680. this.clearHeaderChecked();
  29681. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
  29682. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
  29683. DomTools.addClass(elem, 'col--title-checked');
  29684. });
  29685. });
  29686. titles.rowNodes = rowNodes;
  29687. },
  29688. _clearHeaderChecked: function _clearHeaderChecked() {
  29689. var elemStore = this.elemStore;
  29690. var headerElem = elemStore['main-header-list'];
  29691. if (headerElem) {
  29692. ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-checked'), function (elem) {
  29693. return DomTools.removeClass(elem, 'col--title-checked');
  29694. });
  29695. }
  29696. return this.$nextTick();
  29697. },
  29698. /**
  29699. * 清空已复制的内容
  29700. */
  29701. _clearCopyed: function _clearCopyed() {
  29702. var $refs = this.$refs,
  29703. editStore = this.editStore,
  29704. keyboardConfig = this.keyboardConfig;
  29705. var copyed = editStore.copyed;
  29706. if (keyboardConfig && keyboardConfig.isCut) {
  29707. var tableBody = $refs.tableBody;
  29708. var copyBorders = $refs.tableBody.$refs.copyBorders;
  29709. copyed.cut = false;
  29710. copyed.rows = [];
  29711. copyed.columns = [];
  29712. copyBorders.style.display = 'none';
  29713. ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--copyed'), function (elem) {
  29714. return DomTools.removeClass(elem, 'col--copyed');
  29715. });
  29716. }
  29717. return this.$nextTick();
  29718. },
  29719. /**
  29720. * 处理复制
  29721. */
  29722. handleCopyed: function handleCopyed(cut) {
  29723. var tableData = this.tableData,
  29724. tableColumn = this.tableColumn,
  29725. editStore = this.editStore;
  29726. var copyed = editStore.copyed,
  29727. checked = editStore.checked;
  29728. var rowNodes = checked.rowNodes;
  29729. this.clearCopyed();
  29730. var cWidth = -3;
  29731. var cHeight = -3;
  29732. var offsetTop = 0;
  29733. var offsetLeft = 0;
  29734. var columns = [];
  29735. var rows = [];
  29736. if (rowNodes.length) {
  29737. var firstRows = rowNodes[0];
  29738. var _DomTools$getCellNode = DomTools.getCellNodeIndex(firstRows[0]),
  29739. rowIndex = _DomTools$getCellNode.rowIndex,
  29740. columnIndex = _DomTools$getCellNode.columnIndex;
  29741. columns = tableColumn.slice(columnIndex, columnIndex + firstRows.length);
  29742. rows = tableData.slice(rowIndex, rowIndex + rowNodes.length);
  29743. }
  29744. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
  29745. var isTop = rowIndex === 0;
  29746. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
  29747. var isLeft = colIndex === 0;
  29748. if (isLeft && isTop) {
  29749. offsetTop = elem.offsetTop;
  29750. offsetLeft = elem.offsetLeft;
  29751. }
  29752. if (isTop) {
  29753. cWidth += elem.offsetWidth;
  29754. }
  29755. if (isLeft) {
  29756. cHeight += elem.offsetHeight;
  29757. }
  29758. DomTools.addClass(elem, 'col--copyed');
  29759. });
  29760. });
  29761. var _this$$refs$tableBody2 = this.$refs.tableBody.$refs,
  29762. copyBorders = _this$$refs$tableBody2.copyBorders,
  29763. copyTop = _this$$refs$tableBody2.copyTop,
  29764. copyRight = _this$$refs$tableBody2.copyRight,
  29765. copyBottom = _this$$refs$tableBody2.copyBottom,
  29766. copyLeft = _this$$refs$tableBody2.copyLeft;
  29767. copyBorders.style.display = 'block';
  29768. Object.assign(copyTop.style, {
  29769. top: "".concat(offsetTop, "px"),
  29770. left: "".concat(offsetLeft, "px"),
  29771. width: "".concat(cWidth, "px")
  29772. });
  29773. Object.assign(copyRight.style, {
  29774. top: "".concat(offsetTop, "px"),
  29775. left: "".concat(offsetLeft + cWidth, "px"),
  29776. height: "".concat(cHeight, "px")
  29777. });
  29778. Object.assign(copyBottom.style, {
  29779. top: "".concat(offsetTop + cHeight, "px"),
  29780. left: "".concat(offsetLeft, "px"),
  29781. width: "".concat(cWidth, "px")
  29782. });
  29783. Object.assign(copyLeft.style, {
  29784. top: "".concat(offsetTop, "px"),
  29785. left: "".concat(offsetLeft, "px"),
  29786. height: "".concat(cHeight, "px")
  29787. });
  29788. copyed.cut = cut;
  29789. copyed.rows = rows;
  29790. copyed.columns = columns;
  29791. copyed.rowNodes = rowNodes;
  29792. },
  29793. /**
  29794. * 处理粘贴
  29795. */
  29796. handlePaste: function handlePaste() {
  29797. var tableData = this.tableData,
  29798. visibleColumn = this.visibleColumn,
  29799. editStore = this.editStore,
  29800. elemStore = this.elemStore;
  29801. var copyed = editStore.copyed,
  29802. selected = editStore.selected;
  29803. var cut = copyed.cut,
  29804. rows = copyed.rows,
  29805. columns = copyed.columns;
  29806. if (rows.length && columns.length && selected.row && selected.column) {
  29807. var _selected$args = selected.args,
  29808. rowIndex = _selected$args.rowIndex,
  29809. columnIndex = _selected$args.columnIndex;
  29810. ctor_amd_xe_utils_default.a.arrayEach(rows, function (row, rIndex) {
  29811. var offsetRow = tableData[rowIndex + rIndex];
  29812. if (offsetRow) {
  29813. ctor_amd_xe_utils_default.a.arrayEach(columns, function (column, cIndex) {
  29814. var offsetColumn = visibleColumn[columnIndex + cIndex];
  29815. if (offsetColumn) {
  29816. UtilTools.setCellValue(offsetRow, offsetColumn, UtilTools.getCellValue(row, column));
  29817. }
  29818. if (cut) {
  29819. UtilTools.setCellValue(row, column, null);
  29820. }
  29821. });
  29822. }
  29823. });
  29824. if (cut) {
  29825. this.clearCopyed();
  29826. }
  29827. var bodyList = elemStore['main-body-list'].children;
  29828. var cell = selected.args.cell;
  29829. var trElem = cell.parentNode;
  29830. var colIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
  29831. var rIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(bodyList, trElem);
  29832. var targetTrElem = bodyList[rIndex + rows.length - 1];
  29833. var targetCell = targetTrElem.children[colIndex + columns.length - 1];
  29834. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(cell), DomTools.getCellNodeIndex(targetCell)));
  29835. }
  29836. }
  29837. }
  29838. });
  29839. // CONCATENATED MODULE: ./packages/keyboard/index.js
  29840. var Keyboard = {
  29841. install: function install() {
  29842. v_x_e_table.reg('keyboard');
  29843. packages_table.mixins.push(keyboard_src_mixin);
  29844. }
  29845. };
  29846. /* harmony default export */ var packages_keyboard = (Keyboard);
  29847. // CONCATENATED MODULE: ./packages/validator/src/mixin.js
  29848. /**
  29849. * 校验规则
  29850. */
  29851. var mixin_Rule = /*#__PURE__*/function () {
  29852. function Rule(rule) {
  29853. _classCallCheck(this, Rule);
  29854. Object.assign(this, {
  29855. $options: rule,
  29856. required: rule.required,
  29857. min: rule.min,
  29858. max: rule.max,
  29859. type: rule.type,
  29860. pattern: rule.pattern,
  29861. validator: rule.validator,
  29862. trigger: rule.trigger,
  29863. maxWidth: rule.maxWidth
  29864. });
  29865. }
  29866. /**
  29867. * 获取校验不通过的消息
  29868. * 支持国际化翻译
  29869. */
  29870. _createClass(Rule, [{
  29871. key: "content",
  29872. get: function get() {
  29873. return UtilTools.getFuncText(this.$options.content || this.$options.message);
  29874. }
  29875. }, {
  29876. key: "message",
  29877. get: function get() {
  29878. return this.content;
  29879. }
  29880. }]);
  29881. return Rule;
  29882. }();
  29883. /* harmony default export */ var validator_src_mixin = ({
  29884. methods: {
  29885. /**
  29886. * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
  29887. */
  29888. _fullValidate: function _fullValidate(rows, cb) {
  29889. return this.beginValidate(rows, cb, true);
  29890. },
  29891. /**
  29892. * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
  29893. */
  29894. _validate: function _validate(rows, cb) {
  29895. return this.beginValidate(rows, cb);
  29896. },
  29897. /**
  29898. * 聚焦到校验通过的单元格并弹出校验错误提示
  29899. */
  29900. handleValidError: function handleValidError(params) {
  29901. var _this = this;
  29902. if (this.validOpts.autoPos === false) {
  29903. this.emitEvent('valid-error', params);
  29904. } else {
  29905. this.handleActived(params, {
  29906. type: 'valid-error',
  29907. trigger: 'call'
  29908. }).then(function () {
  29909. return setTimeout(function () {
  29910. return _this.showValidTooltip(params);
  29911. }, 10);
  29912. });
  29913. }
  29914. },
  29915. /**
  29916. * 对表格数据进行校验
  29917. * 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
  29918. * 如果传 true 则校验当前表格数据
  29919. * 如果传 row 指定行记录,则只验证传入的行
  29920. * 如果传 rows 为多行记录,则只验证传入的行
  29921. * 如果只传 callback 否则默认验证整个表格数据
  29922. * 返回 Promise 对象,或者使用回调方式
  29923. */
  29924. beginValidate: function beginValidate(rows, cb, isFull) {
  29925. var _this2 = this;
  29926. var validRest = {};
  29927. var editRules = this.editRules,
  29928. afterFullData = this.afterFullData,
  29929. treeConfig = this.treeConfig,
  29930. treeOpts = this.treeOpts;
  29931. var vaildDatas;
  29932. if (rows === true) {
  29933. vaildDatas = afterFullData;
  29934. } else if (rows) {
  29935. if (ctor_amd_xe_utils_default.a.isFunction(rows)) {
  29936. cb = rows;
  29937. } else {
  29938. vaildDatas = ctor_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
  29939. }
  29940. }
  29941. if (!vaildDatas) {
  29942. // 在 v3.0 中废弃 setup.validFullData
  29943. if (conf.validFullData === 'obsolete') {
  29944. vaildDatas = afterFullData;
  29945. } else {
  29946. vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
  29947. }
  29948. }
  29949. var status = true;
  29950. var rowValids = [];
  29951. this.lastCallTime = Date.now();
  29952. this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
  29953. this.clearValidate();
  29954. if (editRules) {
  29955. var columns = this.getColumns();
  29956. var handleVaild = function handleVaild(row) {
  29957. if (isFull || !_this2.validRuleErr) {
  29958. var colVailds = [];
  29959. columns.forEach(function (column) {
  29960. if ((isFull || !_this2.validRuleErr) && ctor_amd_xe_utils_default.a.has(editRules, column.property)) {
  29961. colVailds.push(_this2.validCellRules('all', row, column).catch(function (_ref) {
  29962. var rule = _ref.rule,
  29963. rules = _ref.rules;
  29964. var rest = {
  29965. rule: rule,
  29966. rules: rules,
  29967. rowIndex: _this2.getRowIndex(row),
  29968. row: row,
  29969. columnIndex: _this2.getColumnIndex(column),
  29970. column: column,
  29971. $table: _this2
  29972. };
  29973. if (!validRest[column.property]) {
  29974. validRest[column.property] = [];
  29975. }
  29976. validRest[column.property].push(rest);
  29977. if (!isFull) {
  29978. _this2.validRuleErr = true;
  29979. return Promise.reject(rest);
  29980. }
  29981. }));
  29982. }
  29983. });
  29984. rowValids.push(Promise.all(colVailds));
  29985. }
  29986. };
  29987. if (treeConfig) {
  29988. ctor_amd_xe_utils_default.a.eachTree(vaildDatas, handleVaild, treeOpts);
  29989. } else {
  29990. vaildDatas.forEach(handleVaild);
  29991. }
  29992. return Promise.all(rowValids).then(function () {
  29993. var ruleProps = Object.keys(validRest);
  29994. return _this2.$nextTick().then(function () {
  29995. if (ruleProps.length) {
  29996. return Promise.reject(validRest[ruleProps[0]][0]);
  29997. }
  29998. if (cb) {
  29999. // 在 v3.0 中废弃 setup.validArgs
  30000. if (conf.validArgs === 'obsolete') {
  30001. cb(status);
  30002. } else {
  30003. cb();
  30004. }
  30005. }
  30006. });
  30007. }).catch(function (firstErrParams) {
  30008. return new Promise(function (resolve, reject) {
  30009. var finish = function finish() {
  30010. _this2.$nextTick(function () {
  30011. status = false;
  30012. if (cb) {
  30013. // 在 v3.0 中废弃 setup.validArgs
  30014. if (conf.validArgs === 'obsolete') {
  30015. cb(status, validRest);
  30016. } else {
  30017. cb(validRest);
  30018. }
  30019. resolve();
  30020. } else {
  30021. reject(validRest);
  30022. }
  30023. });
  30024. };
  30025. var posAndFinish = function posAndFinish() {
  30026. firstErrParams.cell = _this2.getCell(firstErrParams.row, firstErrParams.column);
  30027. DomTools.toView(firstErrParams.cell);
  30028. _this2.handleValidError(firstErrParams);
  30029. finish();
  30030. };
  30031. /**
  30032. * 当校验不通过时
  30033. * 将表格滚动到可视区
  30034. * 由于提示信息至少需要占一行,定位向上偏移一行
  30035. */
  30036. var row = firstErrParams.row;
  30037. var rowIndex = afterFullData.indexOf(row);
  30038. var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
  30039. if (_this2.validOpts.autoPos === false) {
  30040. finish();
  30041. } else {
  30042. if (treeConfig) {
  30043. _this2.scrollToTreeRow(locatRow).then(posAndFinish);
  30044. } else {
  30045. _this2.scrollToRow(locatRow).then(posAndFinish);
  30046. }
  30047. }
  30048. });
  30049. });
  30050. }
  30051. return this.$nextTick().then(function () {
  30052. if (cb) {
  30053. // 在 v3.0 中废弃 setup.validArgs
  30054. if (conf.validArgs === 'obsolete') {
  30055. cb(status);
  30056. } else {
  30057. cb();
  30058. }
  30059. }
  30060. });
  30061. },
  30062. hasCellRules: function hasCellRules(type, row, column) {
  30063. var editRules = this.editRules;
  30064. var property = column.property;
  30065. if (property && editRules) {
  30066. var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
  30067. return rules && ctor_amd_xe_utils_default.a.find(rules, function (rule) {
  30068. return type === 'all' || !rule.trigger || type === rule.trigger;
  30069. });
  30070. }
  30071. return false;
  30072. },
  30073. /**
  30074. * 校验数据
  30075. * 按表格行、同步列顺序校验/异步并发校验
  30076. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  30077. * 如果校验失败则,触发回调或者Promise<不通过列的错误消息>
  30078. * 如果是传回调方式这返回一个校验不通过列的错误消息
  30079. *
  30080. * rule 配置:
  30081. * required=Boolean 是否必填
  30082. * min=Number 最小长度
  30083. * max=Number 最大长度
  30084. * validator=Function({ cellValue, rule, rules, row, column, rowIndex, columnIndex }) 自定义校验,接收一个 Promise
  30085. * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行)
  30086. */
  30087. validCellRules: function validCellRules(type, row, column, val) {
  30088. var _this3 = this;
  30089. var editRules = this.editRules;
  30090. var property = column.property;
  30091. var errorRules = [];
  30092. var syncVailds = [];
  30093. if (property && editRules) {
  30094. var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
  30095. if (rules) {
  30096. var cellValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(row, property) : val;
  30097. rules.forEach(function (rule) {
  30098. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  30099. if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
  30100. var customValid; // 在 v3.0 中废弃 setup.validArgs
  30101. if (conf.validArgs === 'obsolete') {
  30102. customValid = new Promise(function (resolve) {
  30103. rule.validator(rule, cellValue, function (e) {
  30104. if (ctor_amd_xe_utils_default.a.isError(e)) {
  30105. _this3.validRuleErr = true;
  30106. errorRules.push(new mixin_Rule({
  30107. type: 'custom',
  30108. trigger: rule.trigger,
  30109. message: e.message,
  30110. rule: new mixin_Rule(rule)
  30111. }));
  30112. }
  30113. resolve();
  30114. }, {
  30115. rule: rule,
  30116. rules: rules,
  30117. row: row,
  30118. column: column,
  30119. rowIndex: _this3.getRowIndex(row),
  30120. columnIndex: _this3.getColumnIndex(column),
  30121. $table: _this3
  30122. });
  30123. });
  30124. } else {
  30125. customValid = rule.validator({
  30126. cellValue: cellValue,
  30127. rule: rule,
  30128. rules: rules,
  30129. row: row,
  30130. rowIndex: _this3.getRowIndex(row),
  30131. column: column,
  30132. columnIndex: _this3.getColumnIndex(column),
  30133. $table: _this3
  30134. });
  30135. }
  30136. if (customValid) {
  30137. if (ctor_amd_xe_utils_default.a.isError(customValid)) {
  30138. _this3.validRuleErr = true;
  30139. errorRules.push(new mixin_Rule({
  30140. type: 'custom',
  30141. trigger: rule.trigger,
  30142. message: customValid.message,
  30143. rule: new mixin_Rule(rule)
  30144. }));
  30145. } else if (customValid.catch) {
  30146. // 如果为异步校验(注:异步校验是并发无序的)
  30147. syncVailds.push(customValid.catch(function (e) {
  30148. _this3.validRuleErr = true;
  30149. errorRules.push(new mixin_Rule({
  30150. type: 'custom',
  30151. trigger: rule.trigger,
  30152. message: e && e.message ? e.message : rule.content || rule.message,
  30153. rule: new mixin_Rule(rule)
  30154. }));
  30155. }));
  30156. }
  30157. }
  30158. } else {
  30159. var isNumType = rule.type === 'number';
  30160. var isArrType = rule.type === 'array';
  30161. var numVal = isNumType ? ctor_amd_xe_utils_default.a.toNumber(cellValue) : ctor_amd_xe_utils_default.a.getSize(cellValue);
  30162. if (rule.required && (isArrType ? !ctor_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : cellValue === null || cellValue === undefined || cellValue === '')) {
  30163. _this3.validRuleErr = true;
  30164. errorRules.push(new mixin_Rule(rule));
  30165. } else if (isNumType && isNaN(cellValue) || !isNaN(rule.min) && numVal < parseFloat(rule.min) || !isNaN(rule.max) && numVal > parseFloat(rule.max) || rule.pattern && !(rule.pattern.test ? rule.pattern : new RegExp(rule.pattern)).test(cellValue)) {
  30166. _this3.validRuleErr = true;
  30167. errorRules.push(new mixin_Rule(rule));
  30168. }
  30169. }
  30170. }
  30171. });
  30172. }
  30173. }
  30174. return Promise.all(syncVailds).then(function () {
  30175. if (errorRules.length) {
  30176. var rest = {
  30177. rules: errorRules,
  30178. rule: errorRules[0]
  30179. };
  30180. return Promise.reject(rest);
  30181. }
  30182. });
  30183. },
  30184. _clearValidate: function _clearValidate() {
  30185. var validTip = this.$refs.validTip;
  30186. Object.assign(this.validStore, {
  30187. visible: false,
  30188. row: null,
  30189. column: null,
  30190. content: '',
  30191. rule: null
  30192. });
  30193. if (validTip && validTip.visible) {
  30194. validTip.close();
  30195. }
  30196. return this.$nextTick();
  30197. },
  30198. /**
  30199. * 触发校验
  30200. */
  30201. triggerValidate: function triggerValidate(type) {
  30202. var _this4 = this;
  30203. var editConfig = this.editConfig,
  30204. editStore = this.editStore,
  30205. editRules = this.editRules,
  30206. validStore = this.validStore;
  30207. var actived = editStore.actived;
  30208. if (actived.row && editRules) {
  30209. var _actived$args = actived.args,
  30210. row = _actived$args.row,
  30211. column = _actived$args.column,
  30212. cell = _actived$args.cell;
  30213. if (this.hasCellRules(type, row, column)) {
  30214. return this.validCellRules(type, row, column).then(function () {
  30215. if (editConfig.mode === 'row') {
  30216. if (validStore.visible && validStore.row === row && validStore.column === column) {
  30217. _this4.clearValidate();
  30218. }
  30219. }
  30220. }).catch(function (_ref2) {
  30221. var rule = _ref2.rule;
  30222. // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
  30223. if (!rule.trigger || type === rule.trigger) {
  30224. var rest = {
  30225. rule: rule,
  30226. row: row,
  30227. column: column,
  30228. cell: cell
  30229. };
  30230. _this4.showValidTooltip(rest);
  30231. return Promise.reject(rest);
  30232. }
  30233. return Promise.resolve();
  30234. });
  30235. }
  30236. }
  30237. return Promise.resolve();
  30238. },
  30239. /**
  30240. * 弹出校验错误提示
  30241. */
  30242. showValidTooltip: function showValidTooltip(params) {
  30243. var _this5 = this;
  30244. var $refs = this.$refs,
  30245. height = this.height,
  30246. tableData = this.tableData,
  30247. validOpts = this.validOpts;
  30248. var rule = params.rule,
  30249. row = params.row,
  30250. column = params.column,
  30251. cell = params.cell;
  30252. var validTip = $refs.validTip;
  30253. var content = rule.message;
  30254. this.$nextTick(function () {
  30255. Object.assign(_this5.validStore, {
  30256. row: row,
  30257. column: column,
  30258. rule: rule,
  30259. content: content,
  30260. visible: true
  30261. });
  30262. if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
  30263. validTip.open(cell, content);
  30264. }
  30265. _this5.emitEvent('valid-error', params);
  30266. });
  30267. }
  30268. }
  30269. });
  30270. // CONCATENATED MODULE: ./packages/validator/index.js
  30271. var Validator = {
  30272. install: function install() {
  30273. v_x_e_table.reg('valid');
  30274. packages_table.mixins.push(validator_src_mixin);
  30275. }
  30276. };
  30277. /* harmony default export */ var validator = (Validator);
  30278. // CONCATENATED MODULE: ./packages/resize/index.js
  30279. var Resize = {
  30280. /* eslint-disable @typescript-eslint/no-empty-function */
  30281. install: function install() {}
  30282. };
  30283. /* harmony default export */ var packages_resize = (Resize);
  30284. // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
  30285. /* harmony default export */ var zh_CN = ({
  30286. vxe: {
  30287. error: {
  30288. groupFixed: '如果使用分组表头,固定列必须按组设置',
  30289. groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
  30290. groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
  30291. scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
  30292. scrollXNotGroup: '横向虚拟滚动不支持分组表头,需要设置 "scroll-x.enabled=false" 参数,否则可能会导致出现错误',
  30293. errConflicts: '参数 "{0}" 与 "{1}" 有冲突',
  30294. unableInsert: '无法插入到指定位置,请检查参数是否正确',
  30295. useErr: '安装 "{0}" 模块时发生错误,可能顺序不正确,依赖的模块需要在 Table 之前安装',
  30296. barUnableLink: '工具栏无法关联表格',
  30297. expandContent: '展开行的插槽应该是 "content",请检查是否正确',
  30298. reqModule: '缺少 "{0}" 模块',
  30299. reqProp: '缺少必要的 "{0}" 参数,这可能会导致出现错误',
  30300. emptyProp: '参数 "{0}" 不允许为空',
  30301. errProp: '不支持的参数 "{0}",可能为 "{1}"',
  30302. colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
  30303. notFunc: '方法 "{0}" 不存在',
  30304. notSlot: '插槽 "{0}" 不存在',
  30305. noTree: '树结构不支持 "{0}"',
  30306. notProp: '不支持的参数 "{0}"',
  30307. coverProp: '"{0}" 的参数 "{1}" 被覆盖,这可能会出现错误',
  30308. delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
  30309. delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
  30310. delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
  30311. removeProp: '参数 "{0}" 已废弃,不建议使用,这可能会导致出现错误',
  30312. errFormat: '全局的格式化内容应该使用 "VXETable.formats" 定义,挂载 "formatter={0}" 的方式已不建议使用',
  30313. notType: '不支持的文件类型 "{0}"',
  30314. notExp: '该浏览器不支持导入/导出功能',
  30315. impFields: '导入失败,请检查字段名和数据格式是否正确',
  30316. treeNotImp: '树表格不支持导入'
  30317. },
  30318. renderer: {
  30319. search: '搜索',
  30320. cases: {
  30321. equal: '等于',
  30322. unequal: '不等于',
  30323. gt: '大于',
  30324. ge: '大于或等于',
  30325. lt: '小于',
  30326. le: '小于或等于',
  30327. begin: '开头是',
  30328. notbegin: '开头不是',
  30329. endin: '结尾是',
  30330. notendin: '结尾不是',
  30331. include: '包含',
  30332. exclude: '不包含',
  30333. between: '介于',
  30334. custom: '自定义筛选',
  30335. insensitive: '不区分大小写',
  30336. isSensitive: '区分大小写'
  30337. },
  30338. combination: {
  30339. menus: {
  30340. sortAsc: '升序',
  30341. sortDesc: '降序',
  30342. fixedColumn: '锁定列',
  30343. fixedGroup: '锁定组',
  30344. cancelFixed: '取消锁定',
  30345. fixedLeft: '锁定左侧',
  30346. fixedRight: '锁定右侧',
  30347. clearFilter: '清除筛选',
  30348. textOption: '文本筛选',
  30349. numberOption: '数值筛选'
  30350. },
  30351. popup: {
  30352. title: '自定义筛选的方式',
  30353. currColumnTitle: '当前列:',
  30354. and: '与',
  30355. or: '或',
  30356. describeHtml: '可用 ? 代表单个字符<br/>用 * 代表任意多个字符'
  30357. },
  30358. empty: '(空白)',
  30359. notData: '无匹配项'
  30360. }
  30361. },
  30362. pro: {
  30363. area: {
  30364. mergeErr: '无法对合并单元格进行该操作',
  30365. multiErr: '无法对多重选择区域进行该操作',
  30366. extendErr: '如果延伸的区域包含被合并的单元格,所有合并的单元格需大小相同'
  30367. },
  30368. fnr: {
  30369. title: '查找和替换',
  30370. findLabel: '查找',
  30371. replaceLabel: '替换',
  30372. findTitle: '查找内容:',
  30373. replaceTitle: '替换为:',
  30374. tabs: {
  30375. find: '查找',
  30376. replace: '替换'
  30377. },
  30378. filter: {
  30379. re: '正则表达式',
  30380. whole: '全词匹配',
  30381. sensitive: '区分大小写'
  30382. },
  30383. btns: {
  30384. findNext: '查找下一个',
  30385. findAll: '查找全部',
  30386. replace: '替换',
  30387. replaceAll: '替换全部',
  30388. cancel: '取消'
  30389. },
  30390. header: {
  30391. seq: '#',
  30392. cell: '单元格',
  30393. value: '值'
  30394. },
  30395. empty: '(空值)',
  30396. reError: '无效的正则表达式',
  30397. recordCount: '已找到 {0} 个单元格',
  30398. notCell: '找不到匹配的单元格',
  30399. replaceSuccess: '成功替换 {0} 个单元格'
  30400. }
  30401. },
  30402. table: {
  30403. emptyText: '暂无数据',
  30404. allTitle: '全选/取消',
  30405. seqTitle: '#',
  30406. confirmFilter: '筛选',
  30407. resetFilter: '重置',
  30408. allFilter: '全部',
  30409. sortAsc: '升序:最低到最高',
  30410. sortDesc: '降序:最高到最低',
  30411. filter: '对所选的列启用筛选',
  30412. impSuccess: '成功导入 {0} 条记录',
  30413. expLoading: '正在导出中',
  30414. expSuccess: '导出成功',
  30415. expFilename: '导出_{0}',
  30416. expOriginFilename: '导出_源_{0}',
  30417. customTitle: '列设置',
  30418. customAll: '全部',
  30419. customConfirm: '确认',
  30420. customRestore: '还原'
  30421. },
  30422. grid: {
  30423. selectOneRecord: '请至少选择一条记录!',
  30424. deleteSelectRecord: '您确定要删除所选记录吗?',
  30425. removeSelectRecord: '您确定要移除所选记录吗?',
  30426. dataUnchanged: '数据未改动!',
  30427. delSuccess: '成功删除所选记录!',
  30428. saveSuccess: '保存成功!',
  30429. operError: '发生错误,操作失败!'
  30430. },
  30431. select: {
  30432. emptyText: '暂无数据'
  30433. },
  30434. pager: {
  30435. goto: '前往',
  30436. pagesize: '{0}条/页',
  30437. total: '共 {0} 条记录',
  30438. pageClassifier: '页',
  30439. prevPage: '上一页',
  30440. nextPage: '下一页',
  30441. prevJump: '向上跳页',
  30442. nextJump: '向下跳页'
  30443. },
  30444. alert: {
  30445. title: '消息提示'
  30446. },
  30447. button: {
  30448. confirm: '确认',
  30449. cancel: '取消'
  30450. },
  30451. import: {
  30452. modes: {
  30453. covering: '覆盖',
  30454. insert: '新增'
  30455. },
  30456. impTitle: '导入数据',
  30457. impFile: '文件名',
  30458. impSelect: '选择文件',
  30459. impType: '文件类型',
  30460. impOpts: '参数设置',
  30461. impConfirm: '导入',
  30462. impCancel: '取消'
  30463. },
  30464. export: {
  30465. types: {
  30466. csv: 'CSV (逗号分隔)(*.csv)',
  30467. html: '网页(*.html)',
  30468. xml: 'XML 数据(*.xml)',
  30469. txt: '文本文件(制表符分隔)(*.txt)',
  30470. xls: 'Excel 97-2003 工作簿(*.xls)',
  30471. xlsx: 'Excel 工作簿(*.xlsx)',
  30472. pdf: 'PDF (*.pdf)'
  30473. },
  30474. modes: {
  30475. current: '当前数据(当前页的数据)',
  30476. selected: '选中数据(当前页选中的数据)',
  30477. all: '全量数据(包括所有分页的数据)'
  30478. },
  30479. printTitle: '打印数据',
  30480. expTitle: '导出数据',
  30481. expName: '文件名',
  30482. expNamePlaceholder: '请输入文件名',
  30483. expSheetName: '标题',
  30484. expSheetNamePlaceholder: '请输入标题',
  30485. expType: '保存类型',
  30486. expMode: '选择数据',
  30487. expCurrentColumn: '全部字段',
  30488. expColumn: '选择字段',
  30489. expOpts: '参数设置',
  30490. expOptHeader: '表头',
  30491. expHeaderTitle: '是否需要表头',
  30492. expOptFooter: '表尾',
  30493. expFooterTitle: '是否需要表尾',
  30494. expOptColgroup: '分组表头',
  30495. expColgroupTitle: '如果存在,则支持带有分组结构的表头',
  30496. expOptMerge: '合并',
  30497. expMergeTitle: '如果存在,则支持带有合并结构的单元格',
  30498. expOptAllExpand: '展开层级',
  30499. expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
  30500. expOptUseStyle: '样式',
  30501. expUseStyleTitle: '如果存在,则支持带样式的单元格',
  30502. expOptOriginal: '源数据',
  30503. expOriginalTitle: '如果为源数据,则支持导入到表格中',
  30504. expPrint: '打印',
  30505. expConfirm: '导出',
  30506. expCancel: '取消'
  30507. },
  30508. modal: {
  30509. zoomIn: '最大化',
  30510. zoomOut: '还原',
  30511. close: '关闭'
  30512. },
  30513. form: {
  30514. folding: '收起',
  30515. unfolding: '展开'
  30516. },
  30517. toolbar: {
  30518. import: '导入',
  30519. export: '导出',
  30520. print: '打印',
  30521. refresh: '刷新',
  30522. zoomIn: '全屏',
  30523. zoomOut: '还原',
  30524. custom: '列设置',
  30525. customAll: '全部',
  30526. customConfirm: '确认',
  30527. customRestore: '还原'
  30528. },
  30529. input: {
  30530. date: {
  30531. m1: '01 月',
  30532. m2: '02 月',
  30533. m3: '03 月',
  30534. m4: '04 月',
  30535. m5: '05 月',
  30536. m6: '06 月',
  30537. m7: '07 月',
  30538. m8: '08 月',
  30539. m9: '09 月',
  30540. m10: '10 月',
  30541. m11: '11 月',
  30542. m12: '12 月',
  30543. quarterLabel: '{0} 年',
  30544. monthLabel: '{0} 年',
  30545. dayLabel: '{0} 年 {1}',
  30546. labelFormat: {
  30547. date: 'yyyy-MM-dd',
  30548. time: 'HH:mm:ss',
  30549. datetime: 'yyyy-MM-dd HH:mm:ss',
  30550. week: 'yyyy 年第 WW 周',
  30551. month: 'yyyy-MM',
  30552. quarter: 'yyyy 年第 q 季度',
  30553. year: 'yyyy'
  30554. },
  30555. weeks: {
  30556. w: '周',
  30557. w0: '周日',
  30558. w1: '周一',
  30559. w2: '周二',
  30560. w3: '周三',
  30561. w4: '周四',
  30562. w5: '周五',
  30563. w6: '周六'
  30564. },
  30565. months: {
  30566. m0: '一月',
  30567. m1: '二月',
  30568. m2: '三月',
  30569. m3: '四月',
  30570. m4: '五月',
  30571. m5: '六月',
  30572. m6: '七月',
  30573. m7: '八月',
  30574. m8: '九月',
  30575. m9: '十月',
  30576. m10: '十一月',
  30577. m11: '十二月'
  30578. },
  30579. quarters: {
  30580. q1: '第一季度',
  30581. q2: '第二季度',
  30582. q3: '第三季度',
  30583. q4: '第四季度'
  30584. }
  30585. }
  30586. }
  30587. }
  30588. });
  30589. // CONCATENATED MODULE: ./packages/vxe-table.js
  30590. // 按需加载的组件
  30591. var components = [// 模块
  30592. packages_column, packages_header, packages_footer, filter, packages_loading, packages_grid, packages_menu, packages_toolbar, packages_pager, packages_checkbox, packages_radio, packages_input, packages_textarea, packages_button, packages_modal, packages_tooltip, packages_form, packages_select, packages_switch, packages_list, packages_pulldown, edit, packages_export, packages_keyboard, validator, packages_resize, // 核心
  30593. packages_table]; // 默认安装
  30594. function vxe_table_install(Vue, options) {
  30595. if (ctor_amd_xe_utils_default.a.isPlainObject(options)) {
  30596. v_x_e_table.setup(options);
  30597. }
  30598. components.map(function (component) {
  30599. return component.install(Vue);
  30600. });
  30601. } // 默认中文
  30602. v_x_e_table.setup({
  30603. i18n: ctor_amd_xe_utils_default.a.toFormatString ? function (key, args) {
  30604. return ctor_amd_xe_utils_default.a.toFormatString(ctor_amd_xe_utils_default.a.get(zh_CN, key), args);
  30605. } : function (key, args) {
  30606. return ctor_amd_xe_utils_default.a.template(ctor_amd_xe_utils_default.a.get(zh_CN, key), args, {
  30607. tmplRE: /\{([.\w[\]\s]+)\}/g
  30608. });
  30609. }
  30610. });
  30611. v_x_e_table.install = vxe_table_install;
  30612. if (typeof window !== 'undefined' && window.Vue && window.Vue.use) {
  30613. window.Vue.use(v_x_e_table);
  30614. }
  30615. /* harmony default export */ var vxe_table = (v_x_e_table);
  30616. // CONCATENATED MODULE: ./index.js
  30617. // 默认主题
  30618. // 默认安装全部模块
  30619. /* harmony default export */ var index_0 = (vxe_table);
  30620. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  30621. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (index_0);
  30622. /***/ }),
  30623. /***/ "fb6a":
  30624. /***/ (function(module, exports, __webpack_require__) {
  30625. "use strict";
  30626. var $ = __webpack_require__("23e7");
  30627. var isObject = __webpack_require__("861d");
  30628. var isArray = __webpack_require__("e8b5");
  30629. var toAbsoluteIndex = __webpack_require__("23cb");
  30630. var toLength = __webpack_require__("50c4");
  30631. var toIndexedObject = __webpack_require__("fc6a");
  30632. var createProperty = __webpack_require__("8418");
  30633. var wellKnownSymbol = __webpack_require__("b622");
  30634. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  30635. var arrayMethodUsesToLength = __webpack_require__("ae40");
  30636. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  30637. var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
  30638. var SPECIES = wellKnownSymbol('species');
  30639. var nativeSlice = [].slice;
  30640. var max = Math.max;
  30641. // `Array.prototype.slice` method
  30642. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  30643. // fallback for not array-like ES3 strings and DOM objects
  30644. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  30645. slice: function slice(start, end) {
  30646. var O = toIndexedObject(this);
  30647. var length = toLength(O.length);
  30648. var k = toAbsoluteIndex(start, length);
  30649. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  30650. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  30651. var Constructor, result, n;
  30652. if (isArray(O)) {
  30653. Constructor = O.constructor;
  30654. // cross-realm fallback
  30655. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  30656. Constructor = undefined;
  30657. } else if (isObject(Constructor)) {
  30658. Constructor = Constructor[SPECIES];
  30659. if (Constructor === null) Constructor = undefined;
  30660. }
  30661. if (Constructor === Array || Constructor === undefined) {
  30662. return nativeSlice.call(O, k, fin);
  30663. }
  30664. }
  30665. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  30666. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  30667. result.length = n;
  30668. return result;
  30669. }
  30670. });
  30671. /***/ }),
  30672. /***/ "fc6a":
  30673. /***/ (function(module, exports, __webpack_require__) {
  30674. // toObject with fallback for non-array-like ES3 strings
  30675. var IndexedObject = __webpack_require__("44ad");
  30676. var requireObjectCoercible = __webpack_require__("1d80");
  30677. module.exports = function (it) {
  30678. return IndexedObject(requireObjectCoercible(it));
  30679. };
  30680. /***/ }),
  30681. /***/ "fdbc":
  30682. /***/ (function(module, exports) {
  30683. // iterable DOM collections
  30684. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  30685. module.exports = {
  30686. CSSRuleList: 0,
  30687. CSSStyleDeclaration: 0,
  30688. CSSValueList: 0,
  30689. ClientRectList: 0,
  30690. DOMRectList: 0,
  30691. DOMStringList: 0,
  30692. DOMTokenList: 1,
  30693. DataTransferItemList: 0,
  30694. FileList: 0,
  30695. HTMLAllCollection: 0,
  30696. HTMLCollection: 0,
  30697. HTMLFormElement: 0,
  30698. HTMLSelectElement: 0,
  30699. MediaList: 0,
  30700. MimeTypeArray: 0,
  30701. NamedNodeMap: 0,
  30702. NodeList: 1,
  30703. PaintRequestList: 0,
  30704. Plugin: 0,
  30705. PluginArray: 0,
  30706. SVGLengthList: 0,
  30707. SVGNumberList: 0,
  30708. SVGPathSegList: 0,
  30709. SVGPointList: 0,
  30710. SVGStringList: 0,
  30711. SVGTransformList: 0,
  30712. SourceBufferList: 0,
  30713. StyleSheetList: 0,
  30714. TextTrackCueList: 0,
  30715. TextTrackList: 0,
  30716. TouchList: 0
  30717. };
  30718. /***/ }),
  30719. /***/ "fdbf":
  30720. /***/ (function(module, exports, __webpack_require__) {
  30721. var NATIVE_SYMBOL = __webpack_require__("4930");
  30722. module.exports = NATIVE_SYMBOL
  30723. // eslint-disable-next-line no-undef
  30724. && !Symbol.sham
  30725. // eslint-disable-next-line no-undef
  30726. && typeof Symbol.iterator == 'symbol';
  30727. /***/ })
  30728. /******/ })["default"];
  30729. //# sourceMappingURL=index.common.js.map