index.umd.js 1.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("xe-utils/ctor"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["xe-utils"], factory);
  6. else if(typeof exports === 'object')
  7. exports["VXETable"] = factory(require("xe-utils/ctor"));
  8. else
  9. root["VXETable"] = factory(root["XEUtils"]);
  10. })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__7fd6__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "fb15");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "00ee":
  99. /***/ (function(module, exports, __webpack_require__) {
  100. var wellKnownSymbol = __webpack_require__("b622");
  101. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  102. var test = {};
  103. test[TO_STRING_TAG] = 'z';
  104. module.exports = String(test) === '[object z]';
  105. /***/ }),
  106. /***/ "0366":
  107. /***/ (function(module, exports, __webpack_require__) {
  108. var aFunction = __webpack_require__("1c0b");
  109. // optional / simple context binding
  110. module.exports = function (fn, that, length) {
  111. aFunction(fn);
  112. if (that === undefined) return fn;
  113. switch (length) {
  114. case 0: return function () {
  115. return fn.call(that);
  116. };
  117. case 1: return function (a) {
  118. return fn.call(that, a);
  119. };
  120. case 2: return function (a, b) {
  121. return fn.call(that, a, b);
  122. };
  123. case 3: return function (a, b, c) {
  124. return fn.call(that, a, b, c);
  125. };
  126. }
  127. return function (/* ...args */) {
  128. return fn.apply(that, arguments);
  129. };
  130. };
  131. /***/ }),
  132. /***/ "057f":
  133. /***/ (function(module, exports, __webpack_require__) {
  134. var toIndexedObject = __webpack_require__("fc6a");
  135. var nativeGetOwnPropertyNames = __webpack_require__("241c").f;
  136. var toString = {}.toString;
  137. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  138. ? Object.getOwnPropertyNames(window) : [];
  139. var getWindowNames = function (it) {
  140. try {
  141. return nativeGetOwnPropertyNames(it);
  142. } catch (error) {
  143. return windowNames.slice();
  144. }
  145. };
  146. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  147. module.exports.f = function getOwnPropertyNames(it) {
  148. return windowNames && toString.call(it) == '[object Window]'
  149. ? getWindowNames(it)
  150. : nativeGetOwnPropertyNames(toIndexedObject(it));
  151. };
  152. /***/ }),
  153. /***/ "06cf":
  154. /***/ (function(module, exports, __webpack_require__) {
  155. var DESCRIPTORS = __webpack_require__("83ab");
  156. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  157. var createPropertyDescriptor = __webpack_require__("5c6c");
  158. var toIndexedObject = __webpack_require__("fc6a");
  159. var toPrimitive = __webpack_require__("c04e");
  160. var has = __webpack_require__("5135");
  161. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  162. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  163. // `Object.getOwnPropertyDescriptor` method
  164. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  165. exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  166. O = toIndexedObject(O);
  167. P = toPrimitive(P, true);
  168. if (IE8_DOM_DEFINE) try {
  169. return nativeGetOwnPropertyDescriptor(O, P);
  170. } catch (error) { /* empty */ }
  171. if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
  172. };
  173. /***/ }),
  174. /***/ "0ccb":
  175. /***/ (function(module, exports, __webpack_require__) {
  176. // https://github.com/tc39/proposal-string-pad-start-end
  177. var toLength = __webpack_require__("50c4");
  178. var repeat = __webpack_require__("1148");
  179. var requireObjectCoercible = __webpack_require__("1d80");
  180. var ceil = Math.ceil;
  181. // `String.prototype.{ padStart, padEnd }` methods implementation
  182. var createMethod = function (IS_END) {
  183. return function ($this, maxLength, fillString) {
  184. var S = String(requireObjectCoercible($this));
  185. var stringLength = S.length;
  186. var fillStr = fillString === undefined ? ' ' : String(fillString);
  187. var intMaxLength = toLength(maxLength);
  188. var fillLen, stringFiller;
  189. if (intMaxLength <= stringLength || fillStr == '') return S;
  190. fillLen = intMaxLength - stringLength;
  191. stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
  192. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  193. return IS_END ? S + stringFiller : stringFiller + S;
  194. };
  195. };
  196. module.exports = {
  197. // `String.prototype.padStart` method
  198. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  199. start: createMethod(false),
  200. // `String.prototype.padEnd` method
  201. // https://tc39.github.io/ecma262/#sec-string.prototype.padend
  202. end: createMethod(true)
  203. };
  204. /***/ }),
  205. /***/ "0cfb":
  206. /***/ (function(module, exports, __webpack_require__) {
  207. var DESCRIPTORS = __webpack_require__("83ab");
  208. var fails = __webpack_require__("d039");
  209. var createElement = __webpack_require__("cc12");
  210. // Thank's IE8 for his funny defineProperty
  211. module.exports = !DESCRIPTORS && !fails(function () {
  212. return Object.defineProperty(createElement('div'), 'a', {
  213. get: function () { return 7; }
  214. }).a != 7;
  215. });
  216. /***/ }),
  217. /***/ "0d3b":
  218. /***/ (function(module, exports, __webpack_require__) {
  219. var fails = __webpack_require__("d039");
  220. var wellKnownSymbol = __webpack_require__("b622");
  221. var IS_PURE = __webpack_require__("c430");
  222. var ITERATOR = wellKnownSymbol('iterator');
  223. module.exports = !fails(function () {
  224. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  225. var searchParams = url.searchParams;
  226. var result = '';
  227. url.pathname = 'c%20d';
  228. searchParams.forEach(function (value, key) {
  229. searchParams['delete']('b');
  230. result += key + value;
  231. });
  232. return (IS_PURE && !url.toJSON)
  233. || !searchParams.sort
  234. || url.href !== 'http://a/c%20d?a=1&c=3'
  235. || searchParams.get('c') !== '3'
  236. || String(new URLSearchParams('?a=1')) !== 'a=1'
  237. || !searchParams[ITERATOR]
  238. // throws in Edge
  239. || new URL('https://a@b').username !== 'a'
  240. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  241. // not punycoded in Edge
  242. || new URL('http://тест').host !== 'xn--e1aybc'
  243. // not escaped in Chrome 62-
  244. || new URL('http://a#б').hash !== '#%D0%B1'
  245. // fails in Chrome 66-
  246. || result !== 'a1c3'
  247. // throws in Safari
  248. || new URL('http://x', undefined).host !== 'x';
  249. });
  250. /***/ }),
  251. /***/ "1148":
  252. /***/ (function(module, exports, __webpack_require__) {
  253. "use strict";
  254. var toInteger = __webpack_require__("a691");
  255. var requireObjectCoercible = __webpack_require__("1d80");
  256. // `String.prototype.repeat` method implementation
  257. // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
  258. module.exports = ''.repeat || function repeat(count) {
  259. var str = String(requireObjectCoercible(this));
  260. var result = '';
  261. var n = toInteger(count);
  262. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  263. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  264. return result;
  265. };
  266. /***/ }),
  267. /***/ "1276":
  268. /***/ (function(module, exports, __webpack_require__) {
  269. "use strict";
  270. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  271. var isRegExp = __webpack_require__("44e7");
  272. var anObject = __webpack_require__("825a");
  273. var requireObjectCoercible = __webpack_require__("1d80");
  274. var speciesConstructor = __webpack_require__("4840");
  275. var advanceStringIndex = __webpack_require__("8aa5");
  276. var toLength = __webpack_require__("50c4");
  277. var callRegExpExec = __webpack_require__("14c3");
  278. var regexpExec = __webpack_require__("9263");
  279. var fails = __webpack_require__("d039");
  280. var arrayPush = [].push;
  281. var min = Math.min;
  282. var MAX_UINT32 = 0xFFFFFFFF;
  283. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  284. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  285. // @@split logic
  286. fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  287. var internalSplit;
  288. if (
  289. 'abbc'.split(/(b)*/)[1] == 'c' ||
  290. 'test'.split(/(?:)/, -1).length != 4 ||
  291. 'ab'.split(/(?:ab)*/).length != 2 ||
  292. '.'.split(/(.?)(.?)/).length != 4 ||
  293. '.'.split(/()()/).length > 1 ||
  294. ''.split(/.?/).length
  295. ) {
  296. // based on es5-shim implementation, need to rework it
  297. internalSplit = function (separator, limit) {
  298. var string = String(requireObjectCoercible(this));
  299. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  300. if (lim === 0) return [];
  301. if (separator === undefined) return [string];
  302. // If `separator` is not a regex, use native split
  303. if (!isRegExp(separator)) {
  304. return nativeSplit.call(string, separator, lim);
  305. }
  306. var output = [];
  307. var flags = (separator.ignoreCase ? 'i' : '') +
  308. (separator.multiline ? 'm' : '') +
  309. (separator.unicode ? 'u' : '') +
  310. (separator.sticky ? 'y' : '');
  311. var lastLastIndex = 0;
  312. // Make `global` and avoid `lastIndex` issues by working with a copy
  313. var separatorCopy = new RegExp(separator.source, flags + 'g');
  314. var match, lastIndex, lastLength;
  315. while (match = regexpExec.call(separatorCopy, string)) {
  316. lastIndex = separatorCopy.lastIndex;
  317. if (lastIndex > lastLastIndex) {
  318. output.push(string.slice(lastLastIndex, match.index));
  319. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  320. lastLength = match[0].length;
  321. lastLastIndex = lastIndex;
  322. if (output.length >= lim) break;
  323. }
  324. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  325. }
  326. if (lastLastIndex === string.length) {
  327. if (lastLength || !separatorCopy.test('')) output.push('');
  328. } else output.push(string.slice(lastLastIndex));
  329. return output.length > lim ? output.slice(0, lim) : output;
  330. };
  331. // Chakra, V8
  332. } else if ('0'.split(undefined, 0).length) {
  333. internalSplit = function (separator, limit) {
  334. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  335. };
  336. } else internalSplit = nativeSplit;
  337. return [
  338. // `String.prototype.split` method
  339. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  340. function split(separator, limit) {
  341. var O = requireObjectCoercible(this);
  342. var splitter = separator == undefined ? undefined : separator[SPLIT];
  343. return splitter !== undefined
  344. ? splitter.call(separator, O, limit)
  345. : internalSplit.call(String(O), separator, limit);
  346. },
  347. // `RegExp.prototype[@@split]` method
  348. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  349. //
  350. // NOTE: This cannot be properly polyfilled in engines that don't support
  351. // the 'y' flag.
  352. function (regexp, limit) {
  353. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  354. if (res.done) return res.value;
  355. var rx = anObject(regexp);
  356. var S = String(this);
  357. var C = speciesConstructor(rx, RegExp);
  358. var unicodeMatching = rx.unicode;
  359. var flags = (rx.ignoreCase ? 'i' : '') +
  360. (rx.multiline ? 'm' : '') +
  361. (rx.unicode ? 'u' : '') +
  362. (SUPPORTS_Y ? 'y' : 'g');
  363. // ^(? + rx + ) is needed, in combination with some S slicing, to
  364. // simulate the 'y' flag.
  365. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  366. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  367. if (lim === 0) return [];
  368. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  369. var p = 0;
  370. var q = 0;
  371. var A = [];
  372. while (q < S.length) {
  373. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  374. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  375. var e;
  376. if (
  377. z === null ||
  378. (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  379. ) {
  380. q = advanceStringIndex(S, q, unicodeMatching);
  381. } else {
  382. A.push(S.slice(p, q));
  383. if (A.length === lim) return A;
  384. for (var i = 1; i <= z.length - 1; i++) {
  385. A.push(z[i]);
  386. if (A.length === lim) return A;
  387. }
  388. q = p = e;
  389. }
  390. }
  391. A.push(S.slice(p));
  392. return A;
  393. }
  394. ];
  395. }, !SUPPORTS_Y);
  396. /***/ }),
  397. /***/ "13d5":
  398. /***/ (function(module, exports, __webpack_require__) {
  399. "use strict";
  400. var $ = __webpack_require__("23e7");
  401. var $reduce = __webpack_require__("d58f").left;
  402. var arrayMethodIsStrict = __webpack_require__("a640");
  403. var arrayMethodUsesToLength = __webpack_require__("ae40");
  404. var CHROME_VERSION = __webpack_require__("2d00");
  405. var IS_NODE = __webpack_require__("605d");
  406. var STRICT_METHOD = arrayMethodIsStrict('reduce');
  407. var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
  408. // Chrome 80-82 has a critical bug
  409. // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
  410. var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
  411. // `Array.prototype.reduce` method
  412. // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
  413. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
  414. reduce: function reduce(callbackfn /* , initialValue */) {
  415. return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  416. }
  417. });
  418. /***/ }),
  419. /***/ "14c3":
  420. /***/ (function(module, exports, __webpack_require__) {
  421. var classof = __webpack_require__("c6b6");
  422. var regexpExec = __webpack_require__("9263");
  423. // `RegExpExec` abstract operation
  424. // https://tc39.github.io/ecma262/#sec-regexpexec
  425. module.exports = function (R, S) {
  426. var exec = R.exec;
  427. if (typeof exec === 'function') {
  428. var result = exec.call(R, S);
  429. if (typeof result !== 'object') {
  430. throw TypeError('RegExp exec method returned something other than an Object or null');
  431. }
  432. return result;
  433. }
  434. if (classof(R) !== 'RegExp') {
  435. throw TypeError('RegExp#exec called on incompatible receiver');
  436. }
  437. return regexpExec.call(R, S);
  438. };
  439. /***/ }),
  440. /***/ "159b":
  441. /***/ (function(module, exports, __webpack_require__) {
  442. var global = __webpack_require__("da84");
  443. var DOMIterables = __webpack_require__("fdbc");
  444. var forEach = __webpack_require__("17c2");
  445. var createNonEnumerableProperty = __webpack_require__("9112");
  446. for (var COLLECTION_NAME in DOMIterables) {
  447. var Collection = global[COLLECTION_NAME];
  448. var CollectionPrototype = Collection && Collection.prototype;
  449. // some Chrome versions have non-configurable methods on DOMTokenList
  450. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  451. createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  452. } catch (error) {
  453. CollectionPrototype.forEach = forEach;
  454. }
  455. }
  456. /***/ }),
  457. /***/ "17c2":
  458. /***/ (function(module, exports, __webpack_require__) {
  459. "use strict";
  460. var $forEach = __webpack_require__("b727").forEach;
  461. var arrayMethodIsStrict = __webpack_require__("a640");
  462. var arrayMethodUsesToLength = __webpack_require__("ae40");
  463. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  464. var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
  465. // `Array.prototype.forEach` method implementation
  466. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  467. module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
  468. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  469. } : [].forEach;
  470. /***/ }),
  471. /***/ "19aa":
  472. /***/ (function(module, exports) {
  473. module.exports = function (it, Constructor, name) {
  474. if (!(it instanceof Constructor)) {
  475. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  476. } return it;
  477. };
  478. /***/ }),
  479. /***/ "1a97":
  480. /***/ (function(module, exports, __webpack_require__) {
  481. // extracted by mini-css-extract-plugin
  482. /***/ }),
  483. /***/ "1be4":
  484. /***/ (function(module, exports, __webpack_require__) {
  485. var getBuiltIn = __webpack_require__("d066");
  486. module.exports = getBuiltIn('document', 'documentElement');
  487. /***/ }),
  488. /***/ "1c0b":
  489. /***/ (function(module, exports) {
  490. module.exports = function (it) {
  491. if (typeof it != 'function') {
  492. throw TypeError(String(it) + ' is not a function');
  493. } return it;
  494. };
  495. /***/ }),
  496. /***/ "1c7e":
  497. /***/ (function(module, exports, __webpack_require__) {
  498. var wellKnownSymbol = __webpack_require__("b622");
  499. var ITERATOR = wellKnownSymbol('iterator');
  500. var SAFE_CLOSING = false;
  501. try {
  502. var called = 0;
  503. var iteratorWithReturn = {
  504. next: function () {
  505. return { done: !!called++ };
  506. },
  507. 'return': function () {
  508. SAFE_CLOSING = true;
  509. }
  510. };
  511. iteratorWithReturn[ITERATOR] = function () {
  512. return this;
  513. };
  514. // eslint-disable-next-line no-throw-literal
  515. Array.from(iteratorWithReturn, function () { throw 2; });
  516. } catch (error) { /* empty */ }
  517. module.exports = function (exec, SKIP_CLOSING) {
  518. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  519. var ITERATION_SUPPORT = false;
  520. try {
  521. var object = {};
  522. object[ITERATOR] = function () {
  523. return {
  524. next: function () {
  525. return { done: ITERATION_SUPPORT = true };
  526. }
  527. };
  528. };
  529. exec(object);
  530. } catch (error) { /* empty */ }
  531. return ITERATION_SUPPORT;
  532. };
  533. /***/ }),
  534. /***/ "1d80":
  535. /***/ (function(module, exports) {
  536. // `RequireObjectCoercible` abstract operation
  537. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  538. module.exports = function (it) {
  539. if (it == undefined) throw TypeError("Can't call method on " + it);
  540. return it;
  541. };
  542. /***/ }),
  543. /***/ "1dde":
  544. /***/ (function(module, exports, __webpack_require__) {
  545. var fails = __webpack_require__("d039");
  546. var wellKnownSymbol = __webpack_require__("b622");
  547. var V8_VERSION = __webpack_require__("2d00");
  548. var SPECIES = wellKnownSymbol('species');
  549. module.exports = function (METHOD_NAME) {
  550. // We can't use this feature detection in V8 since it causes
  551. // deoptimization and serious performance degradation
  552. // https://github.com/zloirock/core-js/issues/677
  553. return V8_VERSION >= 51 || !fails(function () {
  554. var array = [];
  555. var constructor = array.constructor = {};
  556. constructor[SPECIES] = function () {
  557. return { foo: 1 };
  558. };
  559. return array[METHOD_NAME](Boolean).foo !== 1;
  560. });
  561. };
  562. /***/ }),
  563. /***/ "2266":
  564. /***/ (function(module, exports, __webpack_require__) {
  565. var anObject = __webpack_require__("825a");
  566. var isArrayIteratorMethod = __webpack_require__("e95a");
  567. var toLength = __webpack_require__("50c4");
  568. var bind = __webpack_require__("0366");
  569. var getIteratorMethod = __webpack_require__("35a1");
  570. var iteratorClose = __webpack_require__("2a62");
  571. var Result = function (stopped, result) {
  572. this.stopped = stopped;
  573. this.result = result;
  574. };
  575. module.exports = function (iterable, unboundFunction, options) {
  576. var that = options && options.that;
  577. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  578. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  579. var INTERRUPTED = !!(options && options.INTERRUPTED);
  580. var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
  581. var iterator, iterFn, index, length, result, next, step;
  582. var stop = function (condition) {
  583. if (iterator) iteratorClose(iterator);
  584. return new Result(true, condition);
  585. };
  586. var callFn = function (value) {
  587. if (AS_ENTRIES) {
  588. anObject(value);
  589. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  590. } return INTERRUPTED ? fn(value, stop) : fn(value);
  591. };
  592. if (IS_ITERATOR) {
  593. iterator = iterable;
  594. } else {
  595. iterFn = getIteratorMethod(iterable);
  596. if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
  597. // optimisation for array iterators
  598. if (isArrayIteratorMethod(iterFn)) {
  599. for (index = 0, length = toLength(iterable.length); length > index; index++) {
  600. result = callFn(iterable[index]);
  601. if (result && result instanceof Result) return result;
  602. } return new Result(false);
  603. }
  604. iterator = iterFn.call(iterable);
  605. }
  606. next = iterator.next;
  607. while (!(step = next.call(iterator)).done) {
  608. try {
  609. result = callFn(step.value);
  610. } catch (error) {
  611. iteratorClose(iterator);
  612. throw error;
  613. }
  614. if (typeof result == 'object' && result && result instanceof Result) return result;
  615. } return new Result(false);
  616. };
  617. /***/ }),
  618. /***/ "23cb":
  619. /***/ (function(module, exports, __webpack_require__) {
  620. var toInteger = __webpack_require__("a691");
  621. var max = Math.max;
  622. var min = Math.min;
  623. // Helper for a popular repeating case of the spec:
  624. // Let integer be ? ToInteger(index).
  625. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  626. module.exports = function (index, length) {
  627. var integer = toInteger(index);
  628. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  629. };
  630. /***/ }),
  631. /***/ "23e7":
  632. /***/ (function(module, exports, __webpack_require__) {
  633. var global = __webpack_require__("da84");
  634. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  635. var createNonEnumerableProperty = __webpack_require__("9112");
  636. var redefine = __webpack_require__("6eeb");
  637. var setGlobal = __webpack_require__("ce4e");
  638. var copyConstructorProperties = __webpack_require__("e893");
  639. var isForced = __webpack_require__("94ca");
  640. /*
  641. options.target - name of the target object
  642. options.global - target is the global object
  643. options.stat - export as static methods of target
  644. options.proto - export as prototype methods of target
  645. options.real - real prototype method for the `pure` version
  646. options.forced - export even if the native feature is available
  647. options.bind - bind methods to the target, required for the `pure` version
  648. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  649. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  650. options.sham - add a flag to not completely full polyfills
  651. options.enumerable - export as enumerable property
  652. options.noTargetGet - prevent calling a getter on target
  653. */
  654. module.exports = function (options, source) {
  655. var TARGET = options.target;
  656. var GLOBAL = options.global;
  657. var STATIC = options.stat;
  658. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  659. if (GLOBAL) {
  660. target = global;
  661. } else if (STATIC) {
  662. target = global[TARGET] || setGlobal(TARGET, {});
  663. } else {
  664. target = (global[TARGET] || {}).prototype;
  665. }
  666. if (target) for (key in source) {
  667. sourceProperty = source[key];
  668. if (options.noTargetGet) {
  669. descriptor = getOwnPropertyDescriptor(target, key);
  670. targetProperty = descriptor && descriptor.value;
  671. } else targetProperty = target[key];
  672. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  673. // contained in target
  674. if (!FORCED && targetProperty !== undefined) {
  675. if (typeof sourceProperty === typeof targetProperty) continue;
  676. copyConstructorProperties(sourceProperty, targetProperty);
  677. }
  678. // add a flag to not completely full polyfills
  679. if (options.sham || (targetProperty && targetProperty.sham)) {
  680. createNonEnumerableProperty(sourceProperty, 'sham', true);
  681. }
  682. // extend global
  683. redefine(target, key, sourceProperty, options);
  684. }
  685. };
  686. /***/ }),
  687. /***/ "241c":
  688. /***/ (function(module, exports, __webpack_require__) {
  689. var internalObjectKeys = __webpack_require__("ca84");
  690. var enumBugKeys = __webpack_require__("7839");
  691. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  692. // `Object.getOwnPropertyNames` method
  693. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  694. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  695. return internalObjectKeys(O, hiddenKeys);
  696. };
  697. /***/ }),
  698. /***/ "2532":
  699. /***/ (function(module, exports, __webpack_require__) {
  700. "use strict";
  701. var $ = __webpack_require__("23e7");
  702. var notARegExp = __webpack_require__("5a34");
  703. var requireObjectCoercible = __webpack_require__("1d80");
  704. var correctIsRegExpLogic = __webpack_require__("ab13");
  705. // `String.prototype.includes` method
  706. // https://tc39.github.io/ecma262/#sec-string.prototype.includes
  707. $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
  708. includes: function includes(searchString /* , position = 0 */) {
  709. return !!~String(requireObjectCoercible(this))
  710. .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  711. }
  712. });
  713. /***/ }),
  714. /***/ "25f0":
  715. /***/ (function(module, exports, __webpack_require__) {
  716. "use strict";
  717. var redefine = __webpack_require__("6eeb");
  718. var anObject = __webpack_require__("825a");
  719. var fails = __webpack_require__("d039");
  720. var flags = __webpack_require__("ad6d");
  721. var TO_STRING = 'toString';
  722. var RegExpPrototype = RegExp.prototype;
  723. var nativeToString = RegExpPrototype[TO_STRING];
  724. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  725. // FF44- RegExp#toString has a wrong name
  726. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  727. // `RegExp.prototype.toString` method
  728. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  729. if (NOT_GENERIC || INCORRECT_NAME) {
  730. redefine(RegExp.prototype, TO_STRING, function toString() {
  731. var R = anObject(this);
  732. var p = String(R.source);
  733. var rf = R.flags;
  734. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
  735. return '/' + p + '/' + f;
  736. }, { unsafe: true });
  737. }
  738. /***/ }),
  739. /***/ "2626":
  740. /***/ (function(module, exports, __webpack_require__) {
  741. "use strict";
  742. var getBuiltIn = __webpack_require__("d066");
  743. var definePropertyModule = __webpack_require__("9bf2");
  744. var wellKnownSymbol = __webpack_require__("b622");
  745. var DESCRIPTORS = __webpack_require__("83ab");
  746. var SPECIES = wellKnownSymbol('species');
  747. module.exports = function (CONSTRUCTOR_NAME) {
  748. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  749. var defineProperty = definePropertyModule.f;
  750. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  751. defineProperty(Constructor, SPECIES, {
  752. configurable: true,
  753. get: function () { return this; }
  754. });
  755. }
  756. };
  757. /***/ }),
  758. /***/ "2a62":
  759. /***/ (function(module, exports, __webpack_require__) {
  760. var anObject = __webpack_require__("825a");
  761. module.exports = function (iterator) {
  762. var returnMethod = iterator['return'];
  763. if (returnMethod !== undefined) {
  764. return anObject(returnMethod.call(iterator)).value;
  765. }
  766. };
  767. /***/ }),
  768. /***/ "2b3d":
  769. /***/ (function(module, exports, __webpack_require__) {
  770. "use strict";
  771. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  772. __webpack_require__("3ca3");
  773. var $ = __webpack_require__("23e7");
  774. var DESCRIPTORS = __webpack_require__("83ab");
  775. var USE_NATIVE_URL = __webpack_require__("0d3b");
  776. var global = __webpack_require__("da84");
  777. var defineProperties = __webpack_require__("37e8");
  778. var redefine = __webpack_require__("6eeb");
  779. var anInstance = __webpack_require__("19aa");
  780. var has = __webpack_require__("5135");
  781. var assign = __webpack_require__("60da");
  782. var arrayFrom = __webpack_require__("4df4");
  783. var codeAt = __webpack_require__("6547").codeAt;
  784. var toASCII = __webpack_require__("5fb2");
  785. var setToStringTag = __webpack_require__("d44e");
  786. var URLSearchParamsModule = __webpack_require__("9861");
  787. var InternalStateModule = __webpack_require__("69f3");
  788. var NativeURL = global.URL;
  789. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  790. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  791. var setInternalState = InternalStateModule.set;
  792. var getInternalURLState = InternalStateModule.getterFor('URL');
  793. var floor = Math.floor;
  794. var pow = Math.pow;
  795. var INVALID_AUTHORITY = 'Invalid authority';
  796. var INVALID_SCHEME = 'Invalid scheme';
  797. var INVALID_HOST = 'Invalid host';
  798. var INVALID_PORT = 'Invalid port';
  799. var ALPHA = /[A-Za-z]/;
  800. var ALPHANUMERIC = /[\d+-.A-Za-z]/;
  801. var DIGIT = /\d/;
  802. var HEX_START = /^(0x|0X)/;
  803. var OCT = /^[0-7]+$/;
  804. var DEC = /^\d+$/;
  805. var HEX = /^[\dA-Fa-f]+$/;
  806. // eslint-disable-next-line no-control-regex
  807. var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
  808. // eslint-disable-next-line no-control-regex
  809. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
  810. // eslint-disable-next-line no-control-regex
  811. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
  812. // eslint-disable-next-line no-control-regex
  813. var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
  814. var EOF;
  815. var parseHost = function (url, input) {
  816. var result, codePoints, index;
  817. if (input.charAt(0) == '[') {
  818. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  819. result = parseIPv6(input.slice(1, -1));
  820. if (!result) return INVALID_HOST;
  821. url.host = result;
  822. // opaque host
  823. } else if (!isSpecial(url)) {
  824. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  825. result = '';
  826. codePoints = arrayFrom(input);
  827. for (index = 0; index < codePoints.length; index++) {
  828. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  829. }
  830. url.host = result;
  831. } else {
  832. input = toASCII(input);
  833. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  834. result = parseIPv4(input);
  835. if (result === null) return INVALID_HOST;
  836. url.host = result;
  837. }
  838. };
  839. var parseIPv4 = function (input) {
  840. var parts = input.split('.');
  841. var partsLength, numbers, index, part, radix, number, ipv4;
  842. if (parts.length && parts[parts.length - 1] == '') {
  843. parts.pop();
  844. }
  845. partsLength = parts.length;
  846. if (partsLength > 4) return input;
  847. numbers = [];
  848. for (index = 0; index < partsLength; index++) {
  849. part = parts[index];
  850. if (part == '') return input;
  851. radix = 10;
  852. if (part.length > 1 && part.charAt(0) == '0') {
  853. radix = HEX_START.test(part) ? 16 : 8;
  854. part = part.slice(radix == 8 ? 1 : 2);
  855. }
  856. if (part === '') {
  857. number = 0;
  858. } else {
  859. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  860. number = parseInt(part, radix);
  861. }
  862. numbers.push(number);
  863. }
  864. for (index = 0; index < partsLength; index++) {
  865. number = numbers[index];
  866. if (index == partsLength - 1) {
  867. if (number >= pow(256, 5 - partsLength)) return null;
  868. } else if (number > 255) return null;
  869. }
  870. ipv4 = numbers.pop();
  871. for (index = 0; index < numbers.length; index++) {
  872. ipv4 += numbers[index] * pow(256, 3 - index);
  873. }
  874. return ipv4;
  875. };
  876. // eslint-disable-next-line max-statements
  877. var parseIPv6 = function (input) {
  878. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  879. var pieceIndex = 0;
  880. var compress = null;
  881. var pointer = 0;
  882. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  883. var char = function () {
  884. return input.charAt(pointer);
  885. };
  886. if (char() == ':') {
  887. if (input.charAt(1) != ':') return;
  888. pointer += 2;
  889. pieceIndex++;
  890. compress = pieceIndex;
  891. }
  892. while (char()) {
  893. if (pieceIndex == 8) return;
  894. if (char() == ':') {
  895. if (compress !== null) return;
  896. pointer++;
  897. pieceIndex++;
  898. compress = pieceIndex;
  899. continue;
  900. }
  901. value = length = 0;
  902. while (length < 4 && HEX.test(char())) {
  903. value = value * 16 + parseInt(char(), 16);
  904. pointer++;
  905. length++;
  906. }
  907. if (char() == '.') {
  908. if (length == 0) return;
  909. pointer -= length;
  910. if (pieceIndex > 6) return;
  911. numbersSeen = 0;
  912. while (char()) {
  913. ipv4Piece = null;
  914. if (numbersSeen > 0) {
  915. if (char() == '.' && numbersSeen < 4) pointer++;
  916. else return;
  917. }
  918. if (!DIGIT.test(char())) return;
  919. while (DIGIT.test(char())) {
  920. number = parseInt(char(), 10);
  921. if (ipv4Piece === null) ipv4Piece = number;
  922. else if (ipv4Piece == 0) return;
  923. else ipv4Piece = ipv4Piece * 10 + number;
  924. if (ipv4Piece > 255) return;
  925. pointer++;
  926. }
  927. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  928. numbersSeen++;
  929. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  930. }
  931. if (numbersSeen != 4) return;
  932. break;
  933. } else if (char() == ':') {
  934. pointer++;
  935. if (!char()) return;
  936. } else if (char()) return;
  937. address[pieceIndex++] = value;
  938. }
  939. if (compress !== null) {
  940. swaps = pieceIndex - compress;
  941. pieceIndex = 7;
  942. while (pieceIndex != 0 && swaps > 0) {
  943. swap = address[pieceIndex];
  944. address[pieceIndex--] = address[compress + swaps - 1];
  945. address[compress + --swaps] = swap;
  946. }
  947. } else if (pieceIndex != 8) return;
  948. return address;
  949. };
  950. var findLongestZeroSequence = function (ipv6) {
  951. var maxIndex = null;
  952. var maxLength = 1;
  953. var currStart = null;
  954. var currLength = 0;
  955. var index = 0;
  956. for (; index < 8; index++) {
  957. if (ipv6[index] !== 0) {
  958. if (currLength > maxLength) {
  959. maxIndex = currStart;
  960. maxLength = currLength;
  961. }
  962. currStart = null;
  963. currLength = 0;
  964. } else {
  965. if (currStart === null) currStart = index;
  966. ++currLength;
  967. }
  968. }
  969. if (currLength > maxLength) {
  970. maxIndex = currStart;
  971. maxLength = currLength;
  972. }
  973. return maxIndex;
  974. };
  975. var serializeHost = function (host) {
  976. var result, index, compress, ignore0;
  977. // ipv4
  978. if (typeof host == 'number') {
  979. result = [];
  980. for (index = 0; index < 4; index++) {
  981. result.unshift(host % 256);
  982. host = floor(host / 256);
  983. } return result.join('.');
  984. // ipv6
  985. } else if (typeof host == 'object') {
  986. result = '';
  987. compress = findLongestZeroSequence(host);
  988. for (index = 0; index < 8; index++) {
  989. if (ignore0 && host[index] === 0) continue;
  990. if (ignore0) ignore0 = false;
  991. if (compress === index) {
  992. result += index ? ':' : '::';
  993. ignore0 = true;
  994. } else {
  995. result += host[index].toString(16);
  996. if (index < 7) result += ':';
  997. }
  998. }
  999. return '[' + result + ']';
  1000. } return host;
  1001. };
  1002. var C0ControlPercentEncodeSet = {};
  1003. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  1004. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  1005. });
  1006. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  1007. '#': 1, '?': 1, '{': 1, '}': 1
  1008. });
  1009. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  1010. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  1011. });
  1012. var percentEncode = function (char, set) {
  1013. var code = codeAt(char, 0);
  1014. return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
  1015. };
  1016. var specialSchemes = {
  1017. ftp: 21,
  1018. file: null,
  1019. http: 80,
  1020. https: 443,
  1021. ws: 80,
  1022. wss: 443
  1023. };
  1024. var isSpecial = function (url) {
  1025. return has(specialSchemes, url.scheme);
  1026. };
  1027. var includesCredentials = function (url) {
  1028. return url.username != '' || url.password != '';
  1029. };
  1030. var cannotHaveUsernamePasswordPort = function (url) {
  1031. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  1032. };
  1033. var isWindowsDriveLetter = function (string, normalized) {
  1034. var second;
  1035. return string.length == 2 && ALPHA.test(string.charAt(0))
  1036. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  1037. };
  1038. var startsWithWindowsDriveLetter = function (string) {
  1039. var third;
  1040. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  1041. string.length == 2 ||
  1042. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  1043. );
  1044. };
  1045. var shortenURLsPath = function (url) {
  1046. var path = url.path;
  1047. var pathSize = path.length;
  1048. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  1049. path.pop();
  1050. }
  1051. };
  1052. var isSingleDot = function (segment) {
  1053. return segment === '.' || segment.toLowerCase() === '%2e';
  1054. };
  1055. var isDoubleDot = function (segment) {
  1056. segment = segment.toLowerCase();
  1057. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  1058. };
  1059. // States:
  1060. var SCHEME_START = {};
  1061. var SCHEME = {};
  1062. var NO_SCHEME = {};
  1063. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  1064. var PATH_OR_AUTHORITY = {};
  1065. var RELATIVE = {};
  1066. var RELATIVE_SLASH = {};
  1067. var SPECIAL_AUTHORITY_SLASHES = {};
  1068. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  1069. var AUTHORITY = {};
  1070. var HOST = {};
  1071. var HOSTNAME = {};
  1072. var PORT = {};
  1073. var FILE = {};
  1074. var FILE_SLASH = {};
  1075. var FILE_HOST = {};
  1076. var PATH_START = {};
  1077. var PATH = {};
  1078. var CANNOT_BE_A_BASE_URL_PATH = {};
  1079. var QUERY = {};
  1080. var FRAGMENT = {};
  1081. // eslint-disable-next-line max-statements
  1082. var parseURL = function (url, input, stateOverride, base) {
  1083. var state = stateOverride || SCHEME_START;
  1084. var pointer = 0;
  1085. var buffer = '';
  1086. var seenAt = false;
  1087. var seenBracket = false;
  1088. var seenPasswordToken = false;
  1089. var codePoints, char, bufferCodePoints, failure;
  1090. if (!stateOverride) {
  1091. url.scheme = '';
  1092. url.username = '';
  1093. url.password = '';
  1094. url.host = null;
  1095. url.port = null;
  1096. url.path = [];
  1097. url.query = null;
  1098. url.fragment = null;
  1099. url.cannotBeABaseURL = false;
  1100. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  1101. }
  1102. input = input.replace(TAB_AND_NEW_LINE, '');
  1103. codePoints = arrayFrom(input);
  1104. while (pointer <= codePoints.length) {
  1105. char = codePoints[pointer];
  1106. switch (state) {
  1107. case SCHEME_START:
  1108. if (char && ALPHA.test(char)) {
  1109. buffer += char.toLowerCase();
  1110. state = SCHEME;
  1111. } else if (!stateOverride) {
  1112. state = NO_SCHEME;
  1113. continue;
  1114. } else return INVALID_SCHEME;
  1115. break;
  1116. case SCHEME:
  1117. if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
  1118. buffer += char.toLowerCase();
  1119. } else if (char == ':') {
  1120. if (stateOverride && (
  1121. (isSpecial(url) != has(specialSchemes, buffer)) ||
  1122. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  1123. (url.scheme == 'file' && !url.host)
  1124. )) return;
  1125. url.scheme = buffer;
  1126. if (stateOverride) {
  1127. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  1128. return;
  1129. }
  1130. buffer = '';
  1131. if (url.scheme == 'file') {
  1132. state = FILE;
  1133. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  1134. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  1135. } else if (isSpecial(url)) {
  1136. state = SPECIAL_AUTHORITY_SLASHES;
  1137. } else if (codePoints[pointer + 1] == '/') {
  1138. state = PATH_OR_AUTHORITY;
  1139. pointer++;
  1140. } else {
  1141. url.cannotBeABaseURL = true;
  1142. url.path.push('');
  1143. state = CANNOT_BE_A_BASE_URL_PATH;
  1144. }
  1145. } else if (!stateOverride) {
  1146. buffer = '';
  1147. state = NO_SCHEME;
  1148. pointer = 0;
  1149. continue;
  1150. } else return INVALID_SCHEME;
  1151. break;
  1152. case NO_SCHEME:
  1153. if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
  1154. if (base.cannotBeABaseURL && char == '#') {
  1155. url.scheme = base.scheme;
  1156. url.path = base.path.slice();
  1157. url.query = base.query;
  1158. url.fragment = '';
  1159. url.cannotBeABaseURL = true;
  1160. state = FRAGMENT;
  1161. break;
  1162. }
  1163. state = base.scheme == 'file' ? FILE : RELATIVE;
  1164. continue;
  1165. case SPECIAL_RELATIVE_OR_AUTHORITY:
  1166. if (char == '/' && codePoints[pointer + 1] == '/') {
  1167. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1168. pointer++;
  1169. } else {
  1170. state = RELATIVE;
  1171. continue;
  1172. } break;
  1173. case PATH_OR_AUTHORITY:
  1174. if (char == '/') {
  1175. state = AUTHORITY;
  1176. break;
  1177. } else {
  1178. state = PATH;
  1179. continue;
  1180. }
  1181. case RELATIVE:
  1182. url.scheme = base.scheme;
  1183. if (char == EOF) {
  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 = base.query;
  1190. } else if (char == '/' || (char == '\\' && isSpecial(url))) {
  1191. state = RELATIVE_SLASH;
  1192. } else if (char == '?') {
  1193. url.username = base.username;
  1194. url.password = base.password;
  1195. url.host = base.host;
  1196. url.port = base.port;
  1197. url.path = base.path.slice();
  1198. url.query = '';
  1199. state = QUERY;
  1200. } else if (char == '#') {
  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.query = base.query;
  1207. url.fragment = '';
  1208. state = FRAGMENT;
  1209. } else {
  1210. url.username = base.username;
  1211. url.password = base.password;
  1212. url.host = base.host;
  1213. url.port = base.port;
  1214. url.path = base.path.slice();
  1215. url.path.pop();
  1216. state = PATH;
  1217. continue;
  1218. } break;
  1219. case RELATIVE_SLASH:
  1220. if (isSpecial(url) && (char == '/' || char == '\\')) {
  1221. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1222. } else if (char == '/') {
  1223. state = AUTHORITY;
  1224. } else {
  1225. url.username = base.username;
  1226. url.password = base.password;
  1227. url.host = base.host;
  1228. url.port = base.port;
  1229. state = PATH;
  1230. continue;
  1231. } break;
  1232. case SPECIAL_AUTHORITY_SLASHES:
  1233. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1234. if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
  1235. pointer++;
  1236. break;
  1237. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  1238. if (char != '/' && char != '\\') {
  1239. state = AUTHORITY;
  1240. continue;
  1241. } break;
  1242. case AUTHORITY:
  1243. if (char == '@') {
  1244. if (seenAt) buffer = '%40' + buffer;
  1245. seenAt = true;
  1246. bufferCodePoints = arrayFrom(buffer);
  1247. for (var i = 0; i < bufferCodePoints.length; i++) {
  1248. var codePoint = bufferCodePoints[i];
  1249. if (codePoint == ':' && !seenPasswordToken) {
  1250. seenPasswordToken = true;
  1251. continue;
  1252. }
  1253. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  1254. if (seenPasswordToken) url.password += encodedCodePoints;
  1255. else url.username += encodedCodePoints;
  1256. }
  1257. buffer = '';
  1258. } else if (
  1259. char == EOF || char == '/' || char == '?' || char == '#' ||
  1260. (char == '\\' && isSpecial(url))
  1261. ) {
  1262. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  1263. pointer -= arrayFrom(buffer).length + 1;
  1264. buffer = '';
  1265. state = HOST;
  1266. } else buffer += char;
  1267. break;
  1268. case HOST:
  1269. case HOSTNAME:
  1270. if (stateOverride && url.scheme == 'file') {
  1271. state = FILE_HOST;
  1272. continue;
  1273. } else if (char == ':' && !seenBracket) {
  1274. if (buffer == '') return INVALID_HOST;
  1275. failure = parseHost(url, buffer);
  1276. if (failure) return failure;
  1277. buffer = '';
  1278. state = PORT;
  1279. if (stateOverride == HOSTNAME) return;
  1280. } else if (
  1281. char == EOF || char == '/' || char == '?' || char == '#' ||
  1282. (char == '\\' && isSpecial(url))
  1283. ) {
  1284. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  1285. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  1286. failure = parseHost(url, buffer);
  1287. if (failure) return failure;
  1288. buffer = '';
  1289. state = PATH_START;
  1290. if (stateOverride) return;
  1291. continue;
  1292. } else {
  1293. if (char == '[') seenBracket = true;
  1294. else if (char == ']') seenBracket = false;
  1295. buffer += char;
  1296. } break;
  1297. case PORT:
  1298. if (DIGIT.test(char)) {
  1299. buffer += char;
  1300. } else if (
  1301. char == EOF || char == '/' || char == '?' || char == '#' ||
  1302. (char == '\\' && isSpecial(url)) ||
  1303. stateOverride
  1304. ) {
  1305. if (buffer != '') {
  1306. var port = parseInt(buffer, 10);
  1307. if (port > 0xFFFF) return INVALID_PORT;
  1308. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  1309. buffer = '';
  1310. }
  1311. if (stateOverride) return;
  1312. state = PATH_START;
  1313. continue;
  1314. } else return INVALID_PORT;
  1315. break;
  1316. case FILE:
  1317. url.scheme = 'file';
  1318. if (char == '/' || char == '\\') state = FILE_SLASH;
  1319. else if (base && base.scheme == 'file') {
  1320. if (char == EOF) {
  1321. url.host = base.host;
  1322. url.path = base.path.slice();
  1323. url.query = base.query;
  1324. } else if (char == '?') {
  1325. url.host = base.host;
  1326. url.path = base.path.slice();
  1327. url.query = '';
  1328. state = QUERY;
  1329. } else if (char == '#') {
  1330. url.host = base.host;
  1331. url.path = base.path.slice();
  1332. url.query = base.query;
  1333. url.fragment = '';
  1334. state = FRAGMENT;
  1335. } else {
  1336. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1337. url.host = base.host;
  1338. url.path = base.path.slice();
  1339. shortenURLsPath(url);
  1340. }
  1341. state = PATH;
  1342. continue;
  1343. }
  1344. } else {
  1345. state = PATH;
  1346. continue;
  1347. } break;
  1348. case FILE_SLASH:
  1349. if (char == '/' || char == '\\') {
  1350. state = FILE_HOST;
  1351. break;
  1352. }
  1353. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1354. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  1355. else url.host = base.host;
  1356. }
  1357. state = PATH;
  1358. continue;
  1359. case FILE_HOST:
  1360. if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
  1361. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  1362. state = PATH;
  1363. } else if (buffer == '') {
  1364. url.host = '';
  1365. if (stateOverride) return;
  1366. state = PATH_START;
  1367. } else {
  1368. failure = parseHost(url, buffer);
  1369. if (failure) return failure;
  1370. if (url.host == 'localhost') url.host = '';
  1371. if (stateOverride) return;
  1372. buffer = '';
  1373. state = PATH_START;
  1374. } continue;
  1375. } else buffer += char;
  1376. break;
  1377. case PATH_START:
  1378. if (isSpecial(url)) {
  1379. state = PATH;
  1380. if (char != '/' && char != '\\') continue;
  1381. } else if (!stateOverride && char == '?') {
  1382. url.query = '';
  1383. state = QUERY;
  1384. } else if (!stateOverride && char == '#') {
  1385. url.fragment = '';
  1386. state = FRAGMENT;
  1387. } else if (char != EOF) {
  1388. state = PATH;
  1389. if (char != '/') continue;
  1390. } break;
  1391. case PATH:
  1392. if (
  1393. char == EOF || char == '/' ||
  1394. (char == '\\' && isSpecial(url)) ||
  1395. (!stateOverride && (char == '?' || char == '#'))
  1396. ) {
  1397. if (isDoubleDot(buffer)) {
  1398. shortenURLsPath(url);
  1399. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1400. url.path.push('');
  1401. }
  1402. } else if (isSingleDot(buffer)) {
  1403. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1404. url.path.push('');
  1405. }
  1406. } else {
  1407. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  1408. if (url.host) url.host = '';
  1409. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  1410. }
  1411. url.path.push(buffer);
  1412. }
  1413. buffer = '';
  1414. if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
  1415. while (url.path.length > 1 && url.path[0] === '') {
  1416. url.path.shift();
  1417. }
  1418. }
  1419. if (char == '?') {
  1420. url.query = '';
  1421. state = QUERY;
  1422. } else if (char == '#') {
  1423. url.fragment = '';
  1424. state = FRAGMENT;
  1425. }
  1426. } else {
  1427. buffer += percentEncode(char, pathPercentEncodeSet);
  1428. } break;
  1429. case CANNOT_BE_A_BASE_URL_PATH:
  1430. if (char == '?') {
  1431. url.query = '';
  1432. state = QUERY;
  1433. } else if (char == '#') {
  1434. url.fragment = '';
  1435. state = FRAGMENT;
  1436. } else if (char != EOF) {
  1437. url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
  1438. } break;
  1439. case QUERY:
  1440. if (!stateOverride && char == '#') {
  1441. url.fragment = '';
  1442. state = FRAGMENT;
  1443. } else if (char != EOF) {
  1444. if (char == "'" && isSpecial(url)) url.query += '%27';
  1445. else if (char == '#') url.query += '%23';
  1446. else url.query += percentEncode(char, C0ControlPercentEncodeSet);
  1447. } break;
  1448. case FRAGMENT:
  1449. if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
  1450. break;
  1451. }
  1452. pointer++;
  1453. }
  1454. };
  1455. // `URL` constructor
  1456. // https://url.spec.whatwg.org/#url-class
  1457. var URLConstructor = function URL(url /* , base */) {
  1458. var that = anInstance(this, URLConstructor, 'URL');
  1459. var base = arguments.length > 1 ? arguments[1] : undefined;
  1460. var urlString = String(url);
  1461. var state = setInternalState(that, { type: 'URL' });
  1462. var baseState, failure;
  1463. if (base !== undefined) {
  1464. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  1465. else {
  1466. failure = parseURL(baseState = {}, String(base));
  1467. if (failure) throw TypeError(failure);
  1468. }
  1469. }
  1470. failure = parseURL(state, urlString, null, baseState);
  1471. if (failure) throw TypeError(failure);
  1472. var searchParams = state.searchParams = new URLSearchParams();
  1473. var searchParamsState = getInternalSearchParamsState(searchParams);
  1474. searchParamsState.updateSearchParams(state.query);
  1475. searchParamsState.updateURL = function () {
  1476. state.query = String(searchParams) || null;
  1477. };
  1478. if (!DESCRIPTORS) {
  1479. that.href = serializeURL.call(that);
  1480. that.origin = getOrigin.call(that);
  1481. that.protocol = getProtocol.call(that);
  1482. that.username = getUsername.call(that);
  1483. that.password = getPassword.call(that);
  1484. that.host = getHost.call(that);
  1485. that.hostname = getHostname.call(that);
  1486. that.port = getPort.call(that);
  1487. that.pathname = getPathname.call(that);
  1488. that.search = getSearch.call(that);
  1489. that.searchParams = getSearchParams.call(that);
  1490. that.hash = getHash.call(that);
  1491. }
  1492. };
  1493. var URLPrototype = URLConstructor.prototype;
  1494. var serializeURL = function () {
  1495. var url = getInternalURLState(this);
  1496. var scheme = url.scheme;
  1497. var username = url.username;
  1498. var password = url.password;
  1499. var host = url.host;
  1500. var port = url.port;
  1501. var path = url.path;
  1502. var query = url.query;
  1503. var fragment = url.fragment;
  1504. var output = scheme + ':';
  1505. if (host !== null) {
  1506. output += '//';
  1507. if (includesCredentials(url)) {
  1508. output += username + (password ? ':' + password : '') + '@';
  1509. }
  1510. output += serializeHost(host);
  1511. if (port !== null) output += ':' + port;
  1512. } else if (scheme == 'file') output += '//';
  1513. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1514. if (query !== null) output += '?' + query;
  1515. if (fragment !== null) output += '#' + fragment;
  1516. return output;
  1517. };
  1518. var getOrigin = function () {
  1519. var url = getInternalURLState(this);
  1520. var scheme = url.scheme;
  1521. var port = url.port;
  1522. if (scheme == 'blob') try {
  1523. return new URL(scheme.path[0]).origin;
  1524. } catch (error) {
  1525. return 'null';
  1526. }
  1527. if (scheme == 'file' || !isSpecial(url)) return 'null';
  1528. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  1529. };
  1530. var getProtocol = function () {
  1531. return getInternalURLState(this).scheme + ':';
  1532. };
  1533. var getUsername = function () {
  1534. return getInternalURLState(this).username;
  1535. };
  1536. var getPassword = function () {
  1537. return getInternalURLState(this).password;
  1538. };
  1539. var getHost = function () {
  1540. var url = getInternalURLState(this);
  1541. var host = url.host;
  1542. var port = url.port;
  1543. return host === null ? ''
  1544. : port === null ? serializeHost(host)
  1545. : serializeHost(host) + ':' + port;
  1546. };
  1547. var getHostname = function () {
  1548. var host = getInternalURLState(this).host;
  1549. return host === null ? '' : serializeHost(host);
  1550. };
  1551. var getPort = function () {
  1552. var port = getInternalURLState(this).port;
  1553. return port === null ? '' : String(port);
  1554. };
  1555. var getPathname = function () {
  1556. var url = getInternalURLState(this);
  1557. var path = url.path;
  1558. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1559. };
  1560. var getSearch = function () {
  1561. var query = getInternalURLState(this).query;
  1562. return query ? '?' + query : '';
  1563. };
  1564. var getSearchParams = function () {
  1565. return getInternalURLState(this).searchParams;
  1566. };
  1567. var getHash = function () {
  1568. var fragment = getInternalURLState(this).fragment;
  1569. return fragment ? '#' + fragment : '';
  1570. };
  1571. var accessorDescriptor = function (getter, setter) {
  1572. return { get: getter, set: setter, configurable: true, enumerable: true };
  1573. };
  1574. if (DESCRIPTORS) {
  1575. defineProperties(URLPrototype, {
  1576. // `URL.prototype.href` accessors pair
  1577. // https://url.spec.whatwg.org/#dom-url-href
  1578. href: accessorDescriptor(serializeURL, function (href) {
  1579. var url = getInternalURLState(this);
  1580. var urlString = String(href);
  1581. var failure = parseURL(url, urlString);
  1582. if (failure) throw TypeError(failure);
  1583. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1584. }),
  1585. // `URL.prototype.origin` getter
  1586. // https://url.spec.whatwg.org/#dom-url-origin
  1587. origin: accessorDescriptor(getOrigin),
  1588. // `URL.prototype.protocol` accessors pair
  1589. // https://url.spec.whatwg.org/#dom-url-protocol
  1590. protocol: accessorDescriptor(getProtocol, function (protocol) {
  1591. var url = getInternalURLState(this);
  1592. parseURL(url, String(protocol) + ':', SCHEME_START);
  1593. }),
  1594. // `URL.prototype.username` accessors pair
  1595. // https://url.spec.whatwg.org/#dom-url-username
  1596. username: accessorDescriptor(getUsername, function (username) {
  1597. var url = getInternalURLState(this);
  1598. var codePoints = arrayFrom(String(username));
  1599. if (cannotHaveUsernamePasswordPort(url)) return;
  1600. url.username = '';
  1601. for (var i = 0; i < codePoints.length; i++) {
  1602. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1603. }
  1604. }),
  1605. // `URL.prototype.password` accessors pair
  1606. // https://url.spec.whatwg.org/#dom-url-password
  1607. password: accessorDescriptor(getPassword, function (password) {
  1608. var url = getInternalURLState(this);
  1609. var codePoints = arrayFrom(String(password));
  1610. if (cannotHaveUsernamePasswordPort(url)) return;
  1611. url.password = '';
  1612. for (var i = 0; i < codePoints.length; i++) {
  1613. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1614. }
  1615. }),
  1616. // `URL.prototype.host` accessors pair
  1617. // https://url.spec.whatwg.org/#dom-url-host
  1618. host: accessorDescriptor(getHost, function (host) {
  1619. var url = getInternalURLState(this);
  1620. if (url.cannotBeABaseURL) return;
  1621. parseURL(url, String(host), HOST);
  1622. }),
  1623. // `URL.prototype.hostname` accessors pair
  1624. // https://url.spec.whatwg.org/#dom-url-hostname
  1625. hostname: accessorDescriptor(getHostname, function (hostname) {
  1626. var url = getInternalURLState(this);
  1627. if (url.cannotBeABaseURL) return;
  1628. parseURL(url, String(hostname), HOSTNAME);
  1629. }),
  1630. // `URL.prototype.port` accessors pair
  1631. // https://url.spec.whatwg.org/#dom-url-port
  1632. port: accessorDescriptor(getPort, function (port) {
  1633. var url = getInternalURLState(this);
  1634. if (cannotHaveUsernamePasswordPort(url)) return;
  1635. port = String(port);
  1636. if (port == '') url.port = null;
  1637. else parseURL(url, port, PORT);
  1638. }),
  1639. // `URL.prototype.pathname` accessors pair
  1640. // https://url.spec.whatwg.org/#dom-url-pathname
  1641. pathname: accessorDescriptor(getPathname, function (pathname) {
  1642. var url = getInternalURLState(this);
  1643. if (url.cannotBeABaseURL) return;
  1644. url.path = [];
  1645. parseURL(url, pathname + '', PATH_START);
  1646. }),
  1647. // `URL.prototype.search` accessors pair
  1648. // https://url.spec.whatwg.org/#dom-url-search
  1649. search: accessorDescriptor(getSearch, function (search) {
  1650. var url = getInternalURLState(this);
  1651. search = String(search);
  1652. if (search == '') {
  1653. url.query = null;
  1654. } else {
  1655. if ('?' == search.charAt(0)) search = search.slice(1);
  1656. url.query = '';
  1657. parseURL(url, search, QUERY);
  1658. }
  1659. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1660. }),
  1661. // `URL.prototype.searchParams` getter
  1662. // https://url.spec.whatwg.org/#dom-url-searchparams
  1663. searchParams: accessorDescriptor(getSearchParams),
  1664. // `URL.prototype.hash` accessors pair
  1665. // https://url.spec.whatwg.org/#dom-url-hash
  1666. hash: accessorDescriptor(getHash, function (hash) {
  1667. var url = getInternalURLState(this);
  1668. hash = String(hash);
  1669. if (hash == '') {
  1670. url.fragment = null;
  1671. return;
  1672. }
  1673. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  1674. url.fragment = '';
  1675. parseURL(url, hash, FRAGMENT);
  1676. })
  1677. });
  1678. }
  1679. // `URL.prototype.toJSON` method
  1680. // https://url.spec.whatwg.org/#dom-url-tojson
  1681. redefine(URLPrototype, 'toJSON', function toJSON() {
  1682. return serializeURL.call(this);
  1683. }, { enumerable: true });
  1684. // `URL.prototype.toString` method
  1685. // https://url.spec.whatwg.org/#URL-stringification-behavior
  1686. redefine(URLPrototype, 'toString', function toString() {
  1687. return serializeURL.call(this);
  1688. }, { enumerable: true });
  1689. if (NativeURL) {
  1690. var nativeCreateObjectURL = NativeURL.createObjectURL;
  1691. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  1692. // `URL.createObjectURL` method
  1693. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  1694. // eslint-disable-next-line no-unused-vars
  1695. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  1696. return nativeCreateObjectURL.apply(NativeURL, arguments);
  1697. });
  1698. // `URL.revokeObjectURL` method
  1699. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  1700. // eslint-disable-next-line no-unused-vars
  1701. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  1702. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  1703. });
  1704. }
  1705. setToStringTag(URLConstructor, 'URL');
  1706. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  1707. URL: URLConstructor
  1708. });
  1709. /***/ }),
  1710. /***/ "2d00":
  1711. /***/ (function(module, exports, __webpack_require__) {
  1712. var global = __webpack_require__("da84");
  1713. var userAgent = __webpack_require__("342f");
  1714. var process = global.process;
  1715. var versions = process && process.versions;
  1716. var v8 = versions && versions.v8;
  1717. var match, version;
  1718. if (v8) {
  1719. match = v8.split('.');
  1720. version = match[0] + match[1];
  1721. } else if (userAgent) {
  1722. match = userAgent.match(/Edge\/(\d+)/);
  1723. if (!match || match[1] >= 74) {
  1724. match = userAgent.match(/Chrome\/(\d+)/);
  1725. if (match) version = match[1];
  1726. }
  1727. }
  1728. module.exports = version && +version;
  1729. /***/ }),
  1730. /***/ "342f":
  1731. /***/ (function(module, exports, __webpack_require__) {
  1732. var getBuiltIn = __webpack_require__("d066");
  1733. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  1734. /***/ }),
  1735. /***/ "35a1":
  1736. /***/ (function(module, exports, __webpack_require__) {
  1737. var classof = __webpack_require__("f5df");
  1738. var Iterators = __webpack_require__("3f8c");
  1739. var wellKnownSymbol = __webpack_require__("b622");
  1740. var ITERATOR = wellKnownSymbol('iterator');
  1741. module.exports = function (it) {
  1742. if (it != undefined) return it[ITERATOR]
  1743. || it['@@iterator']
  1744. || Iterators[classof(it)];
  1745. };
  1746. /***/ }),
  1747. /***/ "37e8":
  1748. /***/ (function(module, exports, __webpack_require__) {
  1749. var DESCRIPTORS = __webpack_require__("83ab");
  1750. var definePropertyModule = __webpack_require__("9bf2");
  1751. var anObject = __webpack_require__("825a");
  1752. var objectKeys = __webpack_require__("df75");
  1753. // `Object.defineProperties` method
  1754. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  1755. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  1756. anObject(O);
  1757. var keys = objectKeys(Properties);
  1758. var length = keys.length;
  1759. var index = 0;
  1760. var key;
  1761. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  1762. return O;
  1763. };
  1764. /***/ }),
  1765. /***/ "3bbe":
  1766. /***/ (function(module, exports, __webpack_require__) {
  1767. var isObject = __webpack_require__("861d");
  1768. module.exports = function (it) {
  1769. if (!isObject(it) && it !== null) {
  1770. throw TypeError("Can't set " + String(it) + ' as a prototype');
  1771. } return it;
  1772. };
  1773. /***/ }),
  1774. /***/ "3ca3":
  1775. /***/ (function(module, exports, __webpack_require__) {
  1776. "use strict";
  1777. var charAt = __webpack_require__("6547").charAt;
  1778. var InternalStateModule = __webpack_require__("69f3");
  1779. var defineIterator = __webpack_require__("7dd0");
  1780. var STRING_ITERATOR = 'String Iterator';
  1781. var setInternalState = InternalStateModule.set;
  1782. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  1783. // `String.prototype[@@iterator]` method
  1784. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1785. defineIterator(String, 'String', function (iterated) {
  1786. setInternalState(this, {
  1787. type: STRING_ITERATOR,
  1788. string: String(iterated),
  1789. index: 0
  1790. });
  1791. // `%StringIteratorPrototype%.next` method
  1792. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1793. }, function next() {
  1794. var state = getInternalState(this);
  1795. var string = state.string;
  1796. var index = state.index;
  1797. var point;
  1798. if (index >= string.length) return { value: undefined, done: true };
  1799. point = charAt(string, index);
  1800. state.index += point.length;
  1801. return { value: point, done: false };
  1802. });
  1803. /***/ }),
  1804. /***/ "3f8c":
  1805. /***/ (function(module, exports) {
  1806. module.exports = {};
  1807. /***/ }),
  1808. /***/ "408a":
  1809. /***/ (function(module, exports, __webpack_require__) {
  1810. var classof = __webpack_require__("c6b6");
  1811. // `thisNumberValue` abstract operation
  1812. // https://tc39.github.io/ecma262/#sec-thisnumbervalue
  1813. module.exports = function (value) {
  1814. if (typeof value != 'number' && classof(value) != 'Number') {
  1815. throw TypeError('Incorrect invocation');
  1816. }
  1817. return +value;
  1818. };
  1819. /***/ }),
  1820. /***/ "4160":
  1821. /***/ (function(module, exports, __webpack_require__) {
  1822. "use strict";
  1823. var $ = __webpack_require__("23e7");
  1824. var forEach = __webpack_require__("17c2");
  1825. // `Array.prototype.forEach` method
  1826. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  1827. $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
  1828. forEach: forEach
  1829. });
  1830. /***/ }),
  1831. /***/ "428f":
  1832. /***/ (function(module, exports, __webpack_require__) {
  1833. var global = __webpack_require__("da84");
  1834. module.exports = global;
  1835. /***/ }),
  1836. /***/ "44ad":
  1837. /***/ (function(module, exports, __webpack_require__) {
  1838. var fails = __webpack_require__("d039");
  1839. var classof = __webpack_require__("c6b6");
  1840. var split = ''.split;
  1841. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1842. module.exports = fails(function () {
  1843. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1844. // eslint-disable-next-line no-prototype-builtins
  1845. return !Object('z').propertyIsEnumerable(0);
  1846. }) ? function (it) {
  1847. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  1848. } : Object;
  1849. /***/ }),
  1850. /***/ "44d2":
  1851. /***/ (function(module, exports, __webpack_require__) {
  1852. var wellKnownSymbol = __webpack_require__("b622");
  1853. var create = __webpack_require__("7c73");
  1854. var definePropertyModule = __webpack_require__("9bf2");
  1855. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1856. var ArrayPrototype = Array.prototype;
  1857. // Array.prototype[@@unscopables]
  1858. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1859. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1860. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  1861. configurable: true,
  1862. value: create(null)
  1863. });
  1864. }
  1865. // add a key to Array.prototype[@@unscopables]
  1866. module.exports = function (key) {
  1867. ArrayPrototype[UNSCOPABLES][key] = true;
  1868. };
  1869. /***/ }),
  1870. /***/ "44e7":
  1871. /***/ (function(module, exports, __webpack_require__) {
  1872. var isObject = __webpack_require__("861d");
  1873. var classof = __webpack_require__("c6b6");
  1874. var wellKnownSymbol = __webpack_require__("b622");
  1875. var MATCH = wellKnownSymbol('match');
  1876. // `IsRegExp` abstract operation
  1877. // https://tc39.github.io/ecma262/#sec-isregexp
  1878. module.exports = function (it) {
  1879. var isRegExp;
  1880. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
  1881. };
  1882. /***/ }),
  1883. /***/ "45fc":
  1884. /***/ (function(module, exports, __webpack_require__) {
  1885. "use strict";
  1886. var $ = __webpack_require__("23e7");
  1887. var $some = __webpack_require__("b727").some;
  1888. var arrayMethodIsStrict = __webpack_require__("a640");
  1889. var arrayMethodUsesToLength = __webpack_require__("ae40");
  1890. var STRICT_METHOD = arrayMethodIsStrict('some');
  1891. var USES_TO_LENGTH = arrayMethodUsesToLength('some');
  1892. // `Array.prototype.some` method
  1893. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  1894. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
  1895. some: function some(callbackfn /* , thisArg */) {
  1896. return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1897. }
  1898. });
  1899. /***/ }),
  1900. /***/ "466d":
  1901. /***/ (function(module, exports, __webpack_require__) {
  1902. "use strict";
  1903. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  1904. var anObject = __webpack_require__("825a");
  1905. var toLength = __webpack_require__("50c4");
  1906. var requireObjectCoercible = __webpack_require__("1d80");
  1907. var advanceStringIndex = __webpack_require__("8aa5");
  1908. var regExpExec = __webpack_require__("14c3");
  1909. // @@match logic
  1910. fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  1911. return [
  1912. // `String.prototype.match` method
  1913. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  1914. function match(regexp) {
  1915. var O = requireObjectCoercible(this);
  1916. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  1917. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  1918. },
  1919. // `RegExp.prototype[@@match]` method
  1920. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  1921. function (regexp) {
  1922. var res = maybeCallNative(nativeMatch, regexp, this);
  1923. if (res.done) return res.value;
  1924. var rx = anObject(regexp);
  1925. var S = String(this);
  1926. if (!rx.global) return regExpExec(rx, S);
  1927. var fullUnicode = rx.unicode;
  1928. rx.lastIndex = 0;
  1929. var A = [];
  1930. var n = 0;
  1931. var result;
  1932. while ((result = regExpExec(rx, S)) !== null) {
  1933. var matchStr = String(result[0]);
  1934. A[n] = matchStr;
  1935. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1936. n++;
  1937. }
  1938. return n === 0 ? null : A;
  1939. }
  1940. ];
  1941. });
  1942. /***/ }),
  1943. /***/ "4840":
  1944. /***/ (function(module, exports, __webpack_require__) {
  1945. var anObject = __webpack_require__("825a");
  1946. var aFunction = __webpack_require__("1c0b");
  1947. var wellKnownSymbol = __webpack_require__("b622");
  1948. var SPECIES = wellKnownSymbol('species');
  1949. // `SpeciesConstructor` abstract operation
  1950. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  1951. module.exports = function (O, defaultConstructor) {
  1952. var C = anObject(O).constructor;
  1953. var S;
  1954. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
  1955. };
  1956. /***/ }),
  1957. /***/ "4930":
  1958. /***/ (function(module, exports, __webpack_require__) {
  1959. var fails = __webpack_require__("d039");
  1960. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1961. // Chrome 38 Symbol has incorrect toString conversion
  1962. // eslint-disable-next-line no-undef
  1963. return !String(Symbol());
  1964. });
  1965. /***/ }),
  1966. /***/ "498a":
  1967. /***/ (function(module, exports, __webpack_require__) {
  1968. "use strict";
  1969. var $ = __webpack_require__("23e7");
  1970. var $trim = __webpack_require__("58a8").trim;
  1971. var forcedStringTrimMethod = __webpack_require__("c8d2");
  1972. // `String.prototype.trim` method
  1973. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  1974. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  1975. trim: function trim() {
  1976. return $trim(this);
  1977. }
  1978. });
  1979. /***/ }),
  1980. /***/ "4d63":
  1981. /***/ (function(module, exports, __webpack_require__) {
  1982. var DESCRIPTORS = __webpack_require__("83ab");
  1983. var global = __webpack_require__("da84");
  1984. var isForced = __webpack_require__("94ca");
  1985. var inheritIfRequired = __webpack_require__("7156");
  1986. var defineProperty = __webpack_require__("9bf2").f;
  1987. var getOwnPropertyNames = __webpack_require__("241c").f;
  1988. var isRegExp = __webpack_require__("44e7");
  1989. var getFlags = __webpack_require__("ad6d");
  1990. var stickyHelpers = __webpack_require__("9f7f");
  1991. var redefine = __webpack_require__("6eeb");
  1992. var fails = __webpack_require__("d039");
  1993. var setInternalState = __webpack_require__("69f3").set;
  1994. var setSpecies = __webpack_require__("2626");
  1995. var wellKnownSymbol = __webpack_require__("b622");
  1996. var MATCH = wellKnownSymbol('match');
  1997. var NativeRegExp = global.RegExp;
  1998. var RegExpPrototype = NativeRegExp.prototype;
  1999. var re1 = /a/g;
  2000. var re2 = /a/g;
  2001. // "new" should create a new object, old webkit bug
  2002. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2003. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  2004. var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
  2005. re2[MATCH] = false;
  2006. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2007. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  2008. })));
  2009. // `RegExp` constructor
  2010. // https://tc39.github.io/ecma262/#sec-regexp-constructor
  2011. if (FORCED) {
  2012. var RegExpWrapper = function RegExp(pattern, flags) {
  2013. var thisIsRegExp = this instanceof RegExpWrapper;
  2014. var patternIsRegExp = isRegExp(pattern);
  2015. var flagsAreUndefined = flags === undefined;
  2016. var sticky;
  2017. if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
  2018. return pattern;
  2019. }
  2020. if (CORRECT_NEW) {
  2021. if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
  2022. } else if (pattern instanceof RegExpWrapper) {
  2023. if (flagsAreUndefined) flags = getFlags.call(pattern);
  2024. pattern = pattern.source;
  2025. }
  2026. if (UNSUPPORTED_Y) {
  2027. sticky = !!flags && flags.indexOf('y') > -1;
  2028. if (sticky) flags = flags.replace(/y/g, '');
  2029. }
  2030. var result = inheritIfRequired(
  2031. CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
  2032. thisIsRegExp ? this : RegExpPrototype,
  2033. RegExpWrapper
  2034. );
  2035. if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
  2036. return result;
  2037. };
  2038. var proxy = function (key) {
  2039. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  2040. configurable: true,
  2041. get: function () { return NativeRegExp[key]; },
  2042. set: function (it) { NativeRegExp[key] = it; }
  2043. });
  2044. };
  2045. var keys = getOwnPropertyNames(NativeRegExp);
  2046. var index = 0;
  2047. while (keys.length > index) proxy(keys[index++]);
  2048. RegExpPrototype.constructor = RegExpWrapper;
  2049. RegExpWrapper.prototype = RegExpPrototype;
  2050. redefine(global, 'RegExp', RegExpWrapper);
  2051. }
  2052. // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
  2053. setSpecies('RegExp');
  2054. /***/ }),
  2055. /***/ "4d64":
  2056. /***/ (function(module, exports, __webpack_require__) {
  2057. var toIndexedObject = __webpack_require__("fc6a");
  2058. var toLength = __webpack_require__("50c4");
  2059. var toAbsoluteIndex = __webpack_require__("23cb");
  2060. // `Array.prototype.{ indexOf, includes }` methods implementation
  2061. var createMethod = function (IS_INCLUDES) {
  2062. return function ($this, el, fromIndex) {
  2063. var O = toIndexedObject($this);
  2064. var length = toLength(O.length);
  2065. var index = toAbsoluteIndex(fromIndex, length);
  2066. var value;
  2067. // Array#includes uses SameValueZero equality algorithm
  2068. // eslint-disable-next-line no-self-compare
  2069. if (IS_INCLUDES && el != el) while (length > index) {
  2070. value = O[index++];
  2071. // eslint-disable-next-line no-self-compare
  2072. if (value != value) return true;
  2073. // Array#indexOf ignores holes, Array#includes - not
  2074. } else for (;length > index; index++) {
  2075. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  2076. } return !IS_INCLUDES && -1;
  2077. };
  2078. };
  2079. module.exports = {
  2080. // `Array.prototype.includes` method
  2081. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  2082. includes: createMethod(true),
  2083. // `Array.prototype.indexOf` method
  2084. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  2085. indexOf: createMethod(false)
  2086. };
  2087. /***/ }),
  2088. /***/ "4d90":
  2089. /***/ (function(module, exports, __webpack_require__) {
  2090. "use strict";
  2091. var $ = __webpack_require__("23e7");
  2092. var $padStart = __webpack_require__("0ccb").start;
  2093. var WEBKIT_BUG = __webpack_require__("9a0c");
  2094. // `String.prototype.padStart` method
  2095. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  2096. $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  2097. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  2098. return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  2099. }
  2100. });
  2101. /***/ }),
  2102. /***/ "4de4":
  2103. /***/ (function(module, exports, __webpack_require__) {
  2104. "use strict";
  2105. var $ = __webpack_require__("23e7");
  2106. var $filter = __webpack_require__("b727").filter;
  2107. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  2108. var arrayMethodUsesToLength = __webpack_require__("ae40");
  2109. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  2110. // Edge 14- issue
  2111. var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
  2112. // `Array.prototype.filter` method
  2113. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  2114. // with adding support of @@species
  2115. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  2116. filter: function filter(callbackfn /* , thisArg */) {
  2117. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2118. }
  2119. });
  2120. /***/ }),
  2121. /***/ "4df4":
  2122. /***/ (function(module, exports, __webpack_require__) {
  2123. "use strict";
  2124. var bind = __webpack_require__("0366");
  2125. var toObject = __webpack_require__("7b0b");
  2126. var callWithSafeIterationClosing = __webpack_require__("9bdd");
  2127. var isArrayIteratorMethod = __webpack_require__("e95a");
  2128. var toLength = __webpack_require__("50c4");
  2129. var createProperty = __webpack_require__("8418");
  2130. var getIteratorMethod = __webpack_require__("35a1");
  2131. // `Array.from` method implementation
  2132. // https://tc39.github.io/ecma262/#sec-array.from
  2133. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2134. var O = toObject(arrayLike);
  2135. var C = typeof this == 'function' ? this : Array;
  2136. var argumentsLength = arguments.length;
  2137. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  2138. var mapping = mapfn !== undefined;
  2139. var iteratorMethod = getIteratorMethod(O);
  2140. var index = 0;
  2141. var length, result, step, iterator, next, value;
  2142. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  2143. // if the target is not iterable or it's an array with the default iterator - use a simple case
  2144. if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
  2145. iterator = iteratorMethod.call(O);
  2146. next = iterator.next;
  2147. result = new C();
  2148. for (;!(step = next.call(iterator)).done; index++) {
  2149. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  2150. createProperty(result, index, value);
  2151. }
  2152. } else {
  2153. length = toLength(O.length);
  2154. result = new C(length);
  2155. for (;length > index; index++) {
  2156. value = mapping ? mapfn(O[index], index) : O[index];
  2157. createProperty(result, index, value);
  2158. }
  2159. }
  2160. result.length = index;
  2161. return result;
  2162. };
  2163. /***/ }),
  2164. /***/ "4ec9":
  2165. /***/ (function(module, exports, __webpack_require__) {
  2166. "use strict";
  2167. var collection = __webpack_require__("6d61");
  2168. var collectionStrong = __webpack_require__("6566");
  2169. // `Map` constructor
  2170. // https://tc39.github.io/ecma262/#sec-map-objects
  2171. module.exports = collection('Map', function (init) {
  2172. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  2173. }, collectionStrong);
  2174. /***/ }),
  2175. /***/ "50c4":
  2176. /***/ (function(module, exports, __webpack_require__) {
  2177. var toInteger = __webpack_require__("a691");
  2178. var min = Math.min;
  2179. // `ToLength` abstract operation
  2180. // https://tc39.github.io/ecma262/#sec-tolength
  2181. module.exports = function (argument) {
  2182. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  2183. };
  2184. /***/ }),
  2185. /***/ "5135":
  2186. /***/ (function(module, exports) {
  2187. var hasOwnProperty = {}.hasOwnProperty;
  2188. module.exports = function (it, key) {
  2189. return hasOwnProperty.call(it, key);
  2190. };
  2191. /***/ }),
  2192. /***/ "5319":
  2193. /***/ (function(module, exports, __webpack_require__) {
  2194. "use strict";
  2195. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2196. var anObject = __webpack_require__("825a");
  2197. var toObject = __webpack_require__("7b0b");
  2198. var toLength = __webpack_require__("50c4");
  2199. var toInteger = __webpack_require__("a691");
  2200. var requireObjectCoercible = __webpack_require__("1d80");
  2201. var advanceStringIndex = __webpack_require__("8aa5");
  2202. var regExpExec = __webpack_require__("14c3");
  2203. var max = Math.max;
  2204. var min = Math.min;
  2205. var floor = Math.floor;
  2206. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  2207. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  2208. var maybeToString = function (it) {
  2209. return it === undefined ? it : String(it);
  2210. };
  2211. // @@replace logic
  2212. fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  2213. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  2214. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  2215. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2216. return [
  2217. // `String.prototype.replace` method
  2218. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  2219. function replace(searchValue, replaceValue) {
  2220. var O = requireObjectCoercible(this);
  2221. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  2222. return replacer !== undefined
  2223. ? replacer.call(searchValue, O, replaceValue)
  2224. : nativeReplace.call(String(O), searchValue, replaceValue);
  2225. },
  2226. // `RegExp.prototype[@@replace]` method
  2227. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  2228. function (regexp, replaceValue) {
  2229. if (
  2230. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  2231. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  2232. ) {
  2233. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  2234. if (res.done) return res.value;
  2235. }
  2236. var rx = anObject(regexp);
  2237. var S = String(this);
  2238. var functionalReplace = typeof replaceValue === 'function';
  2239. if (!functionalReplace) replaceValue = String(replaceValue);
  2240. var global = rx.global;
  2241. if (global) {
  2242. var fullUnicode = rx.unicode;
  2243. rx.lastIndex = 0;
  2244. }
  2245. var results = [];
  2246. while (true) {
  2247. var result = regExpExec(rx, S);
  2248. if (result === null) break;
  2249. results.push(result);
  2250. if (!global) break;
  2251. var matchStr = String(result[0]);
  2252. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2253. }
  2254. var accumulatedResult = '';
  2255. var nextSourcePosition = 0;
  2256. for (var i = 0; i < results.length; i++) {
  2257. result = results[i];
  2258. var matched = String(result[0]);
  2259. var position = max(min(toInteger(result.index), S.length), 0);
  2260. var captures = [];
  2261. // NOTE: This is equivalent to
  2262. // captures = result.slice(1).map(maybeToString)
  2263. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2264. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2265. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2266. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  2267. var namedCaptures = result.groups;
  2268. if (functionalReplace) {
  2269. var replacerArgs = [matched].concat(captures, position, S);
  2270. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  2271. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  2272. } else {
  2273. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2274. }
  2275. if (position >= nextSourcePosition) {
  2276. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  2277. nextSourcePosition = position + matched.length;
  2278. }
  2279. }
  2280. return accumulatedResult + S.slice(nextSourcePosition);
  2281. }
  2282. ];
  2283. // https://tc39.github.io/ecma262/#sec-getsubstitution
  2284. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  2285. var tailPos = position + matched.length;
  2286. var m = captures.length;
  2287. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2288. if (namedCaptures !== undefined) {
  2289. namedCaptures = toObject(namedCaptures);
  2290. symbols = SUBSTITUTION_SYMBOLS;
  2291. }
  2292. return nativeReplace.call(replacement, symbols, function (match, ch) {
  2293. var capture;
  2294. switch (ch.charAt(0)) {
  2295. case '$': return '$';
  2296. case '&': return matched;
  2297. case '`': return str.slice(0, position);
  2298. case "'": return str.slice(tailPos);
  2299. case '<':
  2300. capture = namedCaptures[ch.slice(1, -1)];
  2301. break;
  2302. default: // \d\d?
  2303. var n = +ch;
  2304. if (n === 0) return match;
  2305. if (n > m) {
  2306. var f = floor(n / 10);
  2307. if (f === 0) return match;
  2308. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  2309. return match;
  2310. }
  2311. capture = captures[n - 1];
  2312. }
  2313. return capture === undefined ? '' : capture;
  2314. });
  2315. }
  2316. });
  2317. /***/ }),
  2318. /***/ "5692":
  2319. /***/ (function(module, exports, __webpack_require__) {
  2320. var IS_PURE = __webpack_require__("c430");
  2321. var store = __webpack_require__("c6cd");
  2322. (module.exports = function (key, value) {
  2323. return store[key] || (store[key] = value !== undefined ? value : {});
  2324. })('versions', []).push({
  2325. version: '3.8.1',
  2326. mode: IS_PURE ? 'pure' : 'global',
  2327. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  2328. });
  2329. /***/ }),
  2330. /***/ "56ef":
  2331. /***/ (function(module, exports, __webpack_require__) {
  2332. var getBuiltIn = __webpack_require__("d066");
  2333. var getOwnPropertyNamesModule = __webpack_require__("241c");
  2334. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2335. var anObject = __webpack_require__("825a");
  2336. // all object keys, includes non-enumerable and symbols
  2337. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  2338. var keys = getOwnPropertyNamesModule.f(anObject(it));
  2339. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2340. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  2341. };
  2342. /***/ }),
  2343. /***/ "5899":
  2344. /***/ (function(module, exports) {
  2345. // a string of all valid unicode whitespaces
  2346. // eslint-disable-next-line max-len
  2347. 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';
  2348. /***/ }),
  2349. /***/ "58a8":
  2350. /***/ (function(module, exports, __webpack_require__) {
  2351. var requireObjectCoercible = __webpack_require__("1d80");
  2352. var whitespaces = __webpack_require__("5899");
  2353. var whitespace = '[' + whitespaces + ']';
  2354. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  2355. var rtrim = RegExp(whitespace + whitespace + '*$');
  2356. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2357. var createMethod = function (TYPE) {
  2358. return function ($this) {
  2359. var string = String(requireObjectCoercible($this));
  2360. if (TYPE & 1) string = string.replace(ltrim, '');
  2361. if (TYPE & 2) string = string.replace(rtrim, '');
  2362. return string;
  2363. };
  2364. };
  2365. module.exports = {
  2366. // `String.prototype.{ trimLeft, trimStart }` methods
  2367. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  2368. start: createMethod(1),
  2369. // `String.prototype.{ trimRight, trimEnd }` methods
  2370. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  2371. end: createMethod(2),
  2372. // `String.prototype.trim` method
  2373. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  2374. trim: createMethod(3)
  2375. };
  2376. /***/ }),
  2377. /***/ "5a34":
  2378. /***/ (function(module, exports, __webpack_require__) {
  2379. var isRegExp = __webpack_require__("44e7");
  2380. module.exports = function (it) {
  2381. if (isRegExp(it)) {
  2382. throw TypeError("The method doesn't accept regular expressions");
  2383. } return it;
  2384. };
  2385. /***/ }),
  2386. /***/ "5c6c":
  2387. /***/ (function(module, exports) {
  2388. module.exports = function (bitmap, value) {
  2389. return {
  2390. enumerable: !(bitmap & 1),
  2391. configurable: !(bitmap & 2),
  2392. writable: !(bitmap & 4),
  2393. value: value
  2394. };
  2395. };
  2396. /***/ }),
  2397. /***/ "5fb2":
  2398. /***/ (function(module, exports, __webpack_require__) {
  2399. "use strict";
  2400. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  2401. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  2402. var base = 36;
  2403. var tMin = 1;
  2404. var tMax = 26;
  2405. var skew = 38;
  2406. var damp = 700;
  2407. var initialBias = 72;
  2408. var initialN = 128; // 0x80
  2409. var delimiter = '-'; // '\x2D'
  2410. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  2411. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  2412. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  2413. var baseMinusTMin = base - tMin;
  2414. var floor = Math.floor;
  2415. var stringFromCharCode = String.fromCharCode;
  2416. /**
  2417. * Creates an array containing the numeric code points of each Unicode
  2418. * character in the string. While JavaScript uses UCS-2 internally,
  2419. * this function will convert a pair of surrogate halves (each of which
  2420. * UCS-2 exposes as separate characters) into a single code point,
  2421. * matching UTF-16.
  2422. */
  2423. var ucs2decode = function (string) {
  2424. var output = [];
  2425. var counter = 0;
  2426. var length = string.length;
  2427. while (counter < length) {
  2428. var value = string.charCodeAt(counter++);
  2429. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  2430. // It's a high surrogate, and there is a next character.
  2431. var extra = string.charCodeAt(counter++);
  2432. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  2433. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  2434. } else {
  2435. // It's an unmatched surrogate; only append this code unit, in case the
  2436. // next code unit is the high surrogate of a surrogate pair.
  2437. output.push(value);
  2438. counter--;
  2439. }
  2440. } else {
  2441. output.push(value);
  2442. }
  2443. }
  2444. return output;
  2445. };
  2446. /**
  2447. * Converts a digit/integer into a basic code point.
  2448. */
  2449. var digitToBasic = function (digit) {
  2450. // 0..25 map to ASCII a..z or A..Z
  2451. // 26..35 map to ASCII 0..9
  2452. return digit + 22 + 75 * (digit < 26);
  2453. };
  2454. /**
  2455. * Bias adaptation function as per section 3.4 of RFC 3492.
  2456. * https://tools.ietf.org/html/rfc3492#section-3.4
  2457. */
  2458. var adapt = function (delta, numPoints, firstTime) {
  2459. var k = 0;
  2460. delta = firstTime ? floor(delta / damp) : delta >> 1;
  2461. delta += floor(delta / numPoints);
  2462. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  2463. delta = floor(delta / baseMinusTMin);
  2464. }
  2465. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  2466. };
  2467. /**
  2468. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  2469. * Punycode string of ASCII-only symbols.
  2470. */
  2471. // eslint-disable-next-line max-statements
  2472. var encode = function (input) {
  2473. var output = [];
  2474. // Convert the input in UCS-2 to an array of Unicode code points.
  2475. input = ucs2decode(input);
  2476. // Cache the length.
  2477. var inputLength = input.length;
  2478. // Initialize the state.
  2479. var n = initialN;
  2480. var delta = 0;
  2481. var bias = initialBias;
  2482. var i, currentValue;
  2483. // Handle the basic code points.
  2484. for (i = 0; i < input.length; i++) {
  2485. currentValue = input[i];
  2486. if (currentValue < 0x80) {
  2487. output.push(stringFromCharCode(currentValue));
  2488. }
  2489. }
  2490. var basicLength = output.length; // number of basic code points.
  2491. var handledCPCount = basicLength; // number of code points that have been handled;
  2492. // Finish the basic string with a delimiter unless it's empty.
  2493. if (basicLength) {
  2494. output.push(delimiter);
  2495. }
  2496. // Main encoding loop:
  2497. while (handledCPCount < inputLength) {
  2498. // All non-basic code points < n have been handled already. Find the next larger one:
  2499. var m = maxInt;
  2500. for (i = 0; i < input.length; i++) {
  2501. currentValue = input[i];
  2502. if (currentValue >= n && currentValue < m) {
  2503. m = currentValue;
  2504. }
  2505. }
  2506. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  2507. var handledCPCountPlusOne = handledCPCount + 1;
  2508. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  2509. throw RangeError(OVERFLOW_ERROR);
  2510. }
  2511. delta += (m - n) * handledCPCountPlusOne;
  2512. n = m;
  2513. for (i = 0; i < input.length; i++) {
  2514. currentValue = input[i];
  2515. if (currentValue < n && ++delta > maxInt) {
  2516. throw RangeError(OVERFLOW_ERROR);
  2517. }
  2518. if (currentValue == n) {
  2519. // Represent delta as a generalized variable-length integer.
  2520. var q = delta;
  2521. for (var k = base; /* no condition */; k += base) {
  2522. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  2523. if (q < t) break;
  2524. var qMinusT = q - t;
  2525. var baseMinusT = base - t;
  2526. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  2527. q = floor(qMinusT / baseMinusT);
  2528. }
  2529. output.push(stringFromCharCode(digitToBasic(q)));
  2530. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  2531. delta = 0;
  2532. ++handledCPCount;
  2533. }
  2534. }
  2535. ++delta;
  2536. ++n;
  2537. }
  2538. return output.join('');
  2539. };
  2540. module.exports = function (input) {
  2541. var encoded = [];
  2542. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  2543. var i, label;
  2544. for (i = 0; i < labels.length; i++) {
  2545. label = labels[i];
  2546. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  2547. }
  2548. return encoded.join('.');
  2549. };
  2550. /***/ }),
  2551. /***/ "605d":
  2552. /***/ (function(module, exports, __webpack_require__) {
  2553. var classof = __webpack_require__("c6b6");
  2554. var global = __webpack_require__("da84");
  2555. module.exports = classof(global.process) == 'process';
  2556. /***/ }),
  2557. /***/ "60da":
  2558. /***/ (function(module, exports, __webpack_require__) {
  2559. "use strict";
  2560. var DESCRIPTORS = __webpack_require__("83ab");
  2561. var fails = __webpack_require__("d039");
  2562. var objectKeys = __webpack_require__("df75");
  2563. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2564. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  2565. var toObject = __webpack_require__("7b0b");
  2566. var IndexedObject = __webpack_require__("44ad");
  2567. var nativeAssign = Object.assign;
  2568. var defineProperty = Object.defineProperty;
  2569. // `Object.assign` method
  2570. // https://tc39.github.io/ecma262/#sec-object.assign
  2571. module.exports = !nativeAssign || fails(function () {
  2572. // should have correct order of operations (Edge bug)
  2573. if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  2574. enumerable: true,
  2575. get: function () {
  2576. defineProperty(this, 'b', {
  2577. value: 3,
  2578. enumerable: false
  2579. });
  2580. }
  2581. }), { b: 2 })).b !== 1) return true;
  2582. // should work with symbols and should have deterministic property order (V8 bug)
  2583. var A = {};
  2584. var B = {};
  2585. // eslint-disable-next-line no-undef
  2586. var symbol = Symbol();
  2587. var alphabet = 'abcdefghijklmnopqrst';
  2588. A[symbol] = 7;
  2589. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  2590. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  2591. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  2592. var T = toObject(target);
  2593. var argumentsLength = arguments.length;
  2594. var index = 1;
  2595. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2596. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  2597. while (argumentsLength > index) {
  2598. var S = IndexedObject(arguments[index++]);
  2599. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  2600. var length = keys.length;
  2601. var j = 0;
  2602. var key;
  2603. while (length > j) {
  2604. key = keys[j++];
  2605. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  2606. }
  2607. } return T;
  2608. } : nativeAssign;
  2609. /***/ }),
  2610. /***/ "6547":
  2611. /***/ (function(module, exports, __webpack_require__) {
  2612. var toInteger = __webpack_require__("a691");
  2613. var requireObjectCoercible = __webpack_require__("1d80");
  2614. // `String.prototype.{ codePointAt, at }` methods implementation
  2615. var createMethod = function (CONVERT_TO_STRING) {
  2616. return function ($this, pos) {
  2617. var S = String(requireObjectCoercible($this));
  2618. var position = toInteger(pos);
  2619. var size = S.length;
  2620. var first, second;
  2621. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2622. first = S.charCodeAt(position);
  2623. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2624. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  2625. ? CONVERT_TO_STRING ? S.charAt(position) : first
  2626. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2627. };
  2628. };
  2629. module.exports = {
  2630. // `String.prototype.codePointAt` method
  2631. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  2632. codeAt: createMethod(false),
  2633. // `String.prototype.at` method
  2634. // https://github.com/mathiasbynens/String.prototype.at
  2635. charAt: createMethod(true)
  2636. };
  2637. /***/ }),
  2638. /***/ "6566":
  2639. /***/ (function(module, exports, __webpack_require__) {
  2640. "use strict";
  2641. var defineProperty = __webpack_require__("9bf2").f;
  2642. var create = __webpack_require__("7c73");
  2643. var redefineAll = __webpack_require__("e2cc");
  2644. var bind = __webpack_require__("0366");
  2645. var anInstance = __webpack_require__("19aa");
  2646. var iterate = __webpack_require__("2266");
  2647. var defineIterator = __webpack_require__("7dd0");
  2648. var setSpecies = __webpack_require__("2626");
  2649. var DESCRIPTORS = __webpack_require__("83ab");
  2650. var fastKey = __webpack_require__("f183").fastKey;
  2651. var InternalStateModule = __webpack_require__("69f3");
  2652. var setInternalState = InternalStateModule.set;
  2653. var internalStateGetterFor = InternalStateModule.getterFor;
  2654. module.exports = {
  2655. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  2656. var C = wrapper(function (that, iterable) {
  2657. anInstance(that, C, CONSTRUCTOR_NAME);
  2658. setInternalState(that, {
  2659. type: CONSTRUCTOR_NAME,
  2660. index: create(null),
  2661. first: undefined,
  2662. last: undefined,
  2663. size: 0
  2664. });
  2665. if (!DESCRIPTORS) that.size = 0;
  2666. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  2667. });
  2668. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2669. var define = function (that, key, value) {
  2670. var state = getInternalState(that);
  2671. var entry = getEntry(that, key);
  2672. var previous, index;
  2673. // change existing entry
  2674. if (entry) {
  2675. entry.value = value;
  2676. // create new entry
  2677. } else {
  2678. state.last = entry = {
  2679. index: index = fastKey(key, true),
  2680. key: key,
  2681. value: value,
  2682. previous: previous = state.last,
  2683. next: undefined,
  2684. removed: false
  2685. };
  2686. if (!state.first) state.first = entry;
  2687. if (previous) previous.next = entry;
  2688. if (DESCRIPTORS) state.size++;
  2689. else that.size++;
  2690. // add to index
  2691. if (index !== 'F') state.index[index] = entry;
  2692. } return that;
  2693. };
  2694. var getEntry = function (that, key) {
  2695. var state = getInternalState(that);
  2696. // fast case
  2697. var index = fastKey(key);
  2698. var entry;
  2699. if (index !== 'F') return state.index[index];
  2700. // frozen object case
  2701. for (entry = state.first; entry; entry = entry.next) {
  2702. if (entry.key == key) return entry;
  2703. }
  2704. };
  2705. redefineAll(C.prototype, {
  2706. // 23.1.3.1 Map.prototype.clear()
  2707. // 23.2.3.2 Set.prototype.clear()
  2708. clear: function clear() {
  2709. var that = this;
  2710. var state = getInternalState(that);
  2711. var data = state.index;
  2712. var entry = state.first;
  2713. while (entry) {
  2714. entry.removed = true;
  2715. if (entry.previous) entry.previous = entry.previous.next = undefined;
  2716. delete data[entry.index];
  2717. entry = entry.next;
  2718. }
  2719. state.first = state.last = undefined;
  2720. if (DESCRIPTORS) state.size = 0;
  2721. else that.size = 0;
  2722. },
  2723. // 23.1.3.3 Map.prototype.delete(key)
  2724. // 23.2.3.4 Set.prototype.delete(value)
  2725. 'delete': function (key) {
  2726. var that = this;
  2727. var state = getInternalState(that);
  2728. var entry = getEntry(that, key);
  2729. if (entry) {
  2730. var next = entry.next;
  2731. var prev = entry.previous;
  2732. delete state.index[entry.index];
  2733. entry.removed = true;
  2734. if (prev) prev.next = next;
  2735. if (next) next.previous = prev;
  2736. if (state.first == entry) state.first = next;
  2737. if (state.last == entry) state.last = prev;
  2738. if (DESCRIPTORS) state.size--;
  2739. else that.size--;
  2740. } return !!entry;
  2741. },
  2742. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  2743. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  2744. forEach: function forEach(callbackfn /* , that = undefined */) {
  2745. var state = getInternalState(this);
  2746. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  2747. var entry;
  2748. while (entry = entry ? entry.next : state.first) {
  2749. boundFunction(entry.value, entry.key, this);
  2750. // revert to the last existing entry
  2751. while (entry && entry.removed) entry = entry.previous;
  2752. }
  2753. },
  2754. // 23.1.3.7 Map.prototype.has(key)
  2755. // 23.2.3.7 Set.prototype.has(value)
  2756. has: function has(key) {
  2757. return !!getEntry(this, key);
  2758. }
  2759. });
  2760. redefineAll(C.prototype, IS_MAP ? {
  2761. // 23.1.3.6 Map.prototype.get(key)
  2762. get: function get(key) {
  2763. var entry = getEntry(this, key);
  2764. return entry && entry.value;
  2765. },
  2766. // 23.1.3.9 Map.prototype.set(key, value)
  2767. set: function set(key, value) {
  2768. return define(this, key === 0 ? 0 : key, value);
  2769. }
  2770. } : {
  2771. // 23.2.3.1 Set.prototype.add(value)
  2772. add: function add(value) {
  2773. return define(this, value = value === 0 ? 0 : value, value);
  2774. }
  2775. });
  2776. if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
  2777. get: function () {
  2778. return getInternalState(this).size;
  2779. }
  2780. });
  2781. return C;
  2782. },
  2783. setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
  2784. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  2785. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2786. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  2787. // add .keys, .values, .entries, [@@iterator]
  2788. // 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
  2789. defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
  2790. setInternalState(this, {
  2791. type: ITERATOR_NAME,
  2792. target: iterated,
  2793. state: getInternalCollectionState(iterated),
  2794. kind: kind,
  2795. last: undefined
  2796. });
  2797. }, function () {
  2798. var state = getInternalIteratorState(this);
  2799. var kind = state.kind;
  2800. var entry = state.last;
  2801. // revert to the last existing entry
  2802. while (entry && entry.removed) entry = entry.previous;
  2803. // get next entry
  2804. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  2805. // or finish the iteration
  2806. state.target = undefined;
  2807. return { value: undefined, done: true };
  2808. }
  2809. // return step by kind
  2810. if (kind == 'keys') return { value: entry.key, done: false };
  2811. if (kind == 'values') return { value: entry.value, done: false };
  2812. return { value: [entry.key, entry.value], done: false };
  2813. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  2814. // add [@@species], 23.1.2.2, 23.2.2.2
  2815. setSpecies(CONSTRUCTOR_NAME);
  2816. }
  2817. };
  2818. /***/ }),
  2819. /***/ "65f0":
  2820. /***/ (function(module, exports, __webpack_require__) {
  2821. var isObject = __webpack_require__("861d");
  2822. var isArray = __webpack_require__("e8b5");
  2823. var wellKnownSymbol = __webpack_require__("b622");
  2824. var SPECIES = wellKnownSymbol('species');
  2825. // `ArraySpeciesCreate` abstract operation
  2826. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  2827. module.exports = function (originalArray, length) {
  2828. var C;
  2829. if (isArray(originalArray)) {
  2830. C = originalArray.constructor;
  2831. // cross-realm fallback
  2832. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2833. else if (isObject(C)) {
  2834. C = C[SPECIES];
  2835. if (C === null) C = undefined;
  2836. }
  2837. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  2838. };
  2839. /***/ }),
  2840. /***/ "69f3":
  2841. /***/ (function(module, exports, __webpack_require__) {
  2842. var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
  2843. var global = __webpack_require__("da84");
  2844. var isObject = __webpack_require__("861d");
  2845. var createNonEnumerableProperty = __webpack_require__("9112");
  2846. var objectHas = __webpack_require__("5135");
  2847. var shared = __webpack_require__("c6cd");
  2848. var sharedKey = __webpack_require__("f772");
  2849. var hiddenKeys = __webpack_require__("d012");
  2850. var WeakMap = global.WeakMap;
  2851. var set, get, has;
  2852. var enforce = function (it) {
  2853. return has(it) ? get(it) : set(it, {});
  2854. };
  2855. var getterFor = function (TYPE) {
  2856. return function (it) {
  2857. var state;
  2858. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  2859. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  2860. } return state;
  2861. };
  2862. };
  2863. if (NATIVE_WEAK_MAP) {
  2864. var store = shared.state || (shared.state = new WeakMap());
  2865. var wmget = store.get;
  2866. var wmhas = store.has;
  2867. var wmset = store.set;
  2868. set = function (it, metadata) {
  2869. metadata.facade = it;
  2870. wmset.call(store, it, metadata);
  2871. return metadata;
  2872. };
  2873. get = function (it) {
  2874. return wmget.call(store, it) || {};
  2875. };
  2876. has = function (it) {
  2877. return wmhas.call(store, it);
  2878. };
  2879. } else {
  2880. var STATE = sharedKey('state');
  2881. hiddenKeys[STATE] = true;
  2882. set = function (it, metadata) {
  2883. metadata.facade = it;
  2884. createNonEnumerableProperty(it, STATE, metadata);
  2885. return metadata;
  2886. };
  2887. get = function (it) {
  2888. return objectHas(it, STATE) ? it[STATE] : {};
  2889. };
  2890. has = function (it) {
  2891. return objectHas(it, STATE);
  2892. };
  2893. }
  2894. module.exports = {
  2895. set: set,
  2896. get: get,
  2897. has: has,
  2898. enforce: enforce,
  2899. getterFor: getterFor
  2900. };
  2901. /***/ }),
  2902. /***/ "6d61":
  2903. /***/ (function(module, exports, __webpack_require__) {
  2904. "use strict";
  2905. var $ = __webpack_require__("23e7");
  2906. var global = __webpack_require__("da84");
  2907. var isForced = __webpack_require__("94ca");
  2908. var redefine = __webpack_require__("6eeb");
  2909. var InternalMetadataModule = __webpack_require__("f183");
  2910. var iterate = __webpack_require__("2266");
  2911. var anInstance = __webpack_require__("19aa");
  2912. var isObject = __webpack_require__("861d");
  2913. var fails = __webpack_require__("d039");
  2914. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  2915. var setToStringTag = __webpack_require__("d44e");
  2916. var inheritIfRequired = __webpack_require__("7156");
  2917. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  2918. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  2919. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  2920. var ADDER = IS_MAP ? 'set' : 'add';
  2921. var NativeConstructor = global[CONSTRUCTOR_NAME];
  2922. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  2923. var Constructor = NativeConstructor;
  2924. var exported = {};
  2925. var fixMethod = function (KEY) {
  2926. var nativeMethod = NativePrototype[KEY];
  2927. redefine(NativePrototype, KEY,
  2928. KEY == 'add' ? function add(value) {
  2929. nativeMethod.call(this, value === 0 ? 0 : value);
  2930. return this;
  2931. } : KEY == 'delete' ? function (key) {
  2932. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  2933. } : KEY == 'get' ? function get(key) {
  2934. return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
  2935. } : KEY == 'has' ? function has(key) {
  2936. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  2937. } : function set(key, value) {
  2938. nativeMethod.call(this, key === 0 ? 0 : key, value);
  2939. return this;
  2940. }
  2941. );
  2942. };
  2943. // eslint-disable-next-line max-len
  2944. if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
  2945. new NativeConstructor().entries().next();
  2946. })))) {
  2947. // create collection constructor
  2948. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  2949. InternalMetadataModule.REQUIRED = true;
  2950. } else if (isForced(CONSTRUCTOR_NAME, true)) {
  2951. var instance = new Constructor();
  2952. // early implementations not supports chaining
  2953. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  2954. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  2955. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  2956. // most early implementations doesn't supports iterables, most modern - not close it correctly
  2957. // eslint-disable-next-line no-new
  2958. var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
  2959. // for early implementations -0 and +0 not the same
  2960. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  2961. // V8 ~ Chromium 42- fails only with 5+ elements
  2962. var $instance = new NativeConstructor();
  2963. var index = 5;
  2964. while (index--) $instance[ADDER](index, index);
  2965. return !$instance.has(-0);
  2966. });
  2967. if (!ACCEPT_ITERABLES) {
  2968. Constructor = wrapper(function (dummy, iterable) {
  2969. anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
  2970. var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
  2971. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  2972. return that;
  2973. });
  2974. Constructor.prototype = NativePrototype;
  2975. NativePrototype.constructor = Constructor;
  2976. }
  2977. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  2978. fixMethod('delete');
  2979. fixMethod('has');
  2980. IS_MAP && fixMethod('get');
  2981. }
  2982. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  2983. // weak collections should not contains .clear method
  2984. if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
  2985. }
  2986. exported[CONSTRUCTOR_NAME] = Constructor;
  2987. $({ global: true, forced: Constructor != NativeConstructor }, exported);
  2988. setToStringTag(Constructor, CONSTRUCTOR_NAME);
  2989. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  2990. return Constructor;
  2991. };
  2992. /***/ }),
  2993. /***/ "6eeb":
  2994. /***/ (function(module, exports, __webpack_require__) {
  2995. var global = __webpack_require__("da84");
  2996. var createNonEnumerableProperty = __webpack_require__("9112");
  2997. var has = __webpack_require__("5135");
  2998. var setGlobal = __webpack_require__("ce4e");
  2999. var inspectSource = __webpack_require__("8925");
  3000. var InternalStateModule = __webpack_require__("69f3");
  3001. var getInternalState = InternalStateModule.get;
  3002. var enforceInternalState = InternalStateModule.enforce;
  3003. var TEMPLATE = String(String).split('String');
  3004. (module.exports = function (O, key, value, options) {
  3005. var unsafe = options ? !!options.unsafe : false;
  3006. var simple = options ? !!options.enumerable : false;
  3007. var noTargetGet = options ? !!options.noTargetGet : false;
  3008. var state;
  3009. if (typeof value == 'function') {
  3010. if (typeof key == 'string' && !has(value, 'name')) {
  3011. createNonEnumerableProperty(value, 'name', key);
  3012. }
  3013. state = enforceInternalState(value);
  3014. if (!state.source) {
  3015. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  3016. }
  3017. }
  3018. if (O === global) {
  3019. if (simple) O[key] = value;
  3020. else setGlobal(key, value);
  3021. return;
  3022. } else if (!unsafe) {
  3023. delete O[key];
  3024. } else if (!noTargetGet && O[key]) {
  3025. simple = true;
  3026. }
  3027. if (simple) O[key] = value;
  3028. else createNonEnumerableProperty(O, key, value);
  3029. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  3030. })(Function.prototype, 'toString', function toString() {
  3031. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  3032. });
  3033. /***/ }),
  3034. /***/ "7156":
  3035. /***/ (function(module, exports, __webpack_require__) {
  3036. var isObject = __webpack_require__("861d");
  3037. var setPrototypeOf = __webpack_require__("d2bb");
  3038. // makes subclassing work correct for wrapped built-ins
  3039. module.exports = function ($this, dummy, Wrapper) {
  3040. var NewTarget, NewTargetPrototype;
  3041. if (
  3042. // it can work only with native `setPrototypeOf`
  3043. setPrototypeOf &&
  3044. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  3045. typeof (NewTarget = dummy.constructor) == 'function' &&
  3046. NewTarget !== Wrapper &&
  3047. isObject(NewTargetPrototype = NewTarget.prototype) &&
  3048. NewTargetPrototype !== Wrapper.prototype
  3049. ) setPrototypeOf($this, NewTargetPrototype);
  3050. return $this;
  3051. };
  3052. /***/ }),
  3053. /***/ "7418":
  3054. /***/ (function(module, exports) {
  3055. exports.f = Object.getOwnPropertySymbols;
  3056. /***/ }),
  3057. /***/ "746f":
  3058. /***/ (function(module, exports, __webpack_require__) {
  3059. var path = __webpack_require__("428f");
  3060. var has = __webpack_require__("5135");
  3061. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  3062. var defineProperty = __webpack_require__("9bf2").f;
  3063. module.exports = function (NAME) {
  3064. var Symbol = path.Symbol || (path.Symbol = {});
  3065. if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
  3066. value: wrappedWellKnownSymbolModule.f(NAME)
  3067. });
  3068. };
  3069. /***/ }),
  3070. /***/ "7839":
  3071. /***/ (function(module, exports) {
  3072. // IE8- don't enum bug keys
  3073. module.exports = [
  3074. 'constructor',
  3075. 'hasOwnProperty',
  3076. 'isPrototypeOf',
  3077. 'propertyIsEnumerable',
  3078. 'toLocaleString',
  3079. 'toString',
  3080. 'valueOf'
  3081. ];
  3082. /***/ }),
  3083. /***/ "7b0b":
  3084. /***/ (function(module, exports, __webpack_require__) {
  3085. var requireObjectCoercible = __webpack_require__("1d80");
  3086. // `ToObject` abstract operation
  3087. // https://tc39.github.io/ecma262/#sec-toobject
  3088. module.exports = function (argument) {
  3089. return Object(requireObjectCoercible(argument));
  3090. };
  3091. /***/ }),
  3092. /***/ "7c73":
  3093. /***/ (function(module, exports, __webpack_require__) {
  3094. var anObject = __webpack_require__("825a");
  3095. var defineProperties = __webpack_require__("37e8");
  3096. var enumBugKeys = __webpack_require__("7839");
  3097. var hiddenKeys = __webpack_require__("d012");
  3098. var html = __webpack_require__("1be4");
  3099. var documentCreateElement = __webpack_require__("cc12");
  3100. var sharedKey = __webpack_require__("f772");
  3101. var GT = '>';
  3102. var LT = '<';
  3103. var PROTOTYPE = 'prototype';
  3104. var SCRIPT = 'script';
  3105. var IE_PROTO = sharedKey('IE_PROTO');
  3106. var EmptyConstructor = function () { /* empty */ };
  3107. var scriptTag = function (content) {
  3108. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  3109. };
  3110. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  3111. var NullProtoObjectViaActiveX = function (activeXDocument) {
  3112. activeXDocument.write(scriptTag(''));
  3113. activeXDocument.close();
  3114. var temp = activeXDocument.parentWindow.Object;
  3115. activeXDocument = null; // avoid memory leak
  3116. return temp;
  3117. };
  3118. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  3119. var NullProtoObjectViaIFrame = function () {
  3120. // Thrash, waste and sodomy: IE GC bug
  3121. var iframe = documentCreateElement('iframe');
  3122. var JS = 'java' + SCRIPT + ':';
  3123. var iframeDocument;
  3124. iframe.style.display = 'none';
  3125. html.appendChild(iframe);
  3126. // https://github.com/zloirock/core-js/issues/475
  3127. iframe.src = String(JS);
  3128. iframeDocument = iframe.contentWindow.document;
  3129. iframeDocument.open();
  3130. iframeDocument.write(scriptTag('document.F=Object'));
  3131. iframeDocument.close();
  3132. return iframeDocument.F;
  3133. };
  3134. // Check for document.domain and active x support
  3135. // No need to use active x approach when document.domain is not set
  3136. // see https://github.com/es-shims/es5-shim/issues/150
  3137. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  3138. // avoid IE GC bug
  3139. var activeXDocument;
  3140. var NullProtoObject = function () {
  3141. try {
  3142. /* global ActiveXObject */
  3143. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  3144. } catch (error) { /* ignore */ }
  3145. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  3146. var length = enumBugKeys.length;
  3147. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  3148. return NullProtoObject();
  3149. };
  3150. hiddenKeys[IE_PROTO] = true;
  3151. // `Object.create` method
  3152. // https://tc39.github.io/ecma262/#sec-object.create
  3153. module.exports = Object.create || function create(O, Properties) {
  3154. var result;
  3155. if (O !== null) {
  3156. EmptyConstructor[PROTOTYPE] = anObject(O);
  3157. result = new EmptyConstructor();
  3158. EmptyConstructor[PROTOTYPE] = null;
  3159. // add "__proto__" for Object.getPrototypeOf polyfill
  3160. result[IE_PROTO] = O;
  3161. } else result = NullProtoObject();
  3162. return Properties === undefined ? result : defineProperties(result, Properties);
  3163. };
  3164. /***/ }),
  3165. /***/ "7db0":
  3166. /***/ (function(module, exports, __webpack_require__) {
  3167. "use strict";
  3168. var $ = __webpack_require__("23e7");
  3169. var $find = __webpack_require__("b727").find;
  3170. var addToUnscopables = __webpack_require__("44d2");
  3171. var arrayMethodUsesToLength = __webpack_require__("ae40");
  3172. var FIND = 'find';
  3173. var SKIPS_HOLES = true;
  3174. var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
  3175. // Shouldn't skip holes
  3176. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  3177. // `Array.prototype.find` method
  3178. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  3179. $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
  3180. find: function find(callbackfn /* , that = undefined */) {
  3181. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3182. }
  3183. });
  3184. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  3185. addToUnscopables(FIND);
  3186. /***/ }),
  3187. /***/ "7dd0":
  3188. /***/ (function(module, exports, __webpack_require__) {
  3189. "use strict";
  3190. var $ = __webpack_require__("23e7");
  3191. var createIteratorConstructor = __webpack_require__("9ed3");
  3192. var getPrototypeOf = __webpack_require__("e163");
  3193. var setPrototypeOf = __webpack_require__("d2bb");
  3194. var setToStringTag = __webpack_require__("d44e");
  3195. var createNonEnumerableProperty = __webpack_require__("9112");
  3196. var redefine = __webpack_require__("6eeb");
  3197. var wellKnownSymbol = __webpack_require__("b622");
  3198. var IS_PURE = __webpack_require__("c430");
  3199. var Iterators = __webpack_require__("3f8c");
  3200. var IteratorsCore = __webpack_require__("ae93");
  3201. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3202. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3203. var ITERATOR = wellKnownSymbol('iterator');
  3204. var KEYS = 'keys';
  3205. var VALUES = 'values';
  3206. var ENTRIES = 'entries';
  3207. var returnThis = function () { return this; };
  3208. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3209. createIteratorConstructor(IteratorConstructor, NAME, next);
  3210. var getIterationMethod = function (KIND) {
  3211. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3212. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3213. switch (KIND) {
  3214. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3215. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3216. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3217. } return function () { return new IteratorConstructor(this); };
  3218. };
  3219. var TO_STRING_TAG = NAME + ' Iterator';
  3220. var INCORRECT_VALUES_NAME = false;
  3221. var IterablePrototype = Iterable.prototype;
  3222. var nativeIterator = IterablePrototype[ITERATOR]
  3223. || IterablePrototype['@@iterator']
  3224. || DEFAULT && IterablePrototype[DEFAULT];
  3225. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3226. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3227. var CurrentIteratorPrototype, methods, KEY;
  3228. // fix native
  3229. if (anyNativeIterator) {
  3230. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3231. if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3232. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3233. if (setPrototypeOf) {
  3234. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3235. } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
  3236. createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
  3237. }
  3238. }
  3239. // Set @@toStringTag to native iterators
  3240. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  3241. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  3242. }
  3243. }
  3244. // fix Array#{values, @@iterator}.name in V8 / FF
  3245. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3246. INCORRECT_VALUES_NAME = true;
  3247. defaultIterator = function values() { return nativeIterator.call(this); };
  3248. }
  3249. // define iterator
  3250. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  3251. createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
  3252. }
  3253. Iterators[NAME] = defaultIterator;
  3254. // export additional methods
  3255. if (DEFAULT) {
  3256. methods = {
  3257. values: getIterationMethod(VALUES),
  3258. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3259. entries: getIterationMethod(ENTRIES)
  3260. };
  3261. if (FORCED) for (KEY in methods) {
  3262. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3263. redefine(IterablePrototype, KEY, methods[KEY]);
  3264. }
  3265. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3266. }
  3267. return methods;
  3268. };
  3269. /***/ }),
  3270. /***/ "7f9a":
  3271. /***/ (function(module, exports, __webpack_require__) {
  3272. var global = __webpack_require__("da84");
  3273. var inspectSource = __webpack_require__("8925");
  3274. var WeakMap = global.WeakMap;
  3275. module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  3276. /***/ }),
  3277. /***/ "7fd6":
  3278. /***/ (function(module, exports) {
  3279. module.exports = __WEBPACK_EXTERNAL_MODULE__7fd6__;
  3280. /***/ }),
  3281. /***/ "825a":
  3282. /***/ (function(module, exports, __webpack_require__) {
  3283. var isObject = __webpack_require__("861d");
  3284. module.exports = function (it) {
  3285. if (!isObject(it)) {
  3286. throw TypeError(String(it) + ' is not an object');
  3287. } return it;
  3288. };
  3289. /***/ }),
  3290. /***/ "83ab":
  3291. /***/ (function(module, exports, __webpack_require__) {
  3292. var fails = __webpack_require__("d039");
  3293. // Thank's IE8 for his funny defineProperty
  3294. module.exports = !fails(function () {
  3295. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  3296. });
  3297. /***/ }),
  3298. /***/ "8418":
  3299. /***/ (function(module, exports, __webpack_require__) {
  3300. "use strict";
  3301. var toPrimitive = __webpack_require__("c04e");
  3302. var definePropertyModule = __webpack_require__("9bf2");
  3303. var createPropertyDescriptor = __webpack_require__("5c6c");
  3304. module.exports = function (object, key, value) {
  3305. var propertyKey = toPrimitive(key);
  3306. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  3307. else object[propertyKey] = value;
  3308. };
  3309. /***/ }),
  3310. /***/ "857a":
  3311. /***/ (function(module, exports, __webpack_require__) {
  3312. var requireObjectCoercible = __webpack_require__("1d80");
  3313. var quot = /"/g;
  3314. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  3315. // https://tc39.github.io/ecma262/#sec-createhtml
  3316. module.exports = function (string, tag, attribute, value) {
  3317. var S = String(requireObjectCoercible(string));
  3318. var p1 = '<' + tag;
  3319. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  3320. return p1 + '>' + S + '</' + tag + '>';
  3321. };
  3322. /***/ }),
  3323. /***/ "861d":
  3324. /***/ (function(module, exports) {
  3325. module.exports = function (it) {
  3326. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3327. };
  3328. /***/ }),
  3329. /***/ "8875":
  3330. /***/ (function(module, exports, __webpack_require__) {
  3331. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
  3332. // MIT license
  3333. // source: https://github.com/amiller-gh/currentScript-polyfill
  3334. // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
  3335. (function (root, factory) {
  3336. if (true) {
  3337. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  3338. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  3339. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  3340. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  3341. } else {}
  3342. }(typeof self !== 'undefined' ? self : this, function () {
  3343. function getCurrentScript () {
  3344. var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
  3345. // for chrome
  3346. if (!descriptor && 'currentScript' in document && document.currentScript) {
  3347. return document.currentScript
  3348. }
  3349. // for other browsers with native support for currentScript
  3350. if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
  3351. return document.currentScript
  3352. }
  3353. // IE 8-10 support script readyState
  3354. // IE 11+ & Firefox support stack trace
  3355. try {
  3356. throw new Error();
  3357. }
  3358. catch (err) {
  3359. // Find the second match for the "at" string to get file src url from stack.
  3360. var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
  3361. ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
  3362. stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
  3363. scriptLocation = (stackDetails && stackDetails[1]) || false,
  3364. line = (stackDetails && stackDetails[2]) || false,
  3365. currentLocation = document.location.href.replace(document.location.hash, ''),
  3366. pageSource,
  3367. inlineScriptSourceRegExp,
  3368. inlineScriptSource,
  3369. scripts = document.getElementsByTagName('script'); // Live NodeList collection
  3370. if (scriptLocation === currentLocation) {
  3371. pageSource = document.documentElement.outerHTML;
  3372. inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
  3373. inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
  3374. }
  3375. for (var i = 0; i < scripts.length; i++) {
  3376. // If ready state is interactive, return the script tag
  3377. if (scripts[i].readyState === 'interactive') {
  3378. return scripts[i];
  3379. }
  3380. // If src matches, return the script tag
  3381. if (scripts[i].src === scriptLocation) {
  3382. return scripts[i];
  3383. }
  3384. // If inline source matches, return the script tag
  3385. if (
  3386. scriptLocation === currentLocation &&
  3387. scripts[i].innerHTML &&
  3388. scripts[i].innerHTML.trim() === inlineScriptSource
  3389. ) {
  3390. return scripts[i];
  3391. }
  3392. }
  3393. // If no match, return null
  3394. return null;
  3395. }
  3396. };
  3397. return getCurrentScript
  3398. }));
  3399. /***/ }),
  3400. /***/ "8925":
  3401. /***/ (function(module, exports, __webpack_require__) {
  3402. var store = __webpack_require__("c6cd");
  3403. var functionToString = Function.toString;
  3404. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  3405. if (typeof store.inspectSource != 'function') {
  3406. store.inspectSource = function (it) {
  3407. return functionToString.call(it);
  3408. };
  3409. }
  3410. module.exports = store.inspectSource;
  3411. /***/ }),
  3412. /***/ "8aa5":
  3413. /***/ (function(module, exports, __webpack_require__) {
  3414. "use strict";
  3415. var charAt = __webpack_require__("6547").charAt;
  3416. // `AdvanceStringIndex` abstract operation
  3417. // https://tc39.github.io/ecma262/#sec-advancestringindex
  3418. module.exports = function (S, index, unicode) {
  3419. return index + (unicode ? charAt(S, index).length : 1);
  3420. };
  3421. /***/ }),
  3422. /***/ "90e3":
  3423. /***/ (function(module, exports) {
  3424. var id = 0;
  3425. var postfix = Math.random();
  3426. module.exports = function (key) {
  3427. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  3428. };
  3429. /***/ }),
  3430. /***/ "9112":
  3431. /***/ (function(module, exports, __webpack_require__) {
  3432. var DESCRIPTORS = __webpack_require__("83ab");
  3433. var definePropertyModule = __webpack_require__("9bf2");
  3434. var createPropertyDescriptor = __webpack_require__("5c6c");
  3435. module.exports = DESCRIPTORS ? function (object, key, value) {
  3436. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  3437. } : function (object, key, value) {
  3438. object[key] = value;
  3439. return object;
  3440. };
  3441. /***/ }),
  3442. /***/ "9263":
  3443. /***/ (function(module, exports, __webpack_require__) {
  3444. "use strict";
  3445. var regexpFlags = __webpack_require__("ad6d");
  3446. var stickyHelpers = __webpack_require__("9f7f");
  3447. var nativeExec = RegExp.prototype.exec;
  3448. // This always refers to the native implementation, because the
  3449. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  3450. // which loads this file before patching the method.
  3451. var nativeReplace = String.prototype.replace;
  3452. var patchedExec = nativeExec;
  3453. var UPDATES_LAST_INDEX_WRONG = (function () {
  3454. var re1 = /a/;
  3455. var re2 = /b*/g;
  3456. nativeExec.call(re1, 'a');
  3457. nativeExec.call(re2, 'a');
  3458. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  3459. })();
  3460. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
  3461. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  3462. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  3463. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  3464. if (PATCH) {
  3465. patchedExec = function exec(str) {
  3466. var re = this;
  3467. var lastIndex, reCopy, match, i;
  3468. var sticky = UNSUPPORTED_Y && re.sticky;
  3469. var flags = regexpFlags.call(re);
  3470. var source = re.source;
  3471. var charsAdded = 0;
  3472. var strCopy = str;
  3473. if (sticky) {
  3474. flags = flags.replace('y', '');
  3475. if (flags.indexOf('g') === -1) {
  3476. flags += 'g';
  3477. }
  3478. strCopy = String(str).slice(re.lastIndex);
  3479. // Support anchored sticky behavior.
  3480. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  3481. source = '(?: ' + source + ')';
  3482. strCopy = ' ' + strCopy;
  3483. charsAdded++;
  3484. }
  3485. // ^(? + rx + ) is needed, in combination with some str slicing, to
  3486. // simulate the 'y' flag.
  3487. reCopy = new RegExp('^(?:' + source + ')', flags);
  3488. }
  3489. if (NPCG_INCLUDED) {
  3490. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  3491. }
  3492. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  3493. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  3494. if (sticky) {
  3495. if (match) {
  3496. match.input = match.input.slice(charsAdded);
  3497. match[0] = match[0].slice(charsAdded);
  3498. match.index = re.lastIndex;
  3499. re.lastIndex += match[0].length;
  3500. } else re.lastIndex = 0;
  3501. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  3502. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  3503. }
  3504. if (NPCG_INCLUDED && match && match.length > 1) {
  3505. // Fix browsers whose `exec` methods don't consistently return `undefined`
  3506. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  3507. nativeReplace.call(match[0], reCopy, function () {
  3508. for (i = 1; i < arguments.length - 2; i++) {
  3509. if (arguments[i] === undefined) match[i] = undefined;
  3510. }
  3511. });
  3512. }
  3513. return match;
  3514. };
  3515. }
  3516. module.exports = patchedExec;
  3517. /***/ }),
  3518. /***/ "94ca":
  3519. /***/ (function(module, exports, __webpack_require__) {
  3520. var fails = __webpack_require__("d039");
  3521. var replacement = /#|\.prototype\./;
  3522. var isForced = function (feature, detection) {
  3523. var value = data[normalize(feature)];
  3524. return value == POLYFILL ? true
  3525. : value == NATIVE ? false
  3526. : typeof detection == 'function' ? fails(detection)
  3527. : !!detection;
  3528. };
  3529. var normalize = isForced.normalize = function (string) {
  3530. return String(string).replace(replacement, '.').toLowerCase();
  3531. };
  3532. var data = isForced.data = {};
  3533. var NATIVE = isForced.NATIVE = 'N';
  3534. var POLYFILL = isForced.POLYFILL = 'P';
  3535. module.exports = isForced;
  3536. /***/ }),
  3537. /***/ "9861":
  3538. /***/ (function(module, exports, __webpack_require__) {
  3539. "use strict";
  3540. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  3541. __webpack_require__("e260");
  3542. var $ = __webpack_require__("23e7");
  3543. var getBuiltIn = __webpack_require__("d066");
  3544. var USE_NATIVE_URL = __webpack_require__("0d3b");
  3545. var redefine = __webpack_require__("6eeb");
  3546. var redefineAll = __webpack_require__("e2cc");
  3547. var setToStringTag = __webpack_require__("d44e");
  3548. var createIteratorConstructor = __webpack_require__("9ed3");
  3549. var InternalStateModule = __webpack_require__("69f3");
  3550. var anInstance = __webpack_require__("19aa");
  3551. var hasOwn = __webpack_require__("5135");
  3552. var bind = __webpack_require__("0366");
  3553. var classof = __webpack_require__("f5df");
  3554. var anObject = __webpack_require__("825a");
  3555. var isObject = __webpack_require__("861d");
  3556. var create = __webpack_require__("7c73");
  3557. var createPropertyDescriptor = __webpack_require__("5c6c");
  3558. var getIterator = __webpack_require__("9a1f");
  3559. var getIteratorMethod = __webpack_require__("35a1");
  3560. var wellKnownSymbol = __webpack_require__("b622");
  3561. var $fetch = getBuiltIn('fetch');
  3562. var Headers = getBuiltIn('Headers');
  3563. var ITERATOR = wellKnownSymbol('iterator');
  3564. var URL_SEARCH_PARAMS = 'URLSearchParams';
  3565. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  3566. var setInternalState = InternalStateModule.set;
  3567. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  3568. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  3569. var plus = /\+/g;
  3570. var sequences = Array(4);
  3571. var percentSequence = function (bytes) {
  3572. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  3573. };
  3574. var percentDecode = function (sequence) {
  3575. try {
  3576. return decodeURIComponent(sequence);
  3577. } catch (error) {
  3578. return sequence;
  3579. }
  3580. };
  3581. var deserialize = function (it) {
  3582. var result = it.replace(plus, ' ');
  3583. var bytes = 4;
  3584. try {
  3585. return decodeURIComponent(result);
  3586. } catch (error) {
  3587. while (bytes) {
  3588. result = result.replace(percentSequence(bytes--), percentDecode);
  3589. }
  3590. return result;
  3591. }
  3592. };
  3593. var find = /[!'()~]|%20/g;
  3594. var replace = {
  3595. '!': '%21',
  3596. "'": '%27',
  3597. '(': '%28',
  3598. ')': '%29',
  3599. '~': '%7E',
  3600. '%20': '+'
  3601. };
  3602. var replacer = function (match) {
  3603. return replace[match];
  3604. };
  3605. var serialize = function (it) {
  3606. return encodeURIComponent(it).replace(find, replacer);
  3607. };
  3608. var parseSearchParams = function (result, query) {
  3609. if (query) {
  3610. var attributes = query.split('&');
  3611. var index = 0;
  3612. var attribute, entry;
  3613. while (index < attributes.length) {
  3614. attribute = attributes[index++];
  3615. if (attribute.length) {
  3616. entry = attribute.split('=');
  3617. result.push({
  3618. key: deserialize(entry.shift()),
  3619. value: deserialize(entry.join('='))
  3620. });
  3621. }
  3622. }
  3623. }
  3624. };
  3625. var updateSearchParams = function (query) {
  3626. this.entries.length = 0;
  3627. parseSearchParams(this.entries, query);
  3628. };
  3629. var validateArgumentsLength = function (passed, required) {
  3630. if (passed < required) throw TypeError('Not enough arguments');
  3631. };
  3632. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  3633. setInternalState(this, {
  3634. type: URL_SEARCH_PARAMS_ITERATOR,
  3635. iterator: getIterator(getInternalParamsState(params).entries),
  3636. kind: kind
  3637. });
  3638. }, 'Iterator', function next() {
  3639. var state = getInternalIteratorState(this);
  3640. var kind = state.kind;
  3641. var step = state.iterator.next();
  3642. var entry = step.value;
  3643. if (!step.done) {
  3644. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  3645. } return step;
  3646. });
  3647. // `URLSearchParams` constructor
  3648. // https://url.spec.whatwg.org/#interface-urlsearchparams
  3649. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  3650. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3651. var init = arguments.length > 0 ? arguments[0] : undefined;
  3652. var that = this;
  3653. var entries = [];
  3654. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  3655. setInternalState(that, {
  3656. type: URL_SEARCH_PARAMS,
  3657. entries: entries,
  3658. updateURL: function () { /* empty */ },
  3659. updateSearchParams: updateSearchParams
  3660. });
  3661. if (init !== undefined) {
  3662. if (isObject(init)) {
  3663. iteratorMethod = getIteratorMethod(init);
  3664. if (typeof iteratorMethod === 'function') {
  3665. iterator = iteratorMethod.call(init);
  3666. next = iterator.next;
  3667. while (!(step = next.call(iterator)).done) {
  3668. entryIterator = getIterator(anObject(step.value));
  3669. entryNext = entryIterator.next;
  3670. if (
  3671. (first = entryNext.call(entryIterator)).done ||
  3672. (second = entryNext.call(entryIterator)).done ||
  3673. !entryNext.call(entryIterator).done
  3674. ) throw TypeError('Expected sequence with length 2');
  3675. entries.push({ key: first.value + '', value: second.value + '' });
  3676. }
  3677. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
  3678. } else {
  3679. parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
  3680. }
  3681. }
  3682. };
  3683. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  3684. redefineAll(URLSearchParamsPrototype, {
  3685. // `URLSearchParams.prototype.append` method
  3686. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  3687. append: function append(name, value) {
  3688. validateArgumentsLength(arguments.length, 2);
  3689. var state = getInternalParamsState(this);
  3690. state.entries.push({ key: name + '', value: value + '' });
  3691. state.updateURL();
  3692. },
  3693. // `URLSearchParams.prototype.delete` method
  3694. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  3695. 'delete': function (name) {
  3696. validateArgumentsLength(arguments.length, 1);
  3697. var state = getInternalParamsState(this);
  3698. var entries = state.entries;
  3699. var key = name + '';
  3700. var index = 0;
  3701. while (index < entries.length) {
  3702. if (entries[index].key === key) entries.splice(index, 1);
  3703. else index++;
  3704. }
  3705. state.updateURL();
  3706. },
  3707. // `URLSearchParams.prototype.get` method
  3708. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  3709. get: function get(name) {
  3710. validateArgumentsLength(arguments.length, 1);
  3711. var entries = getInternalParamsState(this).entries;
  3712. var key = name + '';
  3713. var index = 0;
  3714. for (; index < entries.length; index++) {
  3715. if (entries[index].key === key) return entries[index].value;
  3716. }
  3717. return null;
  3718. },
  3719. // `URLSearchParams.prototype.getAll` method
  3720. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  3721. getAll: function getAll(name) {
  3722. validateArgumentsLength(arguments.length, 1);
  3723. var entries = getInternalParamsState(this).entries;
  3724. var key = name + '';
  3725. var result = [];
  3726. var index = 0;
  3727. for (; index < entries.length; index++) {
  3728. if (entries[index].key === key) result.push(entries[index].value);
  3729. }
  3730. return result;
  3731. },
  3732. // `URLSearchParams.prototype.has` method
  3733. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  3734. has: function has(name) {
  3735. validateArgumentsLength(arguments.length, 1);
  3736. var entries = getInternalParamsState(this).entries;
  3737. var key = name + '';
  3738. var index = 0;
  3739. while (index < entries.length) {
  3740. if (entries[index++].key === key) return true;
  3741. }
  3742. return false;
  3743. },
  3744. // `URLSearchParams.prototype.set` method
  3745. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  3746. set: function set(name, value) {
  3747. validateArgumentsLength(arguments.length, 1);
  3748. var state = getInternalParamsState(this);
  3749. var entries = state.entries;
  3750. var found = false;
  3751. var key = name + '';
  3752. var val = value + '';
  3753. var index = 0;
  3754. var entry;
  3755. for (; index < entries.length; index++) {
  3756. entry = entries[index];
  3757. if (entry.key === key) {
  3758. if (found) entries.splice(index--, 1);
  3759. else {
  3760. found = true;
  3761. entry.value = val;
  3762. }
  3763. }
  3764. }
  3765. if (!found) entries.push({ key: key, value: val });
  3766. state.updateURL();
  3767. },
  3768. // `URLSearchParams.prototype.sort` method
  3769. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  3770. sort: function sort() {
  3771. var state = getInternalParamsState(this);
  3772. var entries = state.entries;
  3773. // Array#sort is not stable in some engines
  3774. var slice = entries.slice();
  3775. var entry, entriesIndex, sliceIndex;
  3776. entries.length = 0;
  3777. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  3778. entry = slice[sliceIndex];
  3779. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  3780. if (entries[entriesIndex].key > entry.key) {
  3781. entries.splice(entriesIndex, 0, entry);
  3782. break;
  3783. }
  3784. }
  3785. if (entriesIndex === sliceIndex) entries.push(entry);
  3786. }
  3787. state.updateURL();
  3788. },
  3789. // `URLSearchParams.prototype.forEach` method
  3790. forEach: function forEach(callback /* , thisArg */) {
  3791. var entries = getInternalParamsState(this).entries;
  3792. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  3793. var index = 0;
  3794. var entry;
  3795. while (index < entries.length) {
  3796. entry = entries[index++];
  3797. boundFunction(entry.value, entry.key, this);
  3798. }
  3799. },
  3800. // `URLSearchParams.prototype.keys` method
  3801. keys: function keys() {
  3802. return new URLSearchParamsIterator(this, 'keys');
  3803. },
  3804. // `URLSearchParams.prototype.values` method
  3805. values: function values() {
  3806. return new URLSearchParamsIterator(this, 'values');
  3807. },
  3808. // `URLSearchParams.prototype.entries` method
  3809. entries: function entries() {
  3810. return new URLSearchParamsIterator(this, 'entries');
  3811. }
  3812. }, { enumerable: true });
  3813. // `URLSearchParams.prototype[@@iterator]` method
  3814. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
  3815. // `URLSearchParams.prototype.toString` method
  3816. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  3817. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  3818. var entries = getInternalParamsState(this).entries;
  3819. var result = [];
  3820. var index = 0;
  3821. var entry;
  3822. while (index < entries.length) {
  3823. entry = entries[index++];
  3824. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  3825. } return result.join('&');
  3826. }, { enumerable: true });
  3827. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3828. $({ global: true, forced: !USE_NATIVE_URL }, {
  3829. URLSearchParams: URLSearchParamsConstructor
  3830. });
  3831. // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
  3832. // https://github.com/zloirock/core-js/issues/674
  3833. if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
  3834. $({ global: true, enumerable: true, forced: true }, {
  3835. fetch: function fetch(input /* , init */) {
  3836. var args = [input];
  3837. var init, body, headers;
  3838. if (arguments.length > 1) {
  3839. init = arguments[1];
  3840. if (isObject(init)) {
  3841. body = init.body;
  3842. if (classof(body) === URL_SEARCH_PARAMS) {
  3843. headers = init.headers ? new Headers(init.headers) : new Headers();
  3844. if (!headers.has('content-type')) {
  3845. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  3846. }
  3847. init = create(init, {
  3848. body: createPropertyDescriptor(0, String(body)),
  3849. headers: createPropertyDescriptor(0, headers)
  3850. });
  3851. }
  3852. }
  3853. args.push(init);
  3854. } return $fetch.apply(this, args);
  3855. }
  3856. });
  3857. }
  3858. module.exports = {
  3859. URLSearchParams: URLSearchParamsConstructor,
  3860. getState: getInternalParamsState
  3861. };
  3862. /***/ }),
  3863. /***/ "99af":
  3864. /***/ (function(module, exports, __webpack_require__) {
  3865. "use strict";
  3866. var $ = __webpack_require__("23e7");
  3867. var fails = __webpack_require__("d039");
  3868. var isArray = __webpack_require__("e8b5");
  3869. var isObject = __webpack_require__("861d");
  3870. var toObject = __webpack_require__("7b0b");
  3871. var toLength = __webpack_require__("50c4");
  3872. var createProperty = __webpack_require__("8418");
  3873. var arraySpeciesCreate = __webpack_require__("65f0");
  3874. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  3875. var wellKnownSymbol = __webpack_require__("b622");
  3876. var V8_VERSION = __webpack_require__("2d00");
  3877. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  3878. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  3879. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  3880. // We can't use this feature detection in V8 since it causes
  3881. // deoptimization and serious performance degradation
  3882. // https://github.com/zloirock/core-js/issues/679
  3883. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  3884. var array = [];
  3885. array[IS_CONCAT_SPREADABLE] = false;
  3886. return array.concat()[0] !== array;
  3887. });
  3888. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  3889. var isConcatSpreadable = function (O) {
  3890. if (!isObject(O)) return false;
  3891. var spreadable = O[IS_CONCAT_SPREADABLE];
  3892. return spreadable !== undefined ? !!spreadable : isArray(O);
  3893. };
  3894. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  3895. // `Array.prototype.concat` method
  3896. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  3897. // with adding support of @@isConcatSpreadable and @@species
  3898. $({ target: 'Array', proto: true, forced: FORCED }, {
  3899. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  3900. var O = toObject(this);
  3901. var A = arraySpeciesCreate(O, 0);
  3902. var n = 0;
  3903. var i, k, length, len, E;
  3904. for (i = -1, length = arguments.length; i < length; i++) {
  3905. E = i === -1 ? O : arguments[i];
  3906. if (isConcatSpreadable(E)) {
  3907. len = toLength(E.length);
  3908. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  3909. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  3910. } else {
  3911. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  3912. createProperty(A, n++, E);
  3913. }
  3914. }
  3915. A.length = n;
  3916. return A;
  3917. }
  3918. });
  3919. /***/ }),
  3920. /***/ "9a0c":
  3921. /***/ (function(module, exports, __webpack_require__) {
  3922. // https://github.com/zloirock/core-js/issues/280
  3923. var userAgent = __webpack_require__("342f");
  3924. // eslint-disable-next-line unicorn/no-unsafe-regex
  3925. module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  3926. /***/ }),
  3927. /***/ "9a1f":
  3928. /***/ (function(module, exports, __webpack_require__) {
  3929. var anObject = __webpack_require__("825a");
  3930. var getIteratorMethod = __webpack_require__("35a1");
  3931. module.exports = function (it) {
  3932. var iteratorMethod = getIteratorMethod(it);
  3933. if (typeof iteratorMethod != 'function') {
  3934. throw TypeError(String(it) + ' is not iterable');
  3935. } return anObject(iteratorMethod.call(it));
  3936. };
  3937. /***/ }),
  3938. /***/ "9bdd":
  3939. /***/ (function(module, exports, __webpack_require__) {
  3940. var anObject = __webpack_require__("825a");
  3941. var iteratorClose = __webpack_require__("2a62");
  3942. // call something on iterator step with safe closing on error
  3943. module.exports = function (iterator, fn, value, ENTRIES) {
  3944. try {
  3945. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  3946. // 7.4.6 IteratorClose(iterator, completion)
  3947. } catch (error) {
  3948. iteratorClose(iterator);
  3949. throw error;
  3950. }
  3951. };
  3952. /***/ }),
  3953. /***/ "9bf2":
  3954. /***/ (function(module, exports, __webpack_require__) {
  3955. var DESCRIPTORS = __webpack_require__("83ab");
  3956. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  3957. var anObject = __webpack_require__("825a");
  3958. var toPrimitive = __webpack_require__("c04e");
  3959. var nativeDefineProperty = Object.defineProperty;
  3960. // `Object.defineProperty` method
  3961. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  3962. exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  3963. anObject(O);
  3964. P = toPrimitive(P, true);
  3965. anObject(Attributes);
  3966. if (IE8_DOM_DEFINE) try {
  3967. return nativeDefineProperty(O, P, Attributes);
  3968. } catch (error) { /* empty */ }
  3969. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  3970. if ('value' in Attributes) O[P] = Attributes.value;
  3971. return O;
  3972. };
  3973. /***/ }),
  3974. /***/ "9ed3":
  3975. /***/ (function(module, exports, __webpack_require__) {
  3976. "use strict";
  3977. var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
  3978. var create = __webpack_require__("7c73");
  3979. var createPropertyDescriptor = __webpack_require__("5c6c");
  3980. var setToStringTag = __webpack_require__("d44e");
  3981. var Iterators = __webpack_require__("3f8c");
  3982. var returnThis = function () { return this; };
  3983. module.exports = function (IteratorConstructor, NAME, next) {
  3984. var TO_STRING_TAG = NAME + ' Iterator';
  3985. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  3986. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  3987. Iterators[TO_STRING_TAG] = returnThis;
  3988. return IteratorConstructor;
  3989. };
  3990. /***/ }),
  3991. /***/ "9f7f":
  3992. /***/ (function(module, exports, __webpack_require__) {
  3993. "use strict";
  3994. var fails = __webpack_require__("d039");
  3995. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  3996. // so we use an intermediate function.
  3997. function RE(s, f) {
  3998. return RegExp(s, f);
  3999. }
  4000. exports.UNSUPPORTED_Y = fails(function () {
  4001. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  4002. var re = RE('a', 'y');
  4003. re.lastIndex = 2;
  4004. return re.exec('abcd') != null;
  4005. });
  4006. exports.BROKEN_CARET = fails(function () {
  4007. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  4008. var re = RE('^r', 'gy');
  4009. re.lastIndex = 2;
  4010. return re.exec('str') != null;
  4011. });
  4012. /***/ }),
  4013. /***/ "a15b":
  4014. /***/ (function(module, exports, __webpack_require__) {
  4015. "use strict";
  4016. var $ = __webpack_require__("23e7");
  4017. var IndexedObject = __webpack_require__("44ad");
  4018. var toIndexedObject = __webpack_require__("fc6a");
  4019. var arrayMethodIsStrict = __webpack_require__("a640");
  4020. var nativeJoin = [].join;
  4021. var ES3_STRINGS = IndexedObject != Object;
  4022. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  4023. // `Array.prototype.join` method
  4024. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  4025. $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  4026. join: function join(separator) {
  4027. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  4028. }
  4029. });
  4030. /***/ }),
  4031. /***/ "a434":
  4032. /***/ (function(module, exports, __webpack_require__) {
  4033. "use strict";
  4034. var $ = __webpack_require__("23e7");
  4035. var toAbsoluteIndex = __webpack_require__("23cb");
  4036. var toInteger = __webpack_require__("a691");
  4037. var toLength = __webpack_require__("50c4");
  4038. var toObject = __webpack_require__("7b0b");
  4039. var arraySpeciesCreate = __webpack_require__("65f0");
  4040. var createProperty = __webpack_require__("8418");
  4041. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  4042. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4043. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  4044. var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
  4045. var max = Math.max;
  4046. var min = Math.min;
  4047. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  4048. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  4049. // `Array.prototype.splice` method
  4050. // https://tc39.github.io/ecma262/#sec-array.prototype.splice
  4051. // with adding support of @@species
  4052. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  4053. splice: function splice(start, deleteCount /* , ...items */) {
  4054. var O = toObject(this);
  4055. var len = toLength(O.length);
  4056. var actualStart = toAbsoluteIndex(start, len);
  4057. var argumentsLength = arguments.length;
  4058. var insertCount, actualDeleteCount, A, k, from, to;
  4059. if (argumentsLength === 0) {
  4060. insertCount = actualDeleteCount = 0;
  4061. } else if (argumentsLength === 1) {
  4062. insertCount = 0;
  4063. actualDeleteCount = len - actualStart;
  4064. } else {
  4065. insertCount = argumentsLength - 2;
  4066. actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
  4067. }
  4068. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  4069. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  4070. }
  4071. A = arraySpeciesCreate(O, actualDeleteCount);
  4072. for (k = 0; k < actualDeleteCount; k++) {
  4073. from = actualStart + k;
  4074. if (from in O) createProperty(A, k, O[from]);
  4075. }
  4076. A.length = actualDeleteCount;
  4077. if (insertCount < actualDeleteCount) {
  4078. for (k = actualStart; k < len - actualDeleteCount; k++) {
  4079. from = k + actualDeleteCount;
  4080. to = k + insertCount;
  4081. if (from in O) O[to] = O[from];
  4082. else delete O[to];
  4083. }
  4084. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  4085. } else if (insertCount > actualDeleteCount) {
  4086. for (k = len - actualDeleteCount; k > actualStart; k--) {
  4087. from = k + actualDeleteCount - 1;
  4088. to = k + insertCount - 1;
  4089. if (from in O) O[to] = O[from];
  4090. else delete O[to];
  4091. }
  4092. }
  4093. for (k = 0; k < insertCount; k++) {
  4094. O[k + actualStart] = arguments[k + 2];
  4095. }
  4096. O.length = len - actualDeleteCount + insertCount;
  4097. return A;
  4098. }
  4099. });
  4100. /***/ }),
  4101. /***/ "a4d3":
  4102. /***/ (function(module, exports, __webpack_require__) {
  4103. "use strict";
  4104. var $ = __webpack_require__("23e7");
  4105. var global = __webpack_require__("da84");
  4106. var getBuiltIn = __webpack_require__("d066");
  4107. var IS_PURE = __webpack_require__("c430");
  4108. var DESCRIPTORS = __webpack_require__("83ab");
  4109. var NATIVE_SYMBOL = __webpack_require__("4930");
  4110. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4111. var fails = __webpack_require__("d039");
  4112. var has = __webpack_require__("5135");
  4113. var isArray = __webpack_require__("e8b5");
  4114. var isObject = __webpack_require__("861d");
  4115. var anObject = __webpack_require__("825a");
  4116. var toObject = __webpack_require__("7b0b");
  4117. var toIndexedObject = __webpack_require__("fc6a");
  4118. var toPrimitive = __webpack_require__("c04e");
  4119. var createPropertyDescriptor = __webpack_require__("5c6c");
  4120. var nativeObjectCreate = __webpack_require__("7c73");
  4121. var objectKeys = __webpack_require__("df75");
  4122. var getOwnPropertyNamesModule = __webpack_require__("241c");
  4123. var getOwnPropertyNamesExternal = __webpack_require__("057f");
  4124. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  4125. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  4126. var definePropertyModule = __webpack_require__("9bf2");
  4127. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  4128. var createNonEnumerableProperty = __webpack_require__("9112");
  4129. var redefine = __webpack_require__("6eeb");
  4130. var shared = __webpack_require__("5692");
  4131. var sharedKey = __webpack_require__("f772");
  4132. var hiddenKeys = __webpack_require__("d012");
  4133. var uid = __webpack_require__("90e3");
  4134. var wellKnownSymbol = __webpack_require__("b622");
  4135. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  4136. var defineWellKnownSymbol = __webpack_require__("746f");
  4137. var setToStringTag = __webpack_require__("d44e");
  4138. var InternalStateModule = __webpack_require__("69f3");
  4139. var $forEach = __webpack_require__("b727").forEach;
  4140. var HIDDEN = sharedKey('hidden');
  4141. var SYMBOL = 'Symbol';
  4142. var PROTOTYPE = 'prototype';
  4143. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  4144. var setInternalState = InternalStateModule.set;
  4145. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  4146. var ObjectPrototype = Object[PROTOTYPE];
  4147. var $Symbol = global.Symbol;
  4148. var $stringify = getBuiltIn('JSON', 'stringify');
  4149. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  4150. var nativeDefineProperty = definePropertyModule.f;
  4151. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  4152. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  4153. var AllSymbols = shared('symbols');
  4154. var ObjectPrototypeSymbols = shared('op-symbols');
  4155. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  4156. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  4157. var WellKnownSymbolsStore = shared('wks');
  4158. var QObject = global.QObject;
  4159. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  4160. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  4161. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  4162. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  4163. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  4164. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  4165. })).a != 7;
  4166. }) ? function (O, P, Attributes) {
  4167. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  4168. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  4169. nativeDefineProperty(O, P, Attributes);
  4170. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  4171. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  4172. }
  4173. } : nativeDefineProperty;
  4174. var wrap = function (tag, description) {
  4175. var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
  4176. setInternalState(symbol, {
  4177. type: SYMBOL,
  4178. tag: tag,
  4179. description: description
  4180. });
  4181. if (!DESCRIPTORS) symbol.description = description;
  4182. return symbol;
  4183. };
  4184. var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
  4185. return typeof it == 'symbol';
  4186. } : function (it) {
  4187. return Object(it) instanceof $Symbol;
  4188. };
  4189. var $defineProperty = function defineProperty(O, P, Attributes) {
  4190. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  4191. anObject(O);
  4192. var key = toPrimitive(P, true);
  4193. anObject(Attributes);
  4194. if (has(AllSymbols, key)) {
  4195. if (!Attributes.enumerable) {
  4196. if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  4197. O[HIDDEN][key] = true;
  4198. } else {
  4199. if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  4200. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  4201. } return setSymbolDescriptor(O, key, Attributes);
  4202. } return nativeDefineProperty(O, key, Attributes);
  4203. };
  4204. var $defineProperties = function defineProperties(O, Properties) {
  4205. anObject(O);
  4206. var properties = toIndexedObject(Properties);
  4207. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  4208. $forEach(keys, function (key) {
  4209. if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  4210. });
  4211. return O;
  4212. };
  4213. var $create = function create(O, Properties) {
  4214. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  4215. };
  4216. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  4217. var P = toPrimitive(V, true);
  4218. var enumerable = nativePropertyIsEnumerable.call(this, P);
  4219. if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
  4220. return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  4221. };
  4222. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  4223. var it = toIndexedObject(O);
  4224. var key = toPrimitive(P, true);
  4225. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  4226. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  4227. if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
  4228. descriptor.enumerable = true;
  4229. }
  4230. return descriptor;
  4231. };
  4232. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  4233. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  4234. var result = [];
  4235. $forEach(names, function (key) {
  4236. if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
  4237. });
  4238. return result;
  4239. };
  4240. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  4241. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  4242. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  4243. var result = [];
  4244. $forEach(names, function (key) {
  4245. if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
  4246. result.push(AllSymbols[key]);
  4247. }
  4248. });
  4249. return result;
  4250. };
  4251. // `Symbol` constructor
  4252. // https://tc39.github.io/ecma262/#sec-symbol-constructor
  4253. if (!NATIVE_SYMBOL) {
  4254. $Symbol = function Symbol() {
  4255. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  4256. var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
  4257. var tag = uid(description);
  4258. var setter = function (value) {
  4259. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  4260. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  4261. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  4262. };
  4263. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  4264. return wrap(tag, description);
  4265. };
  4266. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  4267. return getInternalState(this).tag;
  4268. });
  4269. redefine($Symbol, 'withoutSetter', function (description) {
  4270. return wrap(uid(description), description);
  4271. });
  4272. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  4273. definePropertyModule.f = $defineProperty;
  4274. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  4275. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  4276. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  4277. wrappedWellKnownSymbolModule.f = function (name) {
  4278. return wrap(wellKnownSymbol(name), name);
  4279. };
  4280. if (DESCRIPTORS) {
  4281. // https://github.com/tc39/proposal-Symbol-description
  4282. nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
  4283. configurable: true,
  4284. get: function description() {
  4285. return getInternalState(this).description;
  4286. }
  4287. });
  4288. if (!IS_PURE) {
  4289. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  4290. }
  4291. }
  4292. }
  4293. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  4294. Symbol: $Symbol
  4295. });
  4296. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  4297. defineWellKnownSymbol(name);
  4298. });
  4299. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  4300. // `Symbol.for` method
  4301. // https://tc39.github.io/ecma262/#sec-symbol.for
  4302. 'for': function (key) {
  4303. var string = String(key);
  4304. if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  4305. var symbol = $Symbol(string);
  4306. StringToSymbolRegistry[string] = symbol;
  4307. SymbolToStringRegistry[symbol] = string;
  4308. return symbol;
  4309. },
  4310. // `Symbol.keyFor` method
  4311. // https://tc39.github.io/ecma262/#sec-symbol.keyfor
  4312. keyFor: function keyFor(sym) {
  4313. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  4314. if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  4315. },
  4316. useSetter: function () { USE_SETTER = true; },
  4317. useSimple: function () { USE_SETTER = false; }
  4318. });
  4319. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  4320. // `Object.create` method
  4321. // https://tc39.github.io/ecma262/#sec-object.create
  4322. create: $create,
  4323. // `Object.defineProperty` method
  4324. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  4325. defineProperty: $defineProperty,
  4326. // `Object.defineProperties` method
  4327. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  4328. defineProperties: $defineProperties,
  4329. // `Object.getOwnPropertyDescriptor` method
  4330. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  4331. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  4332. });
  4333. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  4334. // `Object.getOwnPropertyNames` method
  4335. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  4336. getOwnPropertyNames: $getOwnPropertyNames,
  4337. // `Object.getOwnPropertySymbols` method
  4338. // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
  4339. getOwnPropertySymbols: $getOwnPropertySymbols
  4340. });
  4341. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  4342. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  4343. $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
  4344. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  4345. return getOwnPropertySymbolsModule.f(toObject(it));
  4346. }
  4347. });
  4348. // `JSON.stringify` method behavior with symbols
  4349. // https://tc39.github.io/ecma262/#sec-json.stringify
  4350. if ($stringify) {
  4351. var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
  4352. var symbol = $Symbol();
  4353. // MS Edge converts symbol values to JSON as {}
  4354. return $stringify([symbol]) != '[null]'
  4355. // WebKit converts symbol values to JSON as null
  4356. || $stringify({ a: symbol }) != '{}'
  4357. // V8 throws on boxed symbols
  4358. || $stringify(Object(symbol)) != '{}';
  4359. });
  4360. $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
  4361. // eslint-disable-next-line no-unused-vars
  4362. stringify: function stringify(it, replacer, space) {
  4363. var args = [it];
  4364. var index = 1;
  4365. var $replacer;
  4366. while (arguments.length > index) args.push(arguments[index++]);
  4367. $replacer = replacer;
  4368. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  4369. if (!isArray(replacer)) replacer = function (key, value) {
  4370. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  4371. if (!isSymbol(value)) return value;
  4372. };
  4373. args[1] = replacer;
  4374. return $stringify.apply(null, args);
  4375. }
  4376. });
  4377. }
  4378. // `Symbol.prototype[@@toPrimitive]` method
  4379. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
  4380. if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
  4381. createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  4382. }
  4383. // `Symbol.prototype[@@toStringTag]` property
  4384. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
  4385. setToStringTag($Symbol, SYMBOL);
  4386. hiddenKeys[HIDDEN] = true;
  4387. /***/ }),
  4388. /***/ "a623":
  4389. /***/ (function(module, exports, __webpack_require__) {
  4390. "use strict";
  4391. var $ = __webpack_require__("23e7");
  4392. var $every = __webpack_require__("b727").every;
  4393. var arrayMethodIsStrict = __webpack_require__("a640");
  4394. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4395. var STRICT_METHOD = arrayMethodIsStrict('every');
  4396. var USES_TO_LENGTH = arrayMethodUsesToLength('every');
  4397. // `Array.prototype.every` method
  4398. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  4399. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
  4400. every: function every(callbackfn /* , thisArg */) {
  4401. return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  4402. }
  4403. });
  4404. /***/ }),
  4405. /***/ "a630":
  4406. /***/ (function(module, exports, __webpack_require__) {
  4407. var $ = __webpack_require__("23e7");
  4408. var from = __webpack_require__("4df4");
  4409. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  4410. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
  4411. Array.from(iterable);
  4412. });
  4413. // `Array.from` method
  4414. // https://tc39.github.io/ecma262/#sec-array.from
  4415. $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
  4416. from: from
  4417. });
  4418. /***/ }),
  4419. /***/ "a640":
  4420. /***/ (function(module, exports, __webpack_require__) {
  4421. "use strict";
  4422. var fails = __webpack_require__("d039");
  4423. module.exports = function (METHOD_NAME, argument) {
  4424. var method = [][METHOD_NAME];
  4425. return !!method && fails(function () {
  4426. // eslint-disable-next-line no-useless-call,no-throw-literal
  4427. method.call(null, argument || function () { throw 1; }, 1);
  4428. });
  4429. };
  4430. /***/ }),
  4431. /***/ "a691":
  4432. /***/ (function(module, exports) {
  4433. var ceil = Math.ceil;
  4434. var floor = Math.floor;
  4435. // `ToInteger` abstract operation
  4436. // https://tc39.github.io/ecma262/#sec-tointeger
  4437. module.exports = function (argument) {
  4438. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  4439. };
  4440. /***/ }),
  4441. /***/ "a9e3":
  4442. /***/ (function(module, exports, __webpack_require__) {
  4443. "use strict";
  4444. var DESCRIPTORS = __webpack_require__("83ab");
  4445. var global = __webpack_require__("da84");
  4446. var isForced = __webpack_require__("94ca");
  4447. var redefine = __webpack_require__("6eeb");
  4448. var has = __webpack_require__("5135");
  4449. var classof = __webpack_require__("c6b6");
  4450. var inheritIfRequired = __webpack_require__("7156");
  4451. var toPrimitive = __webpack_require__("c04e");
  4452. var fails = __webpack_require__("d039");
  4453. var create = __webpack_require__("7c73");
  4454. var getOwnPropertyNames = __webpack_require__("241c").f;
  4455. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  4456. var defineProperty = __webpack_require__("9bf2").f;
  4457. var trim = __webpack_require__("58a8").trim;
  4458. var NUMBER = 'Number';
  4459. var NativeNumber = global[NUMBER];
  4460. var NumberPrototype = NativeNumber.prototype;
  4461. // Opera ~12 has broken Object#toString
  4462. var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
  4463. // `ToNumber` abstract operation
  4464. // https://tc39.github.io/ecma262/#sec-tonumber
  4465. var toNumber = function (argument) {
  4466. var it = toPrimitive(argument, false);
  4467. var first, third, radix, maxCode, digits, length, index, code;
  4468. if (typeof it == 'string' && it.length > 2) {
  4469. it = trim(it);
  4470. first = it.charCodeAt(0);
  4471. if (first === 43 || first === 45) {
  4472. third = it.charCodeAt(2);
  4473. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  4474. } else if (first === 48) {
  4475. switch (it.charCodeAt(1)) {
  4476. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  4477. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  4478. default: return +it;
  4479. }
  4480. digits = it.slice(2);
  4481. length = digits.length;
  4482. for (index = 0; index < length; index++) {
  4483. code = digits.charCodeAt(index);
  4484. // parseInt parses a string to a first unavailable symbol
  4485. // but ToNumber should return NaN if a string contains unavailable symbols
  4486. if (code < 48 || code > maxCode) return NaN;
  4487. } return parseInt(digits, radix);
  4488. }
  4489. } return +it;
  4490. };
  4491. // `Number` constructor
  4492. // https://tc39.github.io/ecma262/#sec-number-constructor
  4493. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  4494. var NumberWrapper = function Number(value) {
  4495. var it = arguments.length < 1 ? 0 : value;
  4496. var dummy = this;
  4497. return dummy instanceof NumberWrapper
  4498. // check on 1..constructor(foo) case
  4499. && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
  4500. ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
  4501. };
  4502. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  4503. // ES3:
  4504. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  4505. // ES2015 (in case, if modules with ES2015 Number statics required before):
  4506. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  4507. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
  4508. // ESNext
  4509. 'fromString,range'
  4510. ).split(','), j = 0, key; keys.length > j; j++) {
  4511. if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
  4512. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  4513. }
  4514. }
  4515. NumberWrapper.prototype = NumberPrototype;
  4516. NumberPrototype.constructor = NumberWrapper;
  4517. redefine(global, NUMBER, NumberWrapper);
  4518. }
  4519. /***/ }),
  4520. /***/ "ab13":
  4521. /***/ (function(module, exports, __webpack_require__) {
  4522. var wellKnownSymbol = __webpack_require__("b622");
  4523. var MATCH = wellKnownSymbol('match');
  4524. module.exports = function (METHOD_NAME) {
  4525. var regexp = /./;
  4526. try {
  4527. '/./'[METHOD_NAME](regexp);
  4528. } catch (error1) {
  4529. try {
  4530. regexp[MATCH] = false;
  4531. return '/./'[METHOD_NAME](regexp);
  4532. } catch (error2) { /* empty */ }
  4533. } return false;
  4534. };
  4535. /***/ }),
  4536. /***/ "ac1f":
  4537. /***/ (function(module, exports, __webpack_require__) {
  4538. "use strict";
  4539. var $ = __webpack_require__("23e7");
  4540. var exec = __webpack_require__("9263");
  4541. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  4542. exec: exec
  4543. });
  4544. /***/ }),
  4545. /***/ "ad6d":
  4546. /***/ (function(module, exports, __webpack_require__) {
  4547. "use strict";
  4548. var anObject = __webpack_require__("825a");
  4549. // `RegExp.prototype.flags` getter implementation
  4550. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  4551. module.exports = function () {
  4552. var that = anObject(this);
  4553. var result = '';
  4554. if (that.global) result += 'g';
  4555. if (that.ignoreCase) result += 'i';
  4556. if (that.multiline) result += 'm';
  4557. if (that.dotAll) result += 's';
  4558. if (that.unicode) result += 'u';
  4559. if (that.sticky) result += 'y';
  4560. return result;
  4561. };
  4562. /***/ }),
  4563. /***/ "ae40":
  4564. /***/ (function(module, exports, __webpack_require__) {
  4565. var DESCRIPTORS = __webpack_require__("83ab");
  4566. var fails = __webpack_require__("d039");
  4567. var has = __webpack_require__("5135");
  4568. var defineProperty = Object.defineProperty;
  4569. var cache = {};
  4570. var thrower = function (it) { throw it; };
  4571. module.exports = function (METHOD_NAME, options) {
  4572. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  4573. if (!options) options = {};
  4574. var method = [][METHOD_NAME];
  4575. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  4576. var argument0 = has(options, 0) ? options[0] : thrower;
  4577. var argument1 = has(options, 1) ? options[1] : undefined;
  4578. return cache[METHOD_NAME] = !!method && !fails(function () {
  4579. if (ACCESSORS && !DESCRIPTORS) return true;
  4580. var O = { length: -1 };
  4581. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  4582. else O[1] = 1;
  4583. method.call(O, argument0, argument1);
  4584. });
  4585. };
  4586. /***/ }),
  4587. /***/ "ae93":
  4588. /***/ (function(module, exports, __webpack_require__) {
  4589. "use strict";
  4590. var getPrototypeOf = __webpack_require__("e163");
  4591. var createNonEnumerableProperty = __webpack_require__("9112");
  4592. var has = __webpack_require__("5135");
  4593. var wellKnownSymbol = __webpack_require__("b622");
  4594. var IS_PURE = __webpack_require__("c430");
  4595. var ITERATOR = wellKnownSymbol('iterator');
  4596. var BUGGY_SAFARI_ITERATORS = false;
  4597. var returnThis = function () { return this; };
  4598. // `%IteratorPrototype%` object
  4599. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  4600. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  4601. if ([].keys) {
  4602. arrayIterator = [].keys();
  4603. // Safari 8 has buggy iterators w/o `next`
  4604. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  4605. else {
  4606. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  4607. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  4608. }
  4609. }
  4610. if (IteratorPrototype == undefined) IteratorPrototype = {};
  4611. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  4612. if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
  4613. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  4614. }
  4615. module.exports = {
  4616. IteratorPrototype: IteratorPrototype,
  4617. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  4618. };
  4619. /***/ }),
  4620. /***/ "af03":
  4621. /***/ (function(module, exports, __webpack_require__) {
  4622. var fails = __webpack_require__("d039");
  4623. // check the existence of a method, lowercase
  4624. // of a tag and escaping quotes in arguments
  4625. module.exports = function (METHOD_NAME) {
  4626. return fails(function () {
  4627. var test = ''[METHOD_NAME]('"');
  4628. return test !== test.toLowerCase() || test.split('"').length > 3;
  4629. });
  4630. };
  4631. /***/ }),
  4632. /***/ "b041":
  4633. /***/ (function(module, exports, __webpack_require__) {
  4634. "use strict";
  4635. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  4636. var classof = __webpack_require__("f5df");
  4637. // `Object.prototype.toString` method implementation
  4638. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  4639. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  4640. return '[object ' + classof(this) + ']';
  4641. };
  4642. /***/ }),
  4643. /***/ "b0c0":
  4644. /***/ (function(module, exports, __webpack_require__) {
  4645. var DESCRIPTORS = __webpack_require__("83ab");
  4646. var defineProperty = __webpack_require__("9bf2").f;
  4647. var FunctionPrototype = Function.prototype;
  4648. var FunctionPrototypeToString = FunctionPrototype.toString;
  4649. var nameRE = /^\s*function ([^ (]*)/;
  4650. var NAME = 'name';
  4651. // Function instances `.name` property
  4652. // https://tc39.github.io/ecma262/#sec-function-instances-name
  4653. if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
  4654. defineProperty(FunctionPrototype, NAME, {
  4655. configurable: true,
  4656. get: function () {
  4657. try {
  4658. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  4659. } catch (error) {
  4660. return '';
  4661. }
  4662. }
  4663. });
  4664. }
  4665. /***/ }),
  4666. /***/ "b622":
  4667. /***/ (function(module, exports, __webpack_require__) {
  4668. var global = __webpack_require__("da84");
  4669. var shared = __webpack_require__("5692");
  4670. var has = __webpack_require__("5135");
  4671. var uid = __webpack_require__("90e3");
  4672. var NATIVE_SYMBOL = __webpack_require__("4930");
  4673. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4674. var WellKnownSymbolsStore = shared('wks');
  4675. var Symbol = global.Symbol;
  4676. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  4677. module.exports = function (name) {
  4678. if (!has(WellKnownSymbolsStore, name)) {
  4679. if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
  4680. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  4681. } return WellKnownSymbolsStore[name];
  4682. };
  4683. /***/ }),
  4684. /***/ "b64b":
  4685. /***/ (function(module, exports, __webpack_require__) {
  4686. var $ = __webpack_require__("23e7");
  4687. var toObject = __webpack_require__("7b0b");
  4688. var nativeKeys = __webpack_require__("df75");
  4689. var fails = __webpack_require__("d039");
  4690. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  4691. // `Object.keys` method
  4692. // https://tc39.github.io/ecma262/#sec-object.keys
  4693. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  4694. keys: function keys(it) {
  4695. return nativeKeys(toObject(it));
  4696. }
  4697. });
  4698. /***/ }),
  4699. /***/ "b680":
  4700. /***/ (function(module, exports, __webpack_require__) {
  4701. "use strict";
  4702. var $ = __webpack_require__("23e7");
  4703. var toInteger = __webpack_require__("a691");
  4704. var thisNumberValue = __webpack_require__("408a");
  4705. var repeat = __webpack_require__("1148");
  4706. var fails = __webpack_require__("d039");
  4707. var nativeToFixed = 1.0.toFixed;
  4708. var floor = Math.floor;
  4709. var pow = function (x, n, acc) {
  4710. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  4711. };
  4712. var log = function (x) {
  4713. var n = 0;
  4714. var x2 = x;
  4715. while (x2 >= 4096) {
  4716. n += 12;
  4717. x2 /= 4096;
  4718. }
  4719. while (x2 >= 2) {
  4720. n += 1;
  4721. x2 /= 2;
  4722. } return n;
  4723. };
  4724. var FORCED = nativeToFixed && (
  4725. 0.00008.toFixed(3) !== '0.000' ||
  4726. 0.9.toFixed(0) !== '1' ||
  4727. 1.255.toFixed(2) !== '1.25' ||
  4728. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  4729. ) || !fails(function () {
  4730. // V8 ~ Android 4.3-
  4731. nativeToFixed.call({});
  4732. });
  4733. // `Number.prototype.toFixed` method
  4734. // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
  4735. $({ target: 'Number', proto: true, forced: FORCED }, {
  4736. // eslint-disable-next-line max-statements
  4737. toFixed: function toFixed(fractionDigits) {
  4738. var number = thisNumberValue(this);
  4739. var fractDigits = toInteger(fractionDigits);
  4740. var data = [0, 0, 0, 0, 0, 0];
  4741. var sign = '';
  4742. var result = '0';
  4743. var e, z, j, k;
  4744. var multiply = function (n, c) {
  4745. var index = -1;
  4746. var c2 = c;
  4747. while (++index < 6) {
  4748. c2 += n * data[index];
  4749. data[index] = c2 % 1e7;
  4750. c2 = floor(c2 / 1e7);
  4751. }
  4752. };
  4753. var divide = function (n) {
  4754. var index = 6;
  4755. var c = 0;
  4756. while (--index >= 0) {
  4757. c += data[index];
  4758. data[index] = floor(c / n);
  4759. c = (c % n) * 1e7;
  4760. }
  4761. };
  4762. var dataToString = function () {
  4763. var index = 6;
  4764. var s = '';
  4765. while (--index >= 0) {
  4766. if (s !== '' || index === 0 || data[index] !== 0) {
  4767. var t = String(data[index]);
  4768. s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
  4769. }
  4770. } return s;
  4771. };
  4772. if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
  4773. // eslint-disable-next-line no-self-compare
  4774. if (number != number) return 'NaN';
  4775. if (number <= -1e21 || number >= 1e21) return String(number);
  4776. if (number < 0) {
  4777. sign = '-';
  4778. number = -number;
  4779. }
  4780. if (number > 1e-21) {
  4781. e = log(number * pow(2, 69, 1)) - 69;
  4782. z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
  4783. z *= 0x10000000000000;
  4784. e = 52 - e;
  4785. if (e > 0) {
  4786. multiply(0, z);
  4787. j = fractDigits;
  4788. while (j >= 7) {
  4789. multiply(1e7, 0);
  4790. j -= 7;
  4791. }
  4792. multiply(pow(10, j, 1), 0);
  4793. j = e - 1;
  4794. while (j >= 23) {
  4795. divide(1 << 23);
  4796. j -= 23;
  4797. }
  4798. divide(1 << j);
  4799. multiply(1, 1);
  4800. divide(2);
  4801. result = dataToString();
  4802. } else {
  4803. multiply(0, z);
  4804. multiply(1 << -e, 0);
  4805. result = dataToString() + repeat.call('0', fractDigits);
  4806. }
  4807. }
  4808. if (fractDigits > 0) {
  4809. k = result.length;
  4810. result = sign + (k <= fractDigits
  4811. ? '0.' + repeat.call('0', fractDigits - k) + result
  4812. : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
  4813. } else {
  4814. result = sign + result;
  4815. } return result;
  4816. }
  4817. });
  4818. /***/ }),
  4819. /***/ "b727":
  4820. /***/ (function(module, exports, __webpack_require__) {
  4821. var bind = __webpack_require__("0366");
  4822. var IndexedObject = __webpack_require__("44ad");
  4823. var toObject = __webpack_require__("7b0b");
  4824. var toLength = __webpack_require__("50c4");
  4825. var arraySpeciesCreate = __webpack_require__("65f0");
  4826. var push = [].push;
  4827. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  4828. var createMethod = function (TYPE) {
  4829. var IS_MAP = TYPE == 1;
  4830. var IS_FILTER = TYPE == 2;
  4831. var IS_SOME = TYPE == 3;
  4832. var IS_EVERY = TYPE == 4;
  4833. var IS_FIND_INDEX = TYPE == 6;
  4834. var IS_FILTER_OUT = TYPE == 7;
  4835. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  4836. return function ($this, callbackfn, that, specificCreate) {
  4837. var O = toObject($this);
  4838. var self = IndexedObject(O);
  4839. var boundFunction = bind(callbackfn, that, 3);
  4840. var length = toLength(self.length);
  4841. var index = 0;
  4842. var create = specificCreate || arraySpeciesCreate;
  4843. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  4844. var value, result;
  4845. for (;length > index; index++) if (NO_HOLES || index in self) {
  4846. value = self[index];
  4847. result = boundFunction(value, index, O);
  4848. if (TYPE) {
  4849. if (IS_MAP) target[index] = result; // map
  4850. else if (result) switch (TYPE) {
  4851. case 3: return true; // some
  4852. case 5: return value; // find
  4853. case 6: return index; // findIndex
  4854. case 2: push.call(target, value); // filter
  4855. } else switch (TYPE) {
  4856. case 4: return false; // every
  4857. case 7: push.call(target, value); // filterOut
  4858. }
  4859. }
  4860. }
  4861. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  4862. };
  4863. };
  4864. module.exports = {
  4865. // `Array.prototype.forEach` method
  4866. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  4867. forEach: createMethod(0),
  4868. // `Array.prototype.map` method
  4869. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  4870. map: createMethod(1),
  4871. // `Array.prototype.filter` method
  4872. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  4873. filter: createMethod(2),
  4874. // `Array.prototype.some` method
  4875. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  4876. some: createMethod(3),
  4877. // `Array.prototype.every` method
  4878. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  4879. every: createMethod(4),
  4880. // `Array.prototype.find` method
  4881. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  4882. find: createMethod(5),
  4883. // `Array.prototype.findIndex` method
  4884. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  4885. findIndex: createMethod(6),
  4886. // `Array.prototype.filterOut` method
  4887. // https://github.com/tc39/proposal-array-filtering
  4888. filterOut: createMethod(7)
  4889. };
  4890. /***/ }),
  4891. /***/ "baa5":
  4892. /***/ (function(module, exports, __webpack_require__) {
  4893. var $ = __webpack_require__("23e7");
  4894. var lastIndexOf = __webpack_require__("e58c");
  4895. // `Array.prototype.lastIndexOf` method
  4896. // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
  4897. $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
  4898. lastIndexOf: lastIndexOf
  4899. });
  4900. /***/ }),
  4901. /***/ "bb2f":
  4902. /***/ (function(module, exports, __webpack_require__) {
  4903. var fails = __webpack_require__("d039");
  4904. module.exports = !fails(function () {
  4905. return Object.isExtensible(Object.preventExtensions({}));
  4906. });
  4907. /***/ }),
  4908. /***/ "c04e":
  4909. /***/ (function(module, exports, __webpack_require__) {
  4910. var isObject = __webpack_require__("861d");
  4911. // `ToPrimitive` abstract operation
  4912. // https://tc39.github.io/ecma262/#sec-toprimitive
  4913. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  4914. // and the second argument - flag - preferred type is a string
  4915. module.exports = function (input, PREFERRED_STRING) {
  4916. if (!isObject(input)) return input;
  4917. var fn, val;
  4918. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  4919. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  4920. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  4921. throw TypeError("Can't convert object to primitive value");
  4922. };
  4923. /***/ }),
  4924. /***/ "c430":
  4925. /***/ (function(module, exports) {
  4926. module.exports = false;
  4927. /***/ }),
  4928. /***/ "c6b6":
  4929. /***/ (function(module, exports) {
  4930. var toString = {}.toString;
  4931. module.exports = function (it) {
  4932. return toString.call(it).slice(8, -1);
  4933. };
  4934. /***/ }),
  4935. /***/ "c6cd":
  4936. /***/ (function(module, exports, __webpack_require__) {
  4937. var global = __webpack_require__("da84");
  4938. var setGlobal = __webpack_require__("ce4e");
  4939. var SHARED = '__core-js_shared__';
  4940. var store = global[SHARED] || setGlobal(SHARED, {});
  4941. module.exports = store;
  4942. /***/ }),
  4943. /***/ "c7cd":
  4944. /***/ (function(module, exports, __webpack_require__) {
  4945. "use strict";
  4946. var $ = __webpack_require__("23e7");
  4947. var createHTML = __webpack_require__("857a");
  4948. var forcedStringHTMLMethod = __webpack_require__("af03");
  4949. // `String.prototype.fixed` method
  4950. // https://tc39.github.io/ecma262/#sec-string.prototype.fixed
  4951. $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
  4952. fixed: function fixed() {
  4953. return createHTML(this, 'tt', '', '');
  4954. }
  4955. });
  4956. /***/ }),
  4957. /***/ "c8ba":
  4958. /***/ (function(module, exports) {
  4959. var g;
  4960. // This works in non-strict mode
  4961. g = (function() {
  4962. return this;
  4963. })();
  4964. try {
  4965. // This works if eval is allowed (see CSP)
  4966. g = g || new Function("return this")();
  4967. } catch (e) {
  4968. // This works if the window reference is available
  4969. if (typeof window === "object") g = window;
  4970. }
  4971. // g can still be undefined, but nothing to do about it...
  4972. // We return undefined, instead of nothing here, so it's
  4973. // easier to handle this case. if(!global) { ...}
  4974. module.exports = g;
  4975. /***/ }),
  4976. /***/ "c8d2":
  4977. /***/ (function(module, exports, __webpack_require__) {
  4978. var fails = __webpack_require__("d039");
  4979. var whitespaces = __webpack_require__("5899");
  4980. var non = '\u200B\u0085\u180E';
  4981. // check that a method works with the correct list
  4982. // of whitespaces and has a correct name
  4983. module.exports = function (METHOD_NAME) {
  4984. return fails(function () {
  4985. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  4986. });
  4987. };
  4988. /***/ }),
  4989. /***/ "c975":
  4990. /***/ (function(module, exports, __webpack_require__) {
  4991. "use strict";
  4992. var $ = __webpack_require__("23e7");
  4993. var $indexOf = __webpack_require__("4d64").indexOf;
  4994. var arrayMethodIsStrict = __webpack_require__("a640");
  4995. var arrayMethodUsesToLength = __webpack_require__("ae40");
  4996. var nativeIndexOf = [].indexOf;
  4997. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  4998. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  4999. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  5000. // `Array.prototype.indexOf` method
  5001. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  5002. $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
  5003. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  5004. return NEGATIVE_ZERO
  5005. // convert -0 to +0
  5006. ? nativeIndexOf.apply(this, arguments) || 0
  5007. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5008. }
  5009. });
  5010. /***/ }),
  5011. /***/ "ca84":
  5012. /***/ (function(module, exports, __webpack_require__) {
  5013. var has = __webpack_require__("5135");
  5014. var toIndexedObject = __webpack_require__("fc6a");
  5015. var indexOf = __webpack_require__("4d64").indexOf;
  5016. var hiddenKeys = __webpack_require__("d012");
  5017. module.exports = function (object, names) {
  5018. var O = toIndexedObject(object);
  5019. var i = 0;
  5020. var result = [];
  5021. var key;
  5022. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  5023. // Don't enum bug & hidden keys
  5024. while (names.length > i) if (has(O, key = names[i++])) {
  5025. ~indexOf(result, key) || result.push(key);
  5026. }
  5027. return result;
  5028. };
  5029. /***/ }),
  5030. /***/ "caad":
  5031. /***/ (function(module, exports, __webpack_require__) {
  5032. "use strict";
  5033. var $ = __webpack_require__("23e7");
  5034. var $includes = __webpack_require__("4d64").includes;
  5035. var addToUnscopables = __webpack_require__("44d2");
  5036. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5037. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  5038. // `Array.prototype.includes` method
  5039. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  5040. $({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
  5041. includes: function includes(el /* , fromIndex = 0 */) {
  5042. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5043. }
  5044. });
  5045. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  5046. addToUnscopables('includes');
  5047. /***/ }),
  5048. /***/ "cc12":
  5049. /***/ (function(module, exports, __webpack_require__) {
  5050. var global = __webpack_require__("da84");
  5051. var isObject = __webpack_require__("861d");
  5052. var document = global.document;
  5053. // typeof document.createElement is 'object' in old IE
  5054. var EXISTS = isObject(document) && isObject(document.createElement);
  5055. module.exports = function (it) {
  5056. return EXISTS ? document.createElement(it) : {};
  5057. };
  5058. /***/ }),
  5059. /***/ "ce4e":
  5060. /***/ (function(module, exports, __webpack_require__) {
  5061. var global = __webpack_require__("da84");
  5062. var createNonEnumerableProperty = __webpack_require__("9112");
  5063. module.exports = function (key, value) {
  5064. try {
  5065. createNonEnumerableProperty(global, key, value);
  5066. } catch (error) {
  5067. global[key] = value;
  5068. } return value;
  5069. };
  5070. /***/ }),
  5071. /***/ "d012":
  5072. /***/ (function(module, exports) {
  5073. module.exports = {};
  5074. /***/ }),
  5075. /***/ "d039":
  5076. /***/ (function(module, exports) {
  5077. module.exports = function (exec) {
  5078. try {
  5079. return !!exec();
  5080. } catch (error) {
  5081. return true;
  5082. }
  5083. };
  5084. /***/ }),
  5085. /***/ "d066":
  5086. /***/ (function(module, exports, __webpack_require__) {
  5087. var path = __webpack_require__("428f");
  5088. var global = __webpack_require__("da84");
  5089. var aFunction = function (variable) {
  5090. return typeof variable == 'function' ? variable : undefined;
  5091. };
  5092. module.exports = function (namespace, method) {
  5093. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  5094. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  5095. };
  5096. /***/ }),
  5097. /***/ "d1e7":
  5098. /***/ (function(module, exports, __webpack_require__) {
  5099. "use strict";
  5100. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  5101. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5102. // Nashorn ~ JDK8 bug
  5103. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  5104. // `Object.prototype.propertyIsEnumerable` method implementation
  5105. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  5106. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  5107. var descriptor = getOwnPropertyDescriptor(this, V);
  5108. return !!descriptor && descriptor.enumerable;
  5109. } : nativePropertyIsEnumerable;
  5110. /***/ }),
  5111. /***/ "d28b":
  5112. /***/ (function(module, exports, __webpack_require__) {
  5113. var defineWellKnownSymbol = __webpack_require__("746f");
  5114. // `Symbol.iterator` well-known symbol
  5115. // https://tc39.github.io/ecma262/#sec-symbol.iterator
  5116. defineWellKnownSymbol('iterator');
  5117. /***/ }),
  5118. /***/ "d2bb":
  5119. /***/ (function(module, exports, __webpack_require__) {
  5120. var anObject = __webpack_require__("825a");
  5121. var aPossiblePrototype = __webpack_require__("3bbe");
  5122. // `Object.setPrototypeOf` method
  5123. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  5124. // Works with __proto__ only. Old v8 can't work with null proto objects.
  5125. /* eslint-disable no-proto */
  5126. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  5127. var CORRECT_SETTER = false;
  5128. var test = {};
  5129. var setter;
  5130. try {
  5131. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  5132. setter.call(test, []);
  5133. CORRECT_SETTER = test instanceof Array;
  5134. } catch (error) { /* empty */ }
  5135. return function setPrototypeOf(O, proto) {
  5136. anObject(O);
  5137. aPossiblePrototype(proto);
  5138. if (CORRECT_SETTER) setter.call(O, proto);
  5139. else O.__proto__ = proto;
  5140. return O;
  5141. };
  5142. }() : undefined);
  5143. /***/ }),
  5144. /***/ "d3b7":
  5145. /***/ (function(module, exports, __webpack_require__) {
  5146. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5147. var redefine = __webpack_require__("6eeb");
  5148. var toString = __webpack_require__("b041");
  5149. // `Object.prototype.toString` method
  5150. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  5151. if (!TO_STRING_TAG_SUPPORT) {
  5152. redefine(Object.prototype, 'toString', toString, { unsafe: true });
  5153. }
  5154. /***/ }),
  5155. /***/ "d44e":
  5156. /***/ (function(module, exports, __webpack_require__) {
  5157. var defineProperty = __webpack_require__("9bf2").f;
  5158. var has = __webpack_require__("5135");
  5159. var wellKnownSymbol = __webpack_require__("b622");
  5160. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5161. module.exports = function (it, TAG, STATIC) {
  5162. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  5163. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  5164. }
  5165. };
  5166. /***/ }),
  5167. /***/ "d58f":
  5168. /***/ (function(module, exports, __webpack_require__) {
  5169. var aFunction = __webpack_require__("1c0b");
  5170. var toObject = __webpack_require__("7b0b");
  5171. var IndexedObject = __webpack_require__("44ad");
  5172. var toLength = __webpack_require__("50c4");
  5173. // `Array.prototype.{ reduce, reduceRight }` methods implementation
  5174. var createMethod = function (IS_RIGHT) {
  5175. return function (that, callbackfn, argumentsLength, memo) {
  5176. aFunction(callbackfn);
  5177. var O = toObject(that);
  5178. var self = IndexedObject(O);
  5179. var length = toLength(O.length);
  5180. var index = IS_RIGHT ? length - 1 : 0;
  5181. var i = IS_RIGHT ? -1 : 1;
  5182. if (argumentsLength < 2) while (true) {
  5183. if (index in self) {
  5184. memo = self[index];
  5185. index += i;
  5186. break;
  5187. }
  5188. index += i;
  5189. if (IS_RIGHT ? index < 0 : length <= index) {
  5190. throw TypeError('Reduce of empty array with no initial value');
  5191. }
  5192. }
  5193. for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
  5194. memo = callbackfn(memo, self[index], index, O);
  5195. }
  5196. return memo;
  5197. };
  5198. };
  5199. module.exports = {
  5200. // `Array.prototype.reduce` method
  5201. // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
  5202. left: createMethod(false),
  5203. // `Array.prototype.reduceRight` method
  5204. // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
  5205. right: createMethod(true)
  5206. };
  5207. /***/ }),
  5208. /***/ "d784":
  5209. /***/ (function(module, exports, __webpack_require__) {
  5210. "use strict";
  5211. // TODO: Remove from `core-js@4` since it's moved to entry points
  5212. __webpack_require__("ac1f");
  5213. var redefine = __webpack_require__("6eeb");
  5214. var fails = __webpack_require__("d039");
  5215. var wellKnownSymbol = __webpack_require__("b622");
  5216. var regexpExec = __webpack_require__("9263");
  5217. var createNonEnumerableProperty = __webpack_require__("9112");
  5218. var SPECIES = wellKnownSymbol('species');
  5219. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  5220. // #replace needs built-in support for named groups.
  5221. // #match works fine because it just return the exec results, even if it has
  5222. // a "grops" property.
  5223. var re = /./;
  5224. re.exec = function () {
  5225. var result = [];
  5226. result.groups = { a: '7' };
  5227. return result;
  5228. };
  5229. return ''.replace(re, '$<a>') !== '7';
  5230. });
  5231. // IE <= 11 replaces $0 with the whole match, as if it was $&
  5232. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  5233. var REPLACE_KEEPS_$0 = (function () {
  5234. return 'a'.replace(/./, '$0') === '$0';
  5235. })();
  5236. var REPLACE = wellKnownSymbol('replace');
  5237. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  5238. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  5239. if (/./[REPLACE]) {
  5240. return /./[REPLACE]('a', '$0') === '';
  5241. }
  5242. return false;
  5243. })();
  5244. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  5245. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  5246. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  5247. var re = /(?:)/;
  5248. var originalExec = re.exec;
  5249. re.exec = function () { return originalExec.apply(this, arguments); };
  5250. var result = 'ab'.split(re);
  5251. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  5252. });
  5253. module.exports = function (KEY, length, exec, sham) {
  5254. var SYMBOL = wellKnownSymbol(KEY);
  5255. var DELEGATES_TO_SYMBOL = !fails(function () {
  5256. // String methods call symbol-named RegEp methods
  5257. var O = {};
  5258. O[SYMBOL] = function () { return 7; };
  5259. return ''[KEY](O) != 7;
  5260. });
  5261. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  5262. // Symbol-named RegExp methods call .exec
  5263. var execCalled = false;
  5264. var re = /a/;
  5265. if (KEY === 'split') {
  5266. // We can't use real regex here since it causes deoptimization
  5267. // and serious performance degradation in V8
  5268. // https://github.com/zloirock/core-js/issues/306
  5269. re = {};
  5270. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  5271. // a new one. We need to return the patched regex when creating the new one.
  5272. re.constructor = {};
  5273. re.constructor[SPECIES] = function () { return re; };
  5274. re.flags = '';
  5275. re[SYMBOL] = /./[SYMBOL];
  5276. }
  5277. re.exec = function () { execCalled = true; return null; };
  5278. re[SYMBOL]('');
  5279. return !execCalled;
  5280. });
  5281. if (
  5282. !DELEGATES_TO_SYMBOL ||
  5283. !DELEGATES_TO_EXEC ||
  5284. (KEY === 'replace' && !(
  5285. REPLACE_SUPPORTS_NAMED_GROUPS &&
  5286. REPLACE_KEEPS_$0 &&
  5287. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5288. )) ||
  5289. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  5290. ) {
  5291. var nativeRegExpMethod = /./[SYMBOL];
  5292. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  5293. if (regexp.exec === regexpExec) {
  5294. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  5295. // The native String method already delegates to @@method (this
  5296. // polyfilled function), leasing to infinite recursion.
  5297. // We avoid it by directly calling the native @@method method.
  5298. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  5299. }
  5300. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  5301. }
  5302. return { done: false };
  5303. }, {
  5304. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  5305. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5306. });
  5307. var stringMethod = methods[0];
  5308. var regexMethod = methods[1];
  5309. redefine(String.prototype, KEY, stringMethod);
  5310. redefine(RegExp.prototype, SYMBOL, length == 2
  5311. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  5312. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  5313. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  5314. // 21.2.5.6 RegExp.prototype[@@match](string)
  5315. // 21.2.5.9 RegExp.prototype[@@search](string)
  5316. : function (string) { return regexMethod.call(string, this); }
  5317. );
  5318. }
  5319. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  5320. };
  5321. /***/ }),
  5322. /***/ "d81d":
  5323. /***/ (function(module, exports, __webpack_require__) {
  5324. "use strict";
  5325. var $ = __webpack_require__("23e7");
  5326. var $map = __webpack_require__("b727").map;
  5327. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  5328. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5329. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  5330. // FF49- issue
  5331. var USES_TO_LENGTH = arrayMethodUsesToLength('map');
  5332. // `Array.prototype.map` method
  5333. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  5334. // with adding support of @@species
  5335. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  5336. map: function map(callbackfn /* , thisArg */) {
  5337. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5338. }
  5339. });
  5340. /***/ }),
  5341. /***/ "da84":
  5342. /***/ (function(module, exports, __webpack_require__) {
  5343. /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
  5344. return it && it.Math == Math && it;
  5345. };
  5346. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  5347. module.exports =
  5348. // eslint-disable-next-line no-undef
  5349. check(typeof globalThis == 'object' && globalThis) ||
  5350. check(typeof window == 'object' && window) ||
  5351. check(typeof self == 'object' && self) ||
  5352. check(typeof global == 'object' && global) ||
  5353. // eslint-disable-next-line no-new-func
  5354. (function () { return this; })() || Function('return this')();
  5355. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
  5356. /***/ }),
  5357. /***/ "dbb4":
  5358. /***/ (function(module, exports, __webpack_require__) {
  5359. var $ = __webpack_require__("23e7");
  5360. var DESCRIPTORS = __webpack_require__("83ab");
  5361. var ownKeys = __webpack_require__("56ef");
  5362. var toIndexedObject = __webpack_require__("fc6a");
  5363. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  5364. var createProperty = __webpack_require__("8418");
  5365. // `Object.getOwnPropertyDescriptors` method
  5366. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  5367. $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
  5368. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  5369. var O = toIndexedObject(object);
  5370. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  5371. var keys = ownKeys(O);
  5372. var result = {};
  5373. var index = 0;
  5374. var key, descriptor;
  5375. while (keys.length > index) {
  5376. descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
  5377. if (descriptor !== undefined) createProperty(result, key, descriptor);
  5378. }
  5379. return result;
  5380. }
  5381. });
  5382. /***/ }),
  5383. /***/ "ddb0":
  5384. /***/ (function(module, exports, __webpack_require__) {
  5385. var global = __webpack_require__("da84");
  5386. var DOMIterables = __webpack_require__("fdbc");
  5387. var ArrayIteratorMethods = __webpack_require__("e260");
  5388. var createNonEnumerableProperty = __webpack_require__("9112");
  5389. var wellKnownSymbol = __webpack_require__("b622");
  5390. var ITERATOR = wellKnownSymbol('iterator');
  5391. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5392. var ArrayValues = ArrayIteratorMethods.values;
  5393. for (var COLLECTION_NAME in DOMIterables) {
  5394. var Collection = global[COLLECTION_NAME];
  5395. var CollectionPrototype = Collection && Collection.prototype;
  5396. if (CollectionPrototype) {
  5397. // some Chrome versions have non-configurable methods on DOMTokenList
  5398. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  5399. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  5400. } catch (error) {
  5401. CollectionPrototype[ITERATOR] = ArrayValues;
  5402. }
  5403. if (!CollectionPrototype[TO_STRING_TAG]) {
  5404. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  5405. }
  5406. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  5407. // some Chrome versions have non-configurable methods on DOMTokenList
  5408. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  5409. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  5410. } catch (error) {
  5411. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  5412. }
  5413. }
  5414. }
  5415. }
  5416. /***/ }),
  5417. /***/ "df75":
  5418. /***/ (function(module, exports, __webpack_require__) {
  5419. var internalObjectKeys = __webpack_require__("ca84");
  5420. var enumBugKeys = __webpack_require__("7839");
  5421. // `Object.keys` method
  5422. // https://tc39.github.io/ecma262/#sec-object.keys
  5423. module.exports = Object.keys || function keys(O) {
  5424. return internalObjectKeys(O, enumBugKeys);
  5425. };
  5426. /***/ }),
  5427. /***/ "e01a":
  5428. /***/ (function(module, exports, __webpack_require__) {
  5429. "use strict";
  5430. // `Symbol.prototype.description` getter
  5431. // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
  5432. var $ = __webpack_require__("23e7");
  5433. var DESCRIPTORS = __webpack_require__("83ab");
  5434. var global = __webpack_require__("da84");
  5435. var has = __webpack_require__("5135");
  5436. var isObject = __webpack_require__("861d");
  5437. var defineProperty = __webpack_require__("9bf2").f;
  5438. var copyConstructorProperties = __webpack_require__("e893");
  5439. var NativeSymbol = global.Symbol;
  5440. if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  5441. // Safari 12 bug
  5442. NativeSymbol().description !== undefined
  5443. )) {
  5444. var EmptyStringDescriptionStore = {};
  5445. // wrap Symbol constructor for correct work with undefined description
  5446. var SymbolWrapper = function Symbol() {
  5447. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  5448. var result = this instanceof SymbolWrapper
  5449. ? new NativeSymbol(description)
  5450. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  5451. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  5452. if (description === '') EmptyStringDescriptionStore[result] = true;
  5453. return result;
  5454. };
  5455. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  5456. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  5457. symbolPrototype.constructor = SymbolWrapper;
  5458. var symbolToString = symbolPrototype.toString;
  5459. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  5460. var regexp = /^Symbol\((.*)\)[^)]+$/;
  5461. defineProperty(symbolPrototype, 'description', {
  5462. configurable: true,
  5463. get: function description() {
  5464. var symbol = isObject(this) ? this.valueOf() : this;
  5465. var string = symbolToString.call(symbol);
  5466. if (has(EmptyStringDescriptionStore, symbol)) return '';
  5467. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  5468. return desc === '' ? undefined : desc;
  5469. }
  5470. });
  5471. $({ global: true, forced: true }, {
  5472. Symbol: SymbolWrapper
  5473. });
  5474. }
  5475. /***/ }),
  5476. /***/ "e163":
  5477. /***/ (function(module, exports, __webpack_require__) {
  5478. var has = __webpack_require__("5135");
  5479. var toObject = __webpack_require__("7b0b");
  5480. var sharedKey = __webpack_require__("f772");
  5481. var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
  5482. var IE_PROTO = sharedKey('IE_PROTO');
  5483. var ObjectPrototype = Object.prototype;
  5484. // `Object.getPrototypeOf` method
  5485. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  5486. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  5487. O = toObject(O);
  5488. if (has(O, IE_PROTO)) return O[IE_PROTO];
  5489. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  5490. return O.constructor.prototype;
  5491. } return O instanceof Object ? ObjectPrototype : null;
  5492. };
  5493. /***/ }),
  5494. /***/ "e177":
  5495. /***/ (function(module, exports, __webpack_require__) {
  5496. var fails = __webpack_require__("d039");
  5497. module.exports = !fails(function () {
  5498. function F() { /* empty */ }
  5499. F.prototype.constructor = null;
  5500. return Object.getPrototypeOf(new F()) !== F.prototype;
  5501. });
  5502. /***/ }),
  5503. /***/ "e260":
  5504. /***/ (function(module, exports, __webpack_require__) {
  5505. "use strict";
  5506. var toIndexedObject = __webpack_require__("fc6a");
  5507. var addToUnscopables = __webpack_require__("44d2");
  5508. var Iterators = __webpack_require__("3f8c");
  5509. var InternalStateModule = __webpack_require__("69f3");
  5510. var defineIterator = __webpack_require__("7dd0");
  5511. var ARRAY_ITERATOR = 'Array Iterator';
  5512. var setInternalState = InternalStateModule.set;
  5513. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  5514. // `Array.prototype.entries` method
  5515. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  5516. // `Array.prototype.keys` method
  5517. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  5518. // `Array.prototype.values` method
  5519. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  5520. // `Array.prototype[@@iterator]` method
  5521. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  5522. // `CreateArrayIterator` internal method
  5523. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  5524. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  5525. setInternalState(this, {
  5526. type: ARRAY_ITERATOR,
  5527. target: toIndexedObject(iterated), // target
  5528. index: 0, // next index
  5529. kind: kind // kind
  5530. });
  5531. // `%ArrayIteratorPrototype%.next` method
  5532. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  5533. }, function () {
  5534. var state = getInternalState(this);
  5535. var target = state.target;
  5536. var kind = state.kind;
  5537. var index = state.index++;
  5538. if (!target || index >= target.length) {
  5539. state.target = undefined;
  5540. return { value: undefined, done: true };
  5541. }
  5542. if (kind == 'keys') return { value: index, done: false };
  5543. if (kind == 'values') return { value: target[index], done: false };
  5544. return { value: [index, target[index]], done: false };
  5545. }, 'values');
  5546. // argumentsList[@@iterator] is %ArrayProto_values%
  5547. // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
  5548. // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
  5549. Iterators.Arguments = Iterators.Array;
  5550. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  5551. addToUnscopables('keys');
  5552. addToUnscopables('values');
  5553. addToUnscopables('entries');
  5554. /***/ }),
  5555. /***/ "e2cc":
  5556. /***/ (function(module, exports, __webpack_require__) {
  5557. var redefine = __webpack_require__("6eeb");
  5558. module.exports = function (target, src, options) {
  5559. for (var key in src) redefine(target, key, src[key], options);
  5560. return target;
  5561. };
  5562. /***/ }),
  5563. /***/ "e439":
  5564. /***/ (function(module, exports, __webpack_require__) {
  5565. var $ = __webpack_require__("23e7");
  5566. var fails = __webpack_require__("d039");
  5567. var toIndexedObject = __webpack_require__("fc6a");
  5568. var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
  5569. var DESCRIPTORS = __webpack_require__("83ab");
  5570. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
  5571. var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
  5572. // `Object.getOwnPropertyDescriptor` method
  5573. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  5574. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  5575. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  5576. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  5577. }
  5578. });
  5579. /***/ }),
  5580. /***/ "e538":
  5581. /***/ (function(module, exports, __webpack_require__) {
  5582. var wellKnownSymbol = __webpack_require__("b622");
  5583. exports.f = wellKnownSymbol;
  5584. /***/ }),
  5585. /***/ "e58c":
  5586. /***/ (function(module, exports, __webpack_require__) {
  5587. "use strict";
  5588. var toIndexedObject = __webpack_require__("fc6a");
  5589. var toInteger = __webpack_require__("a691");
  5590. var toLength = __webpack_require__("50c4");
  5591. var arrayMethodIsStrict = __webpack_require__("a640");
  5592. var arrayMethodUsesToLength = __webpack_require__("ae40");
  5593. var min = Math.min;
  5594. var nativeLastIndexOf = [].lastIndexOf;
  5595. var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
  5596. var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
  5597. // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
  5598. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  5599. var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
  5600. // `Array.prototype.lastIndexOf` method implementation
  5601. // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
  5602. module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  5603. // convert -0 to +0
  5604. if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
  5605. var O = toIndexedObject(this);
  5606. var length = toLength(O.length);
  5607. var index = length - 1;
  5608. if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
  5609. if (index < 0) index = length + index;
  5610. for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
  5611. return -1;
  5612. } : nativeLastIndexOf;
  5613. /***/ }),
  5614. /***/ "e893":
  5615. /***/ (function(module, exports, __webpack_require__) {
  5616. var has = __webpack_require__("5135");
  5617. var ownKeys = __webpack_require__("56ef");
  5618. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  5619. var definePropertyModule = __webpack_require__("9bf2");
  5620. module.exports = function (target, source) {
  5621. var keys = ownKeys(source);
  5622. var defineProperty = definePropertyModule.f;
  5623. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  5624. for (var i = 0; i < keys.length; i++) {
  5625. var key = keys[i];
  5626. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  5627. }
  5628. };
  5629. /***/ }),
  5630. /***/ "e8b5":
  5631. /***/ (function(module, exports, __webpack_require__) {
  5632. var classof = __webpack_require__("c6b6");
  5633. // `IsArray` abstract operation
  5634. // https://tc39.github.io/ecma262/#sec-isarray
  5635. module.exports = Array.isArray || function isArray(arg) {
  5636. return classof(arg) == 'Array';
  5637. };
  5638. /***/ }),
  5639. /***/ "e95a":
  5640. /***/ (function(module, exports, __webpack_require__) {
  5641. var wellKnownSymbol = __webpack_require__("b622");
  5642. var Iterators = __webpack_require__("3f8c");
  5643. var ITERATOR = wellKnownSymbol('iterator');
  5644. var ArrayPrototype = Array.prototype;
  5645. // check on default Array iterator
  5646. module.exports = function (it) {
  5647. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  5648. };
  5649. /***/ }),
  5650. /***/ "f183":
  5651. /***/ (function(module, exports, __webpack_require__) {
  5652. var hiddenKeys = __webpack_require__("d012");
  5653. var isObject = __webpack_require__("861d");
  5654. var has = __webpack_require__("5135");
  5655. var defineProperty = __webpack_require__("9bf2").f;
  5656. var uid = __webpack_require__("90e3");
  5657. var FREEZING = __webpack_require__("bb2f");
  5658. var METADATA = uid('meta');
  5659. var id = 0;
  5660. var isExtensible = Object.isExtensible || function () {
  5661. return true;
  5662. };
  5663. var setMetadata = function (it) {
  5664. defineProperty(it, METADATA, { value: {
  5665. objectID: 'O' + ++id, // object ID
  5666. weakData: {} // weak collections IDs
  5667. } });
  5668. };
  5669. var fastKey = function (it, create) {
  5670. // return a primitive with prefix
  5671. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  5672. if (!has(it, METADATA)) {
  5673. // can't set metadata to uncaught frozen object
  5674. if (!isExtensible(it)) return 'F';
  5675. // not necessary to add metadata
  5676. if (!create) return 'E';
  5677. // add missing metadata
  5678. setMetadata(it);
  5679. // return object ID
  5680. } return it[METADATA].objectID;
  5681. };
  5682. var getWeakData = function (it, create) {
  5683. if (!has(it, METADATA)) {
  5684. // can't set metadata to uncaught frozen object
  5685. if (!isExtensible(it)) return true;
  5686. // not necessary to add metadata
  5687. if (!create) return false;
  5688. // add missing metadata
  5689. setMetadata(it);
  5690. // return the store of weak collections IDs
  5691. } return it[METADATA].weakData;
  5692. };
  5693. // add metadata on freeze-family methods calling
  5694. var onFreeze = function (it) {
  5695. if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
  5696. return it;
  5697. };
  5698. var meta = module.exports = {
  5699. REQUIRED: false,
  5700. fastKey: fastKey,
  5701. getWeakData: getWeakData,
  5702. onFreeze: onFreeze
  5703. };
  5704. hiddenKeys[METADATA] = true;
  5705. /***/ }),
  5706. /***/ "f5df":
  5707. /***/ (function(module, exports, __webpack_require__) {
  5708. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5709. var classofRaw = __webpack_require__("c6b6");
  5710. var wellKnownSymbol = __webpack_require__("b622");
  5711. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5712. // ES3 wrong here
  5713. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  5714. // fallback for IE11 Script Access Denied error
  5715. var tryGet = function (it, key) {
  5716. try {
  5717. return it[key];
  5718. } catch (error) { /* empty */ }
  5719. };
  5720. // getting tag from ES6+ `Object.prototype.toString`
  5721. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  5722. var O, tag, result;
  5723. return it === undefined ? 'Undefined' : it === null ? 'Null'
  5724. // @@toStringTag case
  5725. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  5726. // builtinTag case
  5727. : CORRECT_ARGUMENTS ? classofRaw(O)
  5728. // ES3 arguments fallback
  5729. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  5730. };
  5731. /***/ }),
  5732. /***/ "f772":
  5733. /***/ (function(module, exports, __webpack_require__) {
  5734. var shared = __webpack_require__("5692");
  5735. var uid = __webpack_require__("90e3");
  5736. var keys = shared('keys');
  5737. module.exports = function (key) {
  5738. return keys[key] || (keys[key] = uid(key));
  5739. };
  5740. /***/ }),
  5741. /***/ "fb15":
  5742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5743. "use strict";
  5744. // ESM COMPAT FLAG
  5745. __webpack_require__.r(__webpack_exports__);
  5746. // EXPORTS
  5747. __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
  5748. __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
  5749. __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Header; });
  5750. __webpack_require__.d(__webpack_exports__, "Body", function() { return /* reexport */ Body; });
  5751. __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
  5752. __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
  5753. __webpack_require__.d(__webpack_exports__, "Loading", function() { return /* reexport */ Loading; });
  5754. __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid; });
  5755. __webpack_require__.d(__webpack_exports__, "Menu", function() { return /* reexport */ Menu; });
  5756. __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ Toolbar; });
  5757. __webpack_require__.d(__webpack_exports__, "Pager", function() { return /* reexport */ Pager; });
  5758. __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return /* reexport */ Checkbox; });
  5759. __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
  5760. __webpack_require__.d(__webpack_exports__, "Input", function() { return /* reexport */ Input; });
  5761. __webpack_require__.d(__webpack_exports__, "Textarea", function() { return /* reexport */ Textarea; });
  5762. __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ Button; });
  5763. __webpack_require__.d(__webpack_exports__, "ModalController", function() { return /* reexport */ ModalController; });
  5764. __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
  5765. __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ Tooltip; });
  5766. __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; });
  5767. __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
  5768. __webpack_require__.d(__webpack_exports__, "Switch", function() { return /* reexport */ Switch; });
  5769. __webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
  5770. __webpack_require__.d(__webpack_exports__, "Pulldown", function() { return /* reexport */ Pulldown; });
  5771. __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
  5772. __webpack_require__.d(__webpack_exports__, "Export", function() { return /* reexport */ Export; });
  5773. __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return /* reexport */ Keyboard; });
  5774. __webpack_require__.d(__webpack_exports__, "Validator", function() { return /* reexport */ Validator; });
  5775. __webpack_require__.d(__webpack_exports__, "Resize", function() { return /* reexport */ Resize; });
  5776. __webpack_require__.d(__webpack_exports__, "Table", function() { return /* reexport */ Table; });
  5777. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  5778. // This file is imported into lib/wc client bundles.
  5779. if (typeof window !== 'undefined') {
  5780. var currentScript = window.document.currentScript
  5781. if (true) {
  5782. var getCurrentScript = __webpack_require__("8875")
  5783. currentScript = getCurrentScript()
  5784. // for backward compatibility, because previously we directly included the polyfill
  5785. if (!('currentScript' in document)) {
  5786. Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
  5787. }
  5788. }
  5789. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
  5790. if (src) {
  5791. __webpack_require__.p = src[1] // eslint-disable-line
  5792. }
  5793. }
  5794. // Indicate to webpack that this file can be concatenated
  5795. /* harmony default export */ var setPublicPath = (null);
  5796. // EXTERNAL MODULE: ./styles/index.scss
  5797. var styles = __webpack_require__("1a97");
  5798. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
  5799. var es_array_map = __webpack_require__("d81d");
  5800. // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils/ctor","commonjs2":"xe-utils/ctor","amd":"xe-utils"}
  5801. var ctor_amd_xe_utils_ = __webpack_require__("7fd6");
  5802. var ctor_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(ctor_amd_xe_utils_);
  5803. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
  5804. var es_array_index_of = __webpack_require__("c975");
  5805. // CONCATENATED MODULE: ./packages/conf/index.js
  5806. var iconPrefix = 'vxe-icon--';
  5807. var GlobalConfig = {
  5808. // size: null, // 全局尺寸
  5809. zIndex: 999,
  5810. // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
  5811. version: 0,
  5812. // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
  5813. // resizeInterval: 500,
  5814. emptyCell: ' ',
  5815. table: {
  5816. fit: true,
  5817. showHeader: true,
  5818. animat: true,
  5819. delayHover: 250,
  5820. // keepSource: false,
  5821. // cloak: false,
  5822. // showOverflow: null,
  5823. // showHeaderOverflow: null,
  5824. // showFooterOverflow: null,
  5825. // resizeInterval: 500,
  5826. // size: null,
  5827. // zIndex: null,
  5828. // resizable: false,
  5829. // autoResize: false,
  5830. // stripe: false,
  5831. // border: false,
  5832. // round: false,
  5833. // emptyRender: {
  5834. // name: ''
  5835. // },
  5836. // radioConfig: {
  5837. // trigger: 'default'
  5838. // },
  5839. // checkboxConfig: {
  5840. // trigger: 'default'
  5841. // },
  5842. // tooltipConfig: {
  5843. // theme: 'dark',
  5844. // enterable: false
  5845. // },
  5846. validConfig: {
  5847. showMessage: true,
  5848. message: 'default'
  5849. },
  5850. // menuConfig: {
  5851. // visibleMethod () {}
  5852. // },
  5853. // customConfig: {
  5854. // storage: false,
  5855. // checkMethod () {}
  5856. // },
  5857. // rowId: '_XID', // 行数据的唯一主键字段名
  5858. sortConfig: {
  5859. // remote: false,
  5860. // trigger: 'default',
  5861. // orders: ['asc', 'desc', null],
  5862. // sortMethod: null,
  5863. showIcon: true
  5864. },
  5865. filterConfig: {
  5866. // remote: false,
  5867. // filterMethod: null,
  5868. showIcon: true
  5869. },
  5870. treeConfig: {
  5871. children: 'children',
  5872. hasChild: 'hasChild',
  5873. indent: 20,
  5874. showIcon: true
  5875. },
  5876. keyboardConfig: {
  5877. isChecked: true
  5878. },
  5879. expandConfig: {
  5880. // trigger: 'default',
  5881. showIcon: true
  5882. },
  5883. editConfig: {
  5884. // mode: 'cell',
  5885. showIcon: true,
  5886. showAsterisk: true
  5887. },
  5888. importConfig: {
  5889. modes: ['insert', 'covering']
  5890. },
  5891. exportConfig: {
  5892. // isPrint: false,
  5893. modes: ['current', 'selected']
  5894. },
  5895. mouseConfig: {
  5896. extension: true
  5897. },
  5898. areaConfig: {
  5899. selectCellByHeader: true
  5900. },
  5901. clipConfig: {
  5902. isCopy: true,
  5903. isCut: true,
  5904. isPaste: true
  5905. },
  5906. fnrConfig: {
  5907. isFind: true,
  5908. isReplace: true
  5909. },
  5910. scrollX: {
  5911. enabled: true,
  5912. gt: 60 // oSize: 0,
  5913. // rSize: 0
  5914. // vSize: 0
  5915. },
  5916. scrollY: {
  5917. enabled: true,
  5918. gt: 100 // oSize: 0,
  5919. // rSize: 0
  5920. // vSize: 0,
  5921. // rHeight: 0
  5922. }
  5923. },
  5924. export: {
  5925. types: {}
  5926. },
  5927. icon: {
  5928. // table
  5929. TABLE_SORT_ASC: iconPrefix + 'caret-top',
  5930. TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
  5931. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  5932. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  5933. TABLE_EDIT: iconPrefix + 'edit-outline',
  5934. TABLE_HELP: iconPrefix + 'question',
  5935. TABLE_TREE_LOADED: iconPrefix + 'refresh roll',
  5936. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  5937. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  5938. TABLE_EXPAND_LOADED: iconPrefix + 'refresh roll',
  5939. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  5940. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  5941. // button
  5942. BUTTON_DROPDOWN: iconPrefix + 'arrow-bottom',
  5943. BUTTON_LOADING: iconPrefix + 'refresh roll',
  5944. // select
  5945. SELECT_LOADED: iconPrefix + 'refresh roll',
  5946. SELECT_OPEN: iconPrefix + 'caret-bottom rotate180',
  5947. SELECT_CLOSE: iconPrefix + 'caret-bottom',
  5948. // pager
  5949. PAGER_JUMP_PREV: iconPrefix + 'd-arrow-left',
  5950. PAGER_JUMP_NEXT: iconPrefix + 'd-arrow-right',
  5951. PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
  5952. PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
  5953. PAGER_JUMP_MORE: iconPrefix + 'more',
  5954. // input
  5955. INPUT_CLEAR: iconPrefix + 'close',
  5956. INPUT_PWD: iconPrefix + 'eye-slash',
  5957. INPUT_SHOW_PWD: iconPrefix + 'eye',
  5958. INPUT_PREV_NUM: iconPrefix + 'caret-top',
  5959. INPUT_NEXT_NUM: iconPrefix + 'caret-bottom',
  5960. INPUT_DATE: iconPrefix + 'calendar',
  5961. INPUT_SEARCH: iconPrefix + 'search',
  5962. // modal
  5963. MODAL_ZOOM_IN: iconPrefix + 'square',
  5964. MODAL_ZOOM_OUT: iconPrefix + 'zoomout',
  5965. MODAL_CLOSE: iconPrefix + 'close',
  5966. MODAL_INFO: iconPrefix + 'info',
  5967. MODAL_SUCCESS: iconPrefix + 'success',
  5968. MODAL_WARNING: iconPrefix + 'warning',
  5969. MODAL_ERROR: iconPrefix + 'error',
  5970. MODAL_QUESTION: iconPrefix + 'question',
  5971. MODAL_LOADING: iconPrefix + 'refresh roll',
  5972. // toolbar
  5973. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'refresh',
  5974. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'refresh roll',
  5975. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  5976. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  5977. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  5978. TOOLBAR_TOOLS_ZOOM_IN: iconPrefix + 'zoomin',
  5979. TOOLBAR_TOOLS_ZOOM_OUT: iconPrefix + 'zoomout',
  5980. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'menu',
  5981. // form
  5982. FORM_PREFIX: iconPrefix + 'info',
  5983. FORM_SUFFIX: iconPrefix + 'info',
  5984. FORM_FOLDING: iconPrefix + 'arrow-top rotate180',
  5985. FORM_UNFOLDING: iconPrefix + 'arrow-top'
  5986. },
  5987. grid: {
  5988. // size: null,
  5989. // zoomConfig: {
  5990. // escRestore: true
  5991. // },
  5992. formConfig: {
  5993. enabled: true
  5994. },
  5995. pagerConfig: {
  5996. enabled: true // perfect: false
  5997. },
  5998. toolbarConfig: {
  5999. enabled: true // perfect: false
  6000. },
  6001. proxyConfig: {
  6002. enabled: true,
  6003. autoLoad: true,
  6004. message: true,
  6005. props: {
  6006. list: null,
  6007. result: 'result',
  6008. total: 'page.total',
  6009. message: 'message'
  6010. } // beforeItem: null,
  6011. // beforeColumn: null,
  6012. // beforeQuery: null,
  6013. // afterQuery: null,
  6014. // beforeDelete: null,
  6015. // afterDelete: null,
  6016. // beforeSave: null,
  6017. // afterSave: null
  6018. }
  6019. },
  6020. tooltip: {
  6021. // size: null,
  6022. trigger: 'hover',
  6023. theme: 'dark',
  6024. leaveDelay: 300
  6025. },
  6026. pager: {// size: null,
  6027. // autoHidden: false,
  6028. // perfect: true,
  6029. // pageSize: 10,
  6030. // pagerCount: 7,
  6031. // pageSizes: [10, 15, 20, 50, 100],
  6032. // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
  6033. },
  6034. form: {
  6035. // preventSubmit: false,
  6036. validConfig: {
  6037. showMessage: true,
  6038. autoPos: true
  6039. },
  6040. // size: null,
  6041. // colon: false,
  6042. titleAsterisk: true
  6043. },
  6044. input: {
  6045. // size: null,
  6046. // transfer: false
  6047. // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
  6048. // labelFormat: '',
  6049. // valueFormat: '',
  6050. minDate: new Date(1900, 0, 1),
  6051. maxDate: new Date(2100, 0, 1),
  6052. startDay: 1,
  6053. selectDay: 1,
  6054. digits: 2,
  6055. controls: true
  6056. },
  6057. textarea: {// size: null,
  6058. // autosize: {
  6059. // minRows: 1,
  6060. // maxRows: 10
  6061. // }
  6062. },
  6063. select: {
  6064. // size: null,
  6065. // transfer: false,
  6066. multiCharOverflow: 8
  6067. },
  6068. toolbar: {// size: null,
  6069. // import: {
  6070. // mode: 'covering'
  6071. // },
  6072. // export: {
  6073. // types: ['csv', 'html', 'xml', 'txt']
  6074. // },
  6075. // custom: {
  6076. // isFooter: true
  6077. // },
  6078. // buttons: []
  6079. },
  6080. button: {// size: null,
  6081. // transfer: false
  6082. },
  6083. radio: {// size: null
  6084. },
  6085. checkbox: {// size: null
  6086. },
  6087. switch: {// size: null
  6088. },
  6089. modal: {
  6090. // size: null,
  6091. top: 15,
  6092. showHeader: true,
  6093. minWidth: 340,
  6094. minHeight: 140,
  6095. lockView: true,
  6096. mask: true,
  6097. duration: 3000,
  6098. marginSize: 0,
  6099. dblclickZoom: true,
  6100. showTitleOverflow: true,
  6101. animat: true,
  6102. showClose: true,
  6103. // storage: false,
  6104. storageKey: 'VXE_MODAL_POSITION'
  6105. },
  6106. list: {
  6107. // size: null,
  6108. scrollY: {
  6109. enabled: true,
  6110. gt: 100 // oSize: 0,
  6111. // rSize: 0
  6112. // vSize: 0,
  6113. // rHeight: 0
  6114. }
  6115. },
  6116. i18n: function i18n(key) {
  6117. return key;
  6118. }
  6119. };
  6120. /* harmony default export */ var conf = (GlobalConfig);
  6121. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
  6122. var es_object_to_string = __webpack_require__("d3b7");
  6123. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
  6124. var es_regexp_exec = __webpack_require__("ac1f");
  6125. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
  6126. var es_regexp_to_string = __webpack_require__("25f0");
  6127. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
  6128. var es_string_replace = __webpack_require__("5319");
  6129. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
  6130. var es_string_split = __webpack_require__("1276");
  6131. // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
  6132. function toType(type) {
  6133. return ctor_amd_xe_utils_default.a.toString(type).replace('_', '').toLowerCase();
  6134. }
  6135. var eventTypes = 'created,mounted,activated,beforeDestroy,destroyed,event.clearActived,event.clearFilter,event.clearAreas,event.showMenu,event.keydown,event.export,event.import'.split(',').map(toType);
  6136. var storeMap = {};
  6137. var interceptor = {
  6138. mixin: function mixin(map) {
  6139. ctor_amd_xe_utils_default.a.each(map, function (evntFn, type) {
  6140. return interceptor.add(type, evntFn);
  6141. });
  6142. return interceptor;
  6143. },
  6144. get: function get(type) {
  6145. return storeMap[toType(type)] || [];
  6146. },
  6147. add: function add(type, evntFn) {
  6148. type = toType(type);
  6149. if (evntFn && eventTypes.indexOf(type) > -1) {
  6150. var eList = storeMap[type];
  6151. if (!eList) {
  6152. eList = storeMap[type] = [];
  6153. }
  6154. eList.push(evntFn);
  6155. }
  6156. return interceptor;
  6157. },
  6158. delete: function _delete(type, evntFn) {
  6159. var eList = storeMap[toType(type)];
  6160. if (eList) {
  6161. ctor_amd_xe_utils_default.a.remove(eList, function (fn) {
  6162. return fn === evntFn;
  6163. });
  6164. }
  6165. return interceptor;
  6166. }
  6167. };
  6168. /* harmony default export */ var src_interceptor = (interceptor);
  6169. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
  6170. var es_array_concat = __webpack_require__("99af");
  6171. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
  6172. var es_array_find = __webpack_require__("7db0");
  6173. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
  6174. var es_array_join = __webpack_require__("a15b");
  6175. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
  6176. var es_function_name = __webpack_require__("b0c0");
  6177. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
  6178. var es_number_to_fixed = __webpack_require__("b680");
  6179. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.for-each.js
  6180. var es_array_for_each = __webpack_require__("4160");
  6181. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.last-index-of.js
  6182. var es_array_last_index_of = __webpack_require__("baa5");
  6183. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
  6184. var es_array_splice = __webpack_require__("a434");
  6185. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
  6186. var es_string_fixed = __webpack_require__("c7cd");
  6187. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
  6188. var web_dom_collections_for_each = __webpack_require__("159b");
  6189. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  6190. function _arrayLikeToArray(arr, len) {
  6191. if (len == null || len > arr.length) len = arr.length;
  6192. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  6193. arr2[i] = arr[i];
  6194. }
  6195. return arr2;
  6196. }
  6197. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  6198. function _arrayWithoutHoles(arr) {
  6199. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  6200. }
  6201. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
  6202. var es_symbol = __webpack_require__("a4d3");
  6203. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
  6204. var es_symbol_description = __webpack_require__("e01a");
  6205. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
  6206. var es_symbol_iterator = __webpack_require__("d28b");
  6207. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
  6208. var es_array_from = __webpack_require__("a630");
  6209. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
  6210. var es_string_iterator = __webpack_require__("3ca3");
  6211. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
  6212. var web_dom_collections_iterator = __webpack_require__("ddb0");
  6213. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  6214. function _iterableToArray(iter) {
  6215. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  6216. }
  6217. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
  6218. var es_array_slice = __webpack_require__("fb6a");
  6219. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
  6220. function _unsupportedIterableToArray(o, minLen) {
  6221. if (!o) return;
  6222. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  6223. var n = Object.prototype.toString.call(o).slice(8, -1);
  6224. if (n === "Object" && o.constructor) n = o.constructor.name;
  6225. if (n === "Map" || n === "Set") return Array.from(o);
  6226. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  6227. }
  6228. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  6229. function _nonIterableSpread() {
  6230. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  6231. }
  6232. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  6233. function _toConsumableArray(arr) {
  6234. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  6235. }
  6236. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  6237. function _classCallCheck(instance, Constructor) {
  6238. if (!(instance instanceof Constructor)) {
  6239. throw new TypeError("Cannot call a class as a function");
  6240. }
  6241. }
  6242. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  6243. function _defineProperties(target, props) {
  6244. for (var i = 0; i < props.length; i++) {
  6245. var descriptor = props[i];
  6246. descriptor.enumerable = descriptor.enumerable || false;
  6247. descriptor.configurable = true;
  6248. if ("value" in descriptor) descriptor.writable = true;
  6249. Object.defineProperty(target, descriptor.key, descriptor);
  6250. }
  6251. }
  6252. function _createClass(Constructor, protoProps, staticProps) {
  6253. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  6254. if (staticProps) _defineProperties(Constructor, staticProps);
  6255. return Constructor;
  6256. }
  6257. // CONCATENATED MODULE: ./packages/v-x-e-table/src/store.js
  6258. /**
  6259. * 创建数据仓库
  6260. */
  6261. var store_Store = /*#__PURE__*/function () {
  6262. function Store() {
  6263. _classCallCheck(this, Store);
  6264. this.store = {};
  6265. }
  6266. _createClass(Store, [{
  6267. key: "mixin",
  6268. value: function mixin(map) {
  6269. Object.assign(this.store, map);
  6270. return Store;
  6271. }
  6272. }, {
  6273. key: "get",
  6274. value: function get(type) {
  6275. return this.store[type];
  6276. }
  6277. }, {
  6278. key: "add",
  6279. value: function add(type, render) {
  6280. this.store[type] = render;
  6281. return Store;
  6282. }
  6283. }, {
  6284. key: "delete",
  6285. value: function _delete(type) {
  6286. delete this.store[type];
  6287. return Store;
  6288. }
  6289. }]);
  6290. return Store;
  6291. }();
  6292. /* harmony default export */ var store = (store_Store);
  6293. // CONCATENATED MODULE: ./packages/v-x-e-table/src/formats.js
  6294. var formats = new store();
  6295. /* harmony default export */ var src_formats = (formats);
  6296. // CONCATENATED MODULE: ./packages/tools/src/utils.js
  6297. var zindexIndex = 0;
  6298. var lastZindex = 1;
  6299. function getColFuncWidth(isExists) {
  6300. var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
  6301. return isExists ? defaultWidth : 0;
  6302. }
  6303. var utils_ColumnInfo = /*#__PURE__*/function () {
  6304. /* eslint-disable @typescript-eslint/no-use-before-define */
  6305. function ColumnInfo($xetable, _vm) {
  6306. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  6307. renderHeader = _ref.renderHeader,
  6308. renderCell = _ref.renderCell,
  6309. renderFooter = _ref.renderFooter,
  6310. renderData = _ref.renderData;
  6311. _classCallCheck(this, ColumnInfo);
  6312. var $xegrid = $xetable.$xegrid;
  6313. var proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
  6314. var formatter = _vm.formatter;
  6315. var visible = ctor_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
  6316. if (_vm.cellRender && _vm.editRender) {
  6317. UtilTools.warn('vxe.error.errConflicts', ['column.cell-render', 'column.edit-render']);
  6318. } // 在 v3.0 中废弃 editRender.type
  6319. if (_vm.editRender && _vm.editRender.type === 'visible') {
  6320. UtilTools.warn('vxe.error.delProp', ['column.edit-render.type', 'column.cell-render']);
  6321. } // 在 v3.0 中废弃 prop
  6322. if (_vm.prop) {
  6323. UtilTools.warn('vxe.error.delProp', ['column.prop', 'column.field']);
  6324. } // 在 v3.0 中废弃 label
  6325. if (_vm.label) {
  6326. UtilTools.warn('vxe.error.delProp', ['column.label', 'column.title']);
  6327. } // 在 v3.0 中废弃 class
  6328. if (_vm.class) {
  6329. UtilTools.warn('vxe.error.delProp', ['column.class', 'column.className']);
  6330. } // 在 v3.0 中废弃 type=index
  6331. if (_vm.type === 'index') {
  6332. UtilTools.warn('vxe.error.delProp', ['column.type=index', 'column.type=seq']);
  6333. } else if (_vm.type === 'selection') {
  6334. // 在 v3.0 中废弃 type=selection
  6335. UtilTools.warn('vxe.error.delProp', ['column.type=selection', 'column.type=checkbox']);
  6336. } else if (_vm.type === 'expand') {
  6337. if ($xetable.treeConfig && $xetable.treeOpts.line) {
  6338. UtilTools.error('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
  6339. }
  6340. if (_vm.slots && !_vm.slots.content && _vm.slots.default) {
  6341. UtilTools.error('vxe.error.expandContent');
  6342. }
  6343. } // 在 v3.0 中 cellRender 只能是对象类型
  6344. if (ctor_amd_xe_utils_default.a.isBoolean(_vm.cellRender) || _vm.cellRender && !ctor_amd_xe_utils_default.a.isObject(_vm.cellRender)) {
  6345. UtilTools.warn('vxe.error.errProp', ["column.cell-render=".concat(_vm.cellRender), 'column.cell-render={}']);
  6346. } // 在 v3.0 中 editRender 只能是对象类型
  6347. if (ctor_amd_xe_utils_default.a.isBoolean(_vm.editRender) || _vm.editRender && !ctor_amd_xe_utils_default.a.isObject(_vm.editRender)) {
  6348. UtilTools.warn('vxe.error.errProp', ["column.edit-render=".concat(_vm.editRender), 'column.edit-render={}']);
  6349. } // 在 v3.0 中废弃 remoteSort
  6350. if (_vm.remoteSort) {
  6351. UtilTools.warn('vxe.error.delProp', ['column.remote-sort', 'sort-config.remote']);
  6352. } // 在 v3.0 中废弃 sortMethod
  6353. if (_vm.sortMethod) {
  6354. UtilTools.warn('vxe.error.delProp', ['column.sort-method', 'sort-config.sortMethod']);
  6355. } // 在 v3.0 中 sortBy 只能是字符串
  6356. if (_vm.sortBy && !ctor_amd_xe_utils_default.a.isString(_vm.sortBy)) {
  6357. UtilTools.warn('vxe.error.errProp', ["column.sort-by=".concat(JSON.stringify(_vm.sortBy)), "column.sort-by=\"".concat(_vm.sortBy[0], "\"")]);
  6358. }
  6359. if (formatter) {
  6360. if (ctor_amd_xe_utils_default.a.isString(formatter)) {
  6361. var globalFunc = src_formats.get(formatter);
  6362. if (!globalFunc && ctor_amd_xe_utils_default.a[formatter]) {
  6363. globalFunc = ctor_amd_xe_utils_default.a[formatter]; // 在 v3.0 中废弃挂载格式化方式
  6364. UtilTools.warn('vxe.error.errFormat', [formatter]);
  6365. }
  6366. if (!ctor_amd_xe_utils_default.a.isFunction(globalFunc)) {
  6367. UtilTools.error('vxe.error.notFunc', [formatter]);
  6368. }
  6369. } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
  6370. var _globalFunc = src_formats.get(formatter[0]);
  6371. if (!_globalFunc && ctor_amd_xe_utils_default.a[formatter[0]]) {
  6372. _globalFunc = ctor_amd_xe_utils_default.a[formatter[0]]; // 在 v3.0 中废弃挂载格式化方式
  6373. UtilTools.warn('vxe.error.errFormat', [formatter[0]]);
  6374. }
  6375. if (!ctor_amd_xe_utils_default.a.isFunction(_globalFunc)) {
  6376. UtilTools.error('vxe.error.notFunc', [formatter[0]]);
  6377. }
  6378. }
  6379. }
  6380. Object.assign(this, {
  6381. // 基本属性
  6382. type: _vm.type,
  6383. // 在 v3.0 中废弃 prop
  6384. prop: _vm.prop,
  6385. property: _vm.field || _vm.prop,
  6386. title: _vm.title,
  6387. // 在 v3.0 中废弃 label
  6388. label: _vm.label,
  6389. width: _vm.width,
  6390. minWidth: _vm.minWidth,
  6391. resizable: _vm.resizable,
  6392. fixed: _vm.fixed,
  6393. align: _vm.align,
  6394. headerAlign: _vm.headerAlign,
  6395. footerAlign: _vm.footerAlign,
  6396. showOverflow: _vm.showOverflow,
  6397. showHeaderOverflow: _vm.showHeaderOverflow,
  6398. showFooterOverflow: _vm.showFooterOverflow,
  6399. className: _vm.class || _vm.className,
  6400. headerClassName: _vm.headerClassName,
  6401. footerClassName: _vm.footerClassName,
  6402. indexMethod: _vm.indexMethod,
  6403. seqMethod: _vm.seqMethod,
  6404. formatter: formatter,
  6405. sortable: _vm.sortable,
  6406. sortBy: _vm.sortBy,
  6407. sortType: _vm.sortType,
  6408. sortMethod: _vm.sortMethod,
  6409. remoteSort: _vm.remoteSort,
  6410. filters: UtilTools.getFilters(_vm.filters),
  6411. filterMultiple: ctor_amd_xe_utils_default.a.isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
  6412. filterMethod: _vm.filterMethod,
  6413. filterResetMethod: _vm.filterResetMethod,
  6414. filterRecoverMethod: _vm.filterRecoverMethod,
  6415. filterRender: _vm.filterRender,
  6416. treeNode: _vm.treeNode,
  6417. cellType: _vm.cellType,
  6418. cellRender: _vm.cellRender,
  6419. editRender: _vm.editRender,
  6420. contentRender: _vm.contentRender,
  6421. exportMethod: _vm.exportMethod,
  6422. footerExportMethod: _vm.footerExportMethod,
  6423. titleHelp: _vm.titleHelp,
  6424. // 自定义参数
  6425. params: _vm.params,
  6426. // 渲染属性
  6427. id: _vm.colId || ctor_amd_xe_utils_default.a.uniqueId('col_'),
  6428. parentId: null,
  6429. visible: visible,
  6430. // 内部属性(一旦被使用,将导致不可升级版本)
  6431. halfVisible: false,
  6432. defaultVisible: visible,
  6433. checked: false,
  6434. halfChecked: false,
  6435. disabled: false,
  6436. level: 1,
  6437. rowSpan: 1,
  6438. colSpan: 1,
  6439. order: null,
  6440. sortTime: 0,
  6441. renderWidth: 0,
  6442. renderHeight: 0,
  6443. resizeWidth: 0,
  6444. renderLeft: 0,
  6445. renderArgs: [],
  6446. // 渲染参数可用于扩展
  6447. model: {},
  6448. renderHeader: renderHeader || _vm.renderHeader,
  6449. renderCell: renderCell || _vm.renderCell,
  6450. renderFooter: renderFooter || _vm.renderFooter,
  6451. renderData: renderData,
  6452. // 单元格插槽,只对 grid 有效
  6453. slots: _vm.slots,
  6454. _own: _vm
  6455. });
  6456. if (proxyOpts && proxyOpts.beforeColumn) {
  6457. proxyOpts.beforeColumn({
  6458. $grid: $xegrid,
  6459. column: this
  6460. });
  6461. }
  6462. }
  6463. _createClass(ColumnInfo, [{
  6464. key: "getTitle",
  6465. value: function getTitle() {
  6466. // 在 v3.0 中废弃 label、type=index
  6467. return UtilTools.getFuncText(this.title || this.label || (this.type === 'seq' || this.type === 'index' ? conf.i18n('vxe.table.seqTitle') : ''));
  6468. }
  6469. }, {
  6470. key: "getKey",
  6471. value: function getKey() {
  6472. return this.property || (this.type ? "type=".concat(this.type) : null);
  6473. }
  6474. }, {
  6475. key: "getMinWidth",
  6476. value: function getMinWidth() {
  6477. var type = this.type,
  6478. filters = this.filters,
  6479. sortable = this.sortable,
  6480. remoteSort = this.remoteSort,
  6481. sortOpts = this.sortOpts,
  6482. editRender = this.editRender,
  6483. editOpts = this.editOpts,
  6484. titleHelp = this.titleHelp;
  6485. return 40 + getColFuncWidth(type === 'checkbox' || type === 'selection', 18) + getColFuncWidth(titleHelp, 18) + getColFuncWidth(filters) + getColFuncWidth((sortable || remoteSort) && sortOpts.showIcon) + getColFuncWidth(editRender && editOpts.showIcon, 32);
  6486. }
  6487. }, {
  6488. key: "update",
  6489. value: function update(name, value) {
  6490. // 不支持双向的属性
  6491. if (name !== 'filters') {
  6492. this[name] = value;
  6493. if (name === 'field') {
  6494. this.property = value;
  6495. }
  6496. }
  6497. }
  6498. }, {
  6499. key: "own",
  6500. get: function get() {
  6501. 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.');
  6502. return this._own;
  6503. }
  6504. }]);
  6505. return ColumnInfo;
  6506. }();
  6507. function outLog(type) {
  6508. return function (message, params) {
  6509. var msg = UtilTools.getLog(message, params);
  6510. console[type](msg);
  6511. return msg;
  6512. };
  6513. }
  6514. var UtilTools = {
  6515. warn: outLog('warn'),
  6516. error: outLog('error'),
  6517. getLog: function getLog(message, args) {
  6518. return "[vxe-table] ".concat(conf.i18n(message, args));
  6519. },
  6520. getFuncText: function getFuncText(content) {
  6521. return ctor_amd_xe_utils_default.a.isFunction(content) ? content() : conf.translate ? conf.translate(content) : content;
  6522. },
  6523. nextZIndex: function nextZIndex() {
  6524. lastZindex = conf.zIndex + zindexIndex++;
  6525. return lastZindex;
  6526. },
  6527. getLastZIndex: function getLastZIndex() {
  6528. return lastZindex;
  6529. },
  6530. // 行主键 key
  6531. getRowkey: function getRowkey($xetable) {
  6532. return $xetable.rowId || '_XID';
  6533. },
  6534. // 行主键 value
  6535. getRowid: function getRowid($xetable, row) {
  6536. var rowId = ctor_amd_xe_utils_default.a.get(row, UtilTools.getRowkey($xetable));
  6537. return ctor_amd_xe_utils_default.a.eqNull(rowId) ? '' : encodeURIComponent(rowId);
  6538. },
  6539. // 获取所有的列,排除分组
  6540. getColumnList: function getColumnList(columns) {
  6541. var result = [];
  6542. columns.forEach(function (column) {
  6543. result.push.apply(result, _toConsumableArray(column.children && column.children.length ? UtilTools.getColumnList(column.children) : [column]));
  6544. });
  6545. return result;
  6546. },
  6547. getClass: function getClass(property, params) {
  6548. return property ? ctor_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
  6549. },
  6550. getFilters: function getFilters(filters) {
  6551. if (filters && ctor_amd_xe_utils_default.a.isArray(filters)) {
  6552. return filters.map(function (_ref2) {
  6553. var label = _ref2.label,
  6554. value = _ref2.value,
  6555. data = _ref2.data,
  6556. resetValue = _ref2.resetValue,
  6557. checked = _ref2.checked;
  6558. return {
  6559. label: label,
  6560. value: value,
  6561. data: data,
  6562. resetValue: resetValue,
  6563. checked: !!checked,
  6564. _checked: !!checked
  6565. };
  6566. });
  6567. }
  6568. return filters;
  6569. },
  6570. formatText: function formatText(value, placeholder) {
  6571. return '' + (value === '' || value === null || value === undefined ? placeholder ? conf.emptyCell : '' : value);
  6572. },
  6573. getCellValue: function getCellValue(row, column) {
  6574. return ctor_amd_xe_utils_default.a.get(row, column.property);
  6575. },
  6576. setCellValue: function setCellValue(row, column, value) {
  6577. return ctor_amd_xe_utils_default.a.set(row, column.property, value);
  6578. },
  6579. isColumn: function isColumn(column) {
  6580. return column instanceof utils_ColumnInfo;
  6581. },
  6582. getColumnConfig: function getColumnConfig($xetable, _vm, options) {
  6583. return UtilTools.isColumn(_vm) ? _vm : new utils_ColumnInfo($xetable, _vm, options);
  6584. },
  6585. // 组装列配置
  6586. assemColumn: function assemColumn(_vm) {
  6587. var $el = _vm.$el,
  6588. $xetable = _vm.$xetable,
  6589. $xecolumn = _vm.$xecolumn,
  6590. columnConfig = _vm.columnConfig;
  6591. var groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
  6592. columnConfig.slots = _vm.$scopedSlots;
  6593. if (groupConfig) {
  6594. if ($xecolumn.$options._componentTag === 'vxe-table-column') {
  6595. UtilTools.warn('vxe.error.groupTag', ["<vxe-table-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-table-column title=".concat($xecolumn.title, " ...>")]);
  6596. } else if ($xecolumn.$options._componentTag === 'vxe-column') {
  6597. UtilTools.warn('vxe.error.groupTag', ["<vxe-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-column title=".concat($xecolumn.title, " ...>")]);
  6598. }
  6599. if (!groupConfig.children) {
  6600. groupConfig.children = [];
  6601. }
  6602. groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
  6603. } else {
  6604. $xetable.collectColumn.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
  6605. }
  6606. },
  6607. // 销毁列
  6608. destroyColumn: function destroyColumn(_vm) {
  6609. var $xetable = _vm.$xetable,
  6610. columnConfig = _vm.columnConfig;
  6611. var matchObj = ctor_amd_xe_utils_default.a.findTree($xetable.collectColumn, function (column) {
  6612. return column === columnConfig;
  6613. });
  6614. if (matchObj) {
  6615. matchObj.items.splice(matchObj.index, 1);
  6616. }
  6617. },
  6618. hasChildrenList: function hasChildrenList(item) {
  6619. return item && item.children && item.children.length > 0;
  6620. },
  6621. getColMinWidth: function getColMinWidth(params) {
  6622. var $table = params.$table,
  6623. column = params.column;
  6624. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  6625. resizableOpts = $table.resizableOpts,
  6626. sortOpts = $table.sortOpts,
  6627. filterOpts = $table.filterOpts,
  6628. editOpts = $table.editOpts;
  6629. var type = column.type,
  6630. showHeaderOverflow = column.showHeaderOverflow,
  6631. filters = column.filters,
  6632. sortable = column.sortable,
  6633. remoteSort = column.remoteSort,
  6634. titleHelp = column.titleHelp,
  6635. editRender = column.editRender;
  6636. var minWidth = resizableOpts.minWidth;
  6637. if (minWidth) {
  6638. var customMinWidth = ctor_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
  6639. if (customMinWidth !== 'auto') {
  6640. return Math.max(1, ctor_amd_xe_utils_default.a.toNumber(customMinWidth));
  6641. }
  6642. }
  6643. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  6644. var showEllipsis = headOverflow === 'ellipsis';
  6645. var showTitle = headOverflow === 'title';
  6646. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  6647. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  6648. var colMinWidth = 40;
  6649. if (hasEllipsis) {
  6650. 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);
  6651. }
  6652. return colMinWidth;
  6653. },
  6654. parseFile: function parseFile(file) {
  6655. var name = file.name;
  6656. var tIndex = ctor_amd_xe_utils_default.a.lastIndexOf(name, '.');
  6657. var type = name.substring(tIndex + 1, name.length);
  6658. var filename = name.substring(0, tIndex);
  6659. return {
  6660. filename: filename,
  6661. type: type
  6662. };
  6663. },
  6664. isNumVal: function isNumVal(num) {
  6665. return !isNaN(parseFloat('' + num));
  6666. },
  6667. isEnableConf: function isEnableConf(conf) {
  6668. return conf && conf.enabled !== false;
  6669. },
  6670. /**
  6671. * 判断值为:'' | null | undefined 时都属于空值
  6672. */
  6673. eqEmptyValue: function eqEmptyValue(cellValue) {
  6674. return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
  6675. }
  6676. };
  6677. /* harmony default export */ var utils = (UtilTools);
  6678. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
  6679. var es_regexp_constructor = __webpack_require__("4d63");
  6680. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
  6681. var es_string_match = __webpack_require__("466d");
  6682. // CONCATENATED MODULE: ./packages/tools/src/dom.js
  6683. var browse = ctor_amd_xe_utils_default.a.browse();
  6684. var htmlElem = browse.isDoc ? document.querySelector('html') : 0;
  6685. var dom_bodyElem = browse.isDoc ? document.body : 0;
  6686. var reClsMap = {};
  6687. function getClsRE(cls) {
  6688. if (!reClsMap[cls]) {
  6689. reClsMap[cls] = new RegExp("(?:^|\\s)".concat(cls, "(?!\\S)"), 'g');
  6690. }
  6691. return reClsMap[cls];
  6692. }
  6693. function getNodeOffset(elem, container, rest) {
  6694. if (elem) {
  6695. var parentElem = elem.parentNode;
  6696. rest.top += elem.offsetTop;
  6697. rest.left += elem.offsetLeft;
  6698. if (parentElem && parentElem !== htmlElem && parentElem !== dom_bodyElem) {
  6699. rest.top -= parentElem.scrollTop;
  6700. rest.left -= parentElem.scrollLeft;
  6701. }
  6702. if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
  6703. return getNodeOffset(elem.offsetParent, container, rest);
  6704. }
  6705. }
  6706. return rest;
  6707. }
  6708. var DomTools = {
  6709. browse: browse,
  6710. isPx: function isPx(val) {
  6711. return val && /^\d+(px)?$/.test(val);
  6712. },
  6713. isScale: function isScale(val) {
  6714. return val && /^\d+%$/.test(val);
  6715. },
  6716. hasClass: function hasClass(elem, cls) {
  6717. return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
  6718. },
  6719. removeClass: function removeClass(elem, cls) {
  6720. if (elem && DomTools.hasClass(elem, cls)) {
  6721. elem.className = elem.className.replace(getClsRE(cls), '');
  6722. }
  6723. },
  6724. addClass: function addClass(elem, cls) {
  6725. if (elem && !DomTools.hasClass(elem, cls)) {
  6726. DomTools.removeClass(elem, cls);
  6727. elem.className = "".concat(elem.className, " ").concat(cls);
  6728. }
  6729. },
  6730. updateCellTitle: function updateCellTitle(overflowElem, column) {
  6731. var content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
  6732. if (overflowElem.getAttribute('title') !== content) {
  6733. overflowElem.setAttribute('title', content);
  6734. }
  6735. },
  6736. rowToVisible: function rowToVisible($xetable, row) {
  6737. var bodyElem = $xetable.$refs.tableBody.$el;
  6738. var trElem = bodyElem.querySelector("[data-rowid=\"".concat(utils.getRowid($xetable, row), "\"]"));
  6739. if (trElem) {
  6740. var bodyHeight = bodyElem.clientHeight;
  6741. var bodySrcollTop = bodyElem.scrollTop;
  6742. var trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
  6743. var trHeight = trElem.clientHeight; // 检测行是否在可视区中
  6744. if (trOffsetTop < bodySrcollTop || trOffsetTop > bodySrcollTop + bodyHeight) {
  6745. // 向上定位
  6746. return $xetable.scrollTo(null, trOffsetTop);
  6747. } else if (trOffsetTop + trHeight >= bodyHeight + bodySrcollTop) {
  6748. // 向下定位
  6749. return $xetable.scrollTo(null, bodySrcollTop + trHeight);
  6750. }
  6751. } else {
  6752. // 如果是虚拟渲染跨行滚动
  6753. if ($xetable.scrollYLoad) {
  6754. return $xetable.scrollTo(null, ($xetable.afterFullData.indexOf(row) - 1) * $xetable.scrollYStore.rowHeight);
  6755. }
  6756. }
  6757. return Promise.resolve();
  6758. },
  6759. colToVisible: function colToVisible($xetable, column) {
  6760. var bodyElem = $xetable.$refs.tableBody.$el;
  6761. var tdElem = bodyElem.querySelector(".".concat(column.id));
  6762. if (tdElem) {
  6763. var bodyWidth = bodyElem.clientWidth;
  6764. var bodySrcollLeft = bodyElem.scrollLeft;
  6765. var tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
  6766. var tdWidth = tdElem.clientWidth; // 检测行是否在可视区中
  6767. if (tdOffsetLeft < bodySrcollLeft || tdOffsetLeft > bodySrcollLeft + bodyWidth) {
  6768. // 向左定位
  6769. return $xetable.scrollTo(tdOffsetLeft);
  6770. } else if (tdOffsetLeft + tdWidth >= bodyWidth + bodySrcollLeft) {
  6771. // 向右定位
  6772. return $xetable.scrollTo(bodySrcollLeft + tdWidth);
  6773. }
  6774. } else {
  6775. // 如果是虚拟渲染跨行滚动
  6776. if ($xetable.scrollXLoad) {
  6777. var visibleColumn = $xetable.visibleColumn;
  6778. var scrollLeft = 0;
  6779. for (var index = 0; index < visibleColumn.length; index++) {
  6780. if (visibleColumn[index] === column) {
  6781. break;
  6782. }
  6783. scrollLeft += visibleColumn[index].renderWidth;
  6784. }
  6785. return $xetable.scrollTo(scrollLeft);
  6786. }
  6787. }
  6788. return Promise.resolve();
  6789. },
  6790. getDomNode: function getDomNode() {
  6791. var documentElement = document.documentElement;
  6792. var bodyElem = document.body;
  6793. return {
  6794. scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
  6795. scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
  6796. visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
  6797. visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
  6798. };
  6799. },
  6800. /**
  6801. * 检查触发源是否属于目标节点
  6802. */
  6803. getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
  6804. var targetElem;
  6805. var target = evnt.target;
  6806. while (target && target.nodeType && target !== document) {
  6807. if (queryCls && DomTools.hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
  6808. targetElem = target;
  6809. } else if (target === container) {
  6810. return {
  6811. flag: queryCls ? !!targetElem : true,
  6812. container: container,
  6813. targetElem: targetElem
  6814. };
  6815. }
  6816. target = target.parentNode;
  6817. }
  6818. return {
  6819. flag: false
  6820. };
  6821. },
  6822. /**
  6823. * 获取元素相对于 document 的位置
  6824. */
  6825. getOffsetPos: function getOffsetPos(elem, container) {
  6826. return getNodeOffset(elem, container, {
  6827. left: 0,
  6828. top: 0
  6829. });
  6830. },
  6831. getAbsolutePos: function getAbsolutePos(elem) {
  6832. var bounding = elem.getBoundingClientRect();
  6833. var boundingTop = bounding.top;
  6834. var boundingLeft = bounding.left;
  6835. var _DomTools$getDomNode = DomTools.getDomNode(),
  6836. scrollTop = _DomTools$getDomNode.scrollTop,
  6837. scrollLeft = _DomTools$getDomNode.scrollLeft,
  6838. visibleHeight = _DomTools$getDomNode.visibleHeight,
  6839. visibleWidth = _DomTools$getDomNode.visibleWidth;
  6840. return {
  6841. boundingTop: boundingTop,
  6842. top: scrollTop + boundingTop,
  6843. boundingLeft: boundingLeft,
  6844. left: scrollLeft + boundingLeft,
  6845. visibleHeight: visibleHeight,
  6846. visibleWidth: visibleWidth
  6847. };
  6848. },
  6849. /**
  6850. * 获取单元格节点索引
  6851. */
  6852. getCellNodeIndex: function getCellNodeIndex(cell) {
  6853. var trElem = cell.parentNode;
  6854. var columnIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
  6855. var rowIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.parentNode.children, trElem);
  6856. return {
  6857. columnIndex: columnIndex,
  6858. rowIndex: rowIndex
  6859. };
  6860. },
  6861. /**
  6862. * 获取选中单元格矩阵范围
  6863. */
  6864. getRowNodes: function getRowNodes(trList, cellNode, targetCellNode) {
  6865. var startColIndex = cellNode.columnIndex;
  6866. var startRowIndex = cellNode.rowIndex;
  6867. var targetColIndex = targetCellNode.columnIndex;
  6868. var targetRowIndex = targetCellNode.rowIndex;
  6869. var rows = [];
  6870. for (var rowIndex = Math.min(startRowIndex, targetRowIndex), rowLen = Math.max(startRowIndex, targetRowIndex); rowIndex <= rowLen; rowIndex++) {
  6871. var cells = [];
  6872. var trElem = trList[rowIndex];
  6873. for (var colIndex = Math.min(startColIndex, targetColIndex), colLen = Math.max(startColIndex, targetColIndex); colIndex <= colLen; colIndex++) {
  6874. var tdElem = trElem.children[colIndex];
  6875. cells.push(tdElem);
  6876. }
  6877. rows.push(cells);
  6878. }
  6879. return rows;
  6880. },
  6881. getCellIndexs: function getCellIndexs(cell) {
  6882. var trElem = cell.parentNode;
  6883. var rowid = trElem.getAttribute('data-rowid');
  6884. var columnIndex = [].indexOf.call(trElem.children, cell);
  6885. var rowIndex = [].indexOf.call(trElem.parentNode.children, trElem);
  6886. return {
  6887. rowid: rowid,
  6888. rowIndex: rowIndex,
  6889. columnIndex: columnIndex
  6890. };
  6891. },
  6892. toView: function toView(elem) {
  6893. var scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
  6894. var scrollIntoView = 'scrollIntoView';
  6895. if (elem) {
  6896. if (elem[scrollIntoViewIfNeeded]) {
  6897. elem[scrollIntoViewIfNeeded]();
  6898. } else if (elem[scrollIntoView]) {
  6899. elem[scrollIntoView]();
  6900. }
  6901. }
  6902. },
  6903. triggerEvent: function triggerEvent(targetElem, type) {
  6904. var evnt;
  6905. if (typeof Event === 'function') {
  6906. evnt = new Event(type);
  6907. } else {
  6908. evnt = document.createEvent('Event');
  6909. evnt.initEvent(type, true, true);
  6910. }
  6911. targetElem.dispatchEvent(evnt);
  6912. },
  6913. calcHeight: function calcHeight($xetable, key) {
  6914. var val = $xetable[key];
  6915. var num = 0;
  6916. if (val) {
  6917. if (val === 'auto') {
  6918. num = $xetable.parentHeight;
  6919. } else {
  6920. if (DomTools.isScale(val)) {
  6921. num = Math.floor(parseInt(val) / 100 * $xetable.parentHeight);
  6922. } else {
  6923. num = ctor_amd_xe_utils_default.a.toNumber(val);
  6924. }
  6925. num -= $xetable.getExcludeHeight();
  6926. }
  6927. }
  6928. return num;
  6929. }
  6930. };
  6931. /* harmony default export */ var dom = (DomTools);
  6932. // CONCATENATED MODULE: ./packages/tools/src/event.js
  6933. // 监听全局事件
  6934. var event_browse = dom.browse;
  6935. var wheelName = event_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  6936. var eventStore = [];
  6937. var GlobalEvent = {
  6938. on: function on(comp, type, cb) {
  6939. if (cb) {
  6940. eventStore.push({
  6941. comp: comp,
  6942. type: type,
  6943. cb: cb
  6944. });
  6945. }
  6946. },
  6947. off: function off(comp, type) {
  6948. ctor_amd_xe_utils_default.a.remove(eventStore, function (item) {
  6949. return item.comp === comp && item.type === type;
  6950. });
  6951. },
  6952. trigger: function trigger(evnt) {
  6953. var isWheel = evnt.type === wheelName;
  6954. eventStore.forEach(function (_ref) {
  6955. var comp = _ref.comp,
  6956. type = _ref.type,
  6957. cb = _ref.cb;
  6958. if (type === evnt.type || isWheel && type === 'mousewheel') {
  6959. cb.call(comp, evnt);
  6960. }
  6961. });
  6962. },
  6963. eqKeypad: function eqKeypad(evnt, keyVal) {
  6964. var key = evnt.key;
  6965. if (keyVal.toLowerCase() === key.toLowerCase()) {
  6966. return true;
  6967. }
  6968. return false;
  6969. }
  6970. };
  6971. if (event_browse.isDoc) {
  6972. if (!event_browse.msie) {
  6973. document.addEventListener('copy', GlobalEvent.trigger, false);
  6974. document.addEventListener('cut', GlobalEvent.trigger, false);
  6975. document.addEventListener('paste', GlobalEvent.trigger, false);
  6976. }
  6977. document.addEventListener('keydown', GlobalEvent.trigger, false);
  6978. document.addEventListener('contextmenu', GlobalEvent.trigger, false);
  6979. window.addEventListener('mousedown', GlobalEvent.trigger, false);
  6980. window.addEventListener('blur', GlobalEvent.trigger, false);
  6981. window.addEventListener('resize', GlobalEvent.trigger, false);
  6982. window.addEventListener(wheelName, ctor_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
  6983. leading: true,
  6984. trailing: false
  6985. }), false);
  6986. }
  6987. /* harmony default export */ var src_event = (GlobalEvent);
  6988. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.some.js
  6989. var es_array_some = __webpack_require__("45fc");
  6990. // CONCATENATED MODULE: ./packages/tools/src/resize.js
  6991. /**
  6992. * 监听 resize 事件
  6993. * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
  6994. */
  6995. var resizeTimeout;
  6996. var resize_eventStore = [];
  6997. var defaultInterval = 500;
  6998. function eventHandle() {
  6999. if (resize_eventStore.length) {
  7000. resize_eventStore.forEach(function (item) {
  7001. item.tarList.forEach(function (observer) {
  7002. var target = observer.target,
  7003. width = observer.width,
  7004. heighe = observer.heighe;
  7005. var clientWidth = target.clientWidth;
  7006. var clientHeight = target.clientHeight;
  7007. var rWidth = clientWidth && width !== clientWidth;
  7008. var rHeight = clientHeight && heighe !== clientHeight;
  7009. if (rWidth || rHeight) {
  7010. observer.width = clientWidth;
  7011. observer.heighe = clientHeight;
  7012. requestAnimationFrame(item.callback);
  7013. }
  7014. });
  7015. });
  7016. /* eslint-disable @typescript-eslint/no-use-before-define */
  7017. eventListener();
  7018. }
  7019. }
  7020. function eventListener() {
  7021. clearTimeout(resizeTimeout);
  7022. resizeTimeout = setTimeout(eventHandle, conf.resizeInterval || defaultInterval);
  7023. }
  7024. var resize_ResizeObserverPolyfill = /*#__PURE__*/function () {
  7025. function ResizeObserverPolyfill(callback) {
  7026. _classCallCheck(this, ResizeObserverPolyfill);
  7027. this.tarList = [];
  7028. this.callback = callback;
  7029. }
  7030. _createClass(ResizeObserverPolyfill, [{
  7031. key: "observe",
  7032. value: function observe(target) {
  7033. var _this = this;
  7034. if (target) {
  7035. if (!this.tarList.some(function (observer) {
  7036. return observer.target === target;
  7037. })) {
  7038. this.tarList.push({
  7039. target: target,
  7040. width: target.clientWidth,
  7041. heighe: target.clientHeight
  7042. });
  7043. }
  7044. if (!resize_eventStore.length) {
  7045. eventListener();
  7046. }
  7047. if (!resize_eventStore.some(function (item) {
  7048. return item === _this;
  7049. })) {
  7050. resize_eventStore.push(this);
  7051. }
  7052. }
  7053. }
  7054. }, {
  7055. key: "unobserve",
  7056. value: function unobserve(target) {
  7057. ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7058. return item.tarList.some(function (observer) {
  7059. return observer.target === target;
  7060. });
  7061. });
  7062. }
  7063. }, {
  7064. key: "disconnect",
  7065. value: function disconnect() {
  7066. var _this2 = this;
  7067. ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7068. return item === _this2;
  7069. });
  7070. }
  7071. }]);
  7072. return ResizeObserverPolyfill;
  7073. }();
  7074. var ResizeEvent = dom.browse.isDoc ? window.ResizeObserver || resize_ResizeObserverPolyfill : resize_ResizeObserverPolyfill;
  7075. /* harmony default export */ var src_resize = (ResizeEvent);
  7076. // CONCATENATED MODULE: ./packages/tools/index.js
  7077. /* harmony default export */ var tools = ({
  7078. UtilTools: utils,
  7079. DomTools: dom,
  7080. GlobalEvent: src_event,
  7081. ResizeEvent: src_resize
  7082. });
  7083. // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
  7084. var inputEventTypes = ['input', 'textarea', '$input', '$textarea'];
  7085. var defaultCompProps = {
  7086. transfer: true
  7087. };
  7088. function isEmptyValue(cellValue) {
  7089. return cellValue === null || cellValue === undefined || cellValue === '';
  7090. }
  7091. function getChangeEvent(renderOpts) {
  7092. return inputEventTypes.indexOf(renderOpts.name) > -1 ? 'input' : 'change';
  7093. }
  7094. function parseDate(value, props) {
  7095. return value && props.valueFormat ? ctor_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
  7096. }
  7097. function getFormatDate(value, props, defaultFormat) {
  7098. var _props$dateConfig = props.dateConfig,
  7099. dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
  7100. return ctor_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
  7101. }
  7102. function getLabelFormatDate(value, props) {
  7103. return getFormatDate(value, props, conf.i18n("vxe.input.date.labelFormat.".concat(props.type)));
  7104. }
  7105. function getDefaultComponentName(_ref) {
  7106. var name = _ref.name;
  7107. return "vxe-".concat(name.replace('$', ''));
  7108. }
  7109. function handleConfirmFilter(params, checked, option) {
  7110. var $panel = params.$panel;
  7111. $panel.changeOption({}, checked, option);
  7112. }
  7113. function getNativeAttrs(_ref2) {
  7114. var name = _ref2.name,
  7115. attrs = _ref2.attrs;
  7116. if (name === 'input') {
  7117. attrs = Object.assign({
  7118. type: 'text'
  7119. }, attrs);
  7120. }
  7121. return attrs;
  7122. }
  7123. function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
  7124. var vSize = params.$table.vSize;
  7125. return ctor_amd_xe_utils_default.a.assign(vSize ? {
  7126. size: vSize
  7127. } : {}, defaultCompProps, defaultProps, renderOpts.props, {
  7128. value: value
  7129. });
  7130. }
  7131. function getItemProps(renderOpts, params, value, defaultProps) {
  7132. var vSize = params.$form.vSize;
  7133. return ctor_amd_xe_utils_default.a.assign(vSize ? {
  7134. size: vSize
  7135. } : {}, defaultCompProps, defaultProps, renderOpts.props, {
  7136. value: value
  7137. });
  7138. }
  7139. function getCellLabelVNs(h, renderOpts, params, cellLabel) {
  7140. var placeholder = renderOpts.placeholder;
  7141. return [h('span', {
  7142. class: 'vxe-cell--label'
  7143. }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
  7144. class: 'vxe-cell--placeholder'
  7145. }, UtilTools.formatText(UtilTools.getFuncText(placeholder), 1))] : UtilTools.formatText(cellLabel, 1))];
  7146. }
  7147. function getNativeOns(renderOpts, params) {
  7148. var nativeEvents = renderOpts.nativeEvents;
  7149. var nativeOns = {};
  7150. ctor_amd_xe_utils_default.a.objectEach(nativeEvents, function (func, key) {
  7151. nativeOns[key] = function () {
  7152. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  7153. args[_key] = arguments[_key];
  7154. }
  7155. func.apply(void 0, [params].concat(args));
  7156. };
  7157. });
  7158. return nativeOns;
  7159. }
  7160. function getOns(renderOpts, params, inputFunc, changeFunc) {
  7161. var events = renderOpts.events;
  7162. var modelEvent = 'input';
  7163. var changeEvent = getChangeEvent(renderOpts);
  7164. var isSameEvent = changeEvent === modelEvent;
  7165. var ons = {};
  7166. ctor_amd_xe_utils_default.a.objectEach(events, function (func, key) {
  7167. ons[key] = function () {
  7168. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  7169. args[_key2] = arguments[_key2];
  7170. }
  7171. func.apply(void 0, [params].concat(args));
  7172. };
  7173. });
  7174. if (inputFunc) {
  7175. ons[modelEvent] = function (targetEvnt) {
  7176. inputFunc(targetEvnt);
  7177. if (events && events[modelEvent]) {
  7178. events[modelEvent](params, targetEvnt);
  7179. }
  7180. if (isSameEvent && changeFunc) {
  7181. changeFunc(targetEvnt);
  7182. }
  7183. };
  7184. }
  7185. if (!isSameEvent && changeFunc) {
  7186. ons[changeEvent] = function () {
  7187. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  7188. args[_key3] = arguments[_key3];
  7189. }
  7190. changeFunc.apply(void 0, args);
  7191. if (events && events[changeEvent]) {
  7192. events[changeEvent].apply(events, [params].concat(args));
  7193. }
  7194. };
  7195. }
  7196. return ons;
  7197. }
  7198. function getEditOns(renderOpts, params) {
  7199. var $table = params.$table,
  7200. row = params.row,
  7201. column = params.column;
  7202. return getOns(renderOpts, params, function (value) {
  7203. // 处理 model 值双向绑定
  7204. ctor_amd_xe_utils_default.a.set(row, column.property, value);
  7205. }, function () {
  7206. // 处理 change 事件相关逻辑
  7207. $table.updateStatus(params);
  7208. });
  7209. }
  7210. function getFilterOns(renderOpts, params, option) {
  7211. return getOns(renderOpts, params, function (value) {
  7212. // 处理 model 值双向绑定
  7213. option.data = value;
  7214. }, function () {
  7215. handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
  7216. });
  7217. }
  7218. function getItemOns(renderOpts, params) {
  7219. var $form = params.$form,
  7220. data = params.data,
  7221. property = params.property;
  7222. return getOns(renderOpts, params, function (value) {
  7223. // 处理 model 值双向绑定
  7224. ctor_amd_xe_utils_default.a.set(data, property, value);
  7225. }, function () {
  7226. // 处理 change 事件相关逻辑
  7227. $form.updateStatus(params);
  7228. });
  7229. }
  7230. function isSyncCell(renderOpts, params) {
  7231. // 在 v3.0 中废弃 editRender.type
  7232. return renderOpts.immediate || renderOpts.type === 'visible' || params.$type === 'cell';
  7233. }
  7234. function getNativeEditOns(renderOpts, params) {
  7235. var $table = params.$table,
  7236. row = params.row,
  7237. column = params.column;
  7238. var model = column.model;
  7239. return getOns(renderOpts, params, function (evnt) {
  7240. // 处理 model 值双向绑定
  7241. var cellValue = evnt.target.value;
  7242. if (isSyncCell(renderOpts, params)) {
  7243. UtilTools.setCellValue(row, column, cellValue);
  7244. } else {
  7245. model.update = true;
  7246. model.value = cellValue;
  7247. }
  7248. }, function (evnt) {
  7249. // 处理 change 事件相关逻辑
  7250. var cellValue = evnt.target.value;
  7251. $table.updateStatus(params, cellValue);
  7252. });
  7253. }
  7254. function getNativeFilterOns(renderOpts, params, option) {
  7255. return getOns(renderOpts, params, function (evnt) {
  7256. // 处理 model 值双向绑定
  7257. option.data = evnt.target.value;
  7258. }, function () {
  7259. handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
  7260. });
  7261. }
  7262. function getNativeItemOns(renderOpts, params) {
  7263. var $form = params.$form,
  7264. data = params.data,
  7265. property = params.property;
  7266. return getOns(renderOpts, params, function (evnt) {
  7267. // 处理 model 值双向绑定
  7268. var itemValue = evnt.target.value;
  7269. ctor_amd_xe_utils_default.a.set(data, property, itemValue);
  7270. }, function () {
  7271. // 处理 change 事件相关逻辑
  7272. $form.updateStatus(params);
  7273. });
  7274. }
  7275. /**
  7276. * 单元格可编辑渲染-原生的标签
  7277. * input、textarea、select
  7278. */
  7279. function nativeEditRender(h, renderOpts, params) {
  7280. var row = params.row,
  7281. column = params.column;
  7282. var name = renderOpts.name;
  7283. var attrs = getNativeAttrs(renderOpts);
  7284. var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7285. return [h(name, {
  7286. class: "vxe-default-".concat(name),
  7287. attrs: attrs,
  7288. domProps: {
  7289. value: cellValue
  7290. },
  7291. on: getNativeEditOns(renderOpts, params)
  7292. })];
  7293. }
  7294. function defaultEditRender(h, renderOpts, params) {
  7295. var row = params.row,
  7296. column = params.column;
  7297. var cellValue = UtilTools.getCellValue(row, column);
  7298. return [h(getDefaultComponentName(renderOpts), {
  7299. props: getCellEditFilterProps(renderOpts, params, cellValue),
  7300. on: getEditOns(renderOpts, params),
  7301. nativeOn: getNativeOns(renderOpts, params)
  7302. })];
  7303. }
  7304. function defaultButtonEditRender(h, renderOpts, params) {
  7305. return [h('vxe-button', {
  7306. props: getCellEditFilterProps(renderOpts, params),
  7307. on: getOns(renderOpts, params),
  7308. nativeOn: getNativeOns(renderOpts, params)
  7309. })];
  7310. }
  7311. function defaultButtonsEditRender(h, renderOpts, params) {
  7312. return renderOpts.children.map(function (childRenderOpts) {
  7313. return defaultButtonEditRender(h, childRenderOpts, params)[0];
  7314. });
  7315. }
  7316. function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
  7317. var optionGroups = renderOpts.optionGroups,
  7318. _renderOpts$optionGro = renderOpts.optionGroupProps,
  7319. optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
  7320. var groupOptions = optionGroupProps.options || 'options';
  7321. var groupLabel = optionGroupProps.label || 'label';
  7322. return optionGroups.map(function (group, gIndex) {
  7323. return h('optgroup', {
  7324. key: gIndex,
  7325. domProps: {
  7326. label: group[groupLabel]
  7327. }
  7328. }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
  7329. });
  7330. }
  7331. /**
  7332. * 渲染原生的 option 标签
  7333. */
  7334. function renderNativeOptions(h, options, renderOpts, params) {
  7335. var _renderOpts$optionPro = renderOpts.optionProps,
  7336. optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
  7337. var row = params.row,
  7338. column = params.column;
  7339. var labelProp = optionProps.label || 'label';
  7340. var valueProp = optionProps.value || 'value';
  7341. var disabledProp = optionProps.disabled || 'disabled';
  7342. var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7343. return options.map(function (option, oIndex) {
  7344. return h('option', {
  7345. key: oIndex,
  7346. attrs: {
  7347. value: option[valueProp],
  7348. disabled: option[disabledProp]
  7349. },
  7350. domProps: {
  7351. /* eslint-disable eqeqeq */
  7352. selected: option[valueProp] == cellValue
  7353. }
  7354. }, option[labelProp]);
  7355. });
  7356. }
  7357. function nativeFilterRender(h, renderOpts, params) {
  7358. var column = params.column;
  7359. var name = renderOpts.name;
  7360. var attrs = getNativeAttrs(renderOpts);
  7361. return column.filters.map(function (option, oIndex) {
  7362. return h(name, {
  7363. key: oIndex,
  7364. class: "vxe-default-".concat(name),
  7365. attrs: attrs,
  7366. domProps: {
  7367. value: option.data
  7368. },
  7369. on: getNativeFilterOns(renderOpts, params, option)
  7370. });
  7371. });
  7372. }
  7373. function defaultFilterRender(h, renderOpts, params) {
  7374. var column = params.column;
  7375. return column.filters.map(function (option, oIndex) {
  7376. var optionValue = option.data;
  7377. return h(getDefaultComponentName(renderOpts), {
  7378. key: oIndex,
  7379. props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
  7380. on: getFilterOns(renderOpts, params, option)
  7381. });
  7382. });
  7383. }
  7384. function handleFilterMethod(_ref3) {
  7385. var option = _ref3.option,
  7386. row = _ref3.row,
  7387. column = _ref3.column;
  7388. var data = option.data;
  7389. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7390. /* eslint-disable eqeqeq */
  7391. return cellValue == data;
  7392. }
  7393. function nativeSelectEditRender(h, renderOpts, params) {
  7394. return [h('select', {
  7395. class: 'vxe-default-select',
  7396. attrs: getNativeAttrs(renderOpts),
  7397. on: getNativeEditOns(renderOpts, params)
  7398. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
  7399. }
  7400. function defaultSelectEditRender(h, renderOpts, params) {
  7401. var row = params.row,
  7402. column = params.column;
  7403. var options = renderOpts.options,
  7404. optionProps = renderOpts.optionProps,
  7405. optionGroups = renderOpts.optionGroups,
  7406. optionGroupProps = renderOpts.optionGroupProps;
  7407. var cellValue = UtilTools.getCellValue(row, column);
  7408. return [h(getDefaultComponentName(renderOpts), {
  7409. props: getCellEditFilterProps(renderOpts, params, cellValue, {
  7410. options: options,
  7411. optionProps: optionProps,
  7412. optionGroups: optionGroups,
  7413. optionGroupProps: optionGroupProps
  7414. }),
  7415. on: getEditOns(renderOpts, params)
  7416. })];
  7417. }
  7418. function getSelectCellValue(renderOpts, _ref4) {
  7419. var row = _ref4.row,
  7420. column = _ref4.column;
  7421. var _renderOpts$props = renderOpts.props,
  7422. props = _renderOpts$props === void 0 ? {} : _renderOpts$props,
  7423. options = renderOpts.options,
  7424. optionGroups = renderOpts.optionGroups,
  7425. _renderOpts$optionPro2 = renderOpts.optionProps,
  7426. optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
  7427. _renderOpts$optionGro2 = renderOpts.optionGroupProps,
  7428. optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
  7429. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7430. var selectItem;
  7431. var labelProp = optionProps.label || 'label';
  7432. var valueProp = optionProps.value || 'value';
  7433. if (!isEmptyValue(cellValue)) {
  7434. return ctor_amd_xe_utils_default.a.map(props.multiple ? cellValue : [cellValue], optionGroups ? function (value) {
  7435. var groupOptions = optionGroupProps.options || 'options';
  7436. for (var index = 0; index < optionGroups.length; index++) {
  7437. /* eslint-disable eqeqeq */
  7438. selectItem = ctor_amd_xe_utils_default.a.find(optionGroups[index][groupOptions], function (item) {
  7439. return item[valueProp] == value;
  7440. });
  7441. if (selectItem) {
  7442. break;
  7443. }
  7444. }
  7445. return selectItem ? selectItem[labelProp] : value;
  7446. } : function (value) {
  7447. /* eslint-disable eqeqeq */
  7448. selectItem = ctor_amd_xe_utils_default.a.find(options, function (item) {
  7449. return item[valueProp] == value;
  7450. });
  7451. return selectItem ? selectItem[labelProp] : value;
  7452. }).join(', ');
  7453. }
  7454. return null;
  7455. }
  7456. /**
  7457. * 渲染表单-项
  7458. * 用于渲染原生的标签
  7459. */
  7460. function nativeItemRender(h, renderOpts, params) {
  7461. var data = params.data,
  7462. property = params.property;
  7463. var name = renderOpts.name;
  7464. var attrs = getNativeAttrs(renderOpts);
  7465. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7466. return [h(name, {
  7467. class: "vxe-default-".concat(name),
  7468. attrs: attrs,
  7469. domProps: attrs && name === 'input' && (attrs.type === 'submit' || attrs.type === 'reset') ? null : {
  7470. value: itemValue
  7471. },
  7472. on: getNativeItemOns(renderOpts, params)
  7473. })];
  7474. }
  7475. function defaultItemRender(h, renderOpts, params) {
  7476. var data = params.data,
  7477. property = params.property;
  7478. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7479. return [h(getDefaultComponentName(renderOpts), {
  7480. props: getItemProps(renderOpts, params, itemValue),
  7481. on: getItemOns(renderOpts, params),
  7482. nativeOn: getNativeOns(renderOpts, params)
  7483. })];
  7484. }
  7485. function defaultButtonItemRender(h, renderOpts, params) {
  7486. return [h('vxe-button', {
  7487. props: getItemProps(renderOpts, params),
  7488. on: getOns(renderOpts, params),
  7489. nativeOn: getNativeOns(renderOpts, params)
  7490. })];
  7491. }
  7492. function defaultButtonsItemRender(h, renderOpts, params) {
  7493. return renderOpts.children.map(function (childRenderOpts) {
  7494. return defaultButtonItemRender(h, childRenderOpts, params)[0];
  7495. });
  7496. }
  7497. /**
  7498. * 渲染原生的 select 标签
  7499. */
  7500. function renderNativeFormOptions(h, options, renderOpts, params) {
  7501. var data = params.data,
  7502. property = params.property;
  7503. var _renderOpts$optionPro3 = renderOpts.optionProps,
  7504. optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
  7505. var labelProp = optionProps.label || 'label';
  7506. var valueProp = optionProps.value || 'value';
  7507. var disabledProp = optionProps.disabled || 'disabled';
  7508. var cellValue = ctor_amd_xe_utils_default.a.get(data, property);
  7509. return options.map(function (item, oIndex) {
  7510. return h('option', {
  7511. key: oIndex,
  7512. attrs: {
  7513. value: item[valueProp],
  7514. disabled: item[disabledProp]
  7515. },
  7516. domProps: {
  7517. /* eslint-disable eqeqeq */
  7518. selected: item[valueProp] == cellValue
  7519. }
  7520. }, item[labelProp]);
  7521. });
  7522. }
  7523. function handleExportSelectMethod(params) {
  7524. var row = params.row,
  7525. column = params.column,
  7526. options = params.options;
  7527. return options.original ? UtilTools.getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
  7528. }
  7529. /**
  7530. * 渲染表单-项中
  7531. * 单选框和复选框
  7532. */
  7533. function defaultFormItemRadioAndCheckboxRender(h, renderOpts, params) {
  7534. var options = renderOpts.options,
  7535. _renderOpts$optionPro4 = renderOpts.optionProps,
  7536. optionProps = _renderOpts$optionPro4 === void 0 ? {} : _renderOpts$optionPro4;
  7537. var data = params.data,
  7538. property = params.property;
  7539. var labelProp = optionProps.label || 'label';
  7540. var valueProp = optionProps.value || 'value';
  7541. var disabledProp = optionProps.disabled || 'disabled';
  7542. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7543. var name = getDefaultComponentName(renderOpts); // 如果是分组
  7544. if (options) {
  7545. return [h("".concat(name, "-group"), {
  7546. props: getItemProps(renderOpts, params, itemValue),
  7547. on: getItemOns(renderOpts, params),
  7548. nativeOn: getNativeOns(renderOpts, params)
  7549. }, options.map(function (item, index) {
  7550. return h(name, {
  7551. key: index,
  7552. props: {
  7553. label: item[valueProp],
  7554. content: item[labelProp],
  7555. disabled: item[disabledProp]
  7556. }
  7557. });
  7558. }))];
  7559. }
  7560. return [h(name, {
  7561. props: getItemProps(renderOpts, params, itemValue),
  7562. on: getItemOns(renderOpts, params),
  7563. nativeOn: getNativeOns(renderOpts, params)
  7564. })];
  7565. }
  7566. /**
  7567. * 内置的组件渲染
  7568. */
  7569. var renderMap = {
  7570. input: {
  7571. autofocus: 'input',
  7572. renderEdit: nativeEditRender,
  7573. renderDefault: nativeEditRender,
  7574. renderFilter: nativeFilterRender,
  7575. filterMethod: handleFilterMethod,
  7576. renderItemContent: nativeItemRender
  7577. },
  7578. textarea: {
  7579. autofocus: 'textarea',
  7580. renderEdit: nativeEditRender,
  7581. renderItemContent: nativeItemRender
  7582. },
  7583. select: {
  7584. renderEdit: nativeSelectEditRender,
  7585. renderDefault: nativeSelectEditRender,
  7586. renderCell: function renderCell(h, renderOpts, params) {
  7587. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  7588. },
  7589. renderFilter: function renderFilter(h, renderOpts, params) {
  7590. var column = params.column;
  7591. return column.filters.map(function (option, oIndex) {
  7592. return h('select', {
  7593. key: oIndex,
  7594. class: 'vxe-default-select',
  7595. attrs: getNativeAttrs(renderOpts),
  7596. on: getNativeFilterOns(renderOpts, params, option)
  7597. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params));
  7598. });
  7599. },
  7600. filterMethod: handleFilterMethod,
  7601. renderItemContent: function renderItemContent(h, renderOpts, params) {
  7602. return [h('select', {
  7603. class: 'vxe-default-select',
  7604. attrs: getNativeAttrs(renderOpts),
  7605. on: getNativeItemOns(renderOpts, params)
  7606. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeFormOptions) : renderNativeFormOptions(h, renderOpts.options, renderOpts, params))];
  7607. },
  7608. cellExportMethod: handleExportSelectMethod
  7609. },
  7610. $input: {
  7611. autofocus: '.vxe-input--inner',
  7612. renderEdit: defaultEditRender,
  7613. renderCell: function renderCell(h, renderOpts, params) {
  7614. var _renderOpts$props2 = renderOpts.props,
  7615. props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
  7616. var row = params.row,
  7617. column = params.column;
  7618. var digits = props.digits || conf.input.digits;
  7619. var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
  7620. if (cellValue) {
  7621. switch (props.type) {
  7622. case 'date':
  7623. case 'week':
  7624. case 'month':
  7625. case 'year':
  7626. cellValue = getLabelFormatDate(cellValue, props);
  7627. break;
  7628. case 'float':
  7629. cellValue = ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(cellValue, digits), digits);
  7630. break;
  7631. }
  7632. }
  7633. return getCellLabelVNs(h, renderOpts, params, cellValue);
  7634. },
  7635. renderDefault: defaultEditRender,
  7636. renderFilter: defaultFilterRender,
  7637. filterMethod: handleFilterMethod,
  7638. renderItemContent: defaultItemRender
  7639. },
  7640. $textarea: {
  7641. autofocus: '.vxe-textarea--inner',
  7642. renderItemContent: defaultItemRender
  7643. },
  7644. $button: {
  7645. renderDefault: defaultButtonEditRender,
  7646. renderItemContent: defaultButtonItemRender
  7647. },
  7648. $buttons: {
  7649. renderDefault: defaultButtonsEditRender,
  7650. renderItemContent: defaultButtonsItemRender
  7651. },
  7652. $select: {
  7653. autofocus: '.vxe-input--inner',
  7654. renderEdit: defaultSelectEditRender,
  7655. renderDefault: defaultSelectEditRender,
  7656. renderCell: function renderCell(h, renderOpts, params) {
  7657. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  7658. },
  7659. renderFilter: function renderFilter(h, renderOpts, params) {
  7660. var column = params.column;
  7661. var options = renderOpts.options,
  7662. optionProps = renderOpts.optionProps,
  7663. optionGroups = renderOpts.optionGroups,
  7664. optionGroupProps = renderOpts.optionGroupProps;
  7665. var nativeOn = getNativeOns(renderOpts, params);
  7666. return column.filters.map(function (option, oIndex) {
  7667. var optionValue = option.data;
  7668. return h(getDefaultComponentName(renderOpts), {
  7669. key: oIndex,
  7670. props: getCellEditFilterProps(renderOpts, params, optionValue, {
  7671. options: options,
  7672. optionProps: optionProps,
  7673. optionGroups: optionGroups,
  7674. optionGroupProps: optionGroupProps
  7675. }),
  7676. on: getFilterOns(renderOpts, params, option),
  7677. nativeOn: nativeOn
  7678. });
  7679. });
  7680. },
  7681. filterMethod: handleFilterMethod,
  7682. renderItemContent: function renderItemContent(h, renderOpts, params) {
  7683. var data = params.data,
  7684. property = params.property;
  7685. var options = renderOpts.options,
  7686. optionProps = renderOpts.optionProps,
  7687. optionGroups = renderOpts.optionGroups,
  7688. optionGroupProps = renderOpts.optionGroupProps;
  7689. var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
  7690. return [h(getDefaultComponentName(renderOpts), {
  7691. props: getItemProps(renderOpts, params, itemValue, {
  7692. options: options,
  7693. optionProps: optionProps,
  7694. optionGroups: optionGroups,
  7695. optionGroupProps: optionGroupProps
  7696. }),
  7697. on: getItemOns(renderOpts, params),
  7698. nativeOn: getNativeOns(renderOpts, params)
  7699. })];
  7700. },
  7701. cellExportMethod: handleExportSelectMethod
  7702. },
  7703. $radio: {
  7704. autofocus: '.vxe-radio--input',
  7705. renderItemContent: defaultFormItemRadioAndCheckboxRender
  7706. },
  7707. $checkbox: {
  7708. autofocus: '.vxe-checkbox--input',
  7709. renderItemContent: defaultFormItemRadioAndCheckboxRender
  7710. },
  7711. $switch: {
  7712. autofocus: '.vxe-switch--button',
  7713. renderEdit: defaultEditRender,
  7714. renderDefault: defaultEditRender,
  7715. renderItemContent: defaultItemRender
  7716. }
  7717. };
  7718. /**
  7719. * 全局渲染器
  7720. */
  7721. var renderer = {
  7722. mixin: function mixin(map) {
  7723. ctor_amd_xe_utils_default.a.each(map, function (options, name) {
  7724. return renderer.add(name, options);
  7725. });
  7726. return renderer;
  7727. },
  7728. get: function get(name) {
  7729. return renderMap[name] || null;
  7730. },
  7731. add: function add(name, options) {
  7732. if (name && options) {
  7733. var renders = renderMap[name];
  7734. if (renders) {
  7735. Object.assign(renders, options);
  7736. } else {
  7737. renderMap[name] = options;
  7738. }
  7739. }
  7740. return renderer;
  7741. },
  7742. delete: function _delete(name) {
  7743. delete renderMap[name];
  7744. return renderer;
  7745. }
  7746. };
  7747. /* harmony default export */ var src_renderer = (renderer);
  7748. // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
  7749. var commands = new store();
  7750. /* harmony default export */ var src_commands = (commands);
  7751. // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
  7752. var menus = new store();
  7753. /* harmony default export */ var src_menus = (menus);
  7754. // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
  7755. /**
  7756. * 全局参数设置
  7757. */
  7758. function setup() {
  7759. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7760. // 在 v3.0 中废弃 setup.menu
  7761. if (options.menu && !(options.menuConfig || options.contextMenu)) {
  7762. options.contextMenu = options.menu;
  7763. options.menuConfig = options.menu;
  7764. console.warn('[vxe-table] parameter "menu" has been replaced by "menuConfig"');
  7765. }
  7766. return ctor_amd_xe_utils_default.a.merge(conf, options);
  7767. }
  7768. /* harmony default export */ var src_setup = (setup);
  7769. // CONCATENATED MODULE: ./packages/v-x-e-table/index.js
  7770. var installedPlugins = [];
  7771. function use(Plugin, options) {
  7772. /* eslint-disable @typescript-eslint/no-use-before-define */
  7773. if (Plugin && Plugin.install) {
  7774. if (installedPlugins.indexOf(Plugin) === -1) {
  7775. Plugin.install(VXETable, options);
  7776. installedPlugins.push(Plugin);
  7777. }
  7778. }
  7779. return VXETable;
  7780. }
  7781. /**
  7782. * 检测模块的安装顺序是否正确
  7783. */
  7784. function reg(key) {
  7785. /* eslint-disable @typescript-eslint/no-use-before-define */
  7786. if (VXETable.Table) {
  7787. UtilTools.error('vxe.error.useErr', [key]);
  7788. }
  7789. VXETable["_".concat(key)] = 1;
  7790. }
  7791. function _t(key, args) {
  7792. return key ? ctor_amd_xe_utils_default.a.toValueString(conf.translate ? conf.translate(key, args) : key) : '';
  7793. }
  7794. var VXETable = {
  7795. t: function t(key, args) {
  7796. return conf.i18n(key, args);
  7797. },
  7798. _t: _t,
  7799. v: 'v2',
  7800. reg: reg,
  7801. use: use,
  7802. types: {},
  7803. setup: src_setup,
  7804. interceptor: src_interceptor,
  7805. renderer: src_renderer,
  7806. commands: src_commands,
  7807. formats: src_formats,
  7808. menus: src_menus
  7809. }; // v3.0 中废弃 buttons
  7810. Object.defineProperty(VXETable, 'buttons', {
  7811. get: function get() {
  7812. UtilTools.warn('vxe.error.delProp', ['buttons', 'commands']);
  7813. return src_commands;
  7814. }
  7815. });
  7816. /**
  7817. * 获取当前的 zIndex
  7818. */
  7819. Object.defineProperty(VXETable, 'zIndex', {
  7820. get: UtilTools.getLastZIndex
  7821. });
  7822. /**
  7823. * 获取下一个 zIndex
  7824. */
  7825. Object.defineProperty(VXETable, 'nextZIndex', {
  7826. get: UtilTools.nextZIndex
  7827. });
  7828. function getExportOrImpotType(types, flag) {
  7829. var rest = [];
  7830. ctor_amd_xe_utils_default.a.objectEach(types, function (val, type) {
  7831. if (val === 0 || val === flag) {
  7832. rest.push(type);
  7833. }
  7834. });
  7835. return rest;
  7836. }
  7837. /**
  7838. * 获取所有导出类型
  7839. */
  7840. Object.defineProperty(VXETable, 'exportTypes', {
  7841. get: function get() {
  7842. return getExportOrImpotType(conf.export.types, 1);
  7843. }
  7844. });
  7845. /**
  7846. * 获取所有导入类型
  7847. */
  7848. Object.defineProperty(VXETable, 'importTypes', {
  7849. get: function get() {
  7850. return getExportOrImpotType(conf.export.types, 2);
  7851. }
  7852. });
  7853. /* harmony default export */ var v_x_e_table = (VXETable);
  7854. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.every.js
  7855. var es_array_every = __webpack_require__("a623");
  7856. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
  7857. var es_map = __webpack_require__("4ec9");
  7858. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
  7859. var es_number_constructor = __webpack_require__("a9e3");
  7860. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
  7861. function _defineProperty(obj, key, value) {
  7862. if (key in obj) {
  7863. Object.defineProperty(obj, key, {
  7864. value: value,
  7865. enumerable: true,
  7866. configurable: true,
  7867. writable: true
  7868. });
  7869. } else {
  7870. obj[key] = value;
  7871. }
  7872. return obj;
  7873. }
  7874. // CONCATENATED MODULE: ./packages/body/src/body.js
  7875. var cellType = 'body'; // 滚动、拖动过程中不需要触发
  7876. function isOperateMouse($xetable) {
  7877. // 在 v3.0 中废弃 optimization.delayHover
  7878. return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
  7879. }
  7880. function countTreeExpand(prevRow, params) {
  7881. var $table = params.$table;
  7882. var rowChildren = prevRow[$table.treeOpts.children];
  7883. var count = 1;
  7884. if ($table.isTreeExpandByRow(prevRow)) {
  7885. for (var index = 0; index < rowChildren.length; index++) {
  7886. count += countTreeExpand(rowChildren[index], params);
  7887. }
  7888. }
  7889. return count;
  7890. }
  7891. function getOffsetSize($xetable) {
  7892. switch ($xetable.vSize) {
  7893. case 'mini':
  7894. return 3;
  7895. case 'small':
  7896. return 2;
  7897. case 'medium':
  7898. return 1;
  7899. }
  7900. return 0;
  7901. }
  7902. function calcTreeLine(params, items) {
  7903. var $table = params.$table,
  7904. $rowIndex = params.$rowIndex;
  7905. var expandSize = 1;
  7906. if ($rowIndex) {
  7907. expandSize = countTreeExpand(items[$rowIndex - 1], params);
  7908. }
  7909. return $table.rowHeight * expandSize - ($rowIndex ? 1 : 12 - getOffsetSize($table));
  7910. }
  7911. function renderLine(h, _vm, $xetable, rowLevel, items, params) {
  7912. var column = params.column;
  7913. var treeOpts = $xetable.treeOpts,
  7914. treeConfig = $xetable.treeConfig;
  7915. return column.slots && column.slots.line ? column.slots.line.call($xetable, params, h) : column.treeNode && treeConfig && treeOpts.line ? [h('div', {
  7916. class: 'vxe-tree--line-wrapper'
  7917. }, [h('div', {
  7918. class: 'vxe-tree--line',
  7919. style: {
  7920. height: "".concat(calcTreeLine(params, items), "px"),
  7921. left: "".concat(rowLevel * treeOpts.indent + (rowLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
  7922. }
  7923. })])] : [];
  7924. }
  7925. function renderBorder(h, type) {
  7926. return h('div', {
  7927. class: "vxe-table-".concat(type, "ed-borders"),
  7928. ref: "".concat(type, "Borders")
  7929. }, [h('span', {
  7930. class: 'vxe-table-border-top',
  7931. ref: "".concat(type, "Top")
  7932. }), h('span', {
  7933. class: 'vxe-table-border-right',
  7934. ref: "".concat(type, "Right")
  7935. }), h('span', {
  7936. class: 'vxe-table-border-bottom',
  7937. ref: "".concat(type, "Bottom")
  7938. }), h('span', {
  7939. class: 'vxe-table-border-left',
  7940. ref: "".concat(type, "Left")
  7941. })]);
  7942. }
  7943. function mergeMethod(mergeList, _rowIndex, _columnIndex) {
  7944. for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
  7945. var _mergeList$mIndex = mergeList[mIndex],
  7946. mergeRowIndex = _mergeList$mIndex.row,
  7947. mergeColIndex = _mergeList$mIndex.col,
  7948. mergeRowspan = _mergeList$mIndex.rowspan,
  7949. mergeColspan = _mergeList$mIndex.colspan;
  7950. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  7951. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  7952. return {
  7953. rowspan: mergeRowspan,
  7954. colspan: mergeColspan
  7955. };
  7956. }
  7957. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  7958. return {
  7959. rowspan: 0,
  7960. colspan: 0
  7961. };
  7962. }
  7963. }
  7964. }
  7965. }
  7966. /**
  7967. * 渲染列
  7968. */
  7969. function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
  7970. var _ref2;
  7971. var _e = $xetable._e,
  7972. tableListeners = $xetable.$listeners,
  7973. afterFullData = $xetable.afterFullData,
  7974. tableData = $xetable.tableData,
  7975. height = $xetable.height,
  7976. columnKey = $xetable.columnKey,
  7977. overflowX = $xetable.overflowX,
  7978. scrollXLoad = $xetable.scrollXLoad,
  7979. scrollYLoad = $xetable.scrollYLoad,
  7980. highlightCurrentRow = $xetable.highlightCurrentRow,
  7981. allColumnOverflow = $xetable.showOverflow,
  7982. allAlign = $xetable.align,
  7983. currentColumn = $xetable.currentColumn,
  7984. cellClassName = $xetable.cellClassName,
  7985. cellStyle = $xetable.cellStyle,
  7986. mergeList = $xetable.mergeList,
  7987. spanMethod = $xetable.spanMethod,
  7988. radioOpts = $xetable.radioOpts,
  7989. checkboxOpts = $xetable.checkboxOpts,
  7990. expandOpts = $xetable.expandOpts,
  7991. treeOpts = $xetable.treeOpts,
  7992. tooltipOpts = $xetable.tooltipOpts,
  7993. mouseConfig = $xetable.mouseConfig,
  7994. editConfig = $xetable.editConfig,
  7995. editOpts = $xetable.editOpts,
  7996. editRules = $xetable.editRules,
  7997. validOpts = $xetable.validOpts,
  7998. editStore = $xetable.editStore,
  7999. validStore = $xetable.validStore;
  8000. var cellRender = column.cellRender,
  8001. editRender = column.editRender,
  8002. align = column.align,
  8003. showOverflow = column.showOverflow,
  8004. className = column.className,
  8005. treeNode = column.treeNode;
  8006. var actived = editStore.actived;
  8007. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  8008. var columnIndex = $xetable.getColumnIndex(column);
  8009. var _columnIndex = $xetable.getVTColumnIndex(column);
  8010. var isEdit = UtilTools.isEnableConf(editRender);
  8011. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
  8012. var cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8013. var showEllipsis = cellOverflow === 'ellipsis';
  8014. var showTitle = cellOverflow === 'title';
  8015. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  8016. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  8017. var isDirty;
  8018. var tdOns = {};
  8019. var cellAlign = align || allAlign;
  8020. var hasValidError = validStore.row === row && validStore.column === column;
  8021. var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
  8022. var attrs = {
  8023. 'data-colid': column.id
  8024. };
  8025. var bindMouseenter = tableListeners['cell-mouseenter'];
  8026. var bindMouseleave = tableListeners['cell-mouseleave'];
  8027. var triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
  8028. var params = {
  8029. $table: $xetable,
  8030. $seq: $seq,
  8031. seq: seq,
  8032. rowid: rowid,
  8033. row: row,
  8034. rowIndex: rowIndex,
  8035. $rowIndex: $rowIndex,
  8036. _rowIndex: _rowIndex,
  8037. column: column,
  8038. columnIndex: columnIndex,
  8039. $columnIndex: $columnIndex,
  8040. _columnIndex: _columnIndex,
  8041. fixed: fixedType,
  8042. type: cellType,
  8043. isHidden: fixedHiddenColumn,
  8044. level: rowLevel,
  8045. visibleData: afterFullData,
  8046. data: tableData,
  8047. items: items
  8048. }; // 虚拟滚动不支持动态高度
  8049. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  8050. showEllipsis = hasEllipsis = true;
  8051. } // hover 进入事件
  8052. if (showTitle || showTooltip || showAllTip || bindMouseenter) {
  8053. tdOns.mouseenter = function (evnt) {
  8054. if (isOperateMouse($xetable)) {
  8055. return;
  8056. }
  8057. if (showTitle) {
  8058. DomTools.updateCellTitle(evnt.currentTarget, column);
  8059. } else if (showTooltip || showAllTip) {
  8060. // 如果配置了显示 tooltip
  8061. $xetable.triggerBodyTooltipEvent(evnt, params);
  8062. }
  8063. if (bindMouseenter) {
  8064. $xetable.emitEvent('cell-mouseenter', Object.assign({
  8065. cell: evnt.currentTarget
  8066. }, params), evnt);
  8067. }
  8068. };
  8069. } // hover 退出事件
  8070. if (showTooltip || showAllTip || bindMouseleave) {
  8071. tdOns.mouseleave = function (evnt) {
  8072. if (isOperateMouse($xetable)) {
  8073. return;
  8074. }
  8075. if (showTooltip || showAllTip) {
  8076. $xetable.handleTargetLeaveEvent(evnt);
  8077. }
  8078. if (bindMouseleave) {
  8079. $xetable.emitEvent('cell-mouseleave', Object.assign({
  8080. cell: evnt.currentTarget
  8081. }, params), evnt);
  8082. }
  8083. };
  8084. } // 按下事件处理
  8085. if (checkboxOpts.range || mouseConfig) {
  8086. tdOns.mousedown = function (evnt) {
  8087. $xetable.triggerCellMousedownEvent(evnt, params);
  8088. };
  8089. } // 点击事件处理
  8090. 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
  8091. checkboxOpts.trigger === 'row' || (column.type === 'checkbox' || column.type === 'selection') && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
  8092. tdOns.click = function (evnt) {
  8093. $xetable.triggerCellClickEvent(evnt, params);
  8094. };
  8095. } // 双击事件处理
  8096. if (triggerDblclick || tableListeners['cell-dblclick']) {
  8097. tdOns.dblclick = function (evnt) {
  8098. $xetable.triggerCellDBLClickEvent(evnt, params);
  8099. };
  8100. } // 合并行或列
  8101. if (mergeList.length) {
  8102. var spanRest = mergeMethod(mergeList, _rowIndex, _columnIndex);
  8103. if (spanRest) {
  8104. var rowspan = spanRest.rowspan,
  8105. colspan = spanRest.colspan;
  8106. if (!rowspan || !colspan) {
  8107. return null;
  8108. }
  8109. if (rowspan > 1) {
  8110. attrs.rowspan = rowspan;
  8111. }
  8112. if (colspan > 1) {
  8113. attrs.colspan = colspan;
  8114. }
  8115. }
  8116. } else if (spanMethod) {
  8117. // 自定义合并行或列的方法
  8118. var _ref = spanMethod(params) || {},
  8119. _ref$rowspan = _ref.rowspan,
  8120. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  8121. _ref$colspan = _ref.colspan,
  8122. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  8123. if (!_rowspan || !_colspan) {
  8124. return null;
  8125. }
  8126. if (_rowspan > 1) {
  8127. attrs.rowspan = _rowspan;
  8128. }
  8129. if (_colspan > 1) {
  8130. attrs.colspan = _colspan;
  8131. }
  8132. } // 如果被合并不可隐藏
  8133. if (fixedHiddenColumn && mergeList) {
  8134. if (attrs.colspan > 1 || attrs.rowspan > 1) {
  8135. fixedHiddenColumn = false;
  8136. }
  8137. } // 如果编辑列开启显示状态
  8138. if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
  8139. isDirty = $xetable.isUpdateByRow(row, column.property);
  8140. }
  8141. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  8142. return h('td', {
  8143. 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)],
  8144. key: columnKey ? column.id : $columnIndex,
  8145. attrs: attrs,
  8146. style: cellStyle ? ctor_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null,
  8147. on: tdOns
  8148. }, allColumnOverflow && fixedHiddenColumn ? [h('div', {
  8149. class: ['vxe-cell', {
  8150. 'c--title': showTitle,
  8151. 'c--tooltip': showTooltip,
  8152. 'c--ellipsis': showEllipsis
  8153. }]
  8154. })] : renderLine(h, _vm, $xetable, rowLevel, items, params).concat([h('div', {
  8155. class: ['vxe-cell', {
  8156. 'c--title': showTitle,
  8157. 'c--tooltip': showTooltip,
  8158. 'c--ellipsis': showEllipsis
  8159. }],
  8160. attrs: {
  8161. title: showTitle ? $xetable.getCellLabel(row, column) : null
  8162. }
  8163. }, column.renderCell(h, params)), showValidTip ? hasValidError ? h('div', {
  8164. class: 'vxe-cell--valid',
  8165. style: validStore.rule && validStore.rule.maxWidth ? {
  8166. width: "".concat(validStore.rule.maxWidth, "px")
  8167. } : null
  8168. }, [h('span', {
  8169. class: 'vxe-cell--valid-msg'
  8170. }, validStore.content)]) : _e() : null]));
  8171. }
  8172. function renderRows(h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tableColumn) {
  8173. var stripe = $xetable.stripe,
  8174. rowKey = $xetable.rowKey,
  8175. highlightHoverRow = $xetable.highlightHoverRow,
  8176. rowClassName = $xetable.rowClassName,
  8177. rowStyle = $xetable.rowStyle,
  8178. allColumnOverflow = $xetable.showOverflow,
  8179. treeConfig = $xetable.treeConfig,
  8180. treeOpts = $xetable.treeOpts,
  8181. treeExpandeds = $xetable.treeExpandeds,
  8182. scrollYLoad = $xetable.scrollYLoad,
  8183. scrollYStore = $xetable.scrollYStore,
  8184. editStore = $xetable.editStore,
  8185. rowExpandeds = $xetable.rowExpandeds,
  8186. radioOpts = $xetable.radioOpts,
  8187. checkboxOpts = $xetable.checkboxOpts,
  8188. expandColumn = $xetable.expandColumn;
  8189. var rows = [];
  8190. tableData.forEach(function (row, $rowIndex) {
  8191. var trOn = {};
  8192. var rowIndex = $rowIndex;
  8193. var seq = rowIndex + 1;
  8194. if (scrollYLoad) {
  8195. seq += scrollYStore.startIndex;
  8196. }
  8197. var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
  8198. rowIndex = $xetable.getRowIndex(row); // 事件绑定
  8199. if (highlightHoverRow) {
  8200. trOn.mouseenter = function (evnt) {
  8201. if (isOperateMouse($xetable)) {
  8202. return;
  8203. }
  8204. $xetable.triggerHoverEvent(evnt, {
  8205. row: row,
  8206. rowIndex: rowIndex
  8207. });
  8208. };
  8209. trOn.mouseleave = function () {
  8210. if (isOperateMouse($xetable)) {
  8211. return;
  8212. }
  8213. $xetable.clearHoverRow();
  8214. };
  8215. }
  8216. var rowid = UtilTools.getRowid($xetable, row);
  8217. var params = {
  8218. $table: $xetable,
  8219. $seq: $seq,
  8220. seq: seq,
  8221. rowid: rowid,
  8222. fixed: fixedType,
  8223. type: cellType,
  8224. level: rowLevel,
  8225. row: row,
  8226. rowIndex: rowIndex,
  8227. $rowIndex: $rowIndex
  8228. };
  8229. rows.push(h('tr', {
  8230. class: ['vxe-body--row', {
  8231. 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
  8232. 'is--new': editStore.insertList.indexOf(row) > -1,
  8233. 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
  8234. 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
  8235. }, rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
  8236. attrs: {
  8237. 'data-rowid': rowid
  8238. },
  8239. style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
  8240. key: rowKey || treeConfig ? rowid : $rowIndex,
  8241. on: trOn
  8242. }, tableColumn.map(function (column, $columnIndex) {
  8243. return renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
  8244. }))); // 如果行被展开了
  8245. if (expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1) {
  8246. var expandColumnIndex = $xetable.getColumnIndex(expandColumn);
  8247. var cellStyle;
  8248. if (treeConfig) {
  8249. cellStyle = {
  8250. paddingLeft: "".concat(rowLevel * treeOpts.indent + 30, "px")
  8251. };
  8252. }
  8253. var showOverflow = expandColumn.showOverflow;
  8254. var hasEllipsis = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8255. var expandParams = {
  8256. $table: $xetable,
  8257. $seq: $seq,
  8258. seq: seq,
  8259. column: expandColumn,
  8260. columnIndex: expandColumnIndex,
  8261. fixed: fixedType,
  8262. type: cellType,
  8263. level: rowLevel,
  8264. row: row,
  8265. rowIndex: rowIndex,
  8266. $rowIndex: $rowIndex
  8267. };
  8268. rows.push(h('tr', {
  8269. class: 'vxe-body--expanded-row',
  8270. key: "expand_".concat(rowid),
  8271. style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
  8272. on: trOn
  8273. }, [h('td', {
  8274. class: ['vxe-body--expanded-column', {
  8275. 'fixed--hidden': fixedType,
  8276. 'col--ellipsis': hasEllipsis
  8277. }],
  8278. attrs: {
  8279. colspan: tableColumn.length
  8280. }
  8281. }, [h('div', {
  8282. class: 'vxe-body--expanded-cell',
  8283. style: cellStyle
  8284. }, [expandColumn.renderData(h, expandParams)])])]));
  8285. } // 如果是树形表格
  8286. if (treeConfig && treeExpandeds.length) {
  8287. var rowChildren = row[treeOpts.children];
  8288. if (rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1) {
  8289. rows.push.apply(rows, _toConsumableArray(renderRows(h, _vm, $xetable, $seq ? "".concat($seq, ".").concat(seq) : "".concat(seq), rowLevel + 1, fixedType, rowChildren, tableColumn)));
  8290. }
  8291. }
  8292. });
  8293. return rows;
  8294. }
  8295. /**
  8296. * 同步滚动条
  8297. * scroll 方式:可以使固定列与内容保持一致的滚动效果,实现相对麻烦
  8298. * mousewheel 方式:对于同步滚动效果就略差了,左右滚动,内容跟随即可
  8299. * css3 translate 方式:对于同步滚动效果会有产生卡顿感觉,虽然可以利用硬件加速,渲染性能略优,但失去table布局能力
  8300. */
  8301. var scrollProcessTimeout;
  8302. function syncBodyScroll(scrollTop, elem1, elem2) {
  8303. if (elem1 || elem2) {
  8304. if (elem1) {
  8305. elem1.onscroll = null;
  8306. elem1.scrollTop = scrollTop;
  8307. }
  8308. if (elem2) {
  8309. elem2.onscroll = null;
  8310. elem2.scrollTop = scrollTop;
  8311. }
  8312. clearTimeout(scrollProcessTimeout);
  8313. scrollProcessTimeout = setTimeout(function () {
  8314. if (elem1) {
  8315. elem1.onscroll = elem1._onscroll;
  8316. }
  8317. if (elem2) {
  8318. elem2.onscroll = elem2._onscroll;
  8319. }
  8320. }, 300);
  8321. }
  8322. }
  8323. /* harmony default export */ var src_body = ({
  8324. name: 'VxeTableBody',
  8325. props: {
  8326. tableData: Array,
  8327. tableColumn: Array,
  8328. visibleColumn: Array,
  8329. fixedColumn: Array,
  8330. size: String,
  8331. fixedType: String,
  8332. isGroup: Boolean
  8333. },
  8334. mounted: function mounted() {
  8335. var $xetable = this.$parent,
  8336. $el = this.$el,
  8337. $refs = this.$refs,
  8338. fixedType = this.fixedType;
  8339. var elemStore = $xetable.elemStore;
  8340. var prefix = "".concat(fixedType || 'main', "-body-");
  8341. elemStore["".concat(prefix, "wrapper")] = $el;
  8342. elemStore["".concat(prefix, "table")] = $refs.table;
  8343. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  8344. elemStore["".concat(prefix, "list")] = $refs.tbody;
  8345. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  8346. elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
  8347. elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
  8348. this.$el.onscroll = this.scrollEvent;
  8349. this.$el._onscroll = this.scrollEvent;
  8350. },
  8351. beforeDestroy: function beforeDestroy() {
  8352. this.$el._onscroll = null;
  8353. this.$el.onscroll = null;
  8354. },
  8355. render: function render(h) {
  8356. var _e = this._e,
  8357. $xetable = this.$parent,
  8358. fixedColumn = this.fixedColumn,
  8359. fixedType = this.fixedType;
  8360. var $scopedSlots = $xetable.$scopedSlots,
  8361. tId = $xetable.tId,
  8362. tableData = $xetable.tableData,
  8363. tableColumn = $xetable.tableColumn,
  8364. allColumnOverflow = $xetable.showOverflow,
  8365. mergeList = $xetable.mergeList,
  8366. spanMethod = $xetable.spanMethod,
  8367. scrollXLoad = $xetable.scrollXLoad,
  8368. mouseConfig = $xetable.mouseConfig,
  8369. mouseOpts = $xetable.mouseOpts,
  8370. emptyRender = $xetable.emptyRender,
  8371. emptyOpts = $xetable.emptyOpts,
  8372. keyboardConfig = $xetable.keyboardConfig,
  8373. keyboardOpts = $xetable.keyboardOpts; // 在 v3.0 中废弃 mouse-config.checked
  8374. var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是固定列与设置了超出隐藏
  8375. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
  8376. if (fixedType && allColumnOverflow) {
  8377. tableColumn = fixedColumn;
  8378. } else if (scrollXLoad) {
  8379. if (fixedType) {
  8380. tableColumn = fixedColumn;
  8381. }
  8382. }
  8383. }
  8384. var emptyContent;
  8385. if ($scopedSlots.empty) {
  8386. emptyContent = $scopedSlots.empty.call(this, {
  8387. $table: $xetable
  8388. }, h);
  8389. } else {
  8390. var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  8391. if (compConf && compConf.renderEmpty) {
  8392. emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
  8393. $table: $xetable
  8394. }, {
  8395. $table: $xetable
  8396. });
  8397. } else {
  8398. emptyContent = $xetable.emptyText || conf.i18n('vxe.table.emptyText');
  8399. }
  8400. }
  8401. return h('div', {
  8402. class: ['vxe-table--body-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  8403. attrs: {
  8404. 'data-tid': tId
  8405. }
  8406. }, [fixedType ? _e() : h('div', {
  8407. class: 'vxe-body--x-space',
  8408. ref: 'xSpace'
  8409. }), h('div', {
  8410. class: 'vxe-body--y-space',
  8411. ref: 'ySpace'
  8412. }), h('table', {
  8413. class: 'vxe-table--body',
  8414. attrs: {
  8415. 'data-tid': tId,
  8416. cellspacing: 0,
  8417. cellpadding: 0,
  8418. border: 0
  8419. },
  8420. ref: 'table'
  8421. }, [
  8422. /**
  8423. * 列宽
  8424. */
  8425. h('colgroup', {
  8426. ref: 'colgroup'
  8427. }, tableColumn.map(function (column, columnIndex) {
  8428. return h('col', {
  8429. attrs: {
  8430. name: column.id
  8431. },
  8432. key: columnIndex
  8433. });
  8434. })),
  8435. /**
  8436. * 内容
  8437. */
  8438. h('tbody', {
  8439. ref: 'tbody'
  8440. }, renderRows(h, this, $xetable, '', 0, fixedType, tableData, tableColumn))]),
  8441. /**
  8442. * 选中边框线
  8443. */
  8444. !fixedType && (isMouseChecked || keyboardOpts.isCut) ? h('div', {
  8445. class: 'vxe-table--borders'
  8446. }, [isMouseChecked ? renderBorder(h, 'check') : null, keyboardOpts.isCut ? renderBorder(h, 'copy') : null]) : null, h('div', {
  8447. class: 'vxe-table--checkbox-range'
  8448. }), mouseConfig && mouseOpts.area ? h('div', {
  8449. class: 'vxe-table--cell-area'
  8450. }, [h('span', {
  8451. class: 'vxe-table--cell-main-area'
  8452. }, mouseOpts.extension ? [h('span', {
  8453. class: 'vxe-table--cell-main-area-btn',
  8454. on: {
  8455. mousedown: function mousedown(evnt) {
  8456. $xetable.triggerCellExtendMousedownEvent(evnt, {
  8457. $table: $xetable,
  8458. fixed: fixedType,
  8459. type: cellType
  8460. });
  8461. }
  8462. }
  8463. })] : null), h('span', {
  8464. class: 'vxe-table--cell-copy-area'
  8465. }), h('span', {
  8466. class: 'vxe-table--cell-extend-area'
  8467. }), h('span', {
  8468. class: 'vxe-table--cell-multi-area'
  8469. }), h('span', {
  8470. class: 'vxe-table--cell-active-area'
  8471. })]) : null, !fixedType ? h('div', {
  8472. class: 'vxe-table--empty-block',
  8473. ref: 'emptyBlock'
  8474. }, [h('div', {
  8475. class: 'vxe-table--empty-content'
  8476. }, emptyContent)]) : null]);
  8477. },
  8478. methods: {
  8479. /**
  8480. * 滚动处理
  8481. * 如果存在列固定左侧,同步更新滚动状态
  8482. * 如果存在列固定右侧,同步更新滚动状态
  8483. */
  8484. scrollEvent: function scrollEvent(evnt) {
  8485. var $el = this.$el,
  8486. $xetable = this.$parent,
  8487. fixedType = this.fixedType;
  8488. var $refs = $xetable.$refs,
  8489. highlightHoverRow = $xetable.highlightHoverRow,
  8490. scrollXLoad = $xetable.scrollXLoad,
  8491. scrollYLoad = $xetable.scrollYLoad,
  8492. lastScrollTop = $xetable.lastScrollTop,
  8493. lastScrollLeft = $xetable.lastScrollLeft;
  8494. var tableHeader = $refs.tableHeader,
  8495. tableBody = $refs.tableBody,
  8496. leftBody = $refs.leftBody,
  8497. rightBody = $refs.rightBody,
  8498. tableFooter = $refs.tableFooter,
  8499. validTip = $refs.validTip;
  8500. var headerElem = tableHeader ? tableHeader.$el : null;
  8501. var footerElem = tableFooter ? tableFooter.$el : null;
  8502. var bodyElem = tableBody.$el;
  8503. var leftElem = leftBody ? leftBody.$el : null;
  8504. var rightElem = rightBody ? rightBody.$el : null;
  8505. var scrollTop = $el.scrollTop;
  8506. var scrollLeft = bodyElem.scrollLeft;
  8507. var isX = scrollLeft !== lastScrollLeft;
  8508. var isY = scrollTop !== lastScrollTop;
  8509. $xetable.lastScrollTop = scrollTop;
  8510. $xetable.lastScrollLeft = scrollLeft;
  8511. $xetable.lastScrollTime = Date.now();
  8512. if (highlightHoverRow) {
  8513. $xetable.clearHoverRow();
  8514. }
  8515. if (leftElem && fixedType === 'left') {
  8516. scrollTop = leftElem.scrollTop;
  8517. syncBodyScroll(scrollTop, bodyElem, rightElem);
  8518. } else if (rightElem && fixedType === 'right') {
  8519. scrollTop = rightElem.scrollTop;
  8520. syncBodyScroll(scrollTop, bodyElem, leftElem);
  8521. } else {
  8522. if (isX) {
  8523. if (headerElem) {
  8524. headerElem.scrollLeft = bodyElem.scrollLeft;
  8525. }
  8526. if (footerElem) {
  8527. footerElem.scrollLeft = bodyElem.scrollLeft;
  8528. }
  8529. }
  8530. if (leftElem || rightElem) {
  8531. $xetable.checkScrolling();
  8532. if (isY) {
  8533. syncBodyScroll(scrollTop, leftElem, rightElem);
  8534. }
  8535. }
  8536. }
  8537. if (scrollXLoad && isX) {
  8538. $xetable.triggerScrollXEvent(evnt);
  8539. if (headerElem && scrollLeft + bodyElem.clientWidth >= bodyElem.scrollWidth - 80) {
  8540. // 修复拖动滚动条时可能存在不同步问题
  8541. this.$nextTick(function () {
  8542. if (bodyElem.scrollLeft !== headerElem.scrollLeft) {
  8543. headerElem.scrollLeft = bodyElem.scrollLeft;
  8544. }
  8545. });
  8546. }
  8547. }
  8548. if (scrollYLoad && isY) {
  8549. $xetable.triggerScrollYEvent(evnt);
  8550. }
  8551. if (isX && validTip && validTip.visible) {
  8552. validTip.updatePlacement();
  8553. }
  8554. $xetable.emitEvent('scroll', {
  8555. type: cellType,
  8556. fixed: fixedType,
  8557. scrollTop: scrollTop,
  8558. scrollLeft: scrollLeft,
  8559. isX: isX,
  8560. isY: isY
  8561. }, evnt);
  8562. }
  8563. }
  8564. });
  8565. // CONCATENATED MODULE: ./packages/body/index.js
  8566. src_body.install = function (Vue) {
  8567. Vue.component(src_body.name, src_body);
  8568. };
  8569. var Body = src_body;
  8570. /* harmony default export */ var packages_body = (src_body);
  8571. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
  8572. var es_array_filter = __webpack_require__("4de4");
  8573. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
  8574. var es_array_reduce = __webpack_require__("13d5");
  8575. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
  8576. var es_object_keys = __webpack_require__("b64b");
  8577. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
  8578. var es_string_trim = __webpack_require__("498a");
  8579. // CONCATENATED MODULE: ./packages/cell/src/cell.js
  8580. function renderHelpIcon(h, params) {
  8581. var $table = params.$table,
  8582. column = params.column;
  8583. var titleHelp = column.titleHelp;
  8584. return titleHelp ? [h('i', {
  8585. class: ['vxe-cell-help-icon', titleHelp.icon || conf.icon.TABLE_HELP],
  8586. on: {
  8587. mouseenter: function mouseenter(evnt) {
  8588. $table.triggerHeaderHelpEvent(evnt, params);
  8589. },
  8590. mouseleave: function mouseleave(evnt) {
  8591. $table.handleTargetLeaveEvent(evnt);
  8592. }
  8593. }
  8594. })] : [];
  8595. }
  8596. function renderTitleContent(h, params, content) {
  8597. var $table = params.$table,
  8598. column = params.column;
  8599. var showHeaderOverflow = column.showHeaderOverflow;
  8600. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  8601. tooltipOpts = $table.tooltipOpts;
  8602. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  8603. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  8604. var showTitle = headOverflow === 'title';
  8605. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  8606. var ons = {};
  8607. if (showTitle || showTooltip || showAllTip) {
  8608. ons.mouseenter = function (evnt) {
  8609. if ($table._isResize) {
  8610. return;
  8611. }
  8612. if (showTitle) {
  8613. DomTools.updateCellTitle(evnt.currentTarget, column);
  8614. } else if (showTooltip || showAllTip) {
  8615. $table.triggerHeaderTooltipEvent(evnt, params);
  8616. }
  8617. };
  8618. }
  8619. if (showTooltip || showAllTip) {
  8620. ons.mouseleave = function (evnt) {
  8621. if ($table._isResize) {
  8622. return;
  8623. }
  8624. if (showTooltip || showAllTip) {
  8625. $table.handleTargetLeaveEvent(evnt);
  8626. }
  8627. };
  8628. }
  8629. return [h('span', {
  8630. class: 'vxe-cell--title',
  8631. on: ons
  8632. }, content)];
  8633. }
  8634. function getFooterContent(h, params) {
  8635. var $table = params.$table,
  8636. column = params.column,
  8637. _columnIndex = params._columnIndex,
  8638. items = params.items;
  8639. var slots = column.slots,
  8640. editRender = column.editRender,
  8641. cellRender = column.cellRender;
  8642. var renderOpts = editRender || cellRender;
  8643. if (slots && slots.footer) {
  8644. return slots.footer.call($table, params, h);
  8645. }
  8646. if (renderOpts) {
  8647. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8648. if (compConf && compConf.renderFooter) {
  8649. return compConf.renderFooter.call($table, h, renderOpts, params, {
  8650. $grid: $table.$xegrid,
  8651. $excel: $table.$parent,
  8652. $table: $table
  8653. });
  8654. }
  8655. }
  8656. return [UtilTools.formatText(items[_columnIndex], 1)];
  8657. }
  8658. function getDefaultCellLabel(params) {
  8659. var $table = params.$table,
  8660. row = params.row,
  8661. column = params.column;
  8662. return UtilTools.formatText($table.getCellLabel(row, column), 1);
  8663. }
  8664. var Cell = {
  8665. createColumn: function createColumn($xetable, _vm) {
  8666. var type = _vm.type,
  8667. sortable = _vm.sortable,
  8668. remoteSort = _vm.remoteSort,
  8669. filters = _vm.filters,
  8670. editRender = _vm.editRender,
  8671. treeNode = _vm.treeNode;
  8672. var editConfig = $xetable.editConfig,
  8673. editOpts = $xetable.editOpts,
  8674. checkboxOpts = $xetable.checkboxOpts;
  8675. var renMaps = {
  8676. renderHeader: this.renderDefaultHeader,
  8677. renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
  8678. renderFooter: this.renderDefaultFooter
  8679. };
  8680. switch (type) {
  8681. case 'seq':
  8682. case 'index':
  8683. renMaps.renderHeader = this.renderIndexHeader;
  8684. renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderIndexCell;
  8685. break;
  8686. case 'radio':
  8687. renMaps.renderHeader = this.renderRadioHeader;
  8688. renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
  8689. break;
  8690. // 在 v3.0 中废弃 type=selection
  8691. case 'checkbox':
  8692. case 'selection':
  8693. renMaps.renderHeader = this.renderSelectionHeader;
  8694. renMaps.renderCell = checkboxOpts.checkField ? treeNode ? this.renderTreeSelectionCellByProp : this.renderSelectionCellByProp : treeNode ? this.renderTreeSelectionCell : this.renderSelectionCell;
  8695. break;
  8696. case 'expand':
  8697. renMaps.renderCell = this.renderExpandCell;
  8698. renMaps.renderData = this.renderExpandData;
  8699. break;
  8700. case 'html':
  8701. renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
  8702. if (filters && (sortable || remoteSort)) {
  8703. renMaps.renderHeader = this.renderSortAndFilterHeader;
  8704. } else if (sortable || remoteSort) {
  8705. renMaps.renderHeader = this.renderSortHeader;
  8706. } else if (filters) {
  8707. renMaps.renderHeader = this.renderFilterHeader;
  8708. }
  8709. break;
  8710. default:
  8711. if (editConfig && editRender) {
  8712. renMaps.renderHeader = this.renderEditHeader;
  8713. renMaps.renderCell = editOpts.mode === 'cell' ? treeNode ? this.renderTreeCellEdit : this.renderCellEdit : treeNode ? this.renderTreeRowEdit : this.renderRowEdit;
  8714. } else if (filters && (sortable || remoteSort)) {
  8715. renMaps.renderHeader = this.renderSortAndFilterHeader;
  8716. } else if (sortable || remoteSort) {
  8717. renMaps.renderHeader = this.renderSortHeader;
  8718. } else if (filters) {
  8719. renMaps.renderHeader = this.renderFilterHeader;
  8720. }
  8721. }
  8722. return UtilTools.getColumnConfig($xetable, _vm, renMaps);
  8723. },
  8724. /**
  8725. * 单元格
  8726. */
  8727. renderHeaderTitle: function renderHeaderTitle(h, params) {
  8728. var $table = params.$table,
  8729. column = params.column;
  8730. var slots = column.slots,
  8731. editRender = column.editRender,
  8732. cellRender = column.cellRender;
  8733. var renderOpts = editRender || cellRender;
  8734. if (slots && slots.header) {
  8735. return renderTitleContent(h, params, slots.header.call($table, params, h));
  8736. }
  8737. if (renderOpts) {
  8738. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8739. if (compConf && compConf.renderHeader) {
  8740. return renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params, {
  8741. $grid: $table.$xegrid,
  8742. $excel: $table.$parent,
  8743. $table: $table
  8744. }));
  8745. }
  8746. }
  8747. return renderTitleContent(h, params, UtilTools.formatText(column.getTitle(), 1));
  8748. },
  8749. renderDefaultHeader: function renderDefaultHeader(h, params) {
  8750. return renderHelpIcon(h, params).concat(Cell.renderHeaderTitle(h, params));
  8751. },
  8752. renderDefaultCell: function renderDefaultCell(h, params) {
  8753. var $table = params.$table,
  8754. row = params.row,
  8755. column = params.column;
  8756. var slots = column.slots,
  8757. editRender = column.editRender,
  8758. cellRender = column.cellRender;
  8759. var renderOpts = editRender || cellRender;
  8760. if (slots && slots.default) {
  8761. return slots.default.call($table, params, h);
  8762. }
  8763. if (renderOpts) {
  8764. var funName = editRender ? 'renderCell' : 'renderDefault';
  8765. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  8766. if (compConf && compConf[funName]) {
  8767. return compConf[funName].call($table, h, renderOpts, Object.assign({
  8768. $type: editRender ? 'edit' : 'cell',
  8769. isEdit: !!editRender
  8770. }, params), {
  8771. $type: editRender ? 'edit' : 'cell',
  8772. $grid: $table.$xegrid,
  8773. $excel: $table.$parent,
  8774. $table: $table
  8775. });
  8776. }
  8777. }
  8778. var cellValue = $table.getCellLabel(row, column);
  8779. var cellPlaceholder = editRender ? editRender.placeholder : '';
  8780. return [h('span', {
  8781. class: 'vxe-cell--label'
  8782. }, editRender && (cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue)) ? [// 如果设置占位符
  8783. h('span', {
  8784. class: 'vxe-cell--placeholder'
  8785. }, UtilTools.formatText(UtilTools.getFuncText(cellPlaceholder), 1))] : UtilTools.formatText(cellValue, 1))];
  8786. },
  8787. renderTreeCell: function renderTreeCell(h, params) {
  8788. return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
  8789. },
  8790. renderDefaultFooter: function renderDefaultFooter(h, params) {
  8791. return [h('span', {
  8792. class: 'vxe-cell--item'
  8793. }, getFooterContent(h, params))];
  8794. },
  8795. /**
  8796. * 树节点
  8797. */
  8798. renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
  8799. var $table = params.$table,
  8800. isHidden = params.isHidden;
  8801. var treeOpts = $table.treeOpts,
  8802. treeExpandeds = $table.treeExpandeds,
  8803. treeLazyLoadeds = $table.treeLazyLoadeds;
  8804. var row = params.row,
  8805. column = params.column,
  8806. level = params.level;
  8807. var slots = column.slots;
  8808. var children = treeOpts.children,
  8809. hasChild = treeOpts.hasChild,
  8810. indent = treeOpts.indent,
  8811. lazy = treeOpts.lazy,
  8812. trigger = treeOpts.trigger,
  8813. iconLoaded = treeOpts.iconLoaded,
  8814. showIcon = treeOpts.showIcon,
  8815. iconOpen = treeOpts.iconOpen,
  8816. iconClose = treeOpts.iconClose;
  8817. var rowChilds = row[children];
  8818. var hasLazyChilds = false;
  8819. var isAceived = false;
  8820. var isLazyLoaded = false;
  8821. var on = {};
  8822. if (slots && slots.icon) {
  8823. return slots.icon.call($table, params, h, cellVNodes);
  8824. }
  8825. if (!isHidden) {
  8826. isAceived = treeExpandeds.indexOf(row) > -1;
  8827. if (lazy) {
  8828. isLazyLoaded = treeLazyLoadeds.indexOf(row) > -1;
  8829. hasLazyChilds = row[hasChild];
  8830. }
  8831. }
  8832. if (!trigger || trigger === 'default') {
  8833. on.click = function (evnt) {
  8834. return $table.triggerTreeExpandEvent(evnt, params);
  8835. };
  8836. }
  8837. return [h('div', {
  8838. class: ['vxe-cell--tree-node', {
  8839. 'is--active': isAceived
  8840. }],
  8841. style: {
  8842. paddingLeft: "".concat(level * indent, "px")
  8843. }
  8844. }, [showIcon && (rowChilds && rowChilds.length || hasLazyChilds) ? [h('div', {
  8845. class: 'vxe-tree--btn-wrapper',
  8846. on: on
  8847. }, [h('i', {
  8848. 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]
  8849. })])] : null, h('div', {
  8850. class: 'vxe-tree-cell'
  8851. }, cellVNodes)])];
  8852. },
  8853. /**
  8854. * 索引
  8855. */
  8856. renderIndexHeader: function renderIndexHeader(h, params) {
  8857. var $table = params.$table,
  8858. column = params.column;
  8859. var slots = column.slots;
  8860. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : UtilTools.formatText(column.getTitle(), 1));
  8861. },
  8862. renderIndexCell: function renderIndexCell(h, params) {
  8863. var $table = params.$table,
  8864. column = params.column;
  8865. var seqOpts = $table.seqOpts,
  8866. startIndex = $table.startIndex;
  8867. var slots = column.slots;
  8868. if (slots && slots.default) {
  8869. return slots.default.call($table, params, h);
  8870. }
  8871. var $seq = params.$seq,
  8872. seq = params.seq,
  8873. level = params.level; // 在 v3.0 中废弃 startIndex、indexMethod
  8874. var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
  8875. return [UtilTools.formatText(seqMethod ? seqMethod(params) : level ? "".concat($seq, ".").concat(seq) : (seqOpts.startIndex || startIndex) + seq, 1)];
  8876. },
  8877. renderTreeIndexCell: function renderTreeIndexCell(h, params) {
  8878. return Cell.renderTreeIcon(h, params, Cell.renderIndexCell(h, params));
  8879. },
  8880. /**
  8881. * 单选
  8882. */
  8883. renderRadioHeader: function renderRadioHeader(h, params) {
  8884. var $table = params.$table,
  8885. column = params.column;
  8886. var slots = column.slots; // 在 v3.0 中废弃 label
  8887. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
  8888. class: 'vxe-radio--label'
  8889. }, UtilTools.formatText(column.getTitle(), 1))]);
  8890. },
  8891. renderRadioCell: function renderRadioCell(h, params) {
  8892. var $table = params.$table,
  8893. column = params.column,
  8894. isHidden = params.isHidden;
  8895. var radioOpts = $table.radioOpts,
  8896. selectRow = $table.selectRow;
  8897. var slots = column.slots;
  8898. var labelField = radioOpts.labelField,
  8899. checkMethod = radioOpts.checkMethod;
  8900. var row = params.row;
  8901. var isChecked = row === selectRow;
  8902. var isDisabled = !!checkMethod;
  8903. var on;
  8904. if (!isHidden) {
  8905. on = {
  8906. click: function click(evnt) {
  8907. if (!isDisabled) {
  8908. $table.triggerRadioRowEvent(evnt, params);
  8909. }
  8910. }
  8911. };
  8912. if (checkMethod) {
  8913. isDisabled = !checkMethod(params);
  8914. }
  8915. }
  8916. return [h('span', {
  8917. class: ['vxe-cell--radio', {
  8918. 'is--checked': isChecked,
  8919. 'is--disabled': isDisabled
  8920. }],
  8921. on: on
  8922. }, [h('span', {
  8923. class: 'vxe-radio--icon vxe-radio--checked-icon'
  8924. }), h('span', {
  8925. class: 'vxe-radio--icon vxe-radio--unchecked-icon'
  8926. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  8927. class: 'vxe-radio--label'
  8928. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  8929. },
  8930. renderTreeRadioCell: function renderTreeRadioCell(h, params) {
  8931. return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
  8932. },
  8933. /**
  8934. * 多选
  8935. */
  8936. renderSelectionHeader: function renderSelectionHeader(h, params) {
  8937. var $table = params.$table,
  8938. column = params.column,
  8939. isHidden = params.isHidden;
  8940. var isIndeterminate = $table.isIndeterminate,
  8941. isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
  8942. var slots = column.slots,
  8943. title = column.title,
  8944. label = column.label;
  8945. var checkboxOpts = $table.checkboxOpts; // 在 v3.0 中废弃 label
  8946. var headerTitle = title || label;
  8947. var isChecked = false;
  8948. var on;
  8949. if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
  8950. return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
  8951. class: 'vxe-checkbox--label'
  8952. }, headerTitle)]);
  8953. }
  8954. if (!isHidden) {
  8955. isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected;
  8956. on = {
  8957. click: function click(evnt) {
  8958. if (!isAllCheckboxDisabled) {
  8959. $table.triggerCheckAllEvent(evnt, !isChecked);
  8960. }
  8961. }
  8962. };
  8963. }
  8964. return renderTitleContent(h, params, [h('span', {
  8965. class: ['vxe-cell--checkbox', {
  8966. 'is--checked': isChecked,
  8967. 'is--disabled': isAllCheckboxDisabled,
  8968. 'is--indeterminate': isIndeterminate
  8969. }],
  8970. attrs: {
  8971. title: conf.i18n('vxe.table.allTitle')
  8972. },
  8973. on: on
  8974. }, [h('span', {
  8975. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  8976. }), h('span', {
  8977. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  8978. }), h('span', {
  8979. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  8980. })].concat(slots && slots.header ? slots.header.call($table, params, h) : headerTitle ? [h('span', {
  8981. class: 'vxe-checkbox--label'
  8982. }, headerTitle)] : []))]);
  8983. },
  8984. renderSelectionCell: function renderSelectionCell(h, params) {
  8985. var $table = params.$table,
  8986. row = params.row,
  8987. column = params.column,
  8988. isHidden = params.isHidden;
  8989. var treeConfig = $table.treeConfig,
  8990. treeIndeterminates = $table.treeIndeterminates;
  8991. var _$table$checkboxOpts = $table.checkboxOpts,
  8992. labelField = _$table$checkboxOpts.labelField,
  8993. checkMethod = _$table$checkboxOpts.checkMethod;
  8994. var slots = column.slots;
  8995. var indeterminate = false;
  8996. var isChecked = false;
  8997. var isDisabled = !!checkMethod;
  8998. var on;
  8999. if (!isHidden) {
  9000. isChecked = $table.selection.indexOf(row) > -1;
  9001. on = {
  9002. click: function click(evnt) {
  9003. if (!isDisabled) {
  9004. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  9005. }
  9006. }
  9007. };
  9008. if (checkMethod) {
  9009. isDisabled = !checkMethod(params);
  9010. }
  9011. if (treeConfig) {
  9012. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9013. }
  9014. }
  9015. return [h('span', {
  9016. class: ['vxe-cell--checkbox', {
  9017. 'is--checked': isChecked,
  9018. 'is--disabled': isDisabled,
  9019. 'is--indeterminate': indeterminate
  9020. }],
  9021. on: on
  9022. }, [h('span', {
  9023. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9024. }), h('span', {
  9025. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9026. }), h('span', {
  9027. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9028. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  9029. class: 'vxe-checkbox--label'
  9030. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9031. },
  9032. renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
  9033. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCell(h, params));
  9034. },
  9035. renderSelectionCellByProp: function renderSelectionCellByProp(h, params) {
  9036. var $table = params.$table,
  9037. row = params.row,
  9038. column = params.column,
  9039. isHidden = params.isHidden;
  9040. var treeConfig = $table.treeConfig,
  9041. treeIndeterminates = $table.treeIndeterminates;
  9042. var _$table$checkboxOpts2 = $table.checkboxOpts,
  9043. labelField = _$table$checkboxOpts2.labelField,
  9044. property = _$table$checkboxOpts2.checkField,
  9045. halfField = _$table$checkboxOpts2.halfField,
  9046. checkMethod = _$table$checkboxOpts2.checkMethod;
  9047. var slots = column.slots;
  9048. var indeterminate = false;
  9049. var isChecked = false;
  9050. var isDisabled = !!checkMethod;
  9051. var on;
  9052. if (!isHidden) {
  9053. isChecked = ctor_amd_xe_utils_default.a.get(row, property);
  9054. on = {
  9055. click: function click(evnt) {
  9056. if (!isDisabled) {
  9057. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  9058. }
  9059. }
  9060. };
  9061. if (checkMethod) {
  9062. isDisabled = !checkMethod(params);
  9063. }
  9064. if (treeConfig) {
  9065. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9066. }
  9067. }
  9068. return [h('span', {
  9069. class: ['vxe-cell--checkbox', {
  9070. 'is--checked': isChecked,
  9071. 'is--disabled': isDisabled,
  9072. 'is--indeterminate': halfField && !isChecked ? row[halfField] : indeterminate
  9073. }],
  9074. on: on
  9075. }, [h('span', {
  9076. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9077. }), h('span', {
  9078. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9079. }), h('span', {
  9080. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9081. })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
  9082. class: 'vxe-checkbox--label'
  9083. }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9084. },
  9085. renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
  9086. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCellByProp(h, params));
  9087. },
  9088. /**
  9089. * 展开行
  9090. */
  9091. renderExpandCell: function renderExpandCell(h, params) {
  9092. var $table = params.$table,
  9093. isHidden = params.isHidden,
  9094. row = params.row,
  9095. column = params.column;
  9096. var expandOpts = $table.expandOpts,
  9097. rowExpandeds = $table.rowExpandeds,
  9098. expandLazyLoadeds = $table.expandLazyLoadeds;
  9099. var lazy = expandOpts.lazy,
  9100. labelField = expandOpts.labelField,
  9101. iconLoaded = expandOpts.iconLoaded,
  9102. showIcon = expandOpts.showIcon,
  9103. iconOpen = expandOpts.iconOpen,
  9104. iconClose = expandOpts.iconClose,
  9105. visibleMethod = expandOpts.visibleMethod;
  9106. var slots = column.slots;
  9107. var isAceived = false;
  9108. var isLazyLoaded = false;
  9109. if (slots && slots.icon) {
  9110. return slots.icon.call($table, params, h);
  9111. }
  9112. if (!isHidden) {
  9113. isAceived = rowExpandeds.indexOf(params.row) > -1;
  9114. if (lazy) {
  9115. isLazyLoaded = expandLazyLoadeds.indexOf(row) > -1;
  9116. }
  9117. }
  9118. return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
  9119. class: ['vxe-table--expanded', {
  9120. 'is--active': isAceived
  9121. }],
  9122. on: {
  9123. click: function click(evnt) {
  9124. $table.triggerRowExpandEvent(evnt, params);
  9125. }
  9126. }
  9127. }, [h('i', {
  9128. 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]
  9129. })]) : null, slots && slots.default || labelField ? h('span', {
  9130. class: 'vxe-table--expand-label'
  9131. }, slots.default ? slots.default.call($table, params, h) : ctor_amd_xe_utils_default.a.get(row, labelField)) : null];
  9132. },
  9133. renderExpandData: function renderExpandData(h, params) {
  9134. var $table = params.$table,
  9135. column = params.column;
  9136. var slots = column.slots,
  9137. contentRender = column.contentRender;
  9138. if (slots) {
  9139. if (slots.content) {
  9140. return slots.content.call($table, params, h);
  9141. } // 在 v3.0 中严格支持 content
  9142. if (slots.default) {
  9143. return slots.default.call($table, params, h);
  9144. }
  9145. }
  9146. if (contentRender) {
  9147. var compConf = v_x_e_table.renderer.get(contentRender.name);
  9148. if (compConf && compConf.renderExpand) {
  9149. return compConf.renderExpand.call($table, h, contentRender, params, {
  9150. $grid: $table.$xegrid,
  9151. $table: $table
  9152. });
  9153. }
  9154. }
  9155. return [];
  9156. },
  9157. /**
  9158. * HTML 标签
  9159. */
  9160. renderHTMLCell: function renderHTMLCell(h, params) {
  9161. var $table = params.$table,
  9162. column = params.column;
  9163. var slots = column.slots;
  9164. if (slots && slots.default) {
  9165. return slots.default.call($table, params, h);
  9166. }
  9167. return [h('span', {
  9168. class: 'vxe-cell--html',
  9169. domProps: {
  9170. innerHTML: getDefaultCellLabel(params)
  9171. }
  9172. })];
  9173. },
  9174. renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
  9175. return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
  9176. },
  9177. /**
  9178. * 排序和筛选
  9179. */
  9180. renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
  9181. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
  9182. },
  9183. /**
  9184. * 排序
  9185. */
  9186. renderSortHeader: function renderSortHeader(h, params) {
  9187. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
  9188. },
  9189. renderSortIcon: function renderSortIcon(h, params) {
  9190. var $table = params.$table,
  9191. column = params.column;
  9192. var _$table$sortOpts = $table.sortOpts,
  9193. showIcon = _$table$sortOpts.showIcon,
  9194. iconAsc = _$table$sortOpts.iconAsc,
  9195. iconDesc = _$table$sortOpts.iconDesc;
  9196. return showIcon ? [h('span', {
  9197. class: 'vxe-cell--sort'
  9198. }, [h('i', {
  9199. class: ['vxe-sort--asc-btn', iconAsc || conf.icon.TABLE_SORT_ASC, {
  9200. 'sort--active': column.order === 'asc'
  9201. }],
  9202. attrs: {
  9203. title: conf.i18n('vxe.table.sortAsc')
  9204. },
  9205. on: {
  9206. click: function click(evnt) {
  9207. $table.triggerSortEvent(evnt, column, 'asc');
  9208. }
  9209. }
  9210. }), h('i', {
  9211. class: ['vxe-sort--desc-btn', iconDesc || conf.icon.TABLE_SORT_DESC, {
  9212. 'sort--active': column.order === 'desc'
  9213. }],
  9214. attrs: {
  9215. title: conf.i18n('vxe.table.sortDesc')
  9216. },
  9217. on: {
  9218. click: function click(evnt) {
  9219. $table.triggerSortEvent(evnt, column, 'desc');
  9220. }
  9221. }
  9222. })])] : [];
  9223. },
  9224. /**
  9225. * 筛选
  9226. */
  9227. renderFilterHeader: function renderFilterHeader(h, params) {
  9228. return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
  9229. },
  9230. renderFilterIcon: function renderFilterIcon(h, params) {
  9231. var $table = params.$table,
  9232. column = params.column,
  9233. hasFilter = params.hasFilter;
  9234. var filterStore = $table.filterStore,
  9235. filterOpts = $table.filterOpts;
  9236. var showIcon = filterOpts.showIcon,
  9237. iconNone = filterOpts.iconNone,
  9238. iconMatch = filterOpts.iconMatch;
  9239. return showIcon ? [h('span', {
  9240. class: ['vxe-cell--filter', {
  9241. 'is--active': filterStore.visible && filterStore.column === column
  9242. }]
  9243. }, [h('i', {
  9244. class: ['vxe-filter--btn', hasFilter ? iconMatch || conf.icon.TABLE_FILTER_MATCH : iconNone || conf.icon.TABLE_FILTER_NONE],
  9245. attrs: {
  9246. title: conf.i18n('vxe.table.filter')
  9247. },
  9248. on: {
  9249. click: function click(evnt) {
  9250. $table.triggerFilterEvent(evnt, params.column, params);
  9251. }
  9252. }
  9253. })])] : [];
  9254. },
  9255. /**
  9256. * 可编辑
  9257. */
  9258. renderEditHeader: function renderEditHeader(h, params) {
  9259. var $table = params.$table,
  9260. column = params.column;
  9261. var editRules = $table.editRules,
  9262. editOpts = $table.editOpts;
  9263. var sortable = column.sortable,
  9264. remoteSort = column.remoteSort,
  9265. editRender = column.editRender,
  9266. filters = column.filters;
  9267. var isRequired;
  9268. if (editRules) {
  9269. var columnRules = ctor_amd_xe_utils_default.a.get(editRules, params.column.property);
  9270. if (columnRules) {
  9271. isRequired = columnRules.some(function (rule) {
  9272. return rule.required;
  9273. });
  9274. }
  9275. }
  9276. return [isRequired && editOpts.showAsterisk ? h('i', {
  9277. class: 'vxe-cell--required-icon'
  9278. }) : null, UtilTools.isEnableConf(editRender) && editOpts.showIcon ? h('i', {
  9279. class: ['vxe-cell--edit-icon', editOpts.icon || conf.icon.TABLE_EDIT]
  9280. }) : null].concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
  9281. },
  9282. // 行格编辑模式
  9283. renderRowEdit: function renderRowEdit(h, params) {
  9284. var $table = params.$table,
  9285. column = params.column;
  9286. var editRender = column.editRender;
  9287. var actived = $table.editStore.actived;
  9288. return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row);
  9289. },
  9290. renderTreeRowEdit: function renderTreeRowEdit(h, params) {
  9291. return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
  9292. },
  9293. // 单元格编辑模式
  9294. renderCellEdit: function renderCellEdit(h, params) {
  9295. var $table = params.$table,
  9296. column = params.column;
  9297. var editRender = column.editRender;
  9298. var actived = $table.editStore.actived;
  9299. return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
  9300. },
  9301. renderTreeCellEdit: function renderTreeCellEdit(h, params) {
  9302. return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
  9303. },
  9304. runRenderer: function runRenderer(h, params, _vm, isEdit) {
  9305. var $table = params.$table,
  9306. column = params.column;
  9307. var slots = column.slots,
  9308. editRender = column.editRender,
  9309. formatter = column.formatter;
  9310. var compConf = v_x_e_table.renderer.get(editRender.name);
  9311. if (editRender.type === 'visible' || isEdit) {
  9312. if (slots && slots.edit) {
  9313. return slots.edit.call($table, params, h);
  9314. }
  9315. return compConf && compConf.renderEdit ? compConf.renderEdit.call($table, h, editRender, Object.assign({
  9316. $type: 'edit',
  9317. isEdit: true
  9318. }, params), {
  9319. $type: 'edit',
  9320. $grid: $table.$xegrid,
  9321. $excel: $table.$parent,
  9322. $table: $table
  9323. }) : [];
  9324. }
  9325. if (slots && slots.default) {
  9326. return slots.default.call($table, params, h);
  9327. }
  9328. if (formatter) {
  9329. return [h('span', {
  9330. class: 'vxe-cell--label'
  9331. }, [getDefaultCellLabel(params)])];
  9332. }
  9333. return Cell.renderDefaultCell.call(_vm, h, params);
  9334. }
  9335. };
  9336. /* harmony default export */ var src_cell = (Cell);
  9337. // CONCATENATED MODULE: ./packages/cell/index.js
  9338. /* harmony default export */ var packages_cell = (src_cell);
  9339. // CONCATENATED MODULE: ./packages/table/src/methods.js
  9340. var methods_getRowid = UtilTools.getRowid,
  9341. getRowkey = UtilTools.getRowkey,
  9342. methods_setCellValue = UtilTools.setCellValue,
  9343. hasChildrenList = UtilTools.hasChildrenList;
  9344. var methods_browse = DomTools.browse,
  9345. methods_calcHeight = DomTools.calcHeight,
  9346. hasClass = DomTools.hasClass,
  9347. addClass = DomTools.addClass,
  9348. removeClass = DomTools.removeClass,
  9349. getEventTargetNode = DomTools.getEventTargetNode;
  9350. var isWebkit = methods_browse['-webkit'] && !methods_browse.edge;
  9351. var debounceScrollYDuration = methods_browse.msie ? 40 : 20;
  9352. var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
  9353. var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
  9354. /**
  9355. * 生成行的唯一主键
  9356. */
  9357. function getRowUniqueId() {
  9358. return ctor_amd_xe_utils_default.a.uniqueId('row_');
  9359. }
  9360. function eqCellNull(cellValue) {
  9361. return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
  9362. }
  9363. function eqCellValue(row1, row2, field) {
  9364. var val1 = ctor_amd_xe_utils_default.a.get(row1, field);
  9365. var val2 = ctor_amd_xe_utils_default.a.get(row2, field);
  9366. if (eqCellNull(val1) && eqCellNull(val2)) {
  9367. return true;
  9368. }
  9369. if (ctor_amd_xe_utils_default.a.isString(val1) || ctor_amd_xe_utils_default.a.isNumber(val1)) {
  9370. /* eslint-disable eqeqeq */
  9371. return val1 == val2;
  9372. }
  9373. return ctor_amd_xe_utils_default.a.isEqual(val1, val2);
  9374. }
  9375. function getNextSortOrder(_vm, column) {
  9376. var orders = _vm.sortOpts.orders;
  9377. var currOrder = column.order || null;
  9378. var oIndex = orders.indexOf(currOrder) + 1;
  9379. return orders[oIndex < orders.length ? oIndex : 0];
  9380. }
  9381. function getCustomStorageMap(key) {
  9382. var version = conf.version;
  9383. var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  9384. return rest && rest._v === version ? rest : {
  9385. _v: version
  9386. };
  9387. }
  9388. function getRecoverRow(_vm, list) {
  9389. var fullAllDataRowMap = _vm.fullAllDataRowMap;
  9390. return list.filter(function (row) {
  9391. return fullAllDataRowMap.has(row);
  9392. });
  9393. }
  9394. function handleReserveRow(_vm, reserveRowMap) {
  9395. var fullDataRowIdData = _vm.fullDataRowIdData;
  9396. var reserveList = [];
  9397. ctor_amd_xe_utils_default.a.each(reserveRowMap, function (item, rowid) {
  9398. if (fullDataRowIdData[rowid] && reserveList.indexOf(fullDataRowIdData[rowid].row) === -1) {
  9399. reserveList.push(fullDataRowIdData[rowid].row);
  9400. }
  9401. });
  9402. return reserveList;
  9403. }
  9404. function setMerges(_vm, merges, mList, rowList) {
  9405. if (merges) {
  9406. var treeConfig = _vm.treeConfig,
  9407. visibleColumn = _vm.visibleColumn;
  9408. if (treeConfig) {
  9409. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-footer-items']));
  9410. }
  9411. if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
  9412. merges = [merges];
  9413. }
  9414. merges.forEach(function (item) {
  9415. var row = item.row,
  9416. col = item.col,
  9417. rowspan = item.rowspan,
  9418. colspan = item.colspan;
  9419. if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
  9420. row = rowList[row];
  9421. }
  9422. if (ctor_amd_xe_utils_default.a.isNumber(col)) {
  9423. col = visibleColumn[col];
  9424. }
  9425. if ((rowList ? row : ctor_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
  9426. rowspan = ctor_amd_xe_utils_default.a.toNumber(rowspan) || 1;
  9427. colspan = ctor_amd_xe_utils_default.a.toNumber(colspan) || 1;
  9428. if (rowspan > 1 || colspan > 1) {
  9429. var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  9430. return item._row === row && item._col === col;
  9431. });
  9432. var mergeItem = mList[mcIndex];
  9433. if (mergeItem) {
  9434. mergeItem.rowspan = rowspan;
  9435. mergeItem.colspan = colspan;
  9436. mergeItem._rowspan = rowspan;
  9437. mergeItem._colspan = colspan;
  9438. } else {
  9439. var mergeRowIndex = rowList ? rowList.indexOf(row) : row;
  9440. var mergeColIndex = visibleColumn.indexOf(col);
  9441. mList.push({
  9442. row: mergeRowIndex,
  9443. col: mergeColIndex,
  9444. rowspan: rowspan,
  9445. colspan: colspan,
  9446. _row: row,
  9447. _col: col,
  9448. _rowspan: rowspan,
  9449. _colspan: colspan
  9450. });
  9451. }
  9452. }
  9453. }
  9454. });
  9455. }
  9456. }
  9457. function removeMerges(_vm, merges, mList, rowList) {
  9458. var rest = [];
  9459. if (merges) {
  9460. var treeConfig = _vm.treeConfig,
  9461. visibleColumn = _vm.visibleColumn;
  9462. if (treeConfig) {
  9463. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-cells']));
  9464. }
  9465. if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
  9466. merges = [merges];
  9467. }
  9468. merges.forEach(function (item) {
  9469. var row = item.row,
  9470. col = item.col;
  9471. if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
  9472. row = rowList[row];
  9473. }
  9474. if (ctor_amd_xe_utils_default.a.isNumber(col)) {
  9475. col = visibleColumn[col];
  9476. }
  9477. var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  9478. return item._row === row && item._col === col;
  9479. });
  9480. if (mcIndex > -1) {
  9481. var rItems = mList.splice(mcIndex, 1);
  9482. rest.push(rItems[0]);
  9483. }
  9484. });
  9485. }
  9486. return rest;
  9487. }
  9488. function getOrderField(_vm, column) {
  9489. var sortBy = column.sortBy,
  9490. sortType = column.sortType;
  9491. if (sortBy && ctor_amd_xe_utils_default.a.isArray(sortBy)) {
  9492. return sortBy;
  9493. }
  9494. return function (row) {
  9495. var cellValue;
  9496. if (sortBy) {
  9497. cellValue = ctor_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
  9498. row: row,
  9499. column: column
  9500. }) : ctor_amd_xe_utils_default.a.get(row, sortBy);
  9501. } else {
  9502. cellValue = _vm.getCellLabel(row, column);
  9503. }
  9504. if (!sortType || sortType === 'auto') {
  9505. return isNaN(cellValue) ? cellValue : ctor_amd_xe_utils_default.a.toNumber(cellValue);
  9506. } else if (sortType === 'number') {
  9507. return ctor_amd_xe_utils_default.a.toNumber(cellValue);
  9508. } else if (sortType === 'string') {
  9509. return ctor_amd_xe_utils_default.a.toValueString(cellValue);
  9510. }
  9511. return cellValue;
  9512. };
  9513. }
  9514. var Methods = {
  9515. /**
  9516. * 获取父容器元素
  9517. */
  9518. getParentElem: function getParentElem() {
  9519. return this.$xegrid ? this.$xegrid.$el.parentNode : this.$el.parentNode;
  9520. },
  9521. /**
  9522. * 获取父容器的高度
  9523. */
  9524. getParentHeight: function getParentHeight() {
  9525. return this.$xegrid ? this.$xegrid.getParentHeight() : this.getParentElem().clientHeight;
  9526. },
  9527. /**
  9528. * 获取需要排除的高度
  9529. * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
  9530. * 如果存在表尾合计滚动条,则需要排除滚动条高度
  9531. */
  9532. getExcludeHeight: function getExcludeHeight() {
  9533. return this.$xegrid ? this.$xegrid.getExcludeHeight() : 0;
  9534. },
  9535. /**
  9536. * 重置表格的一切数据状态
  9537. */
  9538. clearAll: function clearAll() {
  9539. this.inited = false;
  9540. this.clearSort();
  9541. this.clearCurrentRow();
  9542. this.clearCurrentColumn();
  9543. this.clearRadioRow();
  9544. this.clearRadioReserve();
  9545. this.clearCheckboxRow();
  9546. this.clearCheckboxReserve();
  9547. this.clearRowExpand();
  9548. this.clearRowExpandReserve();
  9549. this.clearTreeExpand();
  9550. this.clearTreeExpandReserve();
  9551. if (v_x_e_table._edit) {
  9552. this.clearActived();
  9553. }
  9554. if (v_x_e_table._filter) {
  9555. this.clearFilter();
  9556. }
  9557. if (this.keyboardConfig || this.mouseConfig) {
  9558. this.clearIndexChecked();
  9559. this.clearHeaderChecked();
  9560. this.clearChecked();
  9561. this.clearSelected();
  9562. this.clearCopyed();
  9563. }
  9564. if (this.mouseConfig) {
  9565. this.clearCellAreas();
  9566. this.clearCopyCellArea();
  9567. }
  9568. return this.clearScroll();
  9569. },
  9570. refreshData: function refreshData() {
  9571. UtilTools.warn('vxe.error.delFunc', ['refreshData', 'syncData']);
  9572. return this.syncData();
  9573. },
  9574. /**
  9575. * 同步 data 数据
  9576. * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
  9577. * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
  9578. */
  9579. syncData: function syncData() {
  9580. var _this = this;
  9581. return this.$nextTick().then(function () {
  9582. _this.tableData = [];
  9583. return _this.$nextTick().then(function () {
  9584. return _this.loadTableData(_this.tableFullData);
  9585. });
  9586. });
  9587. },
  9588. /**
  9589. * 手动处理数据
  9590. * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
  9591. */
  9592. updateData: function updateData() {
  9593. return this.handleTableData(true).then(this.updateFooter).then(this.recalculate);
  9594. },
  9595. handleTableData: function handleTableData(force) {
  9596. var scrollYLoad = this.scrollYLoad,
  9597. scrollYStore = this.scrollYStore;
  9598. var fullData = force ? this.updateAfterFullData() : this.afterFullData;
  9599. this.tableData = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
  9600. return this.$nextTick();
  9601. },
  9602. /**
  9603. * 加载表格数据
  9604. * @param {Array} datas 数据
  9605. */
  9606. loadTableData: function loadTableData(datas) {
  9607. var _this2 = this;
  9608. var keepSource = this.keepSource,
  9609. treeConfig = this.treeConfig,
  9610. editStore = this.editStore,
  9611. sYOpts = this.sYOpts,
  9612. scrollYStore = this.scrollYStore;
  9613. var tableFullData = datas ? datas.slice(0) : [];
  9614. var scrollYLoad = !treeConfig && sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  9615. scrollYStore.startIndex = 0;
  9616. scrollYStore.visibleIndex = 0;
  9617. scrollYStore.renderSize = 1;
  9618. editStore.insertList = [];
  9619. editStore.removeList = []; // 全量数据
  9620. this.tableFullData = tableFullData; // 缓存数据
  9621. this.updateCache(true); // 原始数据
  9622. this.tableSynchData = datas;
  9623. if (keepSource) {
  9624. this.tableSourceData = ctor_amd_xe_utils_default.a.clone(tableFullData, true);
  9625. }
  9626. this.scrollYLoad = scrollYLoad;
  9627. if (scrollYLoad) {
  9628. if (!(this.height || this.maxHeight)) {
  9629. UtilTools.error('vxe.error.reqProp', ['height | max-height']);
  9630. }
  9631. if (!this.showOverflow) {
  9632. UtilTools.warn('vxe.error.reqProp', ['show-overflow']);
  9633. }
  9634. if (this.spanMethod) {
  9635. UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
  9636. }
  9637. }
  9638. this.clearMergeCells();
  9639. this.clearMergeFooterItems();
  9640. this.handleTableData(true);
  9641. this.updateFooter();
  9642. return this.computeScrollLoad().then(function () {
  9643. // 是否加载了数据
  9644. _this2.isLoadData = true;
  9645. _this2.computeRowHeight();
  9646. _this2.handleReserveStatus();
  9647. _this2.checkSelectionStatus();
  9648. return _this2.$nextTick().then(_this2.recalculate).then(_this2.refreshScroll);
  9649. });
  9650. },
  9651. /**
  9652. * 重新加载数据,不会清空表格状态
  9653. * @param {Array} datas 数据
  9654. */
  9655. loadData: function loadData(datas) {
  9656. this.inited = true;
  9657. return this.loadTableData(datas).then(this.recalculate);
  9658. },
  9659. /**
  9660. * 重新加载数据,会清空表格状态
  9661. * @param {Array} datas 数据
  9662. */
  9663. reloadData: function reloadData(datas) {
  9664. var _this3 = this;
  9665. return this.clearAll().then(function () {
  9666. _this3.inited = true;
  9667. return _this3.loadTableData(datas);
  9668. }).then(this.handleDefaults);
  9669. },
  9670. /**
  9671. * 局部加载行数据并恢复到初始状态
  9672. * 对于行数据需要局部更改的场景中可能会用到
  9673. * @param {Row} row 行对象
  9674. * @param {Object} record 新数据
  9675. * @param {String} field 字段名
  9676. */
  9677. reloadRow: function reloadRow(row, record, field) {
  9678. var tableSourceData = this.tableSourceData,
  9679. tableData = this.tableData; // 在 v3 中必须要开启 keep-source
  9680. if (!this.keepSource) {
  9681. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  9682. return this.$nextTick();
  9683. }
  9684. var rowIndex = this.getRowIndex(row);
  9685. var oRow = tableSourceData[rowIndex];
  9686. if (oRow && row) {
  9687. if (field) {
  9688. ctor_amd_xe_utils_default.a.set(oRow, field, ctor_amd_xe_utils_default.a.get(record || row, field));
  9689. } else {
  9690. if (record) {
  9691. tableSourceData[rowIndex] = record;
  9692. ctor_amd_xe_utils_default.a.clear(row, undefined);
  9693. Object.assign(row, this.defineField(Object.assign({}, record)));
  9694. this.updateCache(true);
  9695. } else {
  9696. ctor_amd_xe_utils_default.a.destructuring(oRow, ctor_amd_xe_utils_default.a.clone(row, true));
  9697. }
  9698. }
  9699. }
  9700. this.tableData = tableData.slice(0);
  9701. return this.$nextTick();
  9702. },
  9703. /**
  9704. * 加载列配置
  9705. * 对于表格列需要重载、局部递增场景下可能会用到
  9706. * @param {ColumnInfo} columns 列配置
  9707. */
  9708. loadColumn: function loadColumn(columns) {
  9709. var _this4 = this;
  9710. this.collectColumn = ctor_amd_xe_utils_default.a.mapTree(columns, function (column) {
  9711. return packages_cell.createColumn(_this4, column);
  9712. });
  9713. return this.$nextTick();
  9714. },
  9715. /**
  9716. * 加载列配置并恢复到初始状态
  9717. * 对于表格列需要重载、局部递增场景下可能会用到
  9718. * @param {ColumnInfo} columns 列配置
  9719. */
  9720. reloadColumn: function reloadColumn(columns) {
  9721. var _this5 = this;
  9722. return this.clearAll().then(function () {
  9723. return _this5.loadColumn(columns);
  9724. });
  9725. },
  9726. /**
  9727. * 更新数据行的 Map
  9728. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  9729. */
  9730. updateCache: function updateCache(source) {
  9731. var _this6 = this;
  9732. var treeConfig = this.treeConfig,
  9733. treeOpts = this.treeOpts,
  9734. tableFullData = this.tableFullData,
  9735. fullDataRowMap = this.fullDataRowMap,
  9736. fullAllDataRowMap = this.fullAllDataRowMap;
  9737. var fullDataRowIdData = this.fullDataRowIdData,
  9738. fullAllDataRowIdData = this.fullAllDataRowIdData;
  9739. var rowkey = getRowkey(this);
  9740. var isLazy = treeConfig && treeOpts.lazy;
  9741. var handleCache = function handleCache(row, index, items, path, parent) {
  9742. var rowid = methods_getRowid(_this6, row);
  9743. if (UtilTools.eqEmptyValue(rowid)) {
  9744. rowid = getRowUniqueId();
  9745. ctor_amd_xe_utils_default.a.set(row, rowkey, rowid);
  9746. }
  9747. if (isLazy && row[treeOpts.hasChild] && ctor_amd_xe_utils_default.a.isUndefined(row[treeOpts.children])) {
  9748. row[treeOpts.children] = null;
  9749. }
  9750. var rest = {
  9751. row: row,
  9752. rowid: rowid,
  9753. index: treeConfig && parent ? -1 : index,
  9754. items: items,
  9755. parent: parent
  9756. };
  9757. if (source) {
  9758. fullDataRowIdData[rowid] = rest;
  9759. fullDataRowMap.set(row, rest);
  9760. }
  9761. fullAllDataRowIdData[rowid] = rest;
  9762. fullAllDataRowMap.set(row, rest);
  9763. };
  9764. if (source) {
  9765. fullDataRowIdData = this.fullDataRowIdData = {};
  9766. fullDataRowMap.clear();
  9767. }
  9768. fullAllDataRowIdData = this.fullAllDataRowIdData = {};
  9769. fullAllDataRowMap.clear();
  9770. if (treeConfig) {
  9771. ctor_amd_xe_utils_default.a.eachTree(tableFullData, handleCache, treeOpts);
  9772. } else {
  9773. tableFullData.forEach(handleCache);
  9774. }
  9775. },
  9776. loadChildren: function loadChildren(row, childRecords) {
  9777. var _this7 = this;
  9778. return this.createData(childRecords).then(function (rows) {
  9779. var keepSource = _this7.keepSource,
  9780. tableSourceData = _this7.tableSourceData,
  9781. treeOpts = _this7.treeOpts,
  9782. fullDataRowIdData = _this7.fullDataRowIdData,
  9783. fullDataRowMap = _this7.fullDataRowMap,
  9784. fullAllDataRowMap = _this7.fullAllDataRowMap,
  9785. fullAllDataRowIdData = _this7.fullAllDataRowIdData;
  9786. var children = treeOpts.children;
  9787. if (keepSource) {
  9788. var rowid = methods_getRowid(_this7, row);
  9789. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  9790. return rowid === methods_getRowid(_this7, item);
  9791. }, treeOpts);
  9792. if (matchObj) {
  9793. matchObj.item[children] = ctor_amd_xe_utils_default.a.clone(rows, true);
  9794. }
  9795. }
  9796. ctor_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent) {
  9797. var rowid = methods_getRowid(_this7, childRow);
  9798. var rest = {
  9799. row: childRow,
  9800. rowid: rowid,
  9801. index: -1,
  9802. items: items,
  9803. parent: parent
  9804. };
  9805. fullDataRowIdData[rowid] = rest;
  9806. fullDataRowMap.set(childRow, rest);
  9807. fullAllDataRowIdData[rowid] = rest;
  9808. fullAllDataRowMap.set(childRow, rest);
  9809. }, treeOpts);
  9810. row[children] = rows;
  9811. return rows;
  9812. });
  9813. },
  9814. /**
  9815. * 更新数据列的 Map
  9816. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  9817. */
  9818. cacheColumnMap: function cacheColumnMap() {
  9819. var isGroup = this.isGroup,
  9820. tableFullColumn = this.tableFullColumn,
  9821. collectColumn = this.collectColumn,
  9822. fullColumnMap = this.fullColumnMap;
  9823. var fullColumnIdData = this.fullColumnIdData = {};
  9824. var fullColumnFieldData = this.fullColumnFieldData = {};
  9825. var expandColumn;
  9826. var treeNodeColumn;
  9827. var checkboxColumn;
  9828. var radioColumn;
  9829. var hasFixed;
  9830. var handleFunc = function handleFunc(column, index, items, path, parent) {
  9831. var colid = column.id,
  9832. property = column.property,
  9833. fixed = column.fixed,
  9834. type = column.type,
  9835. treeNode = column.treeNode;
  9836. var rest = {
  9837. column: column,
  9838. colid: colid,
  9839. index: index,
  9840. items: items,
  9841. parent: parent
  9842. };
  9843. if (property) {
  9844. if (fullColumnFieldData[property]) {
  9845. UtilTools.warn('vxe.error.colRepet', ['field', property]);
  9846. }
  9847. fullColumnFieldData[property] = rest;
  9848. }
  9849. if (!hasFixed && fixed) {
  9850. hasFixed = fixed;
  9851. }
  9852. if (treeNode) {
  9853. if (treeNodeColumn) {
  9854. UtilTools.warn('vxe.error.colRepet', ['tree-node', treeNode]);
  9855. }
  9856. if (!treeNodeColumn) {
  9857. treeNodeColumn = column;
  9858. }
  9859. } else if (type === 'expand') {
  9860. if (expandColumn) {
  9861. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9862. }
  9863. if (!expandColumn) {
  9864. expandColumn = column;
  9865. }
  9866. }
  9867. if (type === 'checkbox') {
  9868. if (checkboxColumn) {
  9869. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9870. }
  9871. if (!checkboxColumn) {
  9872. checkboxColumn = column;
  9873. }
  9874. } else if (type === 'radio') {
  9875. if (radioColumn) {
  9876. UtilTools.warn('vxe.error.colRepet', ['type', type]);
  9877. }
  9878. if (!radioColumn) {
  9879. radioColumn = column;
  9880. }
  9881. }
  9882. if (fullColumnIdData[colid]) {
  9883. UtilTools.error('vxe.error.colRepet', ['colId', colid]);
  9884. }
  9885. fullColumnIdData[colid] = rest;
  9886. fullColumnMap.set(column, rest);
  9887. };
  9888. fullColumnMap.clear();
  9889. if (isGroup) {
  9890. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent, nodes) {
  9891. column.level = nodes.length;
  9892. handleFunc(column, index, items, path, parent);
  9893. });
  9894. } else {
  9895. tableFullColumn.forEach(handleFunc);
  9896. }
  9897. if (expandColumn && hasFixed) {
  9898. UtilTools.warn('vxe.error.errConflicts', ['column.fixed', 'column.type=expand']);
  9899. }
  9900. if (expandColumn && this.mouseOpts.area) {
  9901. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
  9902. }
  9903. this.treeNodeColumn = treeNodeColumn;
  9904. this.expandColumn = expandColumn;
  9905. },
  9906. /**
  9907. * 根据 tr 元素获取对应的 row 信息
  9908. * @param {Element} tr 元素
  9909. */
  9910. getRowNode: function getRowNode(tr) {
  9911. if (tr) {
  9912. var fullAllDataRowIdData = this.fullAllDataRowIdData;
  9913. var rowid = tr.getAttribute('data-rowid');
  9914. var rest = fullAllDataRowIdData[rowid];
  9915. if (rest) {
  9916. return {
  9917. rowid: rest.rowid,
  9918. item: rest.row,
  9919. index: rest.index,
  9920. items: rest.items,
  9921. parent: rest.parent
  9922. };
  9923. }
  9924. }
  9925. return null;
  9926. },
  9927. /**
  9928. * 根据 th/td 元素获取对应的 column 信息
  9929. * @param {Element} cell 元素
  9930. */
  9931. getColumnNode: function getColumnNode(cell) {
  9932. if (cell) {
  9933. var fullColumnIdData = this.fullColumnIdData;
  9934. var colid = cell.getAttribute('data-colid');
  9935. var rest = fullColumnIdData[colid];
  9936. if (rest) {
  9937. return {
  9938. colid: rest.colid,
  9939. item: rest.column,
  9940. index: rest.index,
  9941. items: rest.items,
  9942. parent: rest.parent
  9943. };
  9944. }
  9945. }
  9946. return null;
  9947. },
  9948. /**
  9949. * 根据 row 获取相对于 data 中的索引
  9950. * @param {Row} row 行对象
  9951. */
  9952. getRowIndex: function getRowIndex(row) {
  9953. return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1;
  9954. },
  9955. /**
  9956. * 根据 row 获取相对于当前数据中的索引
  9957. * @param {Row} row 行对象
  9958. */
  9959. getVTRowIndex: function getVTRowIndex(row) {
  9960. return this.afterFullData.indexOf(row);
  9961. },
  9962. // 在 v3 中废弃
  9963. _getRowIndex: function _getRowIndex(row) {
  9964. UtilTools.warn('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
  9965. return this.getVTRowIndex(row);
  9966. },
  9967. /**
  9968. * 根据 row 获取渲染中的虚拟索引
  9969. * @param {Row} row 行对象
  9970. */
  9971. getVMRowIndex: function getVMRowIndex(row) {
  9972. return this.tableData.indexOf(row);
  9973. },
  9974. // 在 v3 中废弃
  9975. $getRowIndex: function $getRowIndex(row) {
  9976. UtilTools.warn('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
  9977. return this.getVMRowIndex(row);
  9978. },
  9979. /**
  9980. * 根据 column 获取相对于 columns 中的索引
  9981. * @param {ColumnInfo} column 列配置
  9982. */
  9983. getColumnIndex: function getColumnIndex(column) {
  9984. return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1;
  9985. },
  9986. /**
  9987. * 根据 column 获取相对于当前表格列中的索引
  9988. * @param {ColumnInfo} column 列配置
  9989. */
  9990. getVTColumnIndex: function getVTColumnIndex(column) {
  9991. return this.visibleColumn.indexOf(column);
  9992. },
  9993. // 在 v3 中废弃
  9994. _getColumnIndex: function _getColumnIndex(column) {
  9995. UtilTools.warn('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
  9996. return this.getVTColumnIndex(column);
  9997. },
  9998. /**
  9999. * 根据 column 获取渲染中的虚拟索引
  10000. * @param {ColumnInfo} column 列配置
  10001. */
  10002. getVMColumnIndex: function getVMColumnIndex(column) {
  10003. return this.tableColumn.indexOf(column);
  10004. },
  10005. // 在 v3 中废弃
  10006. $getColumnIndex: function $getColumnIndex(column) {
  10007. UtilTools.warn('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
  10008. return this.getVMColumnIndex(column);
  10009. },
  10010. /**
  10011. * 判断是否为索引列
  10012. * @param {ColumnInfo} column 列配置
  10013. */
  10014. isSeqColumn: function isSeqColumn(column) {
  10015. return column && (column.type === 'seq' || column.type === 'index');
  10016. },
  10017. /**
  10018. * 定义行数据中的列属性,如果不存在则定义
  10019. * @param {Row} record 行数据
  10020. */
  10021. defineField: function defineField(record) {
  10022. var radioOpts = this.radioOpts,
  10023. checkboxOpts = this.checkboxOpts,
  10024. treeConfig = this.treeConfig,
  10025. treeOpts = this.treeOpts,
  10026. expandOpts = this.expandOpts;
  10027. var rowkey = getRowkey(this);
  10028. this.visibleColumn.forEach(function (_ref) {
  10029. var property = _ref.property,
  10030. editRender = _ref.editRender;
  10031. if (property && !ctor_amd_xe_utils_default.a.has(record, property)) {
  10032. ctor_amd_xe_utils_default.a.set(record, property, editRender && !ctor_amd_xe_utils_default.a.isUndefined(editRender.defaultValue) ? editRender.defaultValue : null);
  10033. }
  10034. });
  10035. var ohterFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
  10036. ohterFields.forEach(function (key) {
  10037. if (key && UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, key))) {
  10038. ctor_amd_xe_utils_default.a.set(record, key, null);
  10039. }
  10040. });
  10041. if (treeConfig && treeOpts.lazy && ctor_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
  10042. record[treeOpts.children] = null;
  10043. } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
  10044. if (UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, rowkey))) {
  10045. ctor_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
  10046. }
  10047. return record;
  10048. },
  10049. /**
  10050. * 创建 data 对象
  10051. * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
  10052. * @param {Array} records 新数据
  10053. */
  10054. createData: function createData(records) {
  10055. var _this8 = this;
  10056. var treeConfig = this.treeConfig,
  10057. treeOpts = this.treeOpts;
  10058. var handleRrecord = function handleRrecord(record) {
  10059. return _this8.defineField(Object.assign({}, record));
  10060. };
  10061. var rows = treeConfig ? ctor_amd_xe_utils_default.a.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
  10062. return this.$nextTick().then(function () {
  10063. return rows;
  10064. });
  10065. },
  10066. /**
  10067. * 创建 Row|Rows 对象
  10068. * 对于某些特殊场景需要对数据进行手动插入时可能会用到
  10069. * @param {Array/Object} records 新数据
  10070. */
  10071. createRow: function createRow(records) {
  10072. var _this9 = this;
  10073. var isArr = ctor_amd_xe_utils_default.a.isArray(records);
  10074. if (!isArr) {
  10075. records = [records];
  10076. }
  10077. return this.$nextTick().then(function () {
  10078. return _this9.createData(records).then(function (rows) {
  10079. return isArr ? rows : rows[0];
  10080. });
  10081. });
  10082. },
  10083. revert: function revert() {
  10084. UtilTools.warn('vxe.error.delFunc', ['revert', 'revertData']);
  10085. return this.revertData.apply(this, arguments);
  10086. },
  10087. /**
  10088. * 还原数据
  10089. * 如果不传任何参数,则还原整个表格
  10090. * 如果传 row 则还原一行
  10091. * 如果传 rows 则还原多行
  10092. * 如果还额外传了 field 则还原指定的单元格数据
  10093. */
  10094. revertData: function revertData(rows, field) {
  10095. var _this10 = this;
  10096. var tableSourceData = this.tableSourceData,
  10097. treeConfig = this.treeConfig; // 在 v3 中必须要开启 keep-source
  10098. if (!this.keepSource) {
  10099. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  10100. return this.$nextTick();
  10101. }
  10102. var targetRows = rows;
  10103. if (rows) {
  10104. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  10105. targetRows = [rows];
  10106. }
  10107. } else {
  10108. targetRows = ctor_amd_xe_utils_default.a.toArray(this.getUpdateRecords());
  10109. }
  10110. if (targetRows.length) {
  10111. targetRows.forEach(function (row) {
  10112. if (!_this10.isInsertByRow(row)) {
  10113. var rowIndex = _this10.getRowIndex(row);
  10114. if (treeConfig && rowIndex === -1) {
  10115. throw new Error(UtilTools.getLog('vxe.error.noTree', ['revertData']));
  10116. }
  10117. var oRow = tableSourceData[rowIndex];
  10118. if (oRow && row) {
  10119. if (field) {
  10120. 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));
  10121. } else {
  10122. ctor_amd_xe_utils_default.a.destructuring(row, ctor_amd_xe_utils_default.a.clone(oRow, true));
  10123. }
  10124. }
  10125. }
  10126. });
  10127. }
  10128. if (rows) {
  10129. return this.$nextTick();
  10130. }
  10131. return this.reloadData(tableSourceData);
  10132. },
  10133. /**
  10134. * 清空单元格内容
  10135. * 如果不创参数,则清空整个表格内容
  10136. * 如果传 row 则清空一行内容
  10137. * 如果传 rows 则清空多行内容
  10138. * 如果还额外传了 field 则清空指定单元格内容
  10139. * @param {Array/Row} rows 行数据
  10140. * @param {String} field 字段名
  10141. */
  10142. clearData: function clearData(rows, field) {
  10143. var tableFullData = this.tableFullData,
  10144. visibleColumn = this.visibleColumn;
  10145. if (!arguments.length) {
  10146. rows = tableFullData;
  10147. } else if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
  10148. rows = [rows];
  10149. }
  10150. if (field) {
  10151. rows.forEach(function (row) {
  10152. return ctor_amd_xe_utils_default.a.set(row, field, null);
  10153. });
  10154. } else {
  10155. rows.forEach(function (row) {
  10156. visibleColumn.forEach(function (column) {
  10157. if (column.property) {
  10158. methods_setCellValue(row, column, null);
  10159. }
  10160. });
  10161. });
  10162. }
  10163. return this.$nextTick();
  10164. },
  10165. /**
  10166. * 检查是否为临时行数据
  10167. * @param {Row} row 行对象
  10168. */
  10169. isInsertByRow: function isInsertByRow(row) {
  10170. return this.editStore.insertList.indexOf(row) > -1;
  10171. },
  10172. // 在 v3.0 中废弃 hasRowChange
  10173. hasRowChange: function hasRowChange(row, field) {
  10174. UtilTools.warn('vxe.error.delFunc', ['hasRowChange', 'isUpdateByRow']);
  10175. return this.isUpdateByRow(row, field);
  10176. },
  10177. /**
  10178. * 检查行或列数据是否发生改变
  10179. * @param {Row} row 行对象
  10180. * @param {String} field 字段名
  10181. */
  10182. isUpdateByRow: function isUpdateByRow(row, field) {
  10183. var _this11 = this;
  10184. var visibleColumn = this.visibleColumn,
  10185. keepSource = this.keepSource,
  10186. treeConfig = this.treeConfig,
  10187. treeOpts = this.treeOpts,
  10188. tableSourceData = this.tableSourceData,
  10189. fullDataRowIdData = this.fullDataRowIdData;
  10190. if (keepSource) {
  10191. var oRow, property;
  10192. var rowid = methods_getRowid(this, row); // 新增的数据不需要检测
  10193. if (!fullDataRowIdData[rowid]) {
  10194. return false;
  10195. }
  10196. if (treeConfig) {
  10197. var children = treeOpts.children;
  10198. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  10199. return rowid === methods_getRowid(_this11, item);
  10200. }, treeOpts);
  10201. row = Object.assign({}, row, _defineProperty({}, children, null));
  10202. if (matchObj) {
  10203. oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
  10204. }
  10205. } else {
  10206. var oRowIndex = fullDataRowIdData[rowid].index;
  10207. oRow = tableSourceData[oRowIndex];
  10208. }
  10209. if (oRow) {
  10210. if (arguments.length > 1) {
  10211. return !eqCellValue(oRow, row, field);
  10212. }
  10213. for (var index = 0, len = visibleColumn.length; index < len; index++) {
  10214. property = visibleColumn[index].property;
  10215. if (property && !eqCellValue(oRow, row, property)) {
  10216. return true;
  10217. }
  10218. }
  10219. }
  10220. }
  10221. return false;
  10222. },
  10223. /**
  10224. * 获取表格的可视列,也可以指定索引获取列
  10225. * @param {Number} columnIndex 索引
  10226. */
  10227. getColumns: function getColumns(columnIndex) {
  10228. var columns = this.visibleColumn;
  10229. return arguments.length ? columns[columnIndex] : columns.slice(0);
  10230. },
  10231. /**
  10232. * 根据列的唯一主键获取列
  10233. * @param {String} colid 列主键
  10234. */
  10235. getColumnById: function getColumnById(colid) {
  10236. var fullColumnIdData = this.fullColumnIdData;
  10237. return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
  10238. },
  10239. /**
  10240. * 根据列的字段名获取列
  10241. * @param {String} field 字段名
  10242. */
  10243. getColumnByField: function getColumnByField(field) {
  10244. var fullColumnFieldData = this.fullColumnFieldData;
  10245. return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
  10246. },
  10247. /**
  10248. * 获取当前表格的列
  10249. * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
  10250. */
  10251. getTableColumn: function getTableColumn() {
  10252. return {
  10253. collectColumn: this.collectColumn.slice(0),
  10254. fullColumn: this.tableFullColumn.slice(0),
  10255. visibleColumn: this.visibleColumn.slice(0),
  10256. tableColumn: this.tableColumn.slice(0)
  10257. };
  10258. },
  10259. // 在 v3.0 中废弃 getRecords
  10260. getRecords: function getRecords() {
  10261. UtilTools.warn('vxe.error.delFunc', ['getRecords', 'getData']);
  10262. return this.getData.apply(this, arguments);
  10263. },
  10264. /**
  10265. * 获取数据,和 data 的行为一致,也可以指定索引获取数据
  10266. */
  10267. getData: function getData(rowIndex) {
  10268. var tableSynchData = this.data || this.tableSynchData;
  10269. return arguments.length ? tableSynchData[rowIndex] : tableSynchData.slice(0);
  10270. },
  10271. // 在 v3.0 中废弃 getAllRecords
  10272. getAllRecords: function getAllRecords() {
  10273. UtilTools.warn('vxe.error.delFunc', ['getAllRecords', 'getRecordset']);
  10274. return this.getRecordset();
  10275. },
  10276. // 在 v3.0 中废弃 getSelectRecords
  10277. getSelectRecords: function getSelectRecords() {
  10278. UtilTools.warn('vxe.error.delFunc', ['getSelectRecords', 'getCheckboxRecords']);
  10279. return this.getCheckboxRecords();
  10280. },
  10281. /**
  10282. * 用于多选行,获取已选中的数据
  10283. */
  10284. getCheckboxRecords: function getCheckboxRecords() {
  10285. var tableFullData = this.tableFullData,
  10286. treeConfig = this.treeConfig,
  10287. treeOpts = this.treeOpts,
  10288. checkboxOpts = this.checkboxOpts;
  10289. var property = checkboxOpts.checkField;
  10290. var rowList = [];
  10291. if (property) {
  10292. if (treeConfig) {
  10293. rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10294. return ctor_amd_xe_utils_default.a.get(row, property);
  10295. }, treeOpts);
  10296. } else {
  10297. rowList = tableFullData.filter(function (row) {
  10298. return ctor_amd_xe_utils_default.a.get(row, property);
  10299. });
  10300. }
  10301. } else {
  10302. var selection = this.selection;
  10303. if (treeConfig) {
  10304. rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10305. return selection.indexOf(row) > -1;
  10306. }, treeOpts);
  10307. } else {
  10308. rowList = tableFullData.filter(function (row) {
  10309. return selection.indexOf(row) > -1;
  10310. });
  10311. }
  10312. }
  10313. return rowList;
  10314. },
  10315. /**
  10316. * 获取处理后全量的表格数据
  10317. * 如果存在筛选条件,继续处理
  10318. */
  10319. updateAfterFullData: function updateAfterFullData() {
  10320. var _this12 = this;
  10321. var tableFullColumn = this.tableFullColumn,
  10322. tableFullData = this.tableFullData,
  10323. remoteSort = this.remoteSort,
  10324. remoteFilter = this.remoteFilter,
  10325. filterOpts = this.filterOpts,
  10326. sortOpts = this.sortOpts;
  10327. var tableData = tableFullData.slice(0);
  10328. var column = ctor_amd_xe_utils_default.a.find(tableFullColumn, function (column) {
  10329. return column.order;
  10330. });
  10331. var filterColumns = [];
  10332. var orderColumns = [];
  10333. tableFullColumn.forEach(function (column) {
  10334. if (column.filters && column.filters.length) {
  10335. var valueList = [];
  10336. var itemList = [];
  10337. column.filters.forEach(function (item) {
  10338. if (item.checked) {
  10339. itemList.push(item);
  10340. valueList.push(item.value);
  10341. }
  10342. });
  10343. filterColumns.push({
  10344. column: column,
  10345. valueList: valueList,
  10346. itemList: itemList
  10347. });
  10348. }
  10349. if (column.sortable && column.order) {
  10350. orderColumns.push({
  10351. column: column,
  10352. sortBy: column.sortBy,
  10353. property: column.property,
  10354. order: column.order
  10355. });
  10356. }
  10357. });
  10358. if (filterColumns.length) {
  10359. tableData = tableData.filter(function (row) {
  10360. return filterColumns.every(function (_ref2) {
  10361. var column = _ref2.column,
  10362. valueList = _ref2.valueList,
  10363. itemList = _ref2.itemList;
  10364. if (valueList.length && !(filterOpts.remote || remoteFilter)) {
  10365. var filterRender = column.filterRender,
  10366. property = column.property;
  10367. var filterMethod = column.filterMethod;
  10368. var allFilterMethod = filterOpts.filterMethod;
  10369. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  10370. var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
  10371. var defaultFilterMethod = compConf ? compConf.defaultFilterMethod : null;
  10372. var cellValue = UtilTools.getCellValue(row, column);
  10373. if (filterMethod) {
  10374. return itemList.some(function (item) {
  10375. return filterMethod({
  10376. value: item.value,
  10377. option: item,
  10378. cellValue: cellValue,
  10379. row: row,
  10380. column: column,
  10381. $table: _this12
  10382. });
  10383. });
  10384. } else if (compFilterMethod) {
  10385. return itemList.some(function (item) {
  10386. return compFilterMethod({
  10387. value: item.value,
  10388. option: item,
  10389. cellValue: cellValue,
  10390. row: row,
  10391. column: column,
  10392. $table: _this12
  10393. });
  10394. });
  10395. } else if (allFilterMethod) {
  10396. return allFilterMethod({
  10397. options: itemList,
  10398. values: valueList,
  10399. cellValue: cellValue,
  10400. row: row,
  10401. column: column
  10402. });
  10403. } else if (defaultFilterMethod) {
  10404. return itemList.some(function (item) {
  10405. return defaultFilterMethod({
  10406. value: item.value,
  10407. option: item,
  10408. cellValue: cellValue,
  10409. row: row,
  10410. column: column,
  10411. $table: _this12
  10412. });
  10413. });
  10414. }
  10415. return valueList.indexOf(ctor_amd_xe_utils_default.a.get(row, property)) > -1;
  10416. }
  10417. return true;
  10418. });
  10419. });
  10420. }
  10421. if (column && column.order) {
  10422. var allSortMethod = sortOpts.sortMethod || this.sortMethod;
  10423. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote || remoteSort;
  10424. if (!isRemote) {
  10425. if (allSortMethod) {
  10426. tableData = allSortMethod({
  10427. data: tableData,
  10428. column: column,
  10429. property: column.property,
  10430. order: column.order,
  10431. sortList: orderColumns,
  10432. $table: this
  10433. }) || tableData;
  10434. } else {
  10435. var rest = column.sortMethod ? tableData.sort(column.sortMethod) : ctor_amd_xe_utils_default.a.orderBy(tableData, getOrderField(this, column));
  10436. tableData = column.order === 'desc' ? rest.reverse() : rest;
  10437. }
  10438. }
  10439. }
  10440. this.afterFullData = tableData;
  10441. return tableData;
  10442. },
  10443. /**
  10444. * 根据行的唯一主键获取行
  10445. * @param {String/Number} rowid 行主键
  10446. */
  10447. getRowById: function getRowById(rowid) {
  10448. var fullDataRowIdData = this.fullDataRowIdData;
  10449. return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
  10450. },
  10451. /**
  10452. * 根据行获取行的唯一主键
  10453. * @param {Row} row 行对象
  10454. */
  10455. getRowid: function getRowid(row) {
  10456. var fullAllDataRowMap = this.fullAllDataRowMap;
  10457. return fullAllDataRowMap.has(row) ? fullAllDataRowMap.get(row).rowid : null;
  10458. },
  10459. /**
  10460. * 获取处理后的表格数据
  10461. * 如果存在筛选条件,继续处理
  10462. * 如果存在排序,继续处理
  10463. */
  10464. getTableData: function getTableData() {
  10465. var tableFullData = this.tableFullData,
  10466. afterFullData = this.afterFullData,
  10467. tableData = this.tableData,
  10468. footerTableData = this.footerTableData;
  10469. return {
  10470. fullData: tableFullData.slice(0),
  10471. visibleData: afterFullData.slice(0),
  10472. tableData: tableData.slice(0),
  10473. footerData: footerTableData.slice(0)
  10474. };
  10475. },
  10476. /**
  10477. * 默认行为只允许执行一次
  10478. */
  10479. handleDefaults: function handleDefaults() {
  10480. var _this13 = this;
  10481. // 在 v3.0 中废弃 selectConfig
  10482. var checkboxConfig = this.checkboxConfig || this.selectConfig;
  10483. if (checkboxConfig) {
  10484. this.handleDefaultSelectionChecked();
  10485. }
  10486. if (this.radioConfig) {
  10487. this.handleDefaultRadioChecked();
  10488. }
  10489. if (this.sortConfig) {
  10490. this.handleDefaultSort();
  10491. }
  10492. if (this.expandConfig) {
  10493. this.handleDefaultRowExpand();
  10494. }
  10495. if (this.treeConfig) {
  10496. this.handleDefaultTreeExpand();
  10497. }
  10498. if (this.mergeCells) {
  10499. this.handleDefaultMergeCells();
  10500. }
  10501. if (this.mergeFooterItems) {
  10502. this.handleDefaultMergeFooterItems();
  10503. }
  10504. this.$nextTick(function () {
  10505. return setTimeout(_this13.recalculate);
  10506. });
  10507. },
  10508. /**
  10509. * 动态列处理
  10510. */
  10511. mergeCustomColumn: function mergeCustomColumn(customColumns) {
  10512. var tableFullColumn = this.tableFullColumn;
  10513. this.isUpdateCustoms = true;
  10514. if (customColumns.length) {
  10515. tableFullColumn.forEach(function (column) {
  10516. // 在 v3.0 中废弃 prop
  10517. var item = ctor_amd_xe_utils_default.a.find(customColumns, function (item) {
  10518. return column.property && (item.field || item.prop) === column.property;
  10519. });
  10520. if (item) {
  10521. if (ctor_amd_xe_utils_default.a.isNumber(item.resizeWidth)) {
  10522. column.resizeWidth = item.resizeWidth;
  10523. }
  10524. if (ctor_amd_xe_utils_default.a.isBoolean(item.visible)) {
  10525. column.visible = item.visible;
  10526. }
  10527. }
  10528. });
  10529. }
  10530. this.emitEvent('update:customs', tableFullColumn);
  10531. },
  10532. /**
  10533. * 手动重置列的所有操作,还原到初始状态
  10534. * 如果已关联工具栏,则会同步更新
  10535. */
  10536. resetAll: function resetAll() {
  10537. UtilTools.warn('vxe.error.delFunc', ['resetAll', 'resetColumn']);
  10538. this.resetColumn(true);
  10539. },
  10540. /**
  10541. * 隐藏指定列
  10542. * @param {ColumnInfo} column 列配置
  10543. */
  10544. hideColumn: function hideColumn(column) {
  10545. column.visible = false;
  10546. return this.handleCustom();
  10547. },
  10548. /**
  10549. * 显示指定列
  10550. * @param {ColumnInfo} column 列配置
  10551. */
  10552. showColumn: function showColumn(column) {
  10553. column.visible = true;
  10554. return this.handleCustom();
  10555. },
  10556. /**
  10557. * 手动重置列的显示隐藏、列宽拖动的状态;
  10558. * 如果为 true 则重置所有状态
  10559. * 如果已关联工具栏,则会同步更新
  10560. */
  10561. resetColumn: function resetColumn(options) {
  10562. var customOpts = this.customOpts;
  10563. var checkMethod = customOpts.checkMethod;
  10564. var opts = Object.assign({
  10565. visible: true,
  10566. resizable: options === true
  10567. }, options);
  10568. this.tableFullColumn.forEach(function (column) {
  10569. if (opts.resizable) {
  10570. column.resizeWidth = 0;
  10571. }
  10572. if (!checkMethod || checkMethod({
  10573. column: column
  10574. })) {
  10575. column.visible = column.defaultVisible;
  10576. }
  10577. });
  10578. if (opts.resizable) {
  10579. this.saveCustomResizable(true);
  10580. }
  10581. return this.handleCustom();
  10582. },
  10583. handleCustom: function handleCustom() {
  10584. this.saveCustomVisible();
  10585. this.analyColumnWidth();
  10586. return this.refreshColumn();
  10587. },
  10588. resetResizable: function resetResizable() {
  10589. UtilTools.warn('vxe.error.delFunc', ['resetResizable', 'resetColumn']);
  10590. return this.resetColumn();
  10591. },
  10592. /**
  10593. * 已废弃的方法
  10594. */
  10595. reloadCustoms: function reloadCustoms(customColumns) {
  10596. var _this14 = this;
  10597. UtilTools.warn('vxe.error.delFunc', ['reloadCustoms', 'column.visible & refreshColumn']);
  10598. return this.$nextTick().then(function () {
  10599. _this14.mergeCustomColumn(customColumns);
  10600. return _this14.refreshColumn().then(function () {
  10601. return _this14.tableFullColumn;
  10602. });
  10603. });
  10604. },
  10605. /**
  10606. * 还原自定义列操作状态
  10607. */
  10608. restoreCustomStorage: function restoreCustomStorage() {
  10609. var $toolbar = this.$toolbar,
  10610. collectColumn = this.collectColumn,
  10611. customConfig = this.customConfig,
  10612. customOpts = this.customOpts;
  10613. var storage = customOpts.storage;
  10614. var isAllStorage = customOpts.storage === true;
  10615. var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage;
  10616. var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10617. if ((customConfig || $toolbar) && (isResizable || isVisible)) {
  10618. // 在 v3.0 中废弃 toolbar.id
  10619. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10620. var customMap = {};
  10621. if (!id) {
  10622. UtilTools.error('vxe.error.reqProp', ['id']);
  10623. return;
  10624. }
  10625. if (isResizable) {
  10626. var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
  10627. if (columnWidthStorage) {
  10628. ctor_amd_xe_utils_default.a.each(columnWidthStorage, function (resizeWidth, field) {
  10629. customMap[field] = {
  10630. field: field,
  10631. resizeWidth: resizeWidth
  10632. };
  10633. });
  10634. }
  10635. }
  10636. if (isVisible) {
  10637. var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
  10638. if (columnVisibleStorage) {
  10639. var colVisibles = columnVisibleStorage.split('|');
  10640. var colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
  10641. var colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
  10642. colHides.forEach(function (field) {
  10643. if (customMap[field]) {
  10644. customMap[field].visible = false;
  10645. } else {
  10646. customMap[field] = {
  10647. field: field,
  10648. visible: false
  10649. };
  10650. }
  10651. });
  10652. colShows.forEach(function (field) {
  10653. if (customMap[field]) {
  10654. customMap[field].visible = true;
  10655. } else {
  10656. customMap[field] = {
  10657. field: field,
  10658. visible: true
  10659. };
  10660. }
  10661. });
  10662. }
  10663. }
  10664. var keyMap = {};
  10665. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10666. var colKey = column.getKey();
  10667. if (colKey) {
  10668. keyMap[colKey] = column;
  10669. }
  10670. });
  10671. ctor_amd_xe_utils_default.a.each(customMap, function (_ref3, field) {
  10672. var visible = _ref3.visible,
  10673. resizeWidth = _ref3.resizeWidth;
  10674. var column = keyMap[field];
  10675. if (column) {
  10676. if (ctor_amd_xe_utils_default.a.isNumber(resizeWidth)) {
  10677. column.resizeWidth = resizeWidth;
  10678. }
  10679. if (ctor_amd_xe_utils_default.a.isBoolean(visible)) {
  10680. column.visible = visible;
  10681. }
  10682. }
  10683. });
  10684. }
  10685. },
  10686. saveCustomVisible: function saveCustomVisible() {
  10687. var $toolbar = this.$toolbar,
  10688. collectColumn = this.collectColumn,
  10689. customConfig = this.customConfig,
  10690. customOpts = this.customOpts;
  10691. var checkMethod = customOpts.checkMethod,
  10692. storage = customOpts.storage;
  10693. var isAllStorage = customOpts.storage === true;
  10694. var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10695. if ((customConfig || $toolbar) && isVisible) {
  10696. // 在 v3.0 中废弃 toolbar.id
  10697. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10698. var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
  10699. var colHides = [];
  10700. var colShows = [];
  10701. if (!id) {
  10702. UtilTools.error('vxe.error.reqProp', ['id']);
  10703. return;
  10704. }
  10705. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10706. if (!checkMethod || checkMethod({
  10707. column: column
  10708. })) {
  10709. if (!column.visible && column.defaultVisible) {
  10710. var colKey = column.getKey();
  10711. if (colKey) {
  10712. colHides.push(colKey);
  10713. }
  10714. } else if (column.visible && !column.defaultVisible) {
  10715. var _colKey = column.getKey();
  10716. if (_colKey) {
  10717. colShows.push(_colKey);
  10718. }
  10719. }
  10720. }
  10721. });
  10722. columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined;
  10723. localStorage.setItem(visibleStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
  10724. }
  10725. },
  10726. saveCustomResizable: function saveCustomResizable(isReset) {
  10727. var $toolbar = this.$toolbar,
  10728. collectColumn = this.collectColumn,
  10729. customConfig = this.customConfig,
  10730. customOpts = this.customOpts;
  10731. var storage = customOpts.storage;
  10732. var isAllStorage = customOpts.storage === true;
  10733. var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
  10734. if ((customConfig || $toolbar) && isResizable) {
  10735. // 在 v3.0 中废弃 toolbar.id
  10736. var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
  10737. var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
  10738. var columnWidthStorage;
  10739. if (!id) {
  10740. UtilTools.error('vxe.error.reqProp', ['id']);
  10741. return;
  10742. }
  10743. if (!isReset) {
  10744. columnWidthStorage = ctor_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
  10745. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  10746. if (column.resizeWidth) {
  10747. var colKey = column.getKey();
  10748. if (colKey) {
  10749. columnWidthStorage[colKey] = column.renderWidth;
  10750. }
  10751. }
  10752. });
  10753. }
  10754. columnWidthStorageMap[id] = ctor_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
  10755. localStorage.setItem(resizableStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
  10756. }
  10757. },
  10758. /**
  10759. * 刷新列信息
  10760. * 将固定的列左边、右边分别靠边
  10761. */
  10762. refreshColumn: function refreshColumn() {
  10763. var _this15 = this;
  10764. var leftList = [];
  10765. var centerList = [];
  10766. var rightList = [];
  10767. var collectColumn = this.collectColumn,
  10768. tableFullColumn = this.tableFullColumn,
  10769. isGroup = this.isGroup,
  10770. columnStore = this.columnStore,
  10771. sXOpts = this.sXOpts,
  10772. scrollXStore = this.scrollXStore; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
  10773. if (isGroup) {
  10774. var leftGroupList = [];
  10775. var centerGroupList = [];
  10776. var rightGroupList = [];
  10777. ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent) {
  10778. var isColGroup = hasChildrenList(column); // 如果是分组,必须按组设置固定列,不允许给子列设置固定
  10779. if (parent && parent.fixed) {
  10780. column.fixed = parent.fixed;
  10781. }
  10782. if (parent && column.fixed !== parent.fixed) {
  10783. UtilTools.error('vxe.error.groupFixed');
  10784. }
  10785. if (isColGroup) {
  10786. column.visible = !!ctor_amd_xe_utils_default.a.findTree(column.children, function (subColumn) {
  10787. return hasChildrenList(subColumn) ? null : subColumn.visible;
  10788. });
  10789. } else if (column.visible) {
  10790. if (column.fixed === 'left') {
  10791. leftList.push(column);
  10792. } else if (column.fixed === 'right') {
  10793. rightList.push(column);
  10794. } else {
  10795. centerList.push(column);
  10796. }
  10797. }
  10798. });
  10799. collectColumn.forEach(function (column) {
  10800. if (column.visible) {
  10801. if (column.fixed === 'left') {
  10802. leftGroupList.push(column);
  10803. } else if (column.fixed === 'right') {
  10804. rightGroupList.push(column);
  10805. } else {
  10806. centerGroupList.push(column);
  10807. }
  10808. }
  10809. });
  10810. this.tableGroupColumn = leftGroupList.concat(centerGroupList).concat(rightGroupList);
  10811. } else {
  10812. // 重新分配列
  10813. tableFullColumn.forEach(function (column) {
  10814. if (column.visible) {
  10815. if (column.fixed === 'left') {
  10816. leftList.push(column);
  10817. } else if (column.fixed === 'right') {
  10818. rightList.push(column);
  10819. } else {
  10820. centerList.push(column);
  10821. }
  10822. }
  10823. });
  10824. }
  10825. var visibleColumn = leftList.concat(centerList).concat(rightList);
  10826. var tableColumn = visibleColumn;
  10827. var scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
  10828. Object.assign(columnStore, {
  10829. leftList: leftList,
  10830. centerList: centerList,
  10831. rightList: rightList
  10832. });
  10833. if (scrollXLoad && isGroup) {
  10834. scrollXLoad = false;
  10835. UtilTools.warn('vxe.error.scrollXNotGroup');
  10836. }
  10837. if (scrollXLoad) {
  10838. if (this.showHeader && !this.showHeaderOverflow) {
  10839. UtilTools.warn('vxe.error.reqProp', ['show-header-overflow']);
  10840. }
  10841. if (this.showFooter && !this.showFooterOverflow) {
  10842. UtilTools.warn('vxe.error.reqProp', ['show-footer-overflow']);
  10843. }
  10844. if (this.spanMethod) {
  10845. UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
  10846. }
  10847. if (this.footerSpanMethod) {
  10848. UtilTools.warn('vxe.error.scrollErrProp', ['footer-span-method']);
  10849. }
  10850. Object.assign(scrollXStore, {
  10851. startIndex: 0,
  10852. visibleIndex: 0
  10853. });
  10854. tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
  10855. } // 如果列被显示/隐藏,则清除合并状态
  10856. // 如果列被设置为固定,则清除合并状态
  10857. if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
  10858. return column === visibleColumn[index];
  10859. })) {
  10860. this.clearMergeCells();
  10861. this.clearMergeFooterItems();
  10862. }
  10863. this.scrollXLoad = scrollXLoad;
  10864. this.tableColumn = tableColumn;
  10865. this.visibleColumn = visibleColumn;
  10866. return this.$nextTick().then(function () {
  10867. _this15.updateFooter();
  10868. return _this15.recalculate(true);
  10869. }).then(function () {
  10870. _this15.updateCellAreas();
  10871. return _this15.$nextTick().then(function () {
  10872. return _this15.recalculate();
  10873. });
  10874. });
  10875. },
  10876. /**
  10877. * 指定列宽的列进行拆分
  10878. */
  10879. analyColumnWidth: function analyColumnWidth() {
  10880. var columnWidth = this.columnWidth,
  10881. columnMinWidth = this.columnMinWidth,
  10882. columnOpts = this.columnOpts; // 在 v3.0 中废弃 columnWidth
  10883. var defaultWidth = columnOpts.width || columnWidth; // 在 v3.0 中废弃 columnMinWidth
  10884. var defaultMinWidth = columnOpts.minWidth || columnMinWidth;
  10885. var resizeList = [];
  10886. var pxList = [];
  10887. var pxMinList = [];
  10888. var scaleList = [];
  10889. var scaleMinList = [];
  10890. var autoList = [];
  10891. this.tableFullColumn.forEach(function (column) {
  10892. if (defaultWidth && !column.width) {
  10893. column.width = defaultWidth;
  10894. }
  10895. if (defaultMinWidth && !column.minWidth) {
  10896. column.minWidth = defaultMinWidth;
  10897. }
  10898. if (column.visible) {
  10899. if (column.resizeWidth) {
  10900. resizeList.push(column);
  10901. } else if (DomTools.isPx(column.width)) {
  10902. pxList.push(column);
  10903. } else if (DomTools.isScale(column.width)) {
  10904. scaleList.push(column);
  10905. } else if (DomTools.isPx(column.minWidth)) {
  10906. pxMinList.push(column);
  10907. } else if (DomTools.isScale(column.minWidth)) {
  10908. scaleMinList.push(column);
  10909. } else {
  10910. autoList.push(column);
  10911. }
  10912. }
  10913. });
  10914. Object.assign(this.columnStore, {
  10915. resizeList: resizeList,
  10916. pxList: pxList,
  10917. pxMinList: pxMinList,
  10918. scaleList: scaleList,
  10919. scaleMinList: scaleMinList,
  10920. autoList: autoList
  10921. });
  10922. },
  10923. /**
  10924. * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
  10925. */
  10926. refreshScroll: function refreshScroll() {
  10927. var _this16 = this;
  10928. var lastScrollLeft = this.lastScrollLeft,
  10929. lastScrollTop = this.lastScrollTop;
  10930. return this.clearScroll().then(function () {
  10931. if (lastScrollLeft || lastScrollTop) {
  10932. // 重置最后滚动状态
  10933. _this16.lastScrollLeft = 0;
  10934. _this16.lastScrollTop = 0; // 还原滚动状态
  10935. return _this16.scrollTo(lastScrollLeft, lastScrollTop);
  10936. }
  10937. });
  10938. },
  10939. /**
  10940. * 计算单元格列宽,动态分配可用剩余空间
  10941. * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
  10942. */
  10943. recalculate: function recalculate(refull) {
  10944. var _this17 = this;
  10945. var $refs = this.$refs;
  10946. var tableBody = $refs.tableBody,
  10947. tableHeader = $refs.tableHeader,
  10948. tableFooter = $refs.tableFooter;
  10949. var bodyElem = tableBody ? tableBody.$el : null;
  10950. var headerElem = tableHeader ? tableHeader.$el : null;
  10951. var footerElem = tableFooter ? tableFooter.$el : null;
  10952. if (bodyElem) {
  10953. this.autoCellWidth(headerElem, bodyElem, footerElem);
  10954. if (refull === true) {
  10955. // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
  10956. return this.computeScrollLoad().then(function () {
  10957. _this17.autoCellWidth(headerElem, bodyElem, footerElem);
  10958. _this17.computeScrollLoad();
  10959. });
  10960. }
  10961. }
  10962. return this.computeScrollLoad();
  10963. },
  10964. /**
  10965. * 列宽算法
  10966. * 支持 px、%、固定 混合分配
  10967. * 支持动态列表调整分配
  10968. * 支持自动分配偏移量
  10969. * @param {Element} headerElem
  10970. * @param {Element} bodyElem
  10971. * @param {Element} footerElem
  10972. * @param {Number} bodyWidth
  10973. */
  10974. autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) {
  10975. var tableWidth = 0;
  10976. var minCellWidth = 40; // 列宽最少限制 40px
  10977. var bodyWidth = bodyElem.clientWidth;
  10978. var remainWidth = bodyWidth;
  10979. var meanWidth = remainWidth / 100;
  10980. var fit = this.fit,
  10981. columnStore = this.columnStore;
  10982. var resizeList = columnStore.resizeList,
  10983. pxMinList = columnStore.pxMinList,
  10984. pxList = columnStore.pxList,
  10985. scaleList = columnStore.scaleList,
  10986. scaleMinList = columnStore.scaleMinList,
  10987. autoList = columnStore.autoList; // 最小宽
  10988. pxMinList.forEach(function (column) {
  10989. var minWidth = parseInt(column.minWidth);
  10990. tableWidth += minWidth;
  10991. column.renderWidth = minWidth;
  10992. }); // 最小百分比
  10993. scaleMinList.forEach(function (column) {
  10994. var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth);
  10995. tableWidth += scaleWidth;
  10996. column.renderWidth = scaleWidth;
  10997. }); // 固定百分比
  10998. scaleList.forEach(function (column) {
  10999. var scaleWidth = Math.floor(parseInt(column.width) * meanWidth);
  11000. tableWidth += scaleWidth;
  11001. column.renderWidth = scaleWidth;
  11002. }); // 固定宽
  11003. pxList.forEach(function (column) {
  11004. var width = parseInt(column.width);
  11005. tableWidth += width;
  11006. column.renderWidth = width;
  11007. }); // 调整了列宽
  11008. resizeList.forEach(function (column) {
  11009. var width = parseInt(column.resizeWidth);
  11010. tableWidth += width;
  11011. column.renderWidth = width;
  11012. });
  11013. remainWidth -= tableWidth;
  11014. meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0;
  11015. if (fit) {
  11016. if (remainWidth > 0) {
  11017. scaleMinList.concat(pxMinList).forEach(function (column) {
  11018. tableWidth += meanWidth;
  11019. column.renderWidth += meanWidth;
  11020. });
  11021. }
  11022. } else {
  11023. meanWidth = minCellWidth;
  11024. } // 自适应
  11025. autoList.forEach(function (column) {
  11026. var width = Math.max(meanWidth, minCellWidth);
  11027. column.renderWidth = width;
  11028. tableWidth += width;
  11029. });
  11030. if (fit) {
  11031. /**
  11032. * 偏移量算法
  11033. * 如果所有列足够放的情况下,从最后动态列开始分配
  11034. */
  11035. var dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoList);
  11036. var dynamicSize = dynamicList.length - 1;
  11037. if (dynamicSize > 0) {
  11038. var odiffer = bodyWidth - tableWidth;
  11039. if (odiffer > 0) {
  11040. while (odiffer > 0 && dynamicSize >= 0) {
  11041. odiffer--;
  11042. dynamicList[dynamicSize--].renderWidth++;
  11043. }
  11044. tableWidth = bodyWidth;
  11045. }
  11046. }
  11047. }
  11048. var tableHeight = bodyElem.offsetHeight;
  11049. var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight;
  11050. this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyWidth : 0;
  11051. this.overflowY = overflowY;
  11052. this.tableWidth = tableWidth;
  11053. this.tableHeight = tableHeight;
  11054. if (headerElem) {
  11055. this.headerHeight = headerElem.clientHeight; // 检测是否同步滚动
  11056. if (headerElem.scrollLeft !== bodyElem.scrollLeft) {
  11057. headerElem.scrollLeft = bodyElem.scrollLeft;
  11058. }
  11059. } else {
  11060. this.headerHeight = 0;
  11061. }
  11062. if (footerElem) {
  11063. var footerHeight = footerElem.offsetHeight;
  11064. this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0);
  11065. this.overflowX = tableWidth > footerElem.clientWidth;
  11066. this.footerHeight = footerHeight;
  11067. } else {
  11068. this.footerHeight = 0;
  11069. this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0);
  11070. this.overflowX = tableWidth > bodyWidth;
  11071. }
  11072. this.customHeight = methods_calcHeight(this, 'height');
  11073. this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
  11074. this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
  11075. if (this.overflowX) {
  11076. this.checkScrolling();
  11077. }
  11078. },
  11079. updateStyle: function updateStyle() {
  11080. var _this18 = this;
  11081. var $refs = this.$refs,
  11082. isGroup = this.isGroup,
  11083. fullColumnIdData = this.fullColumnIdData,
  11084. tableColumn = this.tableColumn,
  11085. customHeight = this.customHeight,
  11086. customMaxHeight = this.customMaxHeight,
  11087. border = this.border,
  11088. headerHeight = this.headerHeight,
  11089. showFooter = this.showFooter,
  11090. allColumnOverflow = this.showOverflow,
  11091. allColumnHeaderOverflow = this.showHeaderOverflow,
  11092. allColumnFooterOverflow = this.showFooterOverflow,
  11093. footerHeight = this.footerHeight,
  11094. tableHeight = this.tableHeight,
  11095. tableWidth = this.tableWidth,
  11096. scrollbarHeight = this.scrollbarHeight,
  11097. scrollbarWidth = this.scrollbarWidth,
  11098. scrollXLoad = this.scrollXLoad,
  11099. scrollYLoad = this.scrollYLoad,
  11100. cellOffsetWidth = this.cellOffsetWidth,
  11101. columnStore = this.columnStore,
  11102. elemStore = this.elemStore,
  11103. editStore = this.editStore,
  11104. currentRow = this.currentRow,
  11105. mouseConfig = this.mouseConfig;
  11106. var containerList = ['main', 'left', 'right'];
  11107. var emptyPlaceholderElem = $refs.emptyPlaceholder;
  11108. var bodyWrapperElem = elemStore['main-body-wrapper'];
  11109. if (emptyPlaceholderElem) {
  11110. emptyPlaceholderElem.style.top = "".concat(headerHeight, "px");
  11111. emptyPlaceholderElem.style.height = bodyWrapperElem ? "".concat(bodyWrapperElem.offsetHeight - scrollbarHeight, "px") : '';
  11112. }
  11113. if (customHeight > 0) {
  11114. if (showFooter) {
  11115. customHeight += scrollbarHeight;
  11116. }
  11117. }
  11118. containerList.forEach(function (name, index) {
  11119. var fixedType = index > 0 ? name : '';
  11120. var layoutList = ['header', 'body', 'footer'];
  11121. var fixedColumn = columnStore["".concat(fixedType, "List")];
  11122. var fixedWrapperElem = $refs["".concat(fixedType, "Container")];
  11123. layoutList.forEach(function (layout) {
  11124. var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")];
  11125. var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")];
  11126. if (layout === 'header') {
  11127. // 表头体样式处理
  11128. // 横向滚动渲染
  11129. var tWidth = tableWidth;
  11130. if (scrollXLoad) {
  11131. if (fixedType) {
  11132. tableColumn = fixedColumn;
  11133. }
  11134. tWidth = tableColumn.reduce(function (previous, column) {
  11135. return previous + column.renderWidth;
  11136. }, 0);
  11137. }
  11138. if (tableElem) {
  11139. tableElem.style.width = tWidth ? "".concat(tWidth + scrollbarWidth, "px") : ''; // 修复 IE 中高度无法自适应问题
  11140. if (methods_browse.msie) {
  11141. ctor_amd_xe_utils_default.a.arrayEach(tableElem.querySelectorAll('.vxe-resizable'), function (resizeElem) {
  11142. resizeElem.style.height = "".concat(resizeElem.parentNode.offsetHeight, "px");
  11143. });
  11144. }
  11145. }
  11146. var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")];
  11147. if (repairElem) {
  11148. repairElem.style.width = "".concat(tableWidth, "px");
  11149. }
  11150. var listElem = elemStore["".concat(name, "-").concat(layout, "-list")];
  11151. if (isGroup && listElem) {
  11152. // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
  11153. // thElem.style.width = `${scrollbarWidth}px`
  11154. // })
  11155. ctor_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
  11156. var colNode = _this18.getColumnNode(thElem);
  11157. if (colNode) {
  11158. var column = colNode.item;
  11159. var showHeaderOverflow = column.showHeaderOverflow;
  11160. var cellOverflow = ctor_amd_xe_utils_default.a.isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
  11161. var showEllipsis = cellOverflow === 'ellipsis';
  11162. var showTitle = cellOverflow === 'title';
  11163. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11164. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11165. var childWidth = 0;
  11166. var countChild = 0;
  11167. if (hasEllipsis) {
  11168. ctor_amd_xe_utils_default.a.eachTree(column.children, function (item) {
  11169. if (!item.children || !column.children.length) {
  11170. countChild++;
  11171. }
  11172. childWidth += item.renderWidth;
  11173. });
  11174. }
  11175. thElem.style.width = hasEllipsis ? "".concat(childWidth - countChild - (border ? 2 : 0), "px") : '';
  11176. }
  11177. });
  11178. }
  11179. } else if (layout === 'body') {
  11180. var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
  11181. if (wrapperElem) {
  11182. if (customMaxHeight > 0) {
  11183. wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
  11184. } else {
  11185. if (customHeight > 0) {
  11186. wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
  11187. } else {
  11188. wrapperElem.style.height = '';
  11189. }
  11190. }
  11191. } // 如果是固定列
  11192. if (fixedWrapperElem) {
  11193. var isRightFixed = fixedType === 'right';
  11194. var _fixedColumn = columnStore["".concat(fixedType, "List")];
  11195. if (wrapperElem) {
  11196. wrapperElem.style.top = "".concat(headerHeight, "px");
  11197. }
  11198. fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px");
  11199. fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) {
  11200. return previous + column.renderWidth;
  11201. }, isRightFixed ? scrollbarWidth : 0), "px");
  11202. }
  11203. var _tWidth = tableWidth; // 如果是固定列与设置了超出隐藏
  11204. if (fixedType && allColumnOverflow) {
  11205. tableColumn = fixedColumn;
  11206. _tWidth = tableColumn.reduce(function (previous, column) {
  11207. return previous + column.renderWidth;
  11208. }, 0);
  11209. } else if (scrollXLoad) {
  11210. if (fixedType) {
  11211. tableColumn = fixedColumn;
  11212. }
  11213. _tWidth = tableColumn.reduce(function (previous, column) {
  11214. return previous + column.renderWidth;
  11215. }, 0);
  11216. }
  11217. if (tableElem) {
  11218. tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : ''; // 兼容性处理
  11219. tableElem.style.paddingRight = scrollbarWidth && fixedType && (methods_browse['-moz'] || methods_browse.safari) ? "".concat(scrollbarWidth, "px") : '';
  11220. }
  11221. if (emptyBlockElem) {
  11222. emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : '';
  11223. }
  11224. } else if (layout === 'footer') {
  11225. // 如果是使用优化模式
  11226. var _tWidth2 = tableWidth;
  11227. if (fixedType && allColumnOverflow) {
  11228. tableColumn = fixedColumn;
  11229. _tWidth2 = tableColumn.reduce(function (previous, column) {
  11230. return previous + column.renderWidth;
  11231. }, 0);
  11232. } else if (scrollXLoad) {
  11233. if (fixedType) {
  11234. tableColumn = fixedColumn;
  11235. }
  11236. _tWidth2 = tableColumn.reduce(function (previous, column) {
  11237. return previous + column.renderWidth;
  11238. }, 0);
  11239. }
  11240. if (wrapperElem) {
  11241. // 如果是固定列
  11242. if (fixedWrapperElem) {
  11243. wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
  11244. }
  11245. wrapperElem.style.marginTop = "".concat(-scrollbarHeight, "px");
  11246. }
  11247. if (tableElem) {
  11248. tableElem.style.width = _tWidth2 ? "".concat(_tWidth2 + scrollbarWidth, "px") : '';
  11249. } // const listElem = elemStore[`${name}-${layout}-list`]
  11250. // if (listElem) {
  11251. // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
  11252. // thElem.style.width = `${scrollbarWidth}px`
  11253. // })
  11254. // }
  11255. }
  11256. var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
  11257. if (colgroupElem) {
  11258. ctor_amd_xe_utils_default.a.arrayEach(colgroupElem.children, function (colElem) {
  11259. var colid = colElem.getAttribute('name');
  11260. if (colid === 'col_gutter') {
  11261. colElem.style.width = "".concat(scrollbarWidth, "px");
  11262. }
  11263. if (fullColumnIdData[colid]) {
  11264. var column = fullColumnIdData[colid].column;
  11265. var showHeaderOverflow = column.showHeaderOverflow,
  11266. showFooterOverflow = column.showFooterOverflow,
  11267. showOverflow = column.showOverflow;
  11268. var cellOverflow;
  11269. colElem.style.width = "".concat(column.renderWidth, "px");
  11270. if (layout === 'header') {
  11271. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  11272. } else if (layout === 'footer') {
  11273. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  11274. } else {
  11275. cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  11276. }
  11277. var showEllipsis = cellOverflow === 'ellipsis';
  11278. var showTitle = cellOverflow === 'title';
  11279. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11280. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11281. var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; // 滚动的渲染不支持动态行高
  11282. if (layout === 'header' || layout === 'footer') {
  11283. if (scrollXLoad && !hasEllipsis) {
  11284. hasEllipsis = true;
  11285. }
  11286. } else {
  11287. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  11288. hasEllipsis = true;
  11289. }
  11290. }
  11291. if (_listElem) {
  11292. ctor_amd_xe_utils_default.a.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (elem) {
  11293. var colspan = parseInt(elem.getAttribute('colspan') || 1);
  11294. var cellElem = elem.querySelector('.vxe-cell');
  11295. var colWidth = column.renderWidth;
  11296. if (cellElem) {
  11297. if (colspan > 1) {
  11298. var columnIndex = _this18.getColumnIndex(column);
  11299. for (var _index = 1; _index < colspan; _index++) {
  11300. var nextColumn = _this18.getColumns(columnIndex + _index);
  11301. if (nextColumn) {
  11302. colWidth += nextColumn.renderWidth;
  11303. }
  11304. }
  11305. }
  11306. cellElem.style.width = hasEllipsis ? "".concat(colWidth - cellOffsetWidth * colspan, "px") : '';
  11307. }
  11308. });
  11309. }
  11310. }
  11311. });
  11312. }
  11313. });
  11314. });
  11315. if (currentRow) {
  11316. this.setCurrentRow(currentRow);
  11317. }
  11318. if (mouseConfig && mouseConfig.selected && editStore.selected.row && editStore.selected.column) {
  11319. this.addColSdCls();
  11320. }
  11321. return this.$nextTick();
  11322. },
  11323. /**
  11324. * 处理固定列的显示状态
  11325. */
  11326. checkScrolling: function checkScrolling() {
  11327. var _this$$refs = this.$refs,
  11328. tableBody = _this$$refs.tableBody,
  11329. leftContainer = _this$$refs.leftContainer,
  11330. rightContainer = _this$$refs.rightContainer;
  11331. var bodyElem = tableBody ? tableBody.$el : null;
  11332. if (bodyElem) {
  11333. if (leftContainer) {
  11334. DomTools[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle');
  11335. }
  11336. if (rightContainer) {
  11337. DomTools[bodyElem.clientWidth < bodyElem.scrollWidth - Math.ceil(bodyElem.scrollLeft) ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle');
  11338. }
  11339. }
  11340. },
  11341. preventEvent: function preventEvent(evnt, type, args, next, end) {
  11342. var _this19 = this;
  11343. var evntList = v_x_e_table.interceptor.get(type);
  11344. var rest;
  11345. if (!evntList.some(function (func) {
  11346. return func(Object.assign({
  11347. $grid: _this19.$xegrid,
  11348. $table: _this19,
  11349. $event: evnt
  11350. }, args), evnt, _this19) === false;
  11351. })) {
  11352. if (next) {
  11353. rest = next();
  11354. }
  11355. }
  11356. if (end) {
  11357. end();
  11358. }
  11359. return rest;
  11360. },
  11361. /**
  11362. * 全局按下事件处理
  11363. */
  11364. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  11365. var _this20 = this;
  11366. var $el = this.$el,
  11367. $refs = this.$refs,
  11368. $xegrid = this.$xegrid,
  11369. $toolbar = this.$toolbar,
  11370. mouseConfig = this.mouseConfig,
  11371. mouseOpts = this.mouseOpts,
  11372. editStore = this.editStore,
  11373. ctxMenuStore = this.ctxMenuStore,
  11374. editOpts = this.editOpts,
  11375. filterStore = this.filterStore,
  11376. getRowNode = this.getRowNode;
  11377. var actived = editStore.actived;
  11378. var filterWrapper = $refs.filterWrapper,
  11379. validTip = $refs.validTip; // 在 v3.0 中废弃 mouse-config.checked
  11380. var isMouseChecked = mouseConfig && mouseOpts.checked;
  11381. if (filterWrapper) {
  11382. if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {// 如果点击了筛选按钮
  11383. } else if (getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器
  11384. } else {
  11385. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11386. this.preventEvent(evnt, 'event.clearFilter', filterStore.args, this.closeFilter);
  11387. }
  11388. }
  11389. } // 如果已激活了编辑状态
  11390. if (actived.row) {
  11391. if (!(editOpts.autoClear === false)) {
  11392. // 如果是激活状态,点击了单元格之外
  11393. var cell = actived.args.cell;
  11394. if (!cell || !getEventTargetNode(evnt, cell).flag) {
  11395. if (validTip && getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框
  11396. } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
  11397. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11398. // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
  11399. this.preventEvent(evnt, 'event.clearActived', actived.args, function () {
  11400. var isClearActived;
  11401. if (editOpts.mode === 'row') {
  11402. var rowNode = getEventTargetNode(evnt, $el, 'vxe-body--row'); // row 方式,如果点击了不同行
  11403. isClearActived = rowNode.flag ? getRowNode(rowNode.targetElem).item !== actived.args.row : false;
  11404. } else {
  11405. // cell 方式,如果是非编辑列
  11406. isClearActived = !getEventTargetNode(evnt, $el, 'col--edit').flag;
  11407. }
  11408. if (!isClearActived) {
  11409. isClearActived = getEventTargetNode(evnt, $el, 'vxe-header--row').flag;
  11410. }
  11411. if (!isClearActived) {
  11412. isClearActived = getEventTargetNode(evnt, $el, 'vxe-footer--row').flag;
  11413. } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
  11414. if (!isClearActived && _this20.height && !_this20.overflowY) {
  11415. var bodyWrapperElem = evnt.target;
  11416. if (hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
  11417. isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
  11418. }
  11419. }
  11420. if (isClearActived || // 如果点击了当前表格之外
  11421. !getEventTargetNode(evnt, $el).flag) {
  11422. // this.triggerValidate('blur').then(a => {
  11423. // 保证 input 的 change 事件能先触发之后再清除
  11424. setTimeout(function () {
  11425. return _this20.clearActived(evnt);
  11426. }); // }).catch(e => e)
  11427. }
  11428. });
  11429. }
  11430. }
  11431. }
  11432. }
  11433. } else if (mouseConfig) {
  11434. if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !getEventTargetNode(evnt, $refs.tableWrapper).flag && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
  11435. if (isMouseChecked) {
  11436. this.clearIndexChecked();
  11437. this.clearHeaderChecked();
  11438. this.clearChecked();
  11439. }
  11440. this.clearSelected();
  11441. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
  11442. this.preventEvent(evnt, 'event.clearAreas', {}, function () {
  11443. _this20.clearCellAreas();
  11444. _this20.clearCopyCellArea();
  11445. });
  11446. }
  11447. }
  11448. } // 如果配置了快捷菜单且,点击了其他地方则关闭
  11449. if (ctxMenuStore.visible && this.$refs.ctxWrapper && !getEventTargetNode(evnt, this.$refs.ctxWrapper.$el).flag) {
  11450. this.closeMenu();
  11451. } // 最后激活的表格
  11452. this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
  11453. },
  11454. /**
  11455. * 窗口失焦事件处理
  11456. */
  11457. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  11458. this.closeFilter();
  11459. this.closeMenu();
  11460. },
  11461. /**
  11462. * 全局滚动事件
  11463. */
  11464. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent() {
  11465. this.closeTooltip();
  11466. this.closeMenu();
  11467. },
  11468. /**
  11469. * 全局键盘事件
  11470. */
  11471. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  11472. var _this21 = this;
  11473. // 该行为只对当前激活的表格有效
  11474. if (this.isActivated) {
  11475. this.preventEvent(evnt, 'event.keydown', null, function () {
  11476. var filterStore = _this21.filterStore,
  11477. isCtxMenu = _this21.isCtxMenu,
  11478. ctxMenuStore = _this21.ctxMenuStore,
  11479. editStore = _this21.editStore,
  11480. editOpts = _this21.editOpts,
  11481. editConfig = _this21.editConfig,
  11482. mouseConfig = _this21.mouseConfig,
  11483. mouseOpts = _this21.mouseOpts,
  11484. keyboardConfig = _this21.keyboardConfig,
  11485. keyboardOpts = _this21.keyboardOpts,
  11486. treeConfig = _this21.treeConfig,
  11487. treeOpts = _this21.treeOpts,
  11488. highlightCurrentRow = _this21.highlightCurrentRow,
  11489. currentRow = _this21.currentRow,
  11490. bodyCtxMenu = _this21.bodyCtxMenu;
  11491. var selected = editStore.selected,
  11492. actived = editStore.actived;
  11493. var keyCode = evnt.keyCode;
  11494. var isBack = keyCode === 8;
  11495. var isTab = keyCode === 9;
  11496. var isEnter = keyCode === 13;
  11497. var isEsc = keyCode === 27;
  11498. var isSpacebar = keyCode === 32;
  11499. var isLeftArrow = keyCode === 37;
  11500. var isUpArrow = keyCode === 38;
  11501. var isRightArrow = keyCode === 39;
  11502. var isDwArrow = keyCode === 40;
  11503. var isDel = keyCode === 46;
  11504. var isA = keyCode === 65;
  11505. var isF2 = keyCode === 113;
  11506. var isContextMenu = keyCode === 93;
  11507. var hasMetaKey = evnt.metaKey;
  11508. var hasCtrlKey = evnt.ctrlKey;
  11509. var hasShiftKey = evnt.shiftKey;
  11510. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  11511. var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
  11512. var isEditStatus = editConfig && actived.column && actived.row;
  11513. var params;
  11514. if (filterStore.visible) {
  11515. if (isEsc) {
  11516. _this21.closeFilter();
  11517. }
  11518. return;
  11519. }
  11520. if (operCtxMenu) {
  11521. // 如果配置了右键菜单; 支持方向键操作、回车
  11522. evnt.preventDefault();
  11523. if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
  11524. _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
  11525. } else {
  11526. _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this21.ctxMenuList);
  11527. }
  11528. } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this21.handleKeyboardEvent) {
  11529. _this21.handleKeyboardEvent(evnt);
  11530. } else if (isSpacebar && keyboardConfig && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'selection' || selected.column.type === 'radio')) {
  11531. // 在 v3.0 中废弃 type=selection
  11532. // 空格键支持选中复选框
  11533. evnt.preventDefault(); // 在 v3.0 中废弃 type=selection
  11534. if (selected.column.type === 'checkbox' || selected.column.type === 'selection') {
  11535. _this21.handleToggleCheckRowEvent(evnt, selected.args);
  11536. } else {
  11537. _this21.triggerRadioRowEvent(evnt, selected.args);
  11538. }
  11539. } else if (isEsc) {
  11540. // 如果按下了 Esc 键,关闭快捷菜单、筛选
  11541. _this21.closeMenu();
  11542. _this21.closeFilter(); // 如果是激活编辑状态,则取消编辑
  11543. if (actived.row) {
  11544. params = actived.args;
  11545. _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  11546. if (mouseConfig && mouseOpts.selected) {
  11547. _this21.$nextTick(function () {
  11548. return _this21.handleSelected(params, evnt);
  11549. });
  11550. }
  11551. }
  11552. } else if (isF2) {
  11553. if (!isEditStatus) {
  11554. // 如果按下了 F2 键
  11555. if (selected.row && selected.column) {
  11556. evnt.preventDefault();
  11557. _this21.handleActived(selected.args, evnt);
  11558. }
  11559. }
  11560. } else if (isContextMenu) {
  11561. // 如果按下上下文键
  11562. _this21._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
  11563. clearTimeout(_this21.keyCtxTimeout);
  11564. _this21.keyCtxTimeout = setTimeout(function () {
  11565. _this21._keyCtx = false;
  11566. }, 1000);
  11567. } else if (isEnter && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
  11568. // 退出选中
  11569. if (hasCtrlKey) {
  11570. // 如果是激活编辑状态,则取消编辑
  11571. if (actived.row) {
  11572. params = actived.args;
  11573. _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  11574. if (mouseConfig && mouseOpts.selected) {
  11575. _this21.$nextTick(function () {
  11576. return _this21.handleSelected(params, evnt);
  11577. });
  11578. }
  11579. }
  11580. } else {
  11581. // 如果是激活状态,退则出到上一行/下一行
  11582. if (selected.row || actived.row) {
  11583. var targetArgs = selected.row ? selected.args : actived.args;
  11584. if (hasShiftKey) {
  11585. if (keyboardOpts.enterToTab) {
  11586. _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
  11587. } else {
  11588. _this21.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
  11589. }
  11590. } else {
  11591. if (keyboardOpts.enterToTab) {
  11592. _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
  11593. } else {
  11594. _this21.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
  11595. }
  11596. }
  11597. } else if (treeConfig && highlightCurrentRow && currentRow) {
  11598. // 如果是树形表格当前行回车移动到子节点
  11599. var childrens = currentRow[treeOpts.children];
  11600. if (childrens && childrens.length) {
  11601. evnt.preventDefault();
  11602. var targetRow = childrens[0];
  11603. params = {
  11604. $table: _this21,
  11605. row: targetRow
  11606. };
  11607. _this21.setTreeExpand(currentRow, true).then(function () {
  11608. return _this21.scrollToRow(targetRow);
  11609. }).then(function () {
  11610. return _this21.triggerCurrentRowEvent(evnt, params);
  11611. });
  11612. }
  11613. }
  11614. }
  11615. } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
  11616. if (!isEditStatus) {
  11617. // 如果按下了方向键
  11618. if (selected.row && selected.column) {
  11619. _this21.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
  11620. } else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
  11621. // 当前行按键上下移动
  11622. _this21.moveCurrentRow(isUpArrow, isDwArrow, evnt);
  11623. }
  11624. }
  11625. } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
  11626. // 如果按下了 Tab 键切换
  11627. if (selected.row || selected.column) {
  11628. _this21.moveTabSelected(selected.args, hasShiftKey, evnt);
  11629. } else if (actived.row || actived.column) {
  11630. _this21.moveTabSelected(actived.args, hasShiftKey, evnt);
  11631. }
  11632. } else if (keyboardConfig && (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
  11633. if (!isEditStatus) {
  11634. var delMethod = keyboardOpts.delMethod,
  11635. backMethod = keyboardOpts.backMethod; // 如果是删除键
  11636. if (keyboardOpts.isDel && (selected.row || selected.column)) {
  11637. if (delMethod) {
  11638. delMethod({
  11639. row: selected.row,
  11640. rowIndex: _this21.getRowIndex(selected.row),
  11641. column: selected.column,
  11642. columnIndex: _this21.getColumnIndex(selected.column),
  11643. $table: _this21
  11644. });
  11645. } else {
  11646. methods_setCellValue(selected.row, selected.column, null);
  11647. }
  11648. if (isBack) {
  11649. if (backMethod) {
  11650. backMethod({
  11651. row: selected.row,
  11652. rowIndex: _this21.getRowIndex(selected.row),
  11653. column: selected.column,
  11654. columnIndex: _this21.getColumnIndex(selected.column),
  11655. $table: _this21
  11656. });
  11657. } else {
  11658. _this21.handleActived(selected.args, evnt);
  11659. }
  11660. } else if (isDel) {
  11661. // 如果按下 del 键,更新表尾数据
  11662. _this21.updateFooter();
  11663. }
  11664. } else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
  11665. // 如果树形表格回退键关闭当前行返回父节点
  11666. var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(_this21.afterFullData, function (item) {
  11667. return item === currentRow;
  11668. }, treeOpts),
  11669. parentRow = _XEUtils$findTree.parent;
  11670. if (parentRow) {
  11671. evnt.preventDefault();
  11672. params = {
  11673. $table: _this21,
  11674. row: parentRow
  11675. };
  11676. _this21.setTreeExpand(parentRow, false).then(function () {
  11677. return _this21.scrollToRow(parentRow);
  11678. }).then(function () {
  11679. return _this21.triggerCurrentRowEvent(evnt, params);
  11680. });
  11681. }
  11682. }
  11683. }
  11684. } else if (keyboardConfig && hasCtrlKey && isA) {
  11685. if (!isEditStatus) {
  11686. // 如果开启复制功能
  11687. if (keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11688. _this21.handleAllChecked(evnt);
  11689. }
  11690. }
  11691. } 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)) {
  11692. var editMethod = keyboardOpts.editMethod; // 启用编辑后,空格键功能将失效
  11693. // if (isSpacebar) {
  11694. // evnt.preventDefault()
  11695. // }
  11696. // 如果是按下非功能键之外允许直接编辑
  11697. if (selected.column && selected.row && UtilTools.isEnableConf(selected.column.editRender)) {
  11698. if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
  11699. if (editMethod) {
  11700. editMethod({
  11701. row: selected.row,
  11702. rowIndex: _this21.getRowIndex(selected.row),
  11703. column: selected.column,
  11704. columnIndex: _this21.getColumnIndex(selected.column),
  11705. $table: _this21
  11706. });
  11707. } else {
  11708. methods_setCellValue(selected.row, selected.column, null);
  11709. _this21.handleActived(selected.args, evnt);
  11710. }
  11711. }
  11712. }
  11713. }
  11714. _this21.emitEvent('keydown', {}, evnt);
  11715. });
  11716. }
  11717. },
  11718. handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
  11719. var isActivated = this.isActivated,
  11720. keyboardConfig = this.keyboardConfig,
  11721. keyboardOpts = this.keyboardOpts,
  11722. mouseConfig = this.mouseConfig,
  11723. mouseOpts = this.mouseOpts,
  11724. editStore = this.editStore,
  11725. filterStore = this.filterStore;
  11726. var actived = editStore.actived;
  11727. if (isActivated && !filterStore.visible) {
  11728. if (!(actived.row || actived.column)) {
  11729. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handlePasteCellAreaEvent) {
  11730. this.handlePasteCellAreaEvent(evnt);
  11731. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11732. this.handlePaste(evnt);
  11733. }
  11734. }
  11735. this.emitEvent('paste', {}, evnt);
  11736. }
  11737. },
  11738. handleGlobalCopyEvent: function handleGlobalCopyEvent(evnt) {
  11739. var isActivated = this.isActivated,
  11740. keyboardConfig = this.keyboardConfig,
  11741. keyboardOpts = this.keyboardOpts,
  11742. mouseConfig = this.mouseConfig,
  11743. mouseOpts = this.mouseOpts,
  11744. editStore = this.editStore,
  11745. filterStore = this.filterStore;
  11746. var actived = editStore.actived;
  11747. if (isActivated && !filterStore.visible) {
  11748. if (!(actived.row || actived.column)) {
  11749. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCopyCellAreaEvent) {
  11750. this.handleCopyCellAreaEvent(evnt);
  11751. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11752. this.handleCopyed(false, evnt);
  11753. }
  11754. }
  11755. this.emitEvent('copy', {}, evnt);
  11756. }
  11757. },
  11758. handleGlobalCutEvent: function handleGlobalCutEvent(evnt) {
  11759. var isActivated = this.isActivated,
  11760. keyboardConfig = this.keyboardConfig,
  11761. keyboardOpts = this.keyboardOpts,
  11762. mouseConfig = this.mouseConfig,
  11763. mouseOpts = this.mouseOpts,
  11764. editStore = this.editStore,
  11765. filterStore = this.filterStore;
  11766. var actived = editStore.actived;
  11767. if (isActivated && !filterStore.visible) {
  11768. if (!(actived.row || actived.column)) {
  11769. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCutCellAreaEvent) {
  11770. this.handleCutCellAreaEvent(evnt);
  11771. } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
  11772. this.handleCopyed(true, evnt);
  11773. }
  11774. }
  11775. this.emitEvent('cut', {}, evnt);
  11776. }
  11777. },
  11778. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  11779. this.closeMenu();
  11780. this.recalculate(true);
  11781. this.updateCellAreas();
  11782. },
  11783. handleTooltipLeaveEvent: function handleTooltipLeaveEvent() {
  11784. var _this22 = this;
  11785. var tooltipOpts = this.tooltipOpts;
  11786. setTimeout(function () {
  11787. if (!_this22.tooltipActive) {
  11788. _this22.closeTooltip();
  11789. }
  11790. }, tooltipOpts.leaveDelay);
  11791. },
  11792. handleTargetEnterEvent: function handleTargetEnterEvent() {
  11793. clearTimeout(this.tooltipTimeout);
  11794. this.tooltipActive = true;
  11795. this.closeTooltip();
  11796. },
  11797. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  11798. var _this23 = this;
  11799. var tooltipOpts = this.tooltipOpts;
  11800. this.tooltipActive = false;
  11801. if (tooltipOpts.enterable) {
  11802. this.tooltipTimeout = setTimeout(function () {
  11803. var tooltip = _this23.$refs.tooltip;
  11804. if (tooltip && !tooltip.isHover) {
  11805. _this23.closeTooltip();
  11806. }
  11807. }, tooltipOpts.leaveDelay);
  11808. } else {
  11809. this.closeTooltip();
  11810. }
  11811. },
  11812. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  11813. var column = params.column;
  11814. var titleHelp = column.titleHelp;
  11815. if (titleHelp.content || titleHelp.message) {
  11816. var $refs = this.$refs,
  11817. tooltipStore = this.tooltipStore;
  11818. var tooltip = $refs.tooltip;
  11819. var content = UtilTools.getFuncText(titleHelp.content || titleHelp.message);
  11820. this.handleTargetEnterEvent();
  11821. tooltipStore.visible = true;
  11822. if (tooltip) {
  11823. tooltip.open(evnt.currentTarget, content);
  11824. }
  11825. }
  11826. },
  11827. /**
  11828. * 触发表头 tooltip 事件
  11829. */
  11830. triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) {
  11831. var tooltipStore = this.tooltipStore;
  11832. var column = params.column;
  11833. var titleElem = evnt.currentTarget;
  11834. this.handleTargetEnterEvent();
  11835. if (tooltipStore.column !== column || !tooltipStore.visible) {
  11836. this.handleTooltip(evnt, titleElem, titleElem, null, params);
  11837. }
  11838. },
  11839. /**
  11840. * 触发单元格 tooltip 事件
  11841. */
  11842. triggerBodyTooltipEvent: function triggerBodyTooltipEvent(evnt, params) {
  11843. var editConfig = this.editConfig,
  11844. editOpts = this.editOpts,
  11845. editStore = this.editStore,
  11846. tooltipStore = this.tooltipStore;
  11847. var actived = editStore.actived;
  11848. var row = params.row,
  11849. column = params.column;
  11850. var cell = evnt.currentTarget;
  11851. this.handleTargetEnterEvent();
  11852. if (editConfig) {
  11853. if (editOpts.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) {
  11854. return;
  11855. }
  11856. }
  11857. if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
  11858. var overflowElem;
  11859. var tipElem;
  11860. if (column.treeNode) {
  11861. overflowElem = cell.querySelector('.vxe-tree-cell');
  11862. if (column.type === 'html') {
  11863. tipElem = cell.querySelector('.vxe-cell--html');
  11864. }
  11865. } else {
  11866. tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
  11867. }
  11868. this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
  11869. }
  11870. },
  11871. /**
  11872. * 触发表尾 tooltip 事件
  11873. */
  11874. triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) {
  11875. var tooltipStore = this.tooltipStore;
  11876. var column = params.column;
  11877. var cell = evnt.currentTarget;
  11878. this.handleTargetEnterEvent();
  11879. if (tooltipStore.column !== column || !tooltipStore.visible) {
  11880. this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
  11881. }
  11882. },
  11883. /**
  11884. * 处理显示 tooltip
  11885. * @param {Event} evnt 事件
  11886. * @param {ColumnInfo} column 列配置
  11887. * @param {Row} row 行对象
  11888. */
  11889. handleTooltip: function handleTooltip(evnt, cell, overflowElem, tipElem, params) {
  11890. params.cell = cell;
  11891. var $refs = this.$refs,
  11892. tooltipOpts = this.tooltipOpts,
  11893. tooltipStore = this.tooltipStore;
  11894. var column = params.column,
  11895. row = params.row;
  11896. var showAll = tooltipOpts.showAll,
  11897. enabled = tooltipOpts.enabled,
  11898. contentMethod = tooltipOpts.contentMethod;
  11899. var tooltip = $refs.tooltip;
  11900. var customContent = contentMethod ? contentMethod(params) : null;
  11901. var useCustom = contentMethod && !ctor_amd_xe_utils_default.a.eqNull(customContent);
  11902. var content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
  11903. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  11904. if (content && (showAll || enabled || useCustom || isCellOverflow)) {
  11905. Object.assign(tooltipStore, {
  11906. row: row,
  11907. column: column,
  11908. visible: true
  11909. });
  11910. if (tooltip) {
  11911. tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, UtilTools.formatText(content));
  11912. }
  11913. }
  11914. return this.$nextTick();
  11915. },
  11916. openTooltip: function openTooltip(target, message) {
  11917. var $refs = this.$refs;
  11918. var commTip = $refs.commTip;
  11919. if (commTip) {
  11920. return commTip.open(target, message);
  11921. }
  11922. return this.$nextTick();
  11923. },
  11924. /**
  11925. * 关闭 tooltip
  11926. */
  11927. closeTooltip: function closeTooltip() {
  11928. var tooltip = this.$refs.tooltip;
  11929. var commTip = this.$refs.commTip;
  11930. Object.assign(this.tooltipStore, {
  11931. row: null,
  11932. column: null,
  11933. content: null,
  11934. visible: false
  11935. });
  11936. if (tooltip) {
  11937. tooltip.close();
  11938. }
  11939. if (commTip) {
  11940. commTip.close();
  11941. }
  11942. return this.$nextTick();
  11943. },
  11944. /**
  11945. * 判断列头复选框是否被选中
  11946. */
  11947. isAllCheckboxChecked: function isAllCheckboxChecked() {
  11948. return this.isAllSelected;
  11949. },
  11950. /**
  11951. * 判断列头复选框是否被半选
  11952. */
  11953. isAllCheckboxIndeterminate: function isAllCheckboxIndeterminate() {
  11954. return !this.isAllSelected && this.isIndeterminate;
  11955. },
  11956. isCheckboxIndeterminate: function isCheckboxIndeterminate() {
  11957. UtilTools.warn('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate']);
  11958. return this.isAllCheckboxIndeterminate();
  11959. },
  11960. /**
  11961. * 获取复选框半选状态的行数据
  11962. */
  11963. getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords() {
  11964. var treeConfig = this.treeConfig,
  11965. treeIndeterminates = this.treeIndeterminates;
  11966. if (treeConfig) {
  11967. return treeIndeterminates.slice(0);
  11968. }
  11969. return [];
  11970. },
  11971. /**
  11972. * 处理默认勾选
  11973. */
  11974. handleDefaultSelectionChecked: function handleDefaultSelectionChecked() {
  11975. var fullDataRowIdData = this.fullDataRowIdData,
  11976. checkboxOpts = this.checkboxOpts;
  11977. var checkAll = checkboxOpts.checkAll,
  11978. checkRowKeys = checkboxOpts.checkRowKeys;
  11979. if (checkAll) {
  11980. this.setAllCheckboxRow(true);
  11981. } else if (checkRowKeys) {
  11982. var defSelection = [];
  11983. checkRowKeys.forEach(function (rowid) {
  11984. if (fullDataRowIdData[rowid]) {
  11985. defSelection.push(fullDataRowIdData[rowid].row);
  11986. }
  11987. });
  11988. this.setCheckboxRow(defSelection, true);
  11989. }
  11990. },
  11991. // 在 v3.0 中废弃 setSelection
  11992. setSelection: function setSelection(rows, value) {
  11993. UtilTools.warn('vxe.error.delFunc', ['setSelection', 'setCheckboxRow']);
  11994. return this.setCheckboxRow(rows, value);
  11995. },
  11996. /**
  11997. * 用于多选行,设置行为选中状态,第二个参数为选中与否
  11998. * @param {Array/Row} rows 行数据
  11999. * @param {Boolean} value 是否选中
  12000. */
  12001. setCheckboxRow: function setCheckboxRow(rows, value) {
  12002. var _this24 = this;
  12003. if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
  12004. rows = [rows];
  12005. }
  12006. rows.forEach(function (row) {
  12007. return _this24.handleSelectRow({
  12008. row: row
  12009. }, !!value);
  12010. });
  12011. return this.$nextTick();
  12012. },
  12013. isCheckedByRow: function isCheckedByRow(row) {
  12014. UtilTools.warn('vxe.error.delFunc', ['isCheckedByRow', 'isCheckedByCheckboxRow']);
  12015. return this.isCheckedByCheckboxRow(row);
  12016. },
  12017. isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
  12018. var property = this.checkboxOpts.checkField;
  12019. if (property) {
  12020. return ctor_amd_xe_utils_default.a.get(row, property);
  12021. }
  12022. return this.selection.indexOf(row) > -1;
  12023. },
  12024. /**
  12025. * 多选,行选中事件
  12026. * value 选中true 不选false 不确定-1
  12027. */
  12028. handleSelectRow: function handleSelectRow(_ref4, value) {
  12029. var _this25 = this;
  12030. var row = _ref4.row;
  12031. var selection = this.selection,
  12032. afterFullData = this.afterFullData,
  12033. treeConfig = this.treeConfig,
  12034. treeOpts = this.treeOpts,
  12035. treeIndeterminates = this.treeIndeterminates,
  12036. checkboxOpts = this.checkboxOpts;
  12037. var property = checkboxOpts.checkField,
  12038. checkStrictly = checkboxOpts.checkStrictly,
  12039. checkMethod = checkboxOpts.checkMethod;
  12040. if (property) {
  12041. if (treeConfig && !checkStrictly) {
  12042. if (value === -1) {
  12043. if (treeIndeterminates.indexOf(row) === -1) {
  12044. treeIndeterminates.push(row);
  12045. }
  12046. ctor_amd_xe_utils_default.a.set(row, property, false);
  12047. } else {
  12048. // 更新子节点状态
  12049. ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
  12050. if (row === item || !checkMethod || checkMethod({
  12051. row: item
  12052. })) {
  12053. ctor_amd_xe_utils_default.a.set(item, property, value);
  12054. ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12055. return half === item;
  12056. });
  12057. _this25.handleCheckboxReserveRow(row, value);
  12058. }
  12059. }, treeOpts);
  12060. } // 如果存在父节点,更新父节点状态
  12061. var matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12062. return item === row;
  12063. }, treeOpts);
  12064. if (matchObj && matchObj.parent) {
  12065. var parentStatus;
  12066. var vItems = checkMethod ? matchObj.items.filter(function (item) {
  12067. return checkMethod({
  12068. row: item
  12069. });
  12070. }) : matchObj.items;
  12071. var indeterminatesItem = ctor_amd_xe_utils_default.a.find(matchObj.items, function (item) {
  12072. return treeIndeterminates.indexOf(item) > -1;
  12073. });
  12074. if (indeterminatesItem) {
  12075. parentStatus = -1;
  12076. } else {
  12077. var selectItems = matchObj.items.filter(function (item) {
  12078. return ctor_amd_xe_utils_default.a.get(item, property);
  12079. });
  12080. parentStatus = selectItems.filter(function (item) {
  12081. return vItems.indexOf(item) > -1;
  12082. }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
  12083. }
  12084. return this.handleSelectRow({
  12085. row: matchObj.parent
  12086. }, parentStatus);
  12087. }
  12088. } else {
  12089. if (!checkMethod || checkMethod({
  12090. row: row
  12091. })) {
  12092. ctor_amd_xe_utils_default.a.set(row, property, value);
  12093. this.handleCheckboxReserveRow(row, value);
  12094. }
  12095. }
  12096. } else {
  12097. if (treeConfig && !checkStrictly) {
  12098. if (value === -1) {
  12099. if (treeIndeterminates.indexOf(row) === -1) {
  12100. treeIndeterminates.push(row);
  12101. }
  12102. ctor_amd_xe_utils_default.a.remove(selection, function (item) {
  12103. return item === row;
  12104. });
  12105. } else {
  12106. // 更新子节点状态
  12107. ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
  12108. if (row === item || !checkMethod || checkMethod({
  12109. row: item
  12110. })) {
  12111. if (value) {
  12112. selection.push(item);
  12113. } else {
  12114. ctor_amd_xe_utils_default.a.remove(selection, function (select) {
  12115. return select === item;
  12116. });
  12117. }
  12118. ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12119. return half === item;
  12120. });
  12121. _this25.handleCheckboxReserveRow(row, value);
  12122. }
  12123. }, treeOpts);
  12124. } // 如果存在父节点,更新父节点状态
  12125. var _matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12126. return item === row;
  12127. }, treeOpts);
  12128. if (_matchObj && _matchObj.parent) {
  12129. var _parentStatus;
  12130. var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
  12131. return checkMethod({
  12132. row: item
  12133. });
  12134. }) : _matchObj.items;
  12135. var _indeterminatesItem = ctor_amd_xe_utils_default.a.find(_matchObj.items, function (item) {
  12136. return treeIndeterminates.indexOf(item) > -1;
  12137. });
  12138. if (_indeterminatesItem) {
  12139. _parentStatus = -1;
  12140. } else {
  12141. var _selectItems = _matchObj.items.filter(function (item) {
  12142. return selection.indexOf(item) > -1;
  12143. });
  12144. _parentStatus = _selectItems.filter(function (item) {
  12145. return _vItems.indexOf(item) > -1;
  12146. }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
  12147. }
  12148. return this.handleSelectRow({
  12149. row: _matchObj.parent
  12150. }, _parentStatus);
  12151. }
  12152. } else {
  12153. if (!checkMethod || checkMethod({
  12154. row: row
  12155. })) {
  12156. if (value) {
  12157. if (selection.indexOf(row) === -1) {
  12158. selection.push(row);
  12159. }
  12160. } else {
  12161. ctor_amd_xe_utils_default.a.remove(selection, function (item) {
  12162. return item === row;
  12163. });
  12164. }
  12165. this.handleCheckboxReserveRow(row, value);
  12166. }
  12167. }
  12168. }
  12169. this.checkSelectionStatus();
  12170. },
  12171. handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
  12172. var selection = this.selection,
  12173. checkboxOpts = this.checkboxOpts;
  12174. var property = checkboxOpts.checkField;
  12175. var row = params.row;
  12176. var value = property ? !ctor_amd_xe_utils_default.a.get(row, property) : selection.indexOf(row) === -1;
  12177. if (evnt) {
  12178. this.triggerCheckRowEvent(evnt, params, value);
  12179. } else {
  12180. this.handleSelectRow(params, value);
  12181. }
  12182. },
  12183. triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
  12184. var checkMethod = this.checkboxOpts.checkMethod;
  12185. if (!checkMethod || checkMethod({
  12186. row: params.row
  12187. })) {
  12188. this.handleSelectRow(params, value);
  12189. var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-change
  12190. if (this.$listeners['select-change']) {
  12191. UtilTools.warn('vxe.error.delEvent', ['select-change', 'checkbox-change']);
  12192. this.emitEvent('select-change', Object.assign({
  12193. records: records,
  12194. selection: records,
  12195. reserves: this.getCheckboxReserveRecords(),
  12196. checked: value
  12197. }, params), evnt);
  12198. } else {
  12199. this.emitEvent('checkbox-change', Object.assign({
  12200. records: records,
  12201. selection: records,
  12202. reserves: this.getCheckboxReserveRecords(),
  12203. indeterminates: this.getCheckboxIndeterminateRecords(),
  12204. checked: value
  12205. }, params), evnt);
  12206. }
  12207. }
  12208. },
  12209. // 在 v3.0 中废弃 toggleRowSelection
  12210. toggleRowSelection: function toggleRowSelection(row) {
  12211. UtilTools.warn('vxe.error.delFunc', ['toggleRowSelection', 'toggleCheckboxRow']);
  12212. return this.toggleCheckboxRow(row);
  12213. },
  12214. /**
  12215. * 多选,切换某一行的选中状态
  12216. */
  12217. toggleCheckboxRow: function toggleCheckboxRow(row) {
  12218. this.handleToggleCheckRowEvent(null, {
  12219. row: row
  12220. });
  12221. return this.$nextTick();
  12222. },
  12223. // 在 v3.0 中废弃 setAllSelection
  12224. setAllSelection: function setAllSelection(value) {
  12225. UtilTools.warn('vxe.error.delFunc', ['setAllSelection', 'setAllCheckboxRow']);
  12226. return this.setAllCheckboxRow(value);
  12227. },
  12228. /**
  12229. * 用于多选行,设置所有行的选中状态
  12230. * @param {Boolean} value 是否选中
  12231. */
  12232. setAllCheckboxRow: function setAllCheckboxRow(value) {
  12233. var _this26 = this;
  12234. var afterFullData = this.afterFullData,
  12235. treeConfig = this.treeConfig,
  12236. treeOpts = this.treeOpts,
  12237. selection = this.selection,
  12238. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12239. checkboxOpts = this.checkboxOpts;
  12240. var property = checkboxOpts.checkField,
  12241. reserve = checkboxOpts.reserve,
  12242. checkStrictly = checkboxOpts.checkStrictly,
  12243. checkMethod = checkboxOpts.checkMethod;
  12244. var selectRows = [];
  12245. var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
  12246. return afterFullData.indexOf(row) === -1;
  12247. });
  12248. if (checkStrictly) {
  12249. this.isAllSelected = value;
  12250. } else {
  12251. /**
  12252. * 绑定属性方式(高性能,有污染)
  12253. * 必须在行数据存在对应的属性,否则将不响应
  12254. */
  12255. if (property) {
  12256. var checkValFn = function checkValFn(row) {
  12257. if (!checkMethod || checkMethod({
  12258. row: row
  12259. })) {
  12260. if (value) {
  12261. selectRows.push(row);
  12262. }
  12263. ctor_amd_xe_utils_default.a.set(row, property, value);
  12264. }
  12265. }; // 如果存在选中方法
  12266. // 如果方法成立,则更新值,否则忽略该数据
  12267. if (treeConfig) {
  12268. ctor_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
  12269. } else {
  12270. afterFullData.forEach(checkValFn);
  12271. }
  12272. } else {
  12273. /**
  12274. * 默认方式(低性能,无污染)
  12275. * 无需任何属性,直接绑定
  12276. */
  12277. if (treeConfig) {
  12278. if (value) {
  12279. /**
  12280. * 如果是树勾选
  12281. * 如果方法成立,则添加到临时集合中
  12282. */
  12283. ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12284. if (!checkMethod || checkMethod({
  12285. row: row
  12286. })) {
  12287. selectRows.push(row);
  12288. }
  12289. }, treeOpts);
  12290. } else {
  12291. /**
  12292. * 如果是树取消
  12293. * 如果方法成立,则不添加到临时集合中
  12294. */
  12295. if (checkMethod) {
  12296. ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12297. if (checkMethod({
  12298. row: row
  12299. }) ? 0 : selection.indexOf(row) > -1) {
  12300. selectRows.push(row);
  12301. }
  12302. }, treeOpts);
  12303. }
  12304. }
  12305. } else {
  12306. if (value) {
  12307. /**
  12308. * 如果是行勾选
  12309. * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
  12310. * 如果不存在选中方法,则添加所有数据到临时集合中
  12311. */
  12312. if (checkMethod) {
  12313. selectRows = afterFullData.filter(function (row) {
  12314. return selection.indexOf(row) > -1 || checkMethod({
  12315. row: row
  12316. });
  12317. });
  12318. } else {
  12319. selectRows = afterFullData.slice(0);
  12320. }
  12321. } else {
  12322. /**
  12323. * 如果是行取消
  12324. * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
  12325. * 如果不存在选中方法,无需处理,临时集合默认为空
  12326. */
  12327. if (checkMethod) {
  12328. selectRows = afterFullData.filter(function (row) {
  12329. return checkMethod({
  12330. row: row
  12331. }) ? 0 : selection.indexOf(row) > -1;
  12332. });
  12333. }
  12334. }
  12335. }
  12336. }
  12337. if (reserve) {
  12338. if (value) {
  12339. selectRows.forEach(function (row) {
  12340. checkboxReserveRowMap[methods_getRowid(_this26, row)] = row;
  12341. });
  12342. } else {
  12343. afterFullData.forEach(function (row) {
  12344. return _this26.handleCheckboxReserveRow(row, false);
  12345. });
  12346. }
  12347. }
  12348. this.selection = property ? [] : beforeSelection.concat(selectRows);
  12349. }
  12350. this.treeIndeterminates = [];
  12351. this.checkSelectionStatus();
  12352. },
  12353. checkSelectionStatus: function checkSelectionStatus() {
  12354. var afterFullData = this.afterFullData,
  12355. selection = this.selection,
  12356. treeIndeterminates = this.treeIndeterminates,
  12357. checkboxOpts = this.checkboxOpts,
  12358. treeConfig = this.treeConfig;
  12359. var checkField = checkboxOpts.checkField,
  12360. halfField = checkboxOpts.halfField,
  12361. checkStrictly = checkboxOpts.checkStrictly,
  12362. checkMethod = checkboxOpts.checkMethod;
  12363. if (!checkStrictly) {
  12364. var isAllSelected = false;
  12365. var isIndeterminate = false;
  12366. if (checkField) {
  12367. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12368. return !checkMethod({
  12369. row: row
  12370. }) || ctor_amd_xe_utils_default.a.get(row, checkField);
  12371. } : function (row) {
  12372. return ctor_amd_xe_utils_default.a.get(row, checkField);
  12373. });
  12374. if (treeConfig) {
  12375. if (halfField) {
  12376. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12377. return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
  12378. });
  12379. } else {
  12380. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12381. return ctor_amd_xe_utils_default.a.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
  12382. });
  12383. }
  12384. } else {
  12385. if (halfField) {
  12386. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12387. return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField);
  12388. });
  12389. } else {
  12390. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12391. return ctor_amd_xe_utils_default.a.get(row, checkField);
  12392. });
  12393. }
  12394. }
  12395. } else {
  12396. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12397. return !checkMethod({
  12398. row: row
  12399. }) || selection.indexOf(row) > -1;
  12400. } : function (row) {
  12401. return selection.indexOf(row) > -1;
  12402. });
  12403. if (treeConfig) {
  12404. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12405. return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1;
  12406. });
  12407. } else {
  12408. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12409. return selection.indexOf(row) > -1;
  12410. });
  12411. }
  12412. }
  12413. this.isAllSelected = isAllSelected;
  12414. this.isIndeterminate = isIndeterminate;
  12415. }
  12416. },
  12417. // 还原展开、选中等相关状态
  12418. handleReserveStatus: function handleReserveStatus() {
  12419. var expandColumn = this.expandColumn,
  12420. treeOpts = this.treeOpts,
  12421. treeConfig = this.treeConfig,
  12422. fullDataRowIdData = this.fullDataRowIdData,
  12423. fullAllDataRowMap = this.fullAllDataRowMap,
  12424. currentRow = this.currentRow,
  12425. selectRow = this.selectRow,
  12426. radioReserveRow = this.radioReserveRow,
  12427. radioOpts = this.radioOpts,
  12428. checkboxOpts = this.checkboxOpts,
  12429. selection = this.selection,
  12430. rowExpandeds = this.rowExpandeds,
  12431. treeExpandeds = this.treeExpandeds,
  12432. expandOpts = this.expandOpts; // 单选框
  12433. if (selectRow && !fullAllDataRowMap.has(selectRow)) {
  12434. this.selectRow = null; // 刷新单选行状态
  12435. } // 还原保留选中状态
  12436. if (radioOpts.reserve && radioReserveRow) {
  12437. var rowid = methods_getRowid(this, radioReserveRow);
  12438. if (fullDataRowIdData[rowid]) {
  12439. this.setRadioRow(fullDataRowIdData[rowid].row);
  12440. }
  12441. } // 复选框
  12442. this.selection = getRecoverRow(this, selection); // 刷新多选行状态
  12443. // 还原保留选中状态
  12444. if (checkboxOpts.reserve) {
  12445. this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
  12446. }
  12447. if (currentRow && !fullAllDataRowMap.has(currentRow)) {
  12448. this.currentRow = null; // 刷新当前行状态
  12449. } // 行展开
  12450. this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
  12451. // 还原保留状态
  12452. if (expandColumn && expandOpts.reserve) {
  12453. this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
  12454. } // 树展开
  12455. this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
  12456. if (treeConfig && treeOpts.reserve) {
  12457. this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
  12458. }
  12459. },
  12460. /**
  12461. * 获取单选框保留选中的行
  12462. */
  12463. getRadioReserveRecord: function getRadioReserveRecord() {
  12464. var fullDataRowIdData = this.fullDataRowIdData,
  12465. radioReserveRow = this.radioReserveRow,
  12466. radioOpts = this.radioOpts;
  12467. if (radioOpts.reserve && radioReserveRow) {
  12468. if (!fullDataRowIdData[methods_getRowid(this, radioReserveRow)]) {
  12469. return radioReserveRow;
  12470. }
  12471. }
  12472. return null;
  12473. },
  12474. clearRadioReserve: function clearRadioReserve() {
  12475. this.radioReserveRow = null;
  12476. return this.$nextTick();
  12477. },
  12478. handleRadioReserveRow: function handleRadioReserveRow(row) {
  12479. var radioOpts = this.radioOpts;
  12480. if (radioOpts.reserve) {
  12481. this.radioReserveRow = row;
  12482. }
  12483. },
  12484. // 在 v3.0 中废弃 getSelectReserveRecords
  12485. getSelectReserveRecords: function getSelectReserveRecords() {
  12486. UtilTools.warn('vxe.error.delFunc', ['getSelectReserveRecords', 'getCheckboxReserveRecords']);
  12487. return this.getCheckboxReserveRecords();
  12488. },
  12489. /**
  12490. * 获取保留选中的行
  12491. */
  12492. getCheckboxReserveRecords: function getCheckboxReserveRecords() {
  12493. var fullDataRowIdData = this.fullDataRowIdData,
  12494. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12495. checkboxOpts = this.checkboxOpts;
  12496. var reserveSelection = [];
  12497. if (checkboxOpts.reserve) {
  12498. Object.keys(checkboxReserveRowMap).forEach(function (rowid) {
  12499. if (!fullDataRowIdData[rowid]) {
  12500. reserveSelection.push(checkboxReserveRowMap[rowid]);
  12501. }
  12502. });
  12503. }
  12504. return reserveSelection;
  12505. },
  12506. // 在 v3.0 中废弃 clearSelectReserve
  12507. clearSelectReserve: function clearSelectReserve() {
  12508. UtilTools.warn('vxe.error.delFunc', ['clearSelectReserve', 'clearCheckboxReserve']);
  12509. return this.clearCheckboxReserve();
  12510. },
  12511. clearCheckboxReserve: function clearCheckboxReserve() {
  12512. this.checkboxReserveRowMap = {};
  12513. return this.$nextTick();
  12514. },
  12515. handleCheckboxReserveRow: function handleCheckboxReserveRow(row, checked) {
  12516. var checkboxReserveRowMap = this.checkboxReserveRowMap,
  12517. checkboxOpts = this.checkboxOpts;
  12518. if (checkboxOpts.reserve) {
  12519. var rowid = methods_getRowid(this, row);
  12520. if (checked) {
  12521. checkboxReserveRowMap[rowid] = row;
  12522. } else if (checkboxReserveRowMap[rowid]) {
  12523. delete checkboxReserveRowMap[rowid];
  12524. }
  12525. }
  12526. },
  12527. /**
  12528. * 多选,选中所有事件
  12529. */
  12530. triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
  12531. this.setAllCheckboxRow(value);
  12532. var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-all
  12533. if (this.$listeners['select-all']) {
  12534. UtilTools.warn('vxe.error.delEvent', ['select-all', 'checkbox-all']);
  12535. this.emitEvent('select-all', {
  12536. records: records,
  12537. selection: records,
  12538. reserves: this.getCheckboxReserveRecords(),
  12539. checked: value
  12540. }, evnt);
  12541. } else {
  12542. this.emitEvent('checkbox-all', {
  12543. records: records,
  12544. selection: records,
  12545. reserves: this.getCheckboxReserveRecords(),
  12546. indeterminates: this.getCheckboxIndeterminateRecords(),
  12547. checked: value
  12548. }, evnt);
  12549. }
  12550. },
  12551. // 在 v3.0 中废弃 toggleAllSelection
  12552. toggleAllSelection: function toggleAllSelection() {
  12553. UtilTools.warn('vxe.error.delFunc', ['toggleAllSelection', 'toggleAllCheckboxRow']);
  12554. return this.toggleAllCheckboxRow();
  12555. },
  12556. /**
  12557. * 多选,切换所有行的选中状态
  12558. */
  12559. toggleAllCheckboxRow: function toggleAllCheckboxRow() {
  12560. this.triggerCheckAllEvent(null, !this.isAllSelected);
  12561. return this.$nextTick();
  12562. },
  12563. // 在 v3.0 中废弃 clearSelection
  12564. clearSelection: function clearSelection() {
  12565. UtilTools.warn('vxe.error.delFunc', ['clearSelection', 'clearCheckboxRow']);
  12566. return this.clearCheckboxRow();
  12567. },
  12568. /**
  12569. * 用于多选行,手动清空用户的选择
  12570. * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
  12571. */
  12572. clearCheckboxRow: function clearCheckboxRow() {
  12573. var _this27 = this;
  12574. var tableFullData = this.tableFullData,
  12575. treeConfig = this.treeConfig,
  12576. treeOpts = this.treeOpts,
  12577. checkboxOpts = this.checkboxOpts;
  12578. var property = checkboxOpts.checkField,
  12579. reserve = checkboxOpts.reserve;
  12580. if (property) {
  12581. if (treeConfig) {
  12582. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
  12583. return ctor_amd_xe_utils_default.a.set(item, property, false);
  12584. }, treeOpts);
  12585. } else {
  12586. tableFullData.forEach(function (item) {
  12587. return ctor_amd_xe_utils_default.a.set(item, property, false);
  12588. });
  12589. }
  12590. }
  12591. if (reserve) {
  12592. tableFullData.forEach(function (row) {
  12593. return _this27.handleCheckboxReserveRow(row, false);
  12594. });
  12595. }
  12596. this.isAllSelected = false;
  12597. this.isIndeterminate = false;
  12598. this.selection = [];
  12599. this.treeIndeterminates = [];
  12600. return this.$nextTick();
  12601. },
  12602. /**
  12603. * 处理单选框默认勾选
  12604. */
  12605. handleDefaultRadioChecked: function handleDefaultRadioChecked() {
  12606. var radioOpts = this.radioOpts,
  12607. fullDataRowIdData = this.fullDataRowIdData;
  12608. var rowid = radioOpts.checkRowKey,
  12609. reserve = radioOpts.reserve;
  12610. if (rowid) {
  12611. if (fullDataRowIdData[rowid]) {
  12612. this.setRadioRow(fullDataRowIdData[rowid].row);
  12613. }
  12614. if (reserve) {
  12615. var rowkey = getRowkey(this);
  12616. this.radioReserveRow = _defineProperty({}, rowkey, rowid);
  12617. }
  12618. }
  12619. },
  12620. /**
  12621. * 单选,行选中事件
  12622. */
  12623. triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
  12624. var isChange = this.selectRow !== params.row;
  12625. this.setRadioRow(params.row);
  12626. if (isChange) {
  12627. this.emitEvent('radio-change', params, evnt);
  12628. }
  12629. },
  12630. triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) {
  12631. var isChange = this.currentRow !== params.row;
  12632. this.setCurrentRow(params.row);
  12633. if (isChange) {
  12634. this.emitEvent('current-change', params, evnt);
  12635. }
  12636. },
  12637. /**
  12638. * 用于当前行,设置某一行为高亮状态
  12639. * @param {Row} row 行对象
  12640. */
  12641. setCurrentRow: function setCurrentRow(row) {
  12642. this.clearCurrentRow();
  12643. this.clearCurrentColumn();
  12644. this.currentRow = row;
  12645. if (this.highlightCurrentRow) {
  12646. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(methods_getRowid(this, row), "\"]")), function (elem) {
  12647. return addClass(elem, 'row--current');
  12648. });
  12649. }
  12650. return this.$nextTick();
  12651. },
  12652. isCheckedByRadioRow: function isCheckedByRadioRow(row) {
  12653. return this.selectRow === row;
  12654. },
  12655. /**
  12656. * 用于单选行,设置某一行为选中状态
  12657. * @param {Row} row 行对象
  12658. */
  12659. setRadioRow: function setRadioRow(row) {
  12660. var radioOpts = this.radioOpts;
  12661. var checkMethod = radioOpts.checkMethod;
  12662. if (row && (!checkMethod || checkMethod({
  12663. row: row
  12664. }))) {
  12665. this.selectRow = row;
  12666. this.handleRadioReserveRow(row);
  12667. }
  12668. return this.$nextTick();
  12669. },
  12670. /**
  12671. * 用于当前行,手动清空当前高亮的状态
  12672. */
  12673. clearCurrentRow: function clearCurrentRow() {
  12674. this.currentRow = null;
  12675. this.hoverRow = null;
  12676. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) {
  12677. return removeClass(elem, 'row--current');
  12678. });
  12679. return this.$nextTick();
  12680. },
  12681. /**
  12682. * 用于单选行,手动清空用户的选择
  12683. */
  12684. clearRadioRow: function clearRadioRow() {
  12685. this.selectRow = null;
  12686. return this.$nextTick();
  12687. },
  12688. // 在 v3.0 中废弃 getCurrentRow
  12689. getCurrentRow: function getCurrentRow() {
  12690. UtilTools.warn('vxe.error.delFunc', ['getCurrentRow', 'getCurrentRecord']);
  12691. return this.getCurrentRecord();
  12692. },
  12693. /**
  12694. * 用于当前行,获取当前行的数据
  12695. */
  12696. getCurrentRecord: function getCurrentRecord() {
  12697. return this.highlightCurrentRow ? this.currentRow : null;
  12698. },
  12699. // 在 v3.0 中废弃 getRadioRow
  12700. getRadioRow: function getRadioRow() {
  12701. UtilTools.warn('vxe.error.delFunc', ['getRadioRow', 'getRadioRecord']);
  12702. return this.getRadioRecord();
  12703. },
  12704. /**
  12705. * 用于单选行,获取当已选中的数据
  12706. */
  12707. getRadioRecord: function getRadioRecord() {
  12708. return this.selectRow;
  12709. },
  12710. /**
  12711. * 行 hover 事件
  12712. */
  12713. triggerHoverEvent: function triggerHoverEvent(evnt, _ref5) {
  12714. var row = _ref5.row;
  12715. this.setHoverRow(row);
  12716. },
  12717. setHoverRow: function setHoverRow(row) {
  12718. var rowid = methods_getRowid(this, row);
  12719. this.clearHoverRow();
  12720. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(rowid, "\"]")), function (elem) {
  12721. return addClass(elem, 'row--hover');
  12722. });
  12723. this.hoverRow = row;
  12724. },
  12725. clearHoverRow: function clearHoverRow() {
  12726. ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
  12727. return removeClass(elem, 'row--hover');
  12728. });
  12729. this.hoverRow = null;
  12730. },
  12731. triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) {
  12732. var _lastResizeTime = this._lastResizeTime,
  12733. sortOpts = this.sortOpts;
  12734. var column = params.column;
  12735. var cell = evnt.currentTarget;
  12736. var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300;
  12737. var triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  12738. var triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  12739. if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
  12740. this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
  12741. }
  12742. this.emitEvent('header-cell-click', Object.assign({
  12743. triggerResizable: triggerResizable,
  12744. triggerSort: triggerSort,
  12745. triggerFilter: triggerFilter,
  12746. cell: cell
  12747. }, params), evnt);
  12748. if (this.highlightCurrentColumn) {
  12749. return this.setCurrentColumn(column);
  12750. }
  12751. return this.$nextTick();
  12752. },
  12753. triggerHeaderCellDBLClickEvent: function triggerHeaderCellDBLClickEvent(evnt, params) {
  12754. this.emitEvent('header-cell-dblclick', Object.assign({
  12755. cell: evnt.currentTarget
  12756. }, params), evnt);
  12757. },
  12758. getCurrentColumn: function getCurrentColumn() {
  12759. return this.highlightCurrentColumn ? this.currentColumn : null;
  12760. },
  12761. /**
  12762. * 用于当前列,设置某列行为高亮状态
  12763. * @param {ColumnInfo} column 列配置
  12764. */
  12765. setCurrentColumn: function setCurrentColumn(column) {
  12766. this.clearCurrentRow();
  12767. this.clearCurrentColumn();
  12768. this.currentColumn = column;
  12769. return this.$nextTick();
  12770. },
  12771. /**
  12772. * 用于当前列,手动清空当前高亮的状态
  12773. */
  12774. clearCurrentColumn: function clearCurrentColumn() {
  12775. this.currentColumn = null;
  12776. return this.$nextTick();
  12777. },
  12778. checkValidate: function checkValidate(type) {
  12779. if (v_x_e_table._valid) {
  12780. return this.triggerValidate(type);
  12781. }
  12782. return this.$nextTick();
  12783. },
  12784. /**
  12785. * 当单元格发生改变时
  12786. * 如果存在规则,则校验
  12787. */
  12788. handleChangeCell: function handleChangeCell(evnt, params) {
  12789. var _this28 = this;
  12790. this.checkValidate('blur').catch(function (e) {
  12791. return e;
  12792. }).then(function () {
  12793. _this28.handleActived(params, evnt).then(function () {
  12794. return _this28.checkValidate('change');
  12795. }).catch(function (e) {
  12796. return e;
  12797. });
  12798. });
  12799. },
  12800. /**
  12801. * 列点击事件
  12802. * 如果是单击模式,则激活为编辑状态
  12803. * 如果是双击模式,则单击后选中状态
  12804. */
  12805. triggerCellClickEvent: function triggerCellClickEvent(evnt, params) {
  12806. var highlightCurrentRow = this.highlightCurrentRow,
  12807. editStore = this.editStore,
  12808. radioOpts = this.radioOpts,
  12809. expandOpts = this.expandOpts,
  12810. treeOpts = this.treeOpts,
  12811. editConfig = this.editConfig,
  12812. editOpts = this.editOpts,
  12813. checkboxOpts = this.checkboxOpts,
  12814. mouseConfig = this.mouseConfig,
  12815. mouseOpts = this.mouseOpts;
  12816. var actived = editStore.actived;
  12817. var _params = params,
  12818. row = _params.row,
  12819. column = _params.column;
  12820. var type = column.type,
  12821. treeNode = column.treeNode;
  12822. var isRadioType = type === 'radio'; // 在 v3.0 中废弃 selection
  12823. var isCheckboxType = type === 'checkbox' || type === 'selection';
  12824. var isExpandType = type === 'expand';
  12825. var cell = evnt.currentTarget;
  12826. var triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
  12827. var triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
  12828. var triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
  12829. var triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
  12830. params = Object.assign({
  12831. cell: cell,
  12832. triggerRadio: triggerRadio,
  12833. triggerCheckbox: triggerCheckbox,
  12834. triggerTreeNode: triggerTreeNode,
  12835. triggerExpandNode: triggerExpandNode
  12836. }, params); // 在 v3.0 中废弃 mouse-config.checked
  12837. var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是展开行
  12838. if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
  12839. this.triggerRowExpandEvent(evnt, params);
  12840. } // 如果是树形表格
  12841. if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
  12842. this.triggerTreeExpandEvent(evnt, params);
  12843. } // 如果点击了树节点
  12844. if (!triggerTreeNode) {
  12845. if (!triggerExpandNode) {
  12846. // 如果是高亮行
  12847. if (highlightCurrentRow) {
  12848. if (!triggerCheckbox && !triggerRadio) {
  12849. this.triggerCurrentRowEvent(evnt, params);
  12850. }
  12851. } // 如果是单选框
  12852. if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
  12853. this.triggerRadioRowEvent(evnt, params);
  12854. } // 如果是复选框
  12855. if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
  12856. this.handleToggleCheckRowEvent(evnt, params);
  12857. }
  12858. } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
  12859. if (!isMouseChecked) {
  12860. if (editConfig) {
  12861. if (editOpts.trigger === 'manual') {
  12862. if (actived.args && actived.row === row && column !== actived.column) {
  12863. this.handleChangeCell(evnt, params);
  12864. }
  12865. } else if (!actived.args || row !== actived.row || column !== actived.column) {
  12866. if (editOpts.trigger === 'click') {
  12867. this.handleChangeCell(evnt, params);
  12868. } else if (editOpts.trigger === 'dblclick') {
  12869. if (editOpts.mode === 'row' && actived.row === row) {
  12870. this.handleChangeCell(evnt, params);
  12871. }
  12872. }
  12873. }
  12874. }
  12875. }
  12876. }
  12877. this.emitEvent('cell-click', params, evnt);
  12878. },
  12879. /**
  12880. * 列双击点击事件
  12881. * 如果是双击模式,则激活为编辑状态
  12882. */
  12883. triggerCellDBLClickEvent: function triggerCellDBLClickEvent(evnt, params) {
  12884. var _this29 = this;
  12885. var editStore = this.editStore,
  12886. editConfig = this.editConfig,
  12887. editOpts = this.editOpts;
  12888. var actived = editStore.actived;
  12889. var cell = evnt.currentTarget;
  12890. params.cell = cell;
  12891. if (editConfig && editOpts.trigger === 'dblclick') {
  12892. if (!actived.args || evnt.currentTarget !== actived.args.cell) {
  12893. if (editOpts.mode === 'row') {
  12894. this.checkValidate('blur').catch(function (e) {
  12895. return e;
  12896. }).then(function () {
  12897. _this29.handleActived(params, evnt).then(function () {
  12898. return _this29.checkValidate('change');
  12899. }).catch(function (e) {
  12900. return e;
  12901. });
  12902. });
  12903. } else if (editOpts.mode === 'cell') {
  12904. this.handleActived(params, evnt).then(function () {
  12905. return _this29.checkValidate('change');
  12906. }).catch(function (e) {
  12907. return e;
  12908. });
  12909. }
  12910. }
  12911. }
  12912. this.emitEvent('cell-dblclick', params, evnt);
  12913. },
  12914. handleDefaultSort: function handleDefaultSort() {
  12915. var defaultSort = this.sortOpts.defaultSort;
  12916. if (defaultSort) {
  12917. var field = defaultSort.field,
  12918. order = defaultSort.order;
  12919. if (field && order) {
  12920. var column = ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (item) {
  12921. return item.property === field;
  12922. });
  12923. if (column && !column.order) {
  12924. this.sort(field, order);
  12925. }
  12926. }
  12927. }
  12928. },
  12929. /**
  12930. * 点击排序事件
  12931. */
  12932. triggerSortEvent: function triggerSortEvent(evnt, column, order) {
  12933. var property = column.property;
  12934. if (column.sortable || column.remoteSort) {
  12935. if (!order || column.order === order) {
  12936. this.clearSort();
  12937. } else {
  12938. this.sort(property, order);
  12939. }
  12940. var params = {
  12941. column: column,
  12942. property: property,
  12943. order: column.order,
  12944. sortBy: column.sortBy,
  12945. sortList: this.getSortColumns()
  12946. };
  12947. this.emitEvent('sort-change', params, evnt);
  12948. }
  12949. },
  12950. sort: function sort(field, order) {
  12951. var tableFullColumn = this.tableFullColumn,
  12952. sortOpts = this.sortOpts;
  12953. var column = this.getColumnByField(field);
  12954. if (column) {
  12955. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote;
  12956. if (column.sortable || column.remoteSort) {
  12957. if (arguments.length <= 1) {
  12958. order = getNextSortOrder(this, column);
  12959. }
  12960. if (column.order !== order) {
  12961. tableFullColumn.forEach(function (column) {
  12962. column.order = null;
  12963. });
  12964. column.order = order; // 如果是服务端排序,则跳过本地排序处理
  12965. if (!isRemote) {
  12966. this.handleTableData(true);
  12967. }
  12968. }
  12969. return this.$nextTick().then(this.updateStyle);
  12970. }
  12971. }
  12972. return this.$nextTick();
  12973. },
  12974. /**
  12975. * 手动清空排序条件,数据会恢复成未排序的状态
  12976. */
  12977. clearSort: function clearSort() {
  12978. this.tableFullColumn.forEach(function (column) {
  12979. column.order = null;
  12980. });
  12981. return this.handleTableData(true);
  12982. },
  12983. // 在 v3 中废弃
  12984. getSortColumn: function getSortColumn() {
  12985. // UtilTools.warn('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
  12986. return ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (column) {
  12987. return (column.sortable || column.remoteSort) && column.order;
  12988. });
  12989. },
  12990. isSort: function isSort(field) {
  12991. if (field) {
  12992. var column = this.getColumnByField(field);
  12993. return column && (column.sortable || column.remoteSort) && column.order;
  12994. }
  12995. return this.getSortColumns().length > 0;
  12996. },
  12997. getSortColumns: function getSortColumns() {
  12998. var sortList = [];
  12999. this.tableFullColumn.forEach(function (column) {
  13000. var order = column.order;
  13001. if ((column.sortable || column.remoteSort) && order) {
  13002. sortList.push({
  13003. column: column,
  13004. sortBy: column.sortBy,
  13005. property: column.property,
  13006. order: order
  13007. });
  13008. }
  13009. });
  13010. return sortList;
  13011. },
  13012. /**
  13013. * 关闭筛选
  13014. * @param {Event} evnt 事件
  13015. */
  13016. closeFilter: function closeFilter() {
  13017. Object.assign(this.filterStore, {
  13018. isAllSelected: false,
  13019. isIndeterminate: false,
  13020. options: [],
  13021. visible: false
  13022. });
  13023. return this.$nextTick();
  13024. },
  13025. /**
  13026. * 判断指定列是否为筛选状态,如果为空则判断所有列
  13027. * @param {String} fieldOrColumn 字段名或列
  13028. */
  13029. isFilter: function isFilter(fieldOrColumn) {
  13030. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  13031. if (column) {
  13032. return column.filters && column.filters.some(function (option) {
  13033. return option.checked;
  13034. });
  13035. }
  13036. return this.visibleColumn.some(function (column) {
  13037. return column.filters && column.filters.some(function (option) {
  13038. return option.checked;
  13039. });
  13040. });
  13041. },
  13042. /**
  13043. * 判断展开行是否懒加载完成
  13044. * @param {Row} row 行对象
  13045. */
  13046. isRowExpandLoaded: function isRowExpandLoaded(row) {
  13047. var rest = this.fullAllDataRowMap.get(row);
  13048. return rest && rest.expandLoaded;
  13049. },
  13050. clearRowExpandLoaded: function clearRowExpandLoaded(row) {
  13051. var expandOpts = this.expandOpts,
  13052. expandLazyLoadeds = this.expandLazyLoadeds,
  13053. fullAllDataRowMap = this.fullAllDataRowMap;
  13054. var lazy = expandOpts.lazy;
  13055. var rest = fullAllDataRowMap.get(row);
  13056. if (lazy && rest) {
  13057. rest.expandLoaded = false;
  13058. ctor_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
  13059. return row === item;
  13060. });
  13061. }
  13062. return this.$nextTick();
  13063. },
  13064. /**
  13065. * 重新加载展开行的内容
  13066. * @param {Row} row 行对象
  13067. */
  13068. reloadExpandContent: function reloadExpandContent(row) {
  13069. var _this30 = this;
  13070. var expandOpts = this.expandOpts,
  13071. expandLazyLoadeds = this.expandLazyLoadeds;
  13072. var lazy = expandOpts.lazy;
  13073. if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
  13074. this.clearRowExpandLoaded(row).then(function () {
  13075. return _this30.handleAsyncRowExpand(row);
  13076. });
  13077. }
  13078. return this.$nextTick();
  13079. },
  13080. /**
  13081. * 展开行事件
  13082. */
  13083. triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
  13084. var $listeners = this.$listeners,
  13085. expandOpts = this.expandOpts,
  13086. expandLazyLoadeds = this.expandLazyLoadeds,
  13087. column = this.expandColumn;
  13088. var row = params.row;
  13089. var lazy = expandOpts.lazy;
  13090. if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
  13091. var expanded = !this.isExpandByRow(row);
  13092. var columnIndex = this.getColumnIndex(column);
  13093. var $columnIndex = this.getVMColumnIndex(column);
  13094. this.setRowExpand(row, expanded); // 在 v3.0 中废弃 toggle-expand-change
  13095. if ($listeners['toggle-expand-change']) {
  13096. UtilTools.warn('vxe.error.delEvent', ['toggle-expand-change', 'toggle-row-expand']);
  13097. this.emitEvent('toggle-expand-change', {
  13098. expanded: expanded,
  13099. column: column,
  13100. columnIndex: columnIndex,
  13101. $columnIndex: $columnIndex,
  13102. row: row,
  13103. rowIndex: this.getRowIndex(row),
  13104. $rowIndex: this.getVMRowIndex(row)
  13105. }, evnt);
  13106. } else {
  13107. this.emitEvent('toggle-row-expand', {
  13108. expanded: expanded,
  13109. column: column,
  13110. columnIndex: columnIndex,
  13111. $columnIndex: $columnIndex,
  13112. row: row,
  13113. rowIndex: this.getRowIndex(row),
  13114. $rowIndex: this.getVMRowIndex(row)
  13115. }, evnt);
  13116. }
  13117. }
  13118. },
  13119. toggleRowExpansion: function toggleRowExpansion(row) {
  13120. UtilTools.warn('vxe.error.delFunc', ['toggleRowExpansion', 'toggleRowExpand']);
  13121. return this.toggleRowExpand(row);
  13122. },
  13123. /**
  13124. * 切换展开行
  13125. */
  13126. toggleRowExpand: function toggleRowExpand(row) {
  13127. return this.setRowExpand(row, !this.isExpandByRow(row));
  13128. },
  13129. /**
  13130. * 处理默认展开行
  13131. */
  13132. handleDefaultRowExpand: function handleDefaultRowExpand() {
  13133. var expandOpts = this.expandOpts,
  13134. fullDataRowIdData = this.fullDataRowIdData;
  13135. var expandAll = expandOpts.expandAll,
  13136. expandRowKeys = expandOpts.expandRowKeys;
  13137. if (expandAll) {
  13138. this.setAllRowExpand(true);
  13139. } else if (expandRowKeys) {
  13140. var defExpandeds = [];
  13141. expandRowKeys.forEach(function (rowid) {
  13142. if (fullDataRowIdData[rowid]) {
  13143. defExpandeds.push(fullDataRowIdData[rowid].row);
  13144. }
  13145. });
  13146. this.setRowExpand(defExpandeds, true);
  13147. }
  13148. },
  13149. setAllRowExpansion: function setAllRowExpansion(expanded) {
  13150. UtilTools.warn('vxe.error.delFunc', ['setAllRowExpansion', 'setAllRowExpand']);
  13151. return this.setAllRowExpand(expanded);
  13152. },
  13153. /**
  13154. * 设置所有行的展开与否
  13155. * @param {Boolean} expanded 是否展开
  13156. */
  13157. setAllRowExpand: function setAllRowExpand(expanded) {
  13158. return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
  13159. },
  13160. handleAsyncRowExpand: function handleAsyncRowExpand(row) {
  13161. var _this31 = this;
  13162. var rest = this.fullAllDataRowMap.get(row);
  13163. return new Promise(function (resolve) {
  13164. _this31.expandLazyLoadeds.push(row);
  13165. _this31.expandOpts.loadMethod({
  13166. $table: _this31,
  13167. row: row,
  13168. rowIndex: _this31.getRowIndex(row),
  13169. $rowIndex: _this31.getVMRowIndex(row)
  13170. }).catch(function (e) {
  13171. return e;
  13172. }).then(function () {
  13173. rest.expandLoaded = true;
  13174. ctor_amd_xe_utils_default.a.remove(_this31.expandLazyLoadeds, function (item) {
  13175. return item === row;
  13176. });
  13177. _this31.rowExpandeds.push(row);
  13178. resolve(_this31.$nextTick().then(_this31.recalculate));
  13179. });
  13180. });
  13181. },
  13182. setRowExpansion: function setRowExpansion(rows, expanded) {
  13183. UtilTools.warn('vxe.error.delFunc', ['setRowExpansion', 'setRowExpand']);
  13184. return this.setRowExpand(rows, expanded);
  13185. },
  13186. /**
  13187. * 设置展开行,二个参数设置这一行展开与否
  13188. * 支持单行
  13189. * 支持多行
  13190. * @param {Array/Row} rows 行数据
  13191. * @param {Boolean} expanded 是否展开
  13192. */
  13193. setRowExpand: function setRowExpand(rows, expanded) {
  13194. var _this32 = this;
  13195. var fullAllDataRowMap = this.fullAllDataRowMap,
  13196. expandLazyLoadeds = this.expandLazyLoadeds,
  13197. expandOpts = this.expandOpts,
  13198. column = this.expandColumn;
  13199. var rowExpandeds = this.rowExpandeds;
  13200. var reserve = expandOpts.reserve,
  13201. lazy = expandOpts.lazy,
  13202. accordion = expandOpts.accordion,
  13203. toggleMethod = expandOpts.toggleMethod;
  13204. var lazyRests = [];
  13205. var columnIndex = this.getColumnIndex(column);
  13206. var $columnIndex = this.getVMColumnIndex(column);
  13207. if (rows) {
  13208. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  13209. rows = [rows];
  13210. }
  13211. if (accordion) {
  13212. // 只能同时展开一个
  13213. rowExpandeds = [];
  13214. rows = rows.slice(rows.length - 1, rows.length);
  13215. }
  13216. var validRows = toggleMethod ? rows.filter(function (row) {
  13217. return toggleMethod({
  13218. expanded: expanded,
  13219. column: column,
  13220. columnIndex: columnIndex,
  13221. $columnIndex: $columnIndex,
  13222. row: row,
  13223. rowIndex: _this32.getRowIndex(row),
  13224. $rowIndex: _this32.getVMRowIndex(row)
  13225. });
  13226. }) : rows;
  13227. if (expanded) {
  13228. validRows.forEach(function (row) {
  13229. if (rowExpandeds.indexOf(row) === -1) {
  13230. var rest = fullAllDataRowMap.get(row);
  13231. var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
  13232. if (isLoad) {
  13233. lazyRests.push(_this32.handleAsyncRowExpand(row));
  13234. } else {
  13235. rowExpandeds.push(row);
  13236. }
  13237. }
  13238. });
  13239. } else {
  13240. ctor_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
  13241. return validRows.indexOf(row) > -1;
  13242. });
  13243. }
  13244. if (reserve) {
  13245. validRows.forEach(function (row) {
  13246. return _this32.handleRowExpandReserve(row, expanded);
  13247. });
  13248. }
  13249. }
  13250. this.rowExpandeds = rowExpandeds;
  13251. return Promise.all(lazyRests).then(this.recalculate);
  13252. },
  13253. // 在 v3.0 中废弃 getRecords
  13254. hasRowExpand: function hasRowExpand(row) {
  13255. UtilTools.warn('vxe.error.delFunc', ['hasRowExpand', 'isExpandByRow']);
  13256. return this.isExpandByRow(row);
  13257. },
  13258. /**
  13259. * 判断行是否为展开状态
  13260. * @param {Row} row 行对象
  13261. */
  13262. isExpandByRow: function isExpandByRow(row) {
  13263. return this.rowExpandeds.indexOf(row) > -1;
  13264. },
  13265. /**
  13266. * 手动清空展开行状态,数据会恢复成未展开的状态
  13267. */
  13268. clearRowExpand: function clearRowExpand() {
  13269. var _this33 = this;
  13270. var expandOpts = this.expandOpts,
  13271. rowExpandeds = this.rowExpandeds,
  13272. tableFullData = this.tableFullData;
  13273. var reserve = expandOpts.reserve;
  13274. var isExists = rowExpandeds.length;
  13275. this.rowExpandeds = [];
  13276. if (reserve) {
  13277. tableFullData.forEach(function (row) {
  13278. return _this33.handleRowExpandReserve(row, false);
  13279. });
  13280. }
  13281. return this.$nextTick().then(function () {
  13282. if (isExists) {
  13283. _this33.recalculate();
  13284. }
  13285. });
  13286. },
  13287. clearRowExpandReserve: function clearRowExpandReserve() {
  13288. this.rowExpandedReserveRowMap = {};
  13289. return this.$nextTick();
  13290. },
  13291. handleRowExpandReserve: function handleRowExpandReserve(row, expanded) {
  13292. var rowExpandedReserveRowMap = this.rowExpandedReserveRowMap,
  13293. expandOpts = this.expandOpts;
  13294. if (expandOpts.reserve) {
  13295. var rowid = methods_getRowid(this, row);
  13296. if (expanded) {
  13297. rowExpandedReserveRowMap[rowid] = row;
  13298. } else if (rowExpandedReserveRowMap[rowid]) {
  13299. delete rowExpandedReserveRowMap[rowid];
  13300. }
  13301. }
  13302. },
  13303. getRowExpandRecords: function getRowExpandRecords() {
  13304. return this.rowExpandeds.slice(0);
  13305. },
  13306. getTreeExpandRecords: function getTreeExpandRecords() {
  13307. return this.treeExpandeds.slice(0);
  13308. },
  13309. /**
  13310. * 获取数表格状态
  13311. */
  13312. getTreeStatus: function getTreeStatus() {
  13313. if (this.treeConfig) {
  13314. return {
  13315. config: this.treeOpts,
  13316. rowExpandeds: this.getTreeExpandRecords()
  13317. };
  13318. }
  13319. return null;
  13320. },
  13321. /**
  13322. * 判断树节点是否懒加载完成
  13323. * @param {Row} row 行对象
  13324. */
  13325. isTreeExpandLoaded: function isTreeExpandLoaded(row) {
  13326. var rest = this.fullAllDataRowMap.get(row);
  13327. return rest && rest.treeLoaded;
  13328. },
  13329. clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
  13330. var treeOpts = this.treeOpts,
  13331. treeExpandeds = this.treeExpandeds,
  13332. fullAllDataRowMap = this.fullAllDataRowMap;
  13333. var lazy = treeOpts.lazy;
  13334. var rest = fullAllDataRowMap.get(row);
  13335. if (lazy && rest) {
  13336. rest.treeLoaded = false;
  13337. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13338. return row === item;
  13339. });
  13340. }
  13341. return this.$nextTick();
  13342. },
  13343. /**
  13344. * 重新加载树的子节点
  13345. * @param {Row} row 行对象
  13346. */
  13347. reloadTreeChilds: function reloadTreeChilds(row) {
  13348. var _this34 = this;
  13349. var treeOpts = this.treeOpts,
  13350. treeLazyLoadeds = this.treeLazyLoadeds;
  13351. var lazy = treeOpts.lazy,
  13352. hasChild = treeOpts.hasChild;
  13353. if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
  13354. this.clearTreeExpandLoaded(row).then(function () {
  13355. return _this34.handleAsyncTreeExpandChilds(row);
  13356. });
  13357. }
  13358. return this.$nextTick();
  13359. },
  13360. /**
  13361. * 展开树节点事件
  13362. */
  13363. triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
  13364. var $listeners = this.$listeners,
  13365. treeOpts = this.treeOpts,
  13366. treeLazyLoadeds = this.treeLazyLoadeds;
  13367. var row = params.row,
  13368. column = params.column;
  13369. var lazy = treeOpts.lazy;
  13370. if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
  13371. var expanded = !this.isTreeExpandByRow(row);
  13372. var columnIndex = this.getColumnIndex(column);
  13373. var $columnIndex = this.getVMColumnIndex(column);
  13374. this.setTreeExpand(row, expanded); // 在 v3.0 中废弃 toggle-tree-change
  13375. if ($listeners['toggle-tree-change']) {
  13376. UtilTools.warn('vxe.error.delEvent', ['toggle-tree-change', 'toggle-tree-expand']);
  13377. this.emitEvent('toggle-tree-change', {
  13378. expanded: expanded,
  13379. column: column,
  13380. columnIndex: columnIndex,
  13381. $columnIndex: $columnIndex,
  13382. row: row
  13383. }, evnt);
  13384. } else {
  13385. this.emitEvent('toggle-tree-expand', {
  13386. expanded: expanded,
  13387. column: column,
  13388. columnIndex: columnIndex,
  13389. $columnIndex: $columnIndex,
  13390. row: row
  13391. }, evnt);
  13392. }
  13393. }
  13394. },
  13395. toggleTreeExpansion: function toggleTreeExpansion(row) {
  13396. UtilTools.warn('vxe.error.delFunc', ['toggleTreeExpansion', 'toggleTreeExpand']);
  13397. return this.toggleTreeExpand(row);
  13398. },
  13399. /**
  13400. * 切换/展开树节点
  13401. */
  13402. toggleTreeExpand: function toggleTreeExpand(row) {
  13403. return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
  13404. },
  13405. /**
  13406. * 处理默认展开树节点
  13407. */
  13408. handleDefaultTreeExpand: function handleDefaultTreeExpand() {
  13409. var treeConfig = this.treeConfig,
  13410. treeOpts = this.treeOpts,
  13411. tableFullData = this.tableFullData;
  13412. if (treeConfig) {
  13413. var expandAll = treeOpts.expandAll,
  13414. expandRowKeys = treeOpts.expandRowKeys;
  13415. if (expandAll) {
  13416. this.setAllTreeExpand(true);
  13417. } else if (expandRowKeys) {
  13418. var defExpandeds = [];
  13419. var rowkey = getRowkey(this);
  13420. expandRowKeys.forEach(function (rowid) {
  13421. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13422. return rowid === ctor_amd_xe_utils_default.a.get(item, rowkey);
  13423. }, treeOpts);
  13424. if (matchObj) {
  13425. defExpandeds.push(matchObj.item);
  13426. }
  13427. });
  13428. this.setTreeExpand(defExpandeds, true);
  13429. }
  13430. }
  13431. },
  13432. handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
  13433. var _this35 = this;
  13434. var fullAllDataRowMap = this.fullAllDataRowMap,
  13435. treeExpandeds = this.treeExpandeds,
  13436. treeOpts = this.treeOpts,
  13437. treeLazyLoadeds = this.treeLazyLoadeds,
  13438. checkboxOpts = this.checkboxOpts;
  13439. var loadMethod = treeOpts.loadMethod;
  13440. var checkStrictly = checkboxOpts.checkStrictly;
  13441. var rest = fullAllDataRowMap.get(row);
  13442. return new Promise(function (resolve) {
  13443. treeLazyLoadeds.push(row);
  13444. loadMethod({
  13445. $table: _this35,
  13446. row: row
  13447. }).catch(function () {
  13448. return [];
  13449. }).then(function (childRecords) {
  13450. rest.treeLoaded = true;
  13451. ctor_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
  13452. return item === row;
  13453. });
  13454. if (!ctor_amd_xe_utils_default.a.isArray(childRecords)) {
  13455. childRecords = [];
  13456. }
  13457. if (childRecords) {
  13458. _this35.loadChildren(row, childRecords).then(function (childRows) {
  13459. if (childRows.length && treeExpandeds.indexOf(row) === -1) {
  13460. treeExpandeds.push(row);
  13461. } // 如果当前节点已选中,则展开后子节点也被选中
  13462. if (!checkStrictly && _this35.isCheckedByCheckboxRow(row)) {
  13463. _this35.setCheckboxRow(childRows, true);
  13464. }
  13465. });
  13466. }
  13467. resolve(_this35.$nextTick().then(_this35.recalculate));
  13468. });
  13469. });
  13470. },
  13471. setAllTreeExpansion: function setAllTreeExpansion(expanded) {
  13472. UtilTools.warn('vxe.error.delFunc', ['setAllTreeExpansion', 'setAllTreeExpand']);
  13473. return this.setAllTreeExpand(expanded);
  13474. },
  13475. /**
  13476. * 设置所有树节点的展开与否
  13477. * @param {Boolean} expanded 是否展开
  13478. */
  13479. setAllTreeExpand: function setAllTreeExpand(expanded) {
  13480. var tableFullData = this.tableFullData,
  13481. treeOpts = this.treeOpts;
  13482. var lazy = treeOpts.lazy,
  13483. children = treeOpts.children;
  13484. var expandeds = [];
  13485. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  13486. var rowChildren = row[children];
  13487. if (lazy || rowChildren && rowChildren.length) {
  13488. expandeds.push(row);
  13489. }
  13490. }, treeOpts);
  13491. return this.setTreeExpand(expandeds, expanded);
  13492. },
  13493. setTreeExpansion: function setTreeExpansion(rows, expanded) {
  13494. UtilTools.warn('vxe.error.delFunc', ['setTreeExpansion', 'setTreeExpand']);
  13495. return this.setTreeExpand(rows, expanded);
  13496. },
  13497. /**
  13498. * 设置展开树形节点,二个参数设置这一行展开与否
  13499. * 支持单行
  13500. * 支持多行
  13501. * @param {Array/Row} rows 行数据
  13502. * @param {Boolean} expanded 是否展开
  13503. */
  13504. setTreeExpand: function setTreeExpand(rows, expanded) {
  13505. var _this36 = this;
  13506. var fullAllDataRowMap = this.fullAllDataRowMap,
  13507. tableFullData = this.tableFullData,
  13508. treeExpandeds = this.treeExpandeds,
  13509. treeOpts = this.treeOpts,
  13510. treeLazyLoadeds = this.treeLazyLoadeds,
  13511. treeNodeColumn = this.treeNodeColumn;
  13512. var reserve = treeOpts.reserve,
  13513. lazy = treeOpts.lazy,
  13514. hasChild = treeOpts.hasChild,
  13515. children = treeOpts.children,
  13516. accordion = treeOpts.accordion,
  13517. toggleMethod = treeOpts.toggleMethod;
  13518. var result = [];
  13519. var columnIndex = this.getColumnIndex(treeNodeColumn);
  13520. var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
  13521. if (rows) {
  13522. if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  13523. rows = [rows];
  13524. }
  13525. if (rows.length) {
  13526. var validRows = toggleMethod ? rows.filter(function (row) {
  13527. return toggleMethod({
  13528. expanded: expanded,
  13529. column: treeNodeColumn,
  13530. columnIndex: columnIndex,
  13531. $columnIndex: $columnIndex,
  13532. row: row
  13533. });
  13534. }) : rows;
  13535. if (accordion) {
  13536. validRows = validRows.length ? [validRows[validRows.length - 1]] : []; // 同一级只能展开一个
  13537. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13538. return item === validRows[0];
  13539. }, treeOpts);
  13540. if (matchObj) {
  13541. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13542. return matchObj.items.indexOf(item) > -1;
  13543. });
  13544. }
  13545. }
  13546. if (expanded) {
  13547. validRows.forEach(function (row) {
  13548. if (treeExpandeds.indexOf(row) === -1) {
  13549. var rest = fullAllDataRowMap.get(row);
  13550. var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
  13551. if (isLoad) {
  13552. result.push(_this36.handleAsyncTreeExpandChilds(row));
  13553. } else {
  13554. if (row[children] && row[children].length) {
  13555. treeExpandeds.push(row);
  13556. }
  13557. }
  13558. }
  13559. });
  13560. } else {
  13561. ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
  13562. return validRows.indexOf(row) > -1;
  13563. });
  13564. }
  13565. if (reserve) {
  13566. validRows.forEach(function (row) {
  13567. return _this36.handleTreeExpandReserve(row, expanded);
  13568. });
  13569. }
  13570. return Promise.all(result).then(this.recalculate);
  13571. }
  13572. }
  13573. return this.$nextTick();
  13574. },
  13575. // 在 v3.0 中废弃 hasTreeExpand
  13576. hasTreeExpand: function hasTreeExpand(row) {
  13577. UtilTools.warn('vxe.error.delFunc', ['hasTreeExpand', 'isTreeExpandByRow']);
  13578. return this.isTreeExpandByRow(row);
  13579. },
  13580. /**
  13581. * 判断行是否为树形节点展开状态
  13582. * @param {Row} row 行对象
  13583. */
  13584. isTreeExpandByRow: function isTreeExpandByRow(row) {
  13585. return this.treeExpandeds.indexOf(row) > -1;
  13586. },
  13587. /**
  13588. * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
  13589. */
  13590. clearTreeExpand: function clearTreeExpand() {
  13591. var _this37 = this;
  13592. var treeOpts = this.treeOpts,
  13593. treeExpandeds = this.treeExpandeds,
  13594. tableFullData = this.tableFullData;
  13595. var reserve = treeOpts.reserve;
  13596. var isExists = treeExpandeds.length;
  13597. this.treeExpandeds = [];
  13598. if (reserve) {
  13599. ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  13600. return _this37.handleTreeExpandReserve(row, false);
  13601. }, treeOpts);
  13602. }
  13603. return this.$nextTick().then(function () {
  13604. if (isExists) {
  13605. _this37.recalculate();
  13606. }
  13607. });
  13608. },
  13609. clearTreeExpandReserve: function clearTreeExpandReserve() {
  13610. this.treeExpandedReserveRowMap = {};
  13611. return this.$nextTick();
  13612. },
  13613. handleTreeExpandReserve: function handleTreeExpandReserve(row, expanded) {
  13614. var treeExpandedReserveRowMap = this.treeExpandedReserveRowMap,
  13615. treeOpts = this.treeOpts;
  13616. if (treeOpts.reserve) {
  13617. var rowid = methods_getRowid(this, row);
  13618. if (expanded) {
  13619. treeExpandedReserveRowMap[rowid] = row;
  13620. } else if (treeExpandedReserveRowMap[rowid]) {
  13621. delete treeExpandedReserveRowMap[rowid];
  13622. }
  13623. }
  13624. },
  13625. getVirtualScroller: function getVirtualScroller() {
  13626. UtilTools.warn('vxe.error.delFunc', ['getVirtualScroller', 'getScroll']);
  13627. return this.getScroll();
  13628. },
  13629. getTableScroll: function getTableScroll() {
  13630. UtilTools.warn('vxe.error.delFunc', ['getTableScroll', 'getScroll']);
  13631. return this.getScroll();
  13632. },
  13633. /**
  13634. * 获取表格的滚动状态
  13635. */
  13636. getScroll: function getScroll() {
  13637. var $refs = this.$refs,
  13638. scrollXLoad = this.scrollXLoad,
  13639. scrollYLoad = this.scrollYLoad;
  13640. var bodyElem = $refs.tableBody.$el;
  13641. return {
  13642. virtualX: scrollXLoad,
  13643. virtualY: scrollYLoad,
  13644. scrollTop: bodyElem.scrollTop,
  13645. scrollLeft: bodyElem.scrollLeft
  13646. };
  13647. },
  13648. /**
  13649. * 横向 X 可视渲染事件处理
  13650. */
  13651. triggerScrollXEvent: function triggerScrollXEvent() {
  13652. this.loadScrollXData();
  13653. },
  13654. loadScrollXData: function loadScrollXData(force) {
  13655. var $refs = this.$refs,
  13656. visibleColumn = this.visibleColumn,
  13657. scrollXStore = this.scrollXStore;
  13658. var startIndex = scrollXStore.startIndex,
  13659. renderSize = scrollXStore.renderSize,
  13660. offsetSize = scrollXStore.offsetSize,
  13661. visibleSize = scrollXStore.visibleSize;
  13662. var scrollBodyElem = $refs.tableBody.$el;
  13663. var scrollLeft = scrollBodyElem.scrollLeft;
  13664. var toVisibleIndex = 0;
  13665. var width = 0;
  13666. var preload = force || false;
  13667. var colLen = visibleColumn.length;
  13668. for (var colIndex = 0; colIndex < colLen; colIndex++) {
  13669. width += visibleColumn[colIndex].renderWidth;
  13670. if (scrollLeft < width) {
  13671. toVisibleIndex = colIndex;
  13672. break;
  13673. }
  13674. }
  13675. if (force || scrollXStore.visibleIndex !== toVisibleIndex) {
  13676. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  13677. if (scrollXStore.visibleIndex === toVisibleIndex) {
  13678. scrollXStore.startIndex = toVisibleIndex;
  13679. } else if (scrollXStore.visibleIndex > toVisibleIndex) {
  13680. // 向左
  13681. preload = toVisibleIndex - offsetSize <= startIndex;
  13682. if (preload) {
  13683. scrollXStore.startIndex = Math.max(0, Math.max(0, toVisibleIndex - marginSize));
  13684. }
  13685. } else {
  13686. // 向右
  13687. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  13688. if (preload) {
  13689. scrollXStore.startIndex = Math.max(0, Math.min(visibleColumn.length - renderSize, toVisibleIndex - marginSize));
  13690. }
  13691. }
  13692. if (preload) {
  13693. this.updateScrollXData();
  13694. }
  13695. scrollXStore.visibleIndex = toVisibleIndex;
  13696. }
  13697. this.closeTooltip();
  13698. },
  13699. /**
  13700. * 纵向 Y 可视渲染事件处理
  13701. */
  13702. triggerScrollYEvent: function triggerScrollYEvent(evnt) {
  13703. var scrollYStore = this.scrollYStore;
  13704. var adaptive = scrollYStore.adaptive,
  13705. offsetSize = scrollYStore.offsetSize,
  13706. visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式
  13707. if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 80) {
  13708. this.loadScrollYData(evnt);
  13709. } else {
  13710. this.debounceScrollY(evnt);
  13711. }
  13712. },
  13713. debounceScrollY: ctor_amd_xe_utils_default.a.debounce(function (evnt) {
  13714. this.loadScrollYData(evnt);
  13715. }, debounceScrollYDuration, {
  13716. leading: false,
  13717. trailing: true
  13718. }),
  13719. /**
  13720. * 纵向 Y 可视渲染处理
  13721. */
  13722. loadScrollYData: function loadScrollYData(evnt) {
  13723. var afterFullData = this.afterFullData,
  13724. scrollYStore = this.scrollYStore,
  13725. isLoadData = this.isLoadData;
  13726. var startIndex = scrollYStore.startIndex,
  13727. renderSize = scrollYStore.renderSize,
  13728. offsetSize = scrollYStore.offsetSize,
  13729. visibleSize = scrollYStore.visibleSize,
  13730. rowHeight = scrollYStore.rowHeight;
  13731. var scrollBodyElem = evnt.target;
  13732. var scrollTop = scrollBodyElem.scrollTop;
  13733. var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
  13734. var preload = false;
  13735. if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
  13736. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  13737. if (scrollYStore.visibleIndex > toVisibleIndex) {
  13738. // 向上
  13739. preload = toVisibleIndex - offsetSize <= startIndex;
  13740. if (preload) {
  13741. scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
  13742. }
  13743. } else {
  13744. // 向下
  13745. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  13746. if (preload) {
  13747. scrollYStore.startIndex = Math.max(0, Math.min(afterFullData.length - renderSize, toVisibleIndex - marginSize));
  13748. }
  13749. }
  13750. if (preload) {
  13751. this.updateScrollYData();
  13752. }
  13753. scrollYStore.visibleIndex = toVisibleIndex;
  13754. this.isLoadData = false;
  13755. }
  13756. },
  13757. computeRowHeight: function computeRowHeight() {
  13758. var tableBody = this.$refs.tableBody;
  13759. var tableBodyElem = tableBody ? tableBody.$el : null;
  13760. var tableHeader = this.$refs.tableHeader;
  13761. var rowHeight;
  13762. if (tableBodyElem) {
  13763. var firstTrElem = tableBodyElem.querySelector('tbody>tr');
  13764. if (!firstTrElem && tableHeader) {
  13765. firstTrElem = tableHeader.$el.querySelector('thead>tr');
  13766. }
  13767. if (firstTrElem) {
  13768. rowHeight = firstTrElem.clientHeight;
  13769. }
  13770. } // 默认的行高
  13771. if (!rowHeight) {
  13772. rowHeight = this.rowHeightMaps[this.vSize || 'default'];
  13773. }
  13774. this.rowHeight = rowHeight;
  13775. },
  13776. // 计算可视渲染相关数据
  13777. computeScrollLoad: function computeScrollLoad() {
  13778. var _this38 = this;
  13779. return this.$nextTick().then(function () {
  13780. var vSize = _this38.vSize,
  13781. scrollXLoad = _this38.scrollXLoad,
  13782. scrollYLoad = _this38.scrollYLoad,
  13783. sYOpts = _this38.sYOpts,
  13784. scrollYStore = _this38.scrollYStore,
  13785. sXOpts = _this38.sXOpts,
  13786. scrollXStore = _this38.scrollXStore,
  13787. visibleColumn = _this38.visibleColumn,
  13788. rowHeightMaps = _this38.rowHeightMaps;
  13789. var tableBody = _this38.$refs.tableBody;
  13790. var tableBodyElem = tableBody ? tableBody.$el : null;
  13791. var tableHeader = _this38.$refs.tableHeader;
  13792. if (tableBodyElem) {
  13793. // 计算 X 逻辑
  13794. if (scrollXLoad) {
  13795. var bodyWidth = tableBodyElem.clientWidth;
  13796. var visibleXSize = ctor_amd_xe_utils_default.a.toNumber(sXOpts.vSize);
  13797. if (!sXOpts.vSize) {
  13798. var len = visibleXSize = visibleColumn.length;
  13799. var countWidth = 0;
  13800. var column;
  13801. for (var colIndex = 0; colIndex < len; colIndex++) {
  13802. column = visibleColumn[colIndex];
  13803. countWidth += column.renderWidth;
  13804. if (countWidth > bodyWidth) {
  13805. visibleXSize = colIndex + 1;
  13806. break;
  13807. }
  13808. }
  13809. }
  13810. scrollXStore.visibleSize = visibleXSize; // 自动优化
  13811. if (!sXOpts.oSize) {
  13812. scrollXStore.offsetSize = visibleXSize;
  13813. }
  13814. if (!sXOpts.rSize) {
  13815. scrollXStore.renderSize = Math.max(8, visibleXSize + 6);
  13816. }
  13817. _this38.updateScrollXData();
  13818. } else {
  13819. _this38.updateScrollXSpace();
  13820. } // 计算 Y 逻辑
  13821. if (scrollYLoad) {
  13822. var rHeight;
  13823. if (sYOpts.rHeight) {
  13824. rHeight = sYOpts.rHeight;
  13825. } else {
  13826. var firstTrElem = tableBodyElem.querySelector('tbody>tr');
  13827. if (!firstTrElem && tableHeader) {
  13828. firstTrElem = tableHeader.$el.querySelector('thead>tr');
  13829. }
  13830. if (firstTrElem) {
  13831. rHeight = firstTrElem.clientHeight;
  13832. }
  13833. } // 默认的行高
  13834. if (!rHeight) {
  13835. rHeight = rowHeightMaps[vSize || 'default'];
  13836. }
  13837. var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil(tableBodyElem.clientHeight / rHeight));
  13838. scrollYStore.visibleSize = visibleYSize;
  13839. scrollYStore.rowHeight = rHeight; // 自动优化
  13840. if (!sYOpts.oSize) {
  13841. scrollYStore.offsetSize = visibleYSize;
  13842. }
  13843. if (!sYOpts.rSize) {
  13844. scrollYStore.renderSize = Math.max(6, methods_browse.edge ? visibleYSize * 10 : isWebkit ? visibleYSize + 2 : visibleYSize * 6);
  13845. }
  13846. _this38.updateScrollYData();
  13847. } else {
  13848. _this38.updateScrollYSpace();
  13849. }
  13850. }
  13851. _this38.$nextTick(_this38.updateStyle);
  13852. });
  13853. },
  13854. updateScrollXData: function updateScrollXData() {
  13855. var visibleColumn = this.visibleColumn,
  13856. scrollXStore = this.scrollXStore;
  13857. this.tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
  13858. this.updateScrollXSpace();
  13859. },
  13860. // 更新横向 X 可视渲染上下剩余空间大小
  13861. updateScrollXSpace: function updateScrollXSpace() {
  13862. var $refs = this.$refs,
  13863. elemStore = this.elemStore,
  13864. visibleColumn = this.visibleColumn,
  13865. scrollXStore = this.scrollXStore,
  13866. scrollXLoad = this.scrollXLoad,
  13867. tableWidth = this.tableWidth,
  13868. scrollbarWidth = this.scrollbarWidth;
  13869. var tableHeader = $refs.tableHeader,
  13870. tableBody = $refs.tableBody,
  13871. tableFooter = $refs.tableFooter;
  13872. var headerElem = tableHeader ? tableHeader.$el.querySelector('.vxe-table--header') : null;
  13873. var bodyElem = tableBody.$el.querySelector('.vxe-table--body');
  13874. var footerElem = tableFooter ? tableFooter.$el.querySelector('.vxe-table--footer') : null;
  13875. var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) {
  13876. return previous + column.renderWidth;
  13877. }, 0);
  13878. var marginLeft = '';
  13879. if (scrollXLoad) {
  13880. marginLeft = "".concat(leftSpaceWidth, "px");
  13881. }
  13882. if (headerElem) {
  13883. headerElem.style.marginLeft = marginLeft;
  13884. }
  13885. bodyElem.style.marginLeft = marginLeft;
  13886. if (footerElem) {
  13887. footerElem.style.marginLeft = marginLeft;
  13888. }
  13889. var containerList = ['main'];
  13890. containerList.forEach(function (name) {
  13891. var layoutList = ['header', 'body', 'footer'];
  13892. layoutList.forEach(function (layout) {
  13893. var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")];
  13894. if (xSpaceElem) {
  13895. xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : '';
  13896. }
  13897. });
  13898. });
  13899. this.$nextTick(this.updateStyle);
  13900. },
  13901. updateScrollYData: function updateScrollYData() {
  13902. this.handleTableData();
  13903. this.updateScrollYSpace();
  13904. },
  13905. // 更新纵向 Y 可视渲染上下剩余空间大小
  13906. updateScrollYSpace: function updateScrollYSpace() {
  13907. var elemStore = this.elemStore,
  13908. scrollYStore = this.scrollYStore,
  13909. scrollYLoad = this.scrollYLoad,
  13910. afterFullData = this.afterFullData;
  13911. var bodyHeight = afterFullData.length * scrollYStore.rowHeight;
  13912. var topSpaceHeight = Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0);
  13913. var containerList = ['main', 'left', 'right'];
  13914. var marginTop = '';
  13915. var ySpaceHeight = '';
  13916. if (scrollYLoad) {
  13917. marginTop = "".concat(topSpaceHeight, "px");
  13918. ySpaceHeight = "".concat(bodyHeight, "px");
  13919. }
  13920. containerList.forEach(function (name) {
  13921. var layoutList = ['header', 'body', 'footer'];
  13922. var tableElem = elemStore["".concat(name, "-body-table")];
  13923. if (tableElem) {
  13924. tableElem.style.marginTop = marginTop;
  13925. }
  13926. layoutList.forEach(function (layout) {
  13927. var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")];
  13928. if (ySpaceElem) {
  13929. ySpaceElem.style.height = ySpaceHeight;
  13930. }
  13931. });
  13932. });
  13933. this.$nextTick(this.updateStyle);
  13934. },
  13935. /**
  13936. * 如果有滚动条,则滚动到对应的位置
  13937. * @param {Number} scrollLeft 左距离
  13938. * @param {Number} scrollTop 上距离
  13939. */
  13940. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  13941. var _this39 = this;
  13942. var $refs = this.$refs;
  13943. var tableBody = $refs.tableBody,
  13944. rightBody = $refs.rightBody,
  13945. tableFooter = $refs.tableFooter;
  13946. var tableBodyElem = tableBody ? tableBody.$el : null;
  13947. var rightBodyElem = rightBody ? rightBody.$el : null;
  13948. var bodyTargetElem = rightBodyElem || tableBodyElem;
  13949. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  13950. var footerTargetElem = tableFooterElem || tableBodyElem;
  13951. if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  13952. footerTargetElem.scrollLeft = scrollLeft;
  13953. }
  13954. if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
  13955. bodyTargetElem.scrollTop = scrollTop;
  13956. }
  13957. if (this.scrollXLoad || this.scrollYLoad) {
  13958. return new Promise(function (resolve) {
  13959. return setTimeout(function () {
  13960. return resolve(_this39.$nextTick());
  13961. }, 50);
  13962. });
  13963. }
  13964. return this.$nextTick();
  13965. },
  13966. /**
  13967. * 如果有滚动条,则滚动到对应的行
  13968. * @param {Row} row 行对象
  13969. * @param {ColumnInfo} column 列配置
  13970. */
  13971. scrollToRow: function scrollToRow(row, column) {
  13972. var rest = [];
  13973. if (row) {
  13974. if (this.treeConfig) {
  13975. rest.push(this.scrollToTreeRow(row));
  13976. } else {
  13977. rest.push(DomTools.rowToVisible(this, row));
  13978. }
  13979. }
  13980. if (column) {
  13981. rest.push(this.scrollToColumn(column));
  13982. }
  13983. return Promise.all(rest);
  13984. },
  13985. /**
  13986. * 如果有滚动条,则滚动到对应的列
  13987. * @param {ColumnInfo} column 列配置
  13988. */
  13989. scrollToColumn: function scrollToColumn(column) {
  13990. if (column && this.fullColumnMap.has(column)) {
  13991. return DomTools.colToVisible(this, column);
  13992. }
  13993. return this.$nextTick();
  13994. },
  13995. /**
  13996. * 对于树形结构中,可以直接滚动到指定深层节点中
  13997. * 对于某些特定的场景可能会用到,比如定位到某一节点
  13998. * @param {Row} row 行对象
  13999. */
  14000. scrollToTreeRow: function scrollToTreeRow(row) {
  14001. var _this40 = this;
  14002. var tableFullData = this.tableFullData,
  14003. treeConfig = this.treeConfig,
  14004. treeOpts = this.treeOpts;
  14005. var rests = [];
  14006. if (treeConfig) {
  14007. var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  14008. return item === row;
  14009. }, treeOpts);
  14010. if (matchObj) {
  14011. var nodes = matchObj.nodes;
  14012. nodes.forEach(function (row, index) {
  14013. if (index < nodes.length - 1 && !_this40.isTreeExpandByRow(row)) {
  14014. rests.push(_this40.setTreeExpand(row, true));
  14015. }
  14016. });
  14017. }
  14018. }
  14019. return Promise.all(rests).then(function () {
  14020. return DomTools.rowToVisible(_this40, row);
  14021. });
  14022. },
  14023. /**
  14024. * 手动清除滚动相关信息,还原到初始状态
  14025. */
  14026. clearScroll: function clearScroll() {
  14027. var $refs = this.$refs;
  14028. var tableBody = $refs.tableBody,
  14029. rightBody = $refs.rightBody,
  14030. tableFooter = $refs.tableFooter;
  14031. var tableBodyElem = tableBody ? tableBody.$el : null;
  14032. var rightBodyElem = rightBody ? rightBody.$el : null;
  14033. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  14034. if (rightBodyElem) {
  14035. rightBodyElem.scrollTop = 0;
  14036. }
  14037. if (tableFooterElem) {
  14038. tableFooterElem.scrollLeft = 0;
  14039. }
  14040. if (tableBodyElem) {
  14041. tableBodyElem.scrollTop = 0;
  14042. tableBodyElem.scrollLeft = 0;
  14043. }
  14044. return this.$nextTick();
  14045. },
  14046. /**
  14047. * 更新表尾合计
  14048. */
  14049. updateFooter: function updateFooter() {
  14050. var showFooter = this.showFooter,
  14051. visibleColumn = this.visibleColumn,
  14052. footerMethod = this.footerMethod;
  14053. if (showFooter && footerMethod) {
  14054. this.footerTableData = visibleColumn.length ? footerMethod({
  14055. columns: visibleColumn,
  14056. data: this.afterFullData,
  14057. $table: this,
  14058. $grid: this.$xegrid
  14059. }) : [];
  14060. }
  14061. return this.$nextTick();
  14062. },
  14063. /**
  14064. * 更新列状态
  14065. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
  14066. * 如果单元格配置了校验规则,则会进行校验
  14067. */
  14068. updateStatus: function updateStatus(scope, cellValue) {
  14069. var _this41 = this;
  14070. var customVal = !ctor_amd_xe_utils_default.a.isUndefined(cellValue);
  14071. return this.$nextTick().then(function () {
  14072. var $refs = _this41.$refs,
  14073. editRules = _this41.editRules,
  14074. validStore = _this41.validStore;
  14075. if (scope && $refs.tableBody && editRules) {
  14076. var row = scope.row,
  14077. column = scope.column;
  14078. var type = 'change';
  14079. if (_this41.hasCellRules(type, row, column)) {
  14080. var cell = _this41.getCell(row, column);
  14081. if (cell) {
  14082. return _this41.validCellRules(type, row, column, cellValue).then(function () {
  14083. if (customVal && validStore.visible) {
  14084. methods_setCellValue(row, column, cellValue);
  14085. }
  14086. _this41.clearValidate();
  14087. }).catch(function (_ref6) {
  14088. var rule = _ref6.rule;
  14089. if (customVal) {
  14090. methods_setCellValue(row, column, cellValue);
  14091. }
  14092. _this41.showValidTooltip({
  14093. rule: rule,
  14094. row: row,
  14095. column: column,
  14096. cell: cell
  14097. });
  14098. });
  14099. }
  14100. }
  14101. }
  14102. });
  14103. },
  14104. handleDefaultMergeCells: function handleDefaultMergeCells() {
  14105. this.setMergeCells(this.mergeCells);
  14106. },
  14107. /**
  14108. * 设置合并单元格
  14109. * @param {MergeOptions[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
  14110. */
  14111. setMergeCells: function setMergeCells(merges) {
  14112. var _this42 = this;
  14113. if (this.spanMethod) {
  14114. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14115. }
  14116. setMerges(this, merges, this.mergeList, this.afterFullData);
  14117. return this.$nextTick().then(function () {
  14118. return _this42.updateCellAreas();
  14119. });
  14120. },
  14121. /**
  14122. * 移除单元格合并
  14123. * @param {MergeOptions[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
  14124. */
  14125. removeMergeCells: function removeMergeCells(merges) {
  14126. var _this43 = this;
  14127. if (this.spanMethod) {
  14128. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14129. }
  14130. var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
  14131. return this.$nextTick().then(function () {
  14132. _this43.updateCellAreas();
  14133. return rest;
  14134. });
  14135. },
  14136. /**
  14137. * 获取所有被合并的单元格
  14138. */
  14139. getMergeCells: function getMergeCells() {
  14140. return this.mergeList.slice(0);
  14141. },
  14142. /**
  14143. * 清除所有单元格合并
  14144. */
  14145. clearMergeCells: function clearMergeCells() {
  14146. this.mergeList = [];
  14147. return this.$nextTick();
  14148. },
  14149. handleDefaultMergeFooterItems: function handleDefaultMergeFooterItems() {
  14150. this.setMergeFooterItems(this.mergeFooterItems);
  14151. },
  14152. setMergeFooterItems: function setMergeFooterItems(merges) {
  14153. var _this44 = this;
  14154. if (this.footerSpanMethod) {
  14155. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14156. }
  14157. setMerges(this, merges, this.mergeFooterList, null);
  14158. return this.$nextTick().then(function () {
  14159. return _this44.updateCellAreas();
  14160. });
  14161. },
  14162. removeMergeFooterItems: function removeMergeFooterItems(merges) {
  14163. var _this45 = this;
  14164. if (this.footerSpanMethod) {
  14165. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14166. }
  14167. var rest = removeMerges(this, merges, this.mergeFooterList, null);
  14168. return this.$nextTick().then(function () {
  14169. _this45.updateCellAreas();
  14170. return rest;
  14171. });
  14172. },
  14173. /**
  14174. * 获取所有被合并的表尾
  14175. */
  14176. getMergeFooterItems: function getMergeFooterItems() {
  14177. return this.mergeFooterList.slice(0);
  14178. },
  14179. /**
  14180. * 清除所有表尾合并
  14181. */
  14182. clearMergeFooterItems: function clearMergeFooterItems() {
  14183. this.mergeFooterList = [];
  14184. return this.$nextTick();
  14185. },
  14186. updateZindex: function updateZindex() {
  14187. if (this.zIndex) {
  14188. this.tZindex = this.zIndex;
  14189. } else if (this.tZindex < UtilTools.getLastZIndex()) {
  14190. this.tZindex = UtilTools.nextZIndex();
  14191. }
  14192. },
  14193. updateCellAreas: function updateCellAreas() {
  14194. if (this.mouseConfig && this.mouseOpts.area && this.handleUpdateCellAreas) {
  14195. this.handleUpdateCellAreas();
  14196. }
  14197. },
  14198. emitEvent: function emitEvent(type, params, evnt) {
  14199. this.$emit(type, Object.assign({
  14200. $table: this,
  14201. $grid: this.$xegrid,
  14202. $event: evnt
  14203. }, params), evnt);
  14204. },
  14205. focus: function focus() {
  14206. this.isActivated = true;
  14207. return this.$nextTick();
  14208. },
  14209. blur: function blur() {
  14210. this.isActivated = false;
  14211. return this.$nextTick();
  14212. },
  14213. // 与工具栏对接
  14214. connect: function connect($toolbar) {
  14215. if ($toolbar && $toolbar.syncUpdate) {
  14216. $toolbar.syncUpdate({
  14217. collectColumn: this.collectColumn,
  14218. $table: this
  14219. });
  14220. this.$toolbar = $toolbar;
  14221. } else {
  14222. UtilTools.error('vxe.error.barUnableLink');
  14223. }
  14224. return this.$nextTick();
  14225. },
  14226. // 检查触发源是否属于目标节点
  14227. getEventTargetNode: getEventTargetNode,
  14228. /*************************
  14229. * Publish methods
  14230. *************************/
  14231. getCell: function getCell(row, column) {
  14232. var $refs = this.$refs;
  14233. var rowid = methods_getRowid(this, row);
  14234. var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
  14235. if (bodyElem && bodyElem.$el) {
  14236. return bodyElem.$el.querySelector(".vxe-body--row[data-rowid=\"".concat(rowid, "\"] .").concat(column.id));
  14237. }
  14238. return null;
  14239. },
  14240. getCellLabel: function getCellLabel(row, column) {
  14241. var formatter = column.formatter;
  14242. var cellValue = UtilTools.getCellValue(row, column);
  14243. var cellLabel = cellValue;
  14244. if (formatter) {
  14245. var rest, formatData;
  14246. var colid = column.id;
  14247. var fullAllDataRowMap = this.fullAllDataRowMap;
  14248. var cacheFormat = fullAllDataRowMap.has(row);
  14249. if (cacheFormat) {
  14250. rest = fullAllDataRowMap.get(row);
  14251. formatData = rest.formatData;
  14252. if (!formatData) {
  14253. formatData = fullAllDataRowMap.get(row).formatData = {};
  14254. }
  14255. if (rest && formatData[colid]) {
  14256. if (formatData[colid].value === cellValue) {
  14257. return formatData[colid].label;
  14258. }
  14259. }
  14260. }
  14261. var formatParams = {
  14262. cellValue: cellValue,
  14263. row: row,
  14264. rowIndex: this.getRowIndex(row),
  14265. column: column,
  14266. columnIndex: this.getColumnIndex(column)
  14267. };
  14268. if (ctor_amd_xe_utils_default.a.isString(formatter)) {
  14269. if (ctor_amd_xe_utils_default.a[formatter]) {
  14270. cellLabel = ctor_amd_xe_utils_default.a[formatter](cellValue);
  14271. } else if (src_formats.get(formatter)) {
  14272. cellLabel = src_formats.get(formatter)(formatParams);
  14273. } else {
  14274. cellLabel = '';
  14275. }
  14276. } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
  14277. if (ctor_amd_xe_utils_default.a[formatter[0]]) {
  14278. cellLabel = ctor_amd_xe_utils_default.a[formatter[0]].apply(ctor_amd_xe_utils_default.a, [cellValue].concat(_toConsumableArray(formatter.slice(1))));
  14279. } else if (src_formats.get(formatter[0])) {
  14280. cellLabel = src_formats.get(formatter[0]).apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1))));
  14281. } else {
  14282. cellLabel = '';
  14283. }
  14284. } else {
  14285. cellLabel = formatter(formatParams);
  14286. }
  14287. if (formatData) {
  14288. formatData[colid] = {
  14289. value: cellValue,
  14290. label: cellLabel
  14291. };
  14292. }
  14293. }
  14294. return cellLabel;
  14295. }
  14296. /*************************
  14297. * Publish methods
  14298. *************************/
  14299. }; // Module methods
  14300. 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(',');
  14301. funcs.forEach(function (name) {
  14302. Methods[name] = function () {
  14303. return this["_".concat(name)] ? this["_".concat(name)].apply(this, arguments) : null;
  14304. };
  14305. });
  14306. /* harmony default export */ var methods = (Methods);
  14307. // CONCATENATED MODULE: ./packages/table/src/table.js
  14308. /**
  14309. * 渲染浮固定列
  14310. * 分别渲染左边固定列和右边固定列
  14311. * 如果宽度足够情况下,则不需要渲染固定列
  14312. * @param {Function} h 创建 VNode 函数
  14313. * @param {Object} $xetable 表格实例
  14314. * @param {String} fixedType 固定列类型
  14315. */
  14316. function renderFixed(h, $xetable, fixedType) {
  14317. var tableData = $xetable.tableData,
  14318. tableColumn = $xetable.tableColumn,
  14319. visibleColumn = $xetable.visibleColumn,
  14320. tableGroupColumn = $xetable.tableGroupColumn,
  14321. isGroup = $xetable.isGroup,
  14322. vSize = $xetable.vSize,
  14323. showHeader = $xetable.showHeader,
  14324. showFooter = $xetable.showFooter,
  14325. columnStore = $xetable.columnStore,
  14326. footerTableData = $xetable.footerTableData;
  14327. var fixedColumn = columnStore["".concat(fixedType, "List")];
  14328. return h('div', {
  14329. class: "vxe-table--fixed-".concat(fixedType, "-wrapper"),
  14330. ref: "".concat(fixedType, "Container")
  14331. }, [showHeader ? h('vxe-table-header', {
  14332. props: {
  14333. fixedType: fixedType,
  14334. tableData: tableData,
  14335. tableColumn: tableColumn,
  14336. visibleColumn: visibleColumn,
  14337. tableGroupColumn: tableGroupColumn,
  14338. size: vSize,
  14339. fixedColumn: fixedColumn,
  14340. isGroup: isGroup
  14341. },
  14342. ref: "".concat(fixedType, "Header")
  14343. }) : null, h('vxe-table-body', {
  14344. props: {
  14345. fixedType: fixedType,
  14346. tableData: tableData,
  14347. tableColumn: tableColumn,
  14348. visibleColumn: visibleColumn,
  14349. fixedColumn: fixedColumn,
  14350. size: vSize,
  14351. isGroup: isGroup
  14352. },
  14353. ref: "".concat(fixedType, "Body")
  14354. }), showFooter && footerTableData ? h('vxe-table-footer', {
  14355. props: {
  14356. footerTableData: footerTableData,
  14357. tableColumn: tableColumn,
  14358. visibleColumn: visibleColumn,
  14359. fixedColumn: fixedColumn,
  14360. fixedType: fixedType,
  14361. size: vSize
  14362. },
  14363. ref: "".concat(fixedType, "Footer")
  14364. }) : null]);
  14365. }
  14366. /* harmony default export */ var table = ({
  14367. name: 'VxeTable',
  14368. props: {
  14369. /** 基本属性 */
  14370. id: String,
  14371. // 数据
  14372. data: Array,
  14373. // (v3.0 废弃)
  14374. customs: Array,
  14375. // 表格的高度
  14376. height: [Number, String],
  14377. // 表格的最大高度
  14378. maxHeight: [Number, String],
  14379. // 所有列是否允许拖动列宽调整大小
  14380. resizable: {
  14381. type: Boolean,
  14382. default: function _default() {
  14383. return conf.table.resizable;
  14384. }
  14385. },
  14386. // 是否带有斑马纹
  14387. stripe: {
  14388. type: Boolean,
  14389. default: function _default() {
  14390. return conf.table.stripe;
  14391. }
  14392. },
  14393. // 是否带有边框
  14394. border: {
  14395. type: [Boolean, String],
  14396. default: function _default() {
  14397. return conf.table.border;
  14398. }
  14399. },
  14400. // 是否圆角边框
  14401. round: {
  14402. type: Boolean,
  14403. default: function _default() {
  14404. return conf.table.round;
  14405. }
  14406. },
  14407. // 表格的尺寸
  14408. size: {
  14409. type: String,
  14410. default: function _default() {
  14411. return conf.table.size || conf.size;
  14412. }
  14413. },
  14414. // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
  14415. fit: {
  14416. type: Boolean,
  14417. default: function _default() {
  14418. return conf.table.fit;
  14419. }
  14420. },
  14421. // 表格是否加载中
  14422. loading: Boolean,
  14423. // 所有的列对其方式
  14424. align: {
  14425. type: String,
  14426. default: function _default() {
  14427. return conf.table.align;
  14428. }
  14429. },
  14430. // 所有的表头列的对齐方式
  14431. headerAlign: {
  14432. type: String,
  14433. default: function _default() {
  14434. return conf.table.headerAlign;
  14435. }
  14436. },
  14437. // 所有的表尾列的对齐方式
  14438. footerAlign: {
  14439. type: String,
  14440. default: function _default() {
  14441. return conf.table.footerAlign;
  14442. }
  14443. },
  14444. // 是否显示表头
  14445. showHeader: {
  14446. type: Boolean,
  14447. default: function _default() {
  14448. return conf.table.showHeader;
  14449. }
  14450. },
  14451. // (v3.0 废弃)
  14452. startIndex: {
  14453. type: Number,
  14454. default: 0
  14455. },
  14456. // 是否要高亮当前选中行
  14457. highlightCurrentRow: {
  14458. type: Boolean,
  14459. default: function _default() {
  14460. return conf.table.highlightCurrentRow;
  14461. }
  14462. },
  14463. // 鼠标移到行是否要高亮显示
  14464. highlightHoverRow: {
  14465. type: Boolean,
  14466. default: function _default() {
  14467. return conf.table.highlightHoverRow;
  14468. }
  14469. },
  14470. // 是否要高亮当前选中列
  14471. highlightCurrentColumn: {
  14472. type: Boolean,
  14473. default: function _default() {
  14474. return conf.table.highlightCurrentColumn;
  14475. }
  14476. },
  14477. // 鼠标移到列是否要高亮显示
  14478. highlightHoverColumn: {
  14479. type: Boolean,
  14480. default: function _default() {
  14481. return conf.table.highlightHoverColumn;
  14482. }
  14483. },
  14484. // 激活单元格编辑时是否高亮显示
  14485. highlightCell: Boolean,
  14486. // 是否显示表尾合计
  14487. showFooter: Boolean,
  14488. // 表尾合计的计算方法
  14489. footerMethod: {
  14490. type: Function,
  14491. default: conf.table.footerMethod
  14492. },
  14493. // 给行附加 className
  14494. rowClassName: [String, Function],
  14495. // 给单元格附加 className
  14496. cellClassName: [String, Function],
  14497. // 给表头的行附加 className
  14498. headerRowClassName: [String, Function],
  14499. // 给表头的单元格附加 className
  14500. headerCellClassName: [String, Function],
  14501. // 给表尾的行附加 className
  14502. footerRowClassName: [String, Function],
  14503. // 给表尾的单元格附加 className
  14504. footerCellClassName: [String, Function],
  14505. // 给单元格附加样式
  14506. cellStyle: [Object, Function],
  14507. // 给表头单元格附加样式
  14508. headerCellStyle: [Object, Function],
  14509. // 给表尾单元格附加样式
  14510. footerCellStyle: [Object, Function],
  14511. // 给行附加样式
  14512. rowStyle: [Object, Function],
  14513. // 给表头行附加样式
  14514. headerRowStyle: [Object, Function],
  14515. // 给表尾行附加样式
  14516. footerRowStyle: [Object, Function],
  14517. // 合并指定单元格
  14518. mergeCells: Array,
  14519. // 合并指定的表尾数据
  14520. mergeFooterItems: Array,
  14521. // 自定义合并行或列的方法
  14522. spanMethod: Function,
  14523. // 表尾合并行或列
  14524. footerSpanMethod: Function,
  14525. // 设置所有内容过长时显示为省略号
  14526. showOverflow: {
  14527. type: [Boolean, String],
  14528. default: function _default() {
  14529. return conf.table.showOverflow;
  14530. }
  14531. },
  14532. // 设置表头所有内容过长时显示为省略号
  14533. showHeaderOverflow: {
  14534. type: [Boolean, String],
  14535. default: function _default() {
  14536. return conf.table.showHeaderOverflow;
  14537. }
  14538. },
  14539. // 设置表尾所有内容过长时显示为省略号
  14540. showFooterOverflow: {
  14541. type: [Boolean, String],
  14542. default: function _default() {
  14543. return conf.table.showFooterOverflow;
  14544. }
  14545. },
  14546. // 是否所有服务端筛选
  14547. remoteFilter: Boolean,
  14548. // 是否所有服务端排序
  14549. remoteSort: Boolean,
  14550. // 自定义所有列的排序方法
  14551. sortMethod: Function,
  14552. // 所有列宽度
  14553. columnWidth: [Number, String],
  14554. // 所有列最小宽度,把剩余宽度按比例分配
  14555. columnMinWidth: [Number, String],
  14556. /** 高级属性 */
  14557. // 主键配置
  14558. columnKey: Boolean,
  14559. rowKey: Boolean,
  14560. rowId: {
  14561. type: String,
  14562. default: function _default() {
  14563. return conf.table.rowId;
  14564. }
  14565. },
  14566. zIndex: Number,
  14567. emptyText: {
  14568. type: String,
  14569. default: function _default() {
  14570. return conf.table.emptyText;
  14571. }
  14572. },
  14573. keepSource: {
  14574. type: Boolean,
  14575. default: function _default() {
  14576. return conf.table.keepSource;
  14577. }
  14578. },
  14579. // 是否自动监听父容器变化去更新响应式表格宽高
  14580. autoResize: {
  14581. type: Boolean,
  14582. default: function _default() {
  14583. return conf.table.autoResize;
  14584. }
  14585. },
  14586. // 是否自动根据状态属性去更新响应式表格宽高
  14587. syncResize: [Boolean, String, Number],
  14588. // 设置列的默认参数,仅对部分支持的属性有效
  14589. columnConfig: Object,
  14590. resizableConfig: Object,
  14591. // 序号配置项
  14592. seqConfig: Object,
  14593. // 排序配置项
  14594. sortConfig: Object,
  14595. // 筛选配置项
  14596. filterConfig: Object,
  14597. // 单选框配置
  14598. radioConfig: Object,
  14599. // (v3.0 废弃)
  14600. selectConfig: Object,
  14601. // 复选框配置项
  14602. checkboxConfig: Object,
  14603. // tooltip 配置项
  14604. tooltipConfig: Object,
  14605. // 导出配置项
  14606. exportConfig: [Boolean, Object],
  14607. // 导入配置项
  14608. importConfig: [Boolean, Object],
  14609. // 打印配置项
  14610. printConfig: Object,
  14611. // 展开行配置项
  14612. expandConfig: Object,
  14613. // 树形结构配置项
  14614. treeConfig: [Boolean, Object],
  14615. // 快捷菜单配置项
  14616. menuConfig: [Boolean, Object],
  14617. // 在 v3 中废弃
  14618. contextMenu: [Boolean, Object],
  14619. // 鼠标配置项
  14620. mouseConfig: Object,
  14621. // 区域配置项
  14622. areaConfig: Object,
  14623. // 按键配置项
  14624. keyboardConfig: Object,
  14625. // 复制/粘贴配置项
  14626. clipConfig: Object,
  14627. // 查找/替换配置项
  14628. fnrConfig: Object,
  14629. // 编辑配置项
  14630. editConfig: [Boolean, Object],
  14631. // 校验配置项
  14632. validConfig: Object,
  14633. // 校验规则配置项
  14634. editRules: Object,
  14635. // 空内容渲染配置项
  14636. emptyRender: [Boolean, Object],
  14637. // 自定义列配置项
  14638. customConfig: [Boolean, Object],
  14639. // 横向虚拟滚动配置项
  14640. scrollX: Object,
  14641. // 纵向虚拟滚动配置项
  14642. scrollY: Object,
  14643. // 优化相关
  14644. cloak: {
  14645. type: Boolean,
  14646. default: function _default() {
  14647. return conf.table.cloak;
  14648. }
  14649. },
  14650. animat: {
  14651. type: Boolean,
  14652. default: function _default() {
  14653. return conf.table.animat;
  14654. }
  14655. },
  14656. delayHover: {
  14657. type: Number,
  14658. default: function _default() {
  14659. return conf.table.delayHover;
  14660. }
  14661. },
  14662. // 优化配置项
  14663. optimization: Object,
  14664. // 额外的参数
  14665. params: Object
  14666. },
  14667. components: {
  14668. VxeTableBody: packages_body
  14669. },
  14670. provide: function provide() {
  14671. return {
  14672. $xetable: this,
  14673. xecolgroup: null
  14674. };
  14675. },
  14676. inject: {
  14677. $xegrid: {
  14678. default: null
  14679. }
  14680. },
  14681. mixins: [],
  14682. data: function data() {
  14683. return {
  14684. tId: "".concat(ctor_amd_xe_utils_default.a.uniqueId()),
  14685. isCloak: false,
  14686. // 列分组配置
  14687. collectColumn: [],
  14688. // 渲染的列分组
  14689. tableGroupColumn: [],
  14690. // 完整所有列
  14691. tableFullColumn: [],
  14692. // 渲染所有列
  14693. visibleColumn: [],
  14694. // 可视区渲染的列
  14695. tableColumn: [],
  14696. // 渲染中的数据
  14697. tableData: [],
  14698. // 是否启用了横向 X 可视渲染方式加载
  14699. scrollXLoad: false,
  14700. // 是否启用了纵向 Y 可视渲染方式加载
  14701. scrollYLoad: false,
  14702. // 是否存在纵向滚动条
  14703. overflowY: true,
  14704. // 是否存在横向滚动条
  14705. overflowX: false,
  14706. // 纵向滚动条的宽度
  14707. scrollbarWidth: 0,
  14708. // 横向滚动条的高度
  14709. scrollbarHeight: 0,
  14710. // 行高
  14711. rowHeight: 0,
  14712. // 表格父容器的高度
  14713. parentHeight: 0,
  14714. // 复选框属性,是否全选
  14715. isAllSelected: false,
  14716. // 复选框属性,有选中且非全选状态
  14717. isIndeterminate: false,
  14718. // 复选框属性,已选中的行
  14719. selection: [],
  14720. // 当前行
  14721. currentRow: null,
  14722. // 单选框属性,选中列
  14723. currentColumn: null,
  14724. // 单选框属性,选中行
  14725. selectRow: null,
  14726. // 表尾合计数据
  14727. footerTableData: [],
  14728. // 展开列信息
  14729. expandColumn: null,
  14730. // 树节点列信息
  14731. treeNodeColumn: null,
  14732. // 已展开的行
  14733. rowExpandeds: [],
  14734. // 懒加载中的展开行的列表
  14735. expandLazyLoadeds: [],
  14736. // 已展开树节点
  14737. treeExpandeds: [],
  14738. // 懒加载中的树节点的列表
  14739. treeLazyLoadeds: [],
  14740. // 树节点不确定状态的列表
  14741. treeIndeterminates: [],
  14742. // 合并单元格的对象集
  14743. mergeList: [],
  14744. // 合并表尾数据的对象集
  14745. mergeFooterList: [],
  14746. // 是否已经加载了筛选
  14747. hasFilterPanel: false,
  14748. // 当前选中的筛选列
  14749. filterStore: {
  14750. isAllSelected: false,
  14751. isIndeterminate: false,
  14752. style: null,
  14753. options: [],
  14754. column: null,
  14755. multiple: false,
  14756. visible: false
  14757. },
  14758. // 存放列相关的信息
  14759. columnStore: {
  14760. leftList: [],
  14761. centerList: [],
  14762. rightList: [],
  14763. resizeList: [],
  14764. pxList: [],
  14765. pxMinList: [],
  14766. scaleList: [],
  14767. scaleMinList: [],
  14768. autoList: []
  14769. },
  14770. // 存放快捷菜单的信息
  14771. ctxMenuStore: {
  14772. selected: null,
  14773. visible: false,
  14774. showChild: false,
  14775. selectChild: null,
  14776. list: [],
  14777. style: null
  14778. },
  14779. // 存放可编辑相关信息
  14780. editStore: {
  14781. indexs: {
  14782. columns: []
  14783. },
  14784. titles: {
  14785. columns: []
  14786. },
  14787. // 所有选中
  14788. checked: {
  14789. rows: [],
  14790. columns: [],
  14791. tRows: [],
  14792. tColumns: []
  14793. },
  14794. // 选中源
  14795. selected: {
  14796. row: null,
  14797. column: null
  14798. },
  14799. // 已复制源
  14800. copyed: {
  14801. cut: false,
  14802. rows: [],
  14803. columns: []
  14804. },
  14805. // 激活
  14806. actived: {
  14807. row: null,
  14808. column: null
  14809. },
  14810. insertList: [],
  14811. removeList: []
  14812. },
  14813. // 存放数据校验相关信息
  14814. validStore: {
  14815. visible: false,
  14816. row: null,
  14817. column: null,
  14818. content: '',
  14819. rule: null,
  14820. isArrow: false
  14821. },
  14822. // 导入相关信息
  14823. importStore: {
  14824. file: null,
  14825. type: '',
  14826. modeList: [],
  14827. typeList: [],
  14828. filename: '',
  14829. visible: false
  14830. },
  14831. importParams: {
  14832. mode: '',
  14833. types: null,
  14834. message: true
  14835. },
  14836. // 导出相关信息
  14837. exportStore: {
  14838. name: '',
  14839. modeList: [],
  14840. typeList: [],
  14841. columns: [],
  14842. hasFooter: false,
  14843. visible: false
  14844. },
  14845. exportParams: {
  14846. filename: '',
  14847. sheetName: '',
  14848. mode: '',
  14849. type: '',
  14850. original: false,
  14851. message: true,
  14852. isHeader: false,
  14853. isFooter: false
  14854. }
  14855. };
  14856. },
  14857. computed: {
  14858. vSize: function vSize() {
  14859. return this.size || this.$parent.size || this.$parent.vSize;
  14860. },
  14861. validOpts: function validOpts() {
  14862. return Object.assign({
  14863. message: 'default'
  14864. }, conf.table.validConfig, this.validConfig);
  14865. },
  14866. sXOpts: function sXOpts() {
  14867. return Object.assign({}, conf.table.scrollX, this.optimizeOpts.scrollX, this.scrollX);
  14868. },
  14869. sYOpts: function sYOpts() {
  14870. return Object.assign({}, conf.table.scrollY, this.optimizeOpts.scrollY, this.scrollY);
  14871. },
  14872. optimizeOpts: function optimizeOpts() {
  14873. return Object.assign({}, conf.table.optimization, this.optimization);
  14874. },
  14875. rowHeightMaps: function rowHeightMaps() {
  14876. return {
  14877. default: 48,
  14878. medium: 44,
  14879. small: 40,
  14880. mini: 36
  14881. };
  14882. },
  14883. columnOpts: function columnOpts() {
  14884. return Object.assign({}, this.columnConfig);
  14885. },
  14886. resizableOpts: function resizableOpts() {
  14887. return Object.assign({}, conf.table.resizableConfig, this.resizableConfig);
  14888. },
  14889. seqOpts: function seqOpts() {
  14890. return Object.assign({
  14891. startIndex: 0
  14892. }, conf.table.seqConfig, this.seqConfig);
  14893. },
  14894. radioOpts: function radioOpts() {
  14895. return Object.assign({}, conf.table.radioConfig, this.radioConfig);
  14896. },
  14897. checkboxOpts: function checkboxOpts() {
  14898. return Object.assign({}, conf.table.checkboxConfig, this.checkboxConfig || this.selectConfig);
  14899. },
  14900. tooltipOpts: function tooltipOpts() {
  14901. return Object.assign({
  14902. size: this.vSize,
  14903. leaveDelay: 300
  14904. }, conf.table.tooltipConfig, this.tooltipConfig);
  14905. },
  14906. validTipOpts: function validTipOpts() {
  14907. return Object.assign({
  14908. isArrow: false
  14909. }, this.tooltipOpts);
  14910. },
  14911. editOpts: function editOpts() {
  14912. return Object.assign({}, conf.table.editConfig, this.editConfig);
  14913. },
  14914. sortOpts: function sortOpts() {
  14915. return Object.assign({
  14916. orders: ['asc', 'desc', null]
  14917. }, conf.table.sortConfig, this.sortConfig);
  14918. },
  14919. filterOpts: function filterOpts() {
  14920. return Object.assign({}, conf.table.filterConfig, this.filterConfig);
  14921. },
  14922. mouseOpts: function mouseOpts() {
  14923. return Object.assign({}, conf.table.mouseConfig, this.mouseConfig);
  14924. },
  14925. areaOpts: function areaOpts() {
  14926. return Object.assign({}, conf.table.areaConfig, this.areaConfig);
  14927. },
  14928. keyboardOpts: function keyboardOpts() {
  14929. return Object.assign({}, conf.table.keyboardConfig, this.keyboardConfig);
  14930. },
  14931. clipOpts: function clipOpts() {
  14932. return Object.assign({}, conf.table.clipConfig, this.clipConfig);
  14933. },
  14934. fnrOpts: function fnrOpts() {
  14935. return Object.assign({}, conf.table.fnrConfig, this.fnrConfig);
  14936. },
  14937. // 是否使用了分组表头
  14938. isGroup: function isGroup() {
  14939. return this.collectColumn.some(UtilTools.hasChildrenList);
  14940. },
  14941. hasTip: function hasTip() {
  14942. return v_x_e_table._tooltip;
  14943. },
  14944. isResizable: function isResizable() {
  14945. return this.resizable || this.tableFullColumn.some(function (column) {
  14946. return column.resizable;
  14947. });
  14948. },
  14949. headerCtxMenu: function headerCtxMenu() {
  14950. var headerOpts = this.ctxMenuOpts.header;
  14951. return headerOpts && headerOpts.options ? headerOpts.options : [];
  14952. },
  14953. bodyCtxMenu: function bodyCtxMenu() {
  14954. var bodyOpts = this.ctxMenuOpts.body;
  14955. return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
  14956. },
  14957. footerCtxMenu: function footerCtxMenu() {
  14958. var footerOpts = this.ctxMenuOpts.footer;
  14959. return footerOpts && footerOpts.options ? footerOpts.options : [];
  14960. },
  14961. isCtxMenu: function isCtxMenu() {
  14962. return (this.contextMenu || this.menuConfig) && UtilTools.isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length);
  14963. },
  14964. ctxMenuOpts: function ctxMenuOpts() {
  14965. return Object.assign({}, conf.table.contextMenu, conf.table.menuConfig, this.contextMenu, this.menuConfig);
  14966. },
  14967. ctxMenuList: function ctxMenuList() {
  14968. var rest = [];
  14969. this.ctxMenuStore.list.forEach(function (list) {
  14970. list.forEach(function (item) {
  14971. rest.push(item);
  14972. });
  14973. });
  14974. return rest;
  14975. },
  14976. exportOpts: function exportOpts() {
  14977. return Object.assign({}, conf.table.exportConfig, this.exportConfig);
  14978. },
  14979. importOpts: function importOpts() {
  14980. return Object.assign({}, conf.table.importConfig, this.importConfig);
  14981. },
  14982. printOpts: function printOpts() {
  14983. return Object.assign({}, conf.table.printConfig, this.printConfig);
  14984. },
  14985. expandOpts: function expandOpts() {
  14986. return Object.assign({}, conf.table.expandConfig, this.expandConfig);
  14987. },
  14988. treeOpts: function treeOpts() {
  14989. return Object.assign({}, conf.table.treeConfig, this.treeConfig);
  14990. },
  14991. emptyOpts: function emptyOpts() {
  14992. return Object.assign({}, conf.table.emptyRender, this.emptyRender);
  14993. },
  14994. cellOffsetWidth: function cellOffsetWidth() {
  14995. return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
  14996. },
  14997. customOpts: function customOpts() {
  14998. return Object.assign({}, conf.table.customConfig, this.customConfig);
  14999. },
  15000. tableBorder: function tableBorder() {
  15001. var border = this.border;
  15002. if (border === true) {
  15003. return 'full';
  15004. }
  15005. if (border) {
  15006. return border;
  15007. }
  15008. return 'default';
  15009. },
  15010. /**
  15011. * 判断列全选的复选框是否禁用
  15012. */
  15013. isAllCheckboxDisabled: function isAllCheckboxDisabled() {
  15014. var tableFullData = this.tableFullData,
  15015. treeConfig = this.treeConfig,
  15016. checkboxOpts = this.checkboxOpts;
  15017. var strict = checkboxOpts.strict,
  15018. checkMethod = checkboxOpts.checkMethod;
  15019. if (strict) {
  15020. if (tableFullData.length) {
  15021. if (checkMethod) {
  15022. if (treeConfig) {// 暂时不支持树形结构
  15023. } // 如果所有行都被禁用
  15024. return tableFullData.every(function (row) {
  15025. return !checkMethod({
  15026. row: row
  15027. });
  15028. });
  15029. }
  15030. return false;
  15031. }
  15032. return true;
  15033. }
  15034. return false;
  15035. }
  15036. },
  15037. watch: {
  15038. data: function data(value) {
  15039. var _this = this;
  15040. this.loadTableData(value).then(function () {
  15041. if (!_this.inited) {
  15042. _this.inited = true;
  15043. _this.handleDefaults();
  15044. }
  15045. if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
  15046. UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
  15047. }
  15048. });
  15049. },
  15050. customs: function customs(value) {
  15051. if (!this.isUpdateCustoms) {
  15052. this.mergeCustomColumn(value);
  15053. }
  15054. this.isUpdateCustoms = false;
  15055. },
  15056. collectColumn: function collectColumn(value) {
  15057. var _this2 = this;
  15058. var tableFullColumn = UtilTools.getColumnList(value);
  15059. this.tableFullColumn = tableFullColumn;
  15060. this.clearMergeCells();
  15061. this.clearMergeFooterItems();
  15062. this.cacheColumnMap();
  15063. if (this.customs) {
  15064. this.mergeCustomColumn(this.customs);
  15065. }
  15066. if (this.customConfig) {
  15067. this.restoreCustomStorage();
  15068. }
  15069. this.refreshColumn().then(function () {
  15070. if (_this2.scrollXLoad) {
  15071. _this2.loadScrollXData(true);
  15072. }
  15073. });
  15074. this.handleTableData(true);
  15075. if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
  15076. UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
  15077. }
  15078. if (this.isGroup && this.mouseConfig && this.mouseOpts.checked) {
  15079. UtilTools.error('vxe.error.groupMouseRange', ['mouse-config.checked']);
  15080. }
  15081. this.$nextTick(function () {
  15082. if (_this2.$toolbar) {
  15083. _this2.$toolbar.syncUpdate({
  15084. collectColumn: value,
  15085. $table: _this2
  15086. }); // 在 v3.0 中废弃 toolbar 方式
  15087. if (!_this2.customConfig) {
  15088. _this2.restoreCustomStorage();
  15089. _this2.analyColumnWidth();
  15090. _this2.refreshColumn();
  15091. }
  15092. }
  15093. });
  15094. },
  15095. tableColumn: function tableColumn() {
  15096. this.analyColumnWidth();
  15097. },
  15098. showHeader: function showHeader() {
  15099. var _this3 = this;
  15100. this.$nextTick(function () {
  15101. _this3.recalculate(true).then(function () {
  15102. return _this3.refreshScroll();
  15103. });
  15104. });
  15105. },
  15106. showFooter: function showFooter() {
  15107. var _this4 = this;
  15108. this.$nextTick(function () {
  15109. _this4.recalculate(true).then(function () {
  15110. return _this4.refreshScroll();
  15111. });
  15112. });
  15113. },
  15114. height: function height() {
  15115. var _this5 = this;
  15116. this.$nextTick(function () {
  15117. return _this5.recalculate(true);
  15118. });
  15119. },
  15120. maxHeight: function maxHeight() {
  15121. var _this6 = this;
  15122. this.$nextTick(function () {
  15123. return _this6.recalculate(true);
  15124. });
  15125. },
  15126. syncResize: function syncResize(value) {
  15127. var _this7 = this;
  15128. if (value) {
  15129. var $el = this.$el; // 只在可视状态下才去更新
  15130. if ($el.clientWidth && $el.clientHeight) {
  15131. this.recalculate();
  15132. }
  15133. this.$nextTick(function () {
  15134. setTimeout(function () {
  15135. if ($el.clientWidth && $el.clientHeight) {
  15136. _this7.recalculate(true);
  15137. }
  15138. });
  15139. });
  15140. }
  15141. },
  15142. mergeCells: function mergeCells(value) {
  15143. this.clearMergeCells();
  15144. this.setMergeCells(value);
  15145. },
  15146. mergeFooterItems: function mergeFooterItems(value) {
  15147. this.clearMergeFooterItems();
  15148. this.setMergeFooterItems(value);
  15149. }
  15150. },
  15151. created: function created() {
  15152. var _this8 = this;
  15153. var _Object$assign = Object.assign(this, {
  15154. tZindex: 0,
  15155. elemStore: {},
  15156. // 存放横向 X 虚拟滚动相关的信息
  15157. scrollXStore: {},
  15158. // 存放纵向 Y 虚拟滚动相关信息
  15159. scrollYStore: {},
  15160. // 存放 tooltip 相关信息
  15161. tooltipStore: {},
  15162. // 表格宽度
  15163. tableWidth: 0,
  15164. // 表格高度
  15165. tableHeight: 0,
  15166. // 表头高度
  15167. headerHeight: 0,
  15168. // 表尾高度
  15169. footerHeight: 0,
  15170. // 当前 hover 行
  15171. // hoverRow: null,
  15172. // 最后滚动位置
  15173. lastScrollLeft: 0,
  15174. lastScrollTop: 0,
  15175. // 单选框属性,已选中保留的行
  15176. radioReserveRow: null,
  15177. // 复选框属性,已选中保留的行
  15178. checkboxReserveRowMap: {},
  15179. // 行数据,已展开保留的行
  15180. rowExpandedReserveRowMap: {},
  15181. // 树结构数据,已展开保留的行
  15182. treeExpandedReserveRowMap: {},
  15183. // 完整数据、条件处理后
  15184. tableFullData: [],
  15185. afterFullData: [],
  15186. // 缓存数据集
  15187. fullAllDataRowMap: new Map(),
  15188. fullAllDataRowIdData: {},
  15189. fullDataRowMap: new Map(),
  15190. fullDataRowIdData: {},
  15191. fullColumnMap: new Map(),
  15192. fullColumnIdData: {},
  15193. fullColumnFieldData: {}
  15194. }),
  15195. sXOpts = _Object$assign.sXOpts,
  15196. scrollXStore = _Object$assign.scrollXStore,
  15197. sYOpts = _Object$assign.sYOpts,
  15198. scrollYStore = _Object$assign.scrollYStore,
  15199. mouseOpts = _Object$assign.mouseOpts,
  15200. data = _Object$assign.data,
  15201. editOpts = _Object$assign.editOpts,
  15202. treeOpts = _Object$assign.treeOpts,
  15203. treeConfig = _Object$assign.treeConfig,
  15204. showOverflow = _Object$assign.showOverflow;
  15205. if (!this.rowId && (this.checkboxOpts.reserve || this.checkboxOpts.checkRowKeys || this.radioOpts.reserve || this.radioOpts.checkRowKey || this.expandOpts.expandRowKeys || this.treeOpts.expandRowKeys)) {
  15206. UtilTools.warn('vxe.error.reqProp', ['row-id']);
  15207. } // 在 v3.0 中废弃 column-width
  15208. if (this.columnWidth) {
  15209. UtilTools.warn('vxe.error.delProp', ['column-width', 'column-config.width']);
  15210. } // 在 v3.0 中废弃 column-min-width
  15211. if (this.columnMinWidth) {
  15212. UtilTools.warn('vxe.error.delProp', ['column-min-width', 'column-config.minWidth']);
  15213. } // 在 v3.0 中废弃 start-index
  15214. if (this.startIndex) {
  15215. UtilTools.warn('vxe.error.delProp', ['start-index', 'seq-config.startIndex']);
  15216. } // 在 v3.0 中废弃 select-config
  15217. if (this.selectConfig) {
  15218. UtilTools.warn('vxe.error.delProp', ['select-config', 'checkbox-config']);
  15219. }
  15220. if (this.editConfig && editOpts.showStatus && !this.keepSource) {
  15221. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  15222. }
  15223. if (treeConfig && treeOpts.line && (!this.rowKey || !showOverflow)) {
  15224. UtilTools.warn('vxe.error.reqProp', ['row-key | show-overflow']);
  15225. }
  15226. if (this.showFooter && !this.footerMethod) {
  15227. UtilTools.warn('vxe.error.reqProp', ['footer-method']);
  15228. } // 在 v3.0 中废弃 customs
  15229. if (this.customs) {
  15230. UtilTools.warn('vxe.error.removeProp', ['customs']);
  15231. } // 在 v3.0 中废弃 sort-method
  15232. if (this.sortMethod) {
  15233. UtilTools.warn('vxe.error.delProp', ['sort-method', 'sort-config.sortMethod']);
  15234. } // 在 v3.0 中废弃 remote-sort
  15235. if (this.remoteSort) {
  15236. UtilTools.warn('vxe.error.delProp', ['remote-sort', 'sort-config.remote']);
  15237. } // 在 v3.0 中废弃 remote-filter
  15238. if (this.remoteFilter) {
  15239. UtilTools.warn('vxe.error.delProp', ['remote-filter', 'filter-config.remote']);
  15240. }
  15241. if (!this.handleUpdateCellAreas) {
  15242. if (this.clipConfig) {
  15243. UtilTools.warn('vxe.error.notProp', ['clip-config']);
  15244. }
  15245. if (this.fnrConfig) {
  15246. UtilTools.warn('vxe.error.notProp', ['fnr-config']);
  15247. }
  15248. if (this.mouseOpts.area) {
  15249. UtilTools.error('vxe.error.notProp', ['mouse-config.area']);
  15250. return;
  15251. }
  15252. }
  15253. if (mouseOpts.selected && mouseOpts.area) {
  15254. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
  15255. }
  15256. if (mouseOpts.checked && mouseOpts.area) {
  15257. UtilTools.error('vxe.error.errConflicts', ['mouse-config.checked', 'mouse-config.area']);
  15258. } // v3 中只支持对象类型
  15259. // 在 v3.0 中废弃 context-menu
  15260. if (this.contextMenu) {
  15261. UtilTools.warn('vxe.error.delProp', ['context-menu', 'menu-config']);
  15262. if (!ctor_amd_xe_utils_default.a.isObject(this.contextMenu)) {
  15263. UtilTools.warn('vxe.error.errProp', ["table.context-menu=".concat(this.contextMenu), 'table.context-menu={}']);
  15264. }
  15265. }
  15266. if (this.menuConfig && !ctor_amd_xe_utils_default.a.isObject(this.menuConfig)) {
  15267. UtilTools.warn('vxe.error.errProp', ["table.menu-config=".concat(this.menuConfig), 'table.menu-config={}']);
  15268. }
  15269. if (this.exportConfig && !ctor_amd_xe_utils_default.a.isObject(this.exportConfig)) {
  15270. UtilTools.warn('vxe.error.errProp', ["table.export-config=".concat(this.exportConfig), 'table.export-config={}']);
  15271. }
  15272. if (this.importConfig && !ctor_amd_xe_utils_default.a.isObject(this.importConfig)) {
  15273. UtilTools.warn('vxe.error.errProp', ["table.import-config=".concat(this.importConfig), 'table.import-config={}']);
  15274. }
  15275. if (this.printConfig && !ctor_amd_xe_utils_default.a.isObject(this.printConfig)) {
  15276. UtilTools.warn('vxe.error.errProp', ["table.print-config=".concat(this.printConfig), 'table.print-config={}']);
  15277. }
  15278. if (this.treeConfig && !ctor_amd_xe_utils_default.a.isObject(this.treeConfig)) {
  15279. UtilTools.warn('vxe.error.errProp', ["table.tree-config=".concat(this.treeConfig), 'table.tree-config={}']);
  15280. }
  15281. if (this.customConfig && !ctor_amd_xe_utils_default.a.isObject(this.customConfig)) {
  15282. UtilTools.warn('vxe.error.errProp', ["table.custom-config=".concat(this.customConfig), 'table.custom-config={}']);
  15283. }
  15284. if (this.editConfig && !ctor_amd_xe_utils_default.a.isObject(this.editConfig)) {
  15285. UtilTools.warn('vxe.error.errProp', ["table.edit-config=".concat(this.editConfig), 'table.edit-config={}']);
  15286. }
  15287. if (this.emptyRender && !ctor_amd_xe_utils_default.a.isObject(this.emptyRender)) {
  15288. UtilTools.warn('vxe.error.errProp', ["table.empty-render=".concat(this.emptyRender), 'table.empty-render={}']);
  15289. }
  15290. if (this.mouseConfig && this.editConfig) {
  15291. if (mouseOpts.checked && editOpts.trigger !== 'dblclick') {
  15292. UtilTools.warn('vxe.error.errProp', ['mouse-config.checked', 'edit-config.trigger=dblclick']);
  15293. }
  15294. }
  15295. if (this.mouseOpts.area && this.checkboxOpts.range) {
  15296. UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range']);
  15297. }
  15298. if (treeConfig && this.stripe) {
  15299. UtilTools.warn('vxe.error.noTree', ['stripe']);
  15300. } // 在 v3.0 中废弃 optimization
  15301. if (this.optimization) {
  15302. UtilTools.warn('vxe.error.removeProp', ['optimization']);
  15303. } // 废弃 optimization.cloak
  15304. if (this.optimizeOpts.cloak) {
  15305. UtilTools.warn('vxe.error.delProp', ['optimization.cloak', 'cloak']);
  15306. } // 废弃 optimization.animat
  15307. if (this.optimizeOpts.animat) {
  15308. UtilTools.warn('vxe.error.delProp', ['optimization.animat', 'animat']);
  15309. } // 废弃 optimization.delayHover
  15310. if (this.optimizeOpts.delayHover) {
  15311. UtilTools.warn('vxe.error.delProp', ['optimization.delayHover', 'delay-hover']);
  15312. } // 废弃 optimization.scrollX
  15313. if (this.optimizeOpts.scrollX) {
  15314. UtilTools.warn('vxe.error.delProp', ['optimization.scrollX', 'scroll-x']);
  15315. } // 废弃 optimization.scrollY
  15316. if (this.optimizeOpts.scrollY) {
  15317. UtilTools.warn('vxe.error.delProp', ['optimization.scrollY', 'scroll-y']);
  15318. }
  15319. var customOpts = this.customOpts;
  15320. if (!this.id && this.customConfig && (customOpts.storage === true || customOpts.storage && customOpts.storage.resizable || customOpts.storage && customOpts.storage.visible)) {
  15321. UtilTools.error('vxe.error.reqProp', ['id']);
  15322. }
  15323. if (this.treeConfig && this.checkboxOpts.range) {
  15324. UtilTools.error('vxe.error.noTree', ['checkbox-config.range']);
  15325. }
  15326. if (this.treeConfig && this.mouseOpts.area) {
  15327. UtilTools.error('vxe.error.noTree', ['mouse-config.area']);
  15328. } // 检查是否有安装需要的模块
  15329. var errorModuleName;
  15330. if (!v_x_e_table._edit && this.editConfig) {
  15331. errorModuleName = 'Edit';
  15332. } else if (!v_x_e_table._valid && this.editRules) {
  15333. errorModuleName = 'Validator';
  15334. } else if (!v_x_e_table._keyboard && (this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig)) {
  15335. errorModuleName = 'Keyboard';
  15336. } else if (!v_x_e_table._export && (this.importConfig || this.exportConfig)) {
  15337. errorModuleName = 'Export';
  15338. }
  15339. if (errorModuleName) {
  15340. throw new Error(UtilTools.getLog('vxe.error.reqModule', [errorModuleName]));
  15341. }
  15342. Object.assign(scrollYStore, {
  15343. startIndex: 0,
  15344. visibleIndex: 0,
  15345. adaptive: sYOpts.adaptive !== false,
  15346. renderSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.rSize),
  15347. offsetSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.oSize)
  15348. });
  15349. Object.assign(scrollXStore, {
  15350. startIndex: 0,
  15351. visibleIndex: 0,
  15352. renderSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.rSize),
  15353. offsetSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.oSize)
  15354. });
  15355. if (this.cloak) {
  15356. this.isCloak = true;
  15357. setTimeout(function () {
  15358. _this8.isCloak = false;
  15359. }, DomTools.browse ? 500 : 300);
  15360. }
  15361. this.loadTableData(data).then(function () {
  15362. if (data && data.length) {
  15363. _this8.inited = true;
  15364. _this8.handleDefaults();
  15365. }
  15366. _this8.updateStyle();
  15367. _this8.recalculate();
  15368. });
  15369. GlobalEvent.on(this, 'paste', this.handleGlobalPasteEvent);
  15370. GlobalEvent.on(this, 'copy', this.handleGlobalCopyEvent);
  15371. GlobalEvent.on(this, 'cut', this.handleGlobalCutEvent);
  15372. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  15373. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  15374. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  15375. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  15376. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  15377. GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
  15378. this.preventEvent(null, 'created');
  15379. },
  15380. mounted: function mounted() {
  15381. var _this9 = this;
  15382. var $listeners = this.$listeners;
  15383. if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
  15384. UtilTools.warn('vxe.error.reqProp', ['menu-config']);
  15385. }
  15386. if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
  15387. UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
  15388. }
  15389. if (!this.tooltipConfig && (this.$listeners['cell-mouseenter'] || this.$listeners['cell-mouseleave'])) {
  15390. UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
  15391. }
  15392. if (this.autoResize) {
  15393. var resizeObserver = new ResizeEvent(function () {
  15394. return _this9.recalculate(true);
  15395. });
  15396. resizeObserver.observe(this.$el);
  15397. resizeObserver.observe(this.getParentElem());
  15398. this.$resize = resizeObserver;
  15399. }
  15400. if (!this.$xegrid && this.customs) {
  15401. UtilTools.warn('vxe.error.removeProp', ['customs']);
  15402. }
  15403. document.body.appendChild(this.$refs.tableWrapper);
  15404. this.preventEvent(null, 'mounted');
  15405. },
  15406. activated: function activated() {
  15407. var _this10 = this;
  15408. this.recalculate().then(function () {
  15409. return _this10.refreshScroll();
  15410. });
  15411. this.preventEvent(null, 'activated');
  15412. },
  15413. deactivated: function deactivated() {
  15414. this.preventEvent(null, 'deactivated');
  15415. },
  15416. beforeDestroy: function beforeDestroy() {
  15417. var tableWrapper = this.$refs.tableWrapper;
  15418. if (tableWrapper && tableWrapper.parentNode) {
  15419. tableWrapper.parentNode.removeChild(tableWrapper);
  15420. }
  15421. if (this.$resize) {
  15422. this.$resize.disconnect();
  15423. }
  15424. this.closeFilter();
  15425. this.closeMenu();
  15426. this.preventEvent(null, 'beforeDestroy');
  15427. },
  15428. destroyed: function destroyed() {
  15429. GlobalEvent.off(this, 'paste');
  15430. GlobalEvent.off(this, 'copy');
  15431. GlobalEvent.off(this, 'cut');
  15432. GlobalEvent.off(this, 'mousedown');
  15433. GlobalEvent.off(this, 'blur');
  15434. GlobalEvent.off(this, 'mousewheel');
  15435. GlobalEvent.off(this, 'keydown');
  15436. GlobalEvent.off(this, 'resize');
  15437. GlobalEvent.off(this, 'contextmenu');
  15438. this.preventEvent(null, 'destroyed');
  15439. },
  15440. render: function render(h) {
  15441. var _e = this._e,
  15442. $scopedSlots = this.$scopedSlots,
  15443. tId = this.tId,
  15444. tableData = this.tableData,
  15445. tableColumn = this.tableColumn,
  15446. visibleColumn = this.visibleColumn,
  15447. tableGroupColumn = this.tableGroupColumn,
  15448. isGroup = this.isGroup,
  15449. isResizable = this.isResizable,
  15450. isCtxMenu = this.isCtxMenu,
  15451. loading = this.loading,
  15452. isCloak = this.isCloak,
  15453. stripe = this.stripe,
  15454. showHeader = this.showHeader,
  15455. height = this.height,
  15456. tableBorder = this.tableBorder,
  15457. treeOpts = this.treeOpts,
  15458. treeConfig = this.treeConfig,
  15459. mouseConfig = this.mouseConfig,
  15460. mouseOpts = this.mouseOpts,
  15461. vSize = this.vSize,
  15462. validOpts = this.validOpts,
  15463. editRules = this.editRules,
  15464. showFooter = this.showFooter,
  15465. overflowX = this.overflowX,
  15466. overflowY = this.overflowY,
  15467. scrollXLoad = this.scrollXLoad,
  15468. scrollYLoad = this.scrollYLoad,
  15469. scrollbarHeight = this.scrollbarHeight,
  15470. highlightCell = this.highlightCell,
  15471. highlightHoverRow = this.highlightHoverRow,
  15472. highlightHoverColumn = this.highlightHoverColumn,
  15473. editConfig = this.editConfig,
  15474. checkboxOpts = this.checkboxOpts,
  15475. validTipOpts = this.validTipOpts,
  15476. tooltipOpts = this.tooltipOpts,
  15477. columnStore = this.columnStore,
  15478. filterStore = this.filterStore,
  15479. ctxMenuStore = this.ctxMenuStore,
  15480. ctxMenuOpts = this.ctxMenuOpts,
  15481. footerTableData = this.footerTableData,
  15482. hasTip = this.hasTip,
  15483. emptyRender = this.emptyRender,
  15484. emptyOpts = this.emptyOpts;
  15485. var leftList = columnStore.leftList,
  15486. rightList = columnStore.rightList;
  15487. var emptyContent;
  15488. if ($scopedSlots.empty) {
  15489. emptyContent = $scopedSlots.empty.call(this, {
  15490. $table: this
  15491. }, h);
  15492. } else {
  15493. var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  15494. if (compConf) {
  15495. emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
  15496. $table: this
  15497. }, {
  15498. $table: this
  15499. });
  15500. } else {
  15501. emptyContent = this.emptyText || conf.i18n('vxe.table.emptyText');
  15502. }
  15503. }
  15504. return h('div', {
  15505. class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
  15506. 'vxe-editable': !!editConfig,
  15507. 'show--head': showHeader,
  15508. 'show--foot': showFooter,
  15509. 'is--group': isGroup,
  15510. 'has--height': height,
  15511. 'has--tree-line': treeConfig && treeOpts.line,
  15512. 'fixed--left': leftList.length,
  15513. 'fixed--right': rightList.length,
  15514. 'c--highlight': highlightCell,
  15515. 't--animat': !!this.animat,
  15516. 'is--round': this.round,
  15517. 't--stripe': !treeConfig && stripe,
  15518. 't--selected': mouseConfig && mouseOpts.selected,
  15519. // 在 v3.0 中废弃 mouse-config.checked
  15520. 't--checked': mouseConfig && mouseOpts.checked,
  15521. 'is--area': mouseConfig && mouseOpts.area,
  15522. 'row--highlight': highlightHoverRow,
  15523. 'column--highlight': highlightHoverColumn,
  15524. 'is--loading': isCloak || loading,
  15525. 'is--empty': !loading && !tableData.length,
  15526. 'scroll--y': overflowY,
  15527. 'scroll--x': overflowX,
  15528. 'virtual--x': scrollXLoad,
  15529. 'virtual--y': scrollYLoad
  15530. }],
  15531. attrs: {
  15532. 'x-cloak': isCloak
  15533. }
  15534. }, [
  15535. /**
  15536. * 隐藏列
  15537. */
  15538. h('div', {
  15539. class: 'vxe-table-slots',
  15540. ref: 'hideColumn'
  15541. }, this.$slots.default), h('div', {
  15542. class: 'vxe-table--main-wrapper'
  15543. }, [
  15544. /**
  15545. * 主头部
  15546. */
  15547. showHeader ? h('vxe-table-header', {
  15548. ref: 'tableHeader',
  15549. props: {
  15550. tableData: tableData,
  15551. tableColumn: tableColumn,
  15552. visibleColumn: visibleColumn,
  15553. tableGroupColumn: tableGroupColumn,
  15554. size: vSize,
  15555. isGroup: isGroup
  15556. }
  15557. }) : _e(),
  15558. /**
  15559. * 主内容
  15560. */
  15561. h('vxe-table-body', {
  15562. ref: 'tableBody',
  15563. props: {
  15564. tableData: tableData,
  15565. tableColumn: tableColumn,
  15566. visibleColumn: visibleColumn,
  15567. size: vSize,
  15568. isGroup: isGroup
  15569. }
  15570. }),
  15571. /**
  15572. * 底部
  15573. */
  15574. showFooter ? h('vxe-table-footer', {
  15575. props: {
  15576. footerTableData: footerTableData,
  15577. tableColumn: tableColumn,
  15578. visibleColumn: visibleColumn,
  15579. size: vSize
  15580. },
  15581. ref: 'tableFooter'
  15582. }) : null]),
  15583. /**
  15584. * 左侧固定列
  15585. */
  15586. leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
  15587. /**
  15588. * 右侧固定列
  15589. */
  15590. rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e(),
  15591. /**
  15592. * 空数据
  15593. */
  15594. h('div', {
  15595. ref: 'emptyPlaceholder',
  15596. class: 'vxe-table--empty-placeholder'
  15597. }, [h('div', {
  15598. class: 'vxe-table--empty-content'
  15599. }, emptyContent)]),
  15600. /**
  15601. * 边框线
  15602. */
  15603. h('div', {
  15604. class: 'vxe-table--border-line'
  15605. }),
  15606. /**
  15607. * 列宽线
  15608. */
  15609. isResizable ? h('div', {
  15610. class: 'vxe-table--resizable-bar',
  15611. style: overflowX ? {
  15612. 'padding-bottom': "".concat(scrollbarHeight, "px")
  15613. } : null,
  15614. ref: 'resizeBar'
  15615. }) : _e(),
  15616. /**
  15617. * 加载中
  15618. */
  15619. h('div', {
  15620. class: ['vxe-table--loading vxe-loading', {
  15621. 'is--visible': isCloak || loading
  15622. }]
  15623. }, [h('div', {
  15624. class: 'vxe-loading--spinner'
  15625. })]),
  15626. /**
  15627. * 筛选
  15628. */
  15629. this.hasFilterPanel ? h('vxe-table-filter', {
  15630. props: {
  15631. filterStore: filterStore
  15632. },
  15633. ref: 'filterWrapper'
  15634. }) : _e(),
  15635. /**
  15636. * 导入
  15637. */
  15638. this.importConfig ? h('vxe-import-panel', {
  15639. props: {
  15640. defaultOptions: this.importParams,
  15641. storeData: this.importStore
  15642. }
  15643. }) : _e(),
  15644. /**
  15645. * 导出/打印
  15646. */
  15647. this.exportConfig || this.printConfig ? h('vxe-export-panel', {
  15648. props: {
  15649. defaultOptions: this.exportParams,
  15650. storeData: this.exportStore
  15651. }
  15652. }) : _e(), h('div', {
  15653. class: "vxe-table".concat(tId, "-wrapper ").concat(this.$vnode.data.staticClass || ''),
  15654. ref: 'tableWrapper'
  15655. }, [
  15656. /**
  15657. * 复选框-范围选择
  15658. */
  15659. checkboxOpts.range ? h('div', {
  15660. class: 'vxe-table--checkbox-range',
  15661. ref: 'checkboxRange'
  15662. }) : _e(),
  15663. /**
  15664. * 快捷菜单
  15665. */
  15666. isCtxMenu ? h('vxe-table-context-menu', {
  15667. props: {
  15668. ctxMenuStore: ctxMenuStore,
  15669. ctxMenuOpts: ctxMenuOpts
  15670. },
  15671. ref: 'ctxWrapper'
  15672. }) : _e(),
  15673. /**
  15674. * 公用提示
  15675. */
  15676. hasTip ? h('vxe-tooltip', {
  15677. key: 'cTip',
  15678. ref: 'commTip',
  15679. props: {
  15680. isArrow: false,
  15681. enterable: false
  15682. }
  15683. }) : _e(),
  15684. /**
  15685. * 单元格溢出的提示
  15686. */
  15687. hasTip ? h('vxe-tooltip', {
  15688. ref: 'tooltip',
  15689. props: tooltipOpts,
  15690. on: tooltipOpts.enterable ? {
  15691. leave: this.handleTooltipLeaveEvent
  15692. } : null
  15693. }) : _e(),
  15694. /**
  15695. * 单元格校验不通过的提示
  15696. * 仅用于一行数据时有效,多行数据使用内部的提示框
  15697. */
  15698. hasTip && editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
  15699. class: 'vxe-table--valid-error',
  15700. props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null,
  15701. ref: 'validTip'
  15702. }) : _e()])]);
  15703. },
  15704. methods: methods
  15705. });
  15706. // CONCATENATED MODULE: ./packages/table/index.js
  15707. table.install = function (Vue) {
  15708. if (typeof window !== 'undefined' && window.VXETableMixin) {
  15709. table.mixins.push(window.VXETableMixin);
  15710. delete window.VXETableMixin;
  15711. }
  15712. v_x_e_table.Vue = Vue;
  15713. v_x_e_table.Table = table;
  15714. v_x_e_table.TableComponent = table;
  15715. if (!Vue.prototype.$vxe) {
  15716. Vue.prototype.$vxe = {
  15717. t: v_x_e_table.t,
  15718. _t: v_x_e_table._t
  15719. };
  15720. } else {
  15721. Vue.prototype.$vxe.t = v_x_e_table.t;
  15722. Vue.prototype.$vxe._t = v_x_e_table._t;
  15723. }
  15724. Vue.component(table.name, table);
  15725. };
  15726. var Table = table;
  15727. /* harmony default export */ var packages_table = (table);
  15728. // CONCATENATED MODULE: ./packages/column/src/column.js
  15729. var column_props = {
  15730. // 列唯一主键
  15731. colId: [String, Number],
  15732. // 渲染类型 seq,radio,checkbox,expand
  15733. type: String,
  15734. // 在 v3.0 中废弃 prop
  15735. prop: String,
  15736. // 在 v3.0 中废弃 label
  15737. label: String,
  15738. // 列字段名
  15739. field: String,
  15740. // 列标题
  15741. title: String,
  15742. // 列宽度
  15743. width: [Number, String],
  15744. // 列最小宽度,把剩余宽度按比例分配
  15745. minWidth: [Number, String],
  15746. // 是否允许拖动列宽调整大小
  15747. resizable: {
  15748. type: Boolean,
  15749. default: null
  15750. },
  15751. // 将列固定在左侧或者右侧
  15752. fixed: String,
  15753. // 列对其方式
  15754. align: String,
  15755. // 表头对齐方式
  15756. headerAlign: String,
  15757. // 表尾列的对齐方式
  15758. footerAlign: String,
  15759. // 当内容过长时显示为省略号
  15760. showOverflow: {
  15761. type: [Boolean, String],
  15762. default: null
  15763. },
  15764. // 当表头内容过长时显示为省略号
  15765. showHeaderOverflow: {
  15766. type: [Boolean, String],
  15767. default: null
  15768. },
  15769. // 当表尾内容过长时显示为省略号
  15770. showFooterOverflow: {
  15771. type: [Boolean, String],
  15772. default: null
  15773. },
  15774. // 给单元格附加 className
  15775. className: [String, Function],
  15776. // 给表头单元格附加 className
  15777. headerClassName: [String, Function],
  15778. // 给表尾单元格附加 className
  15779. footerClassName: [String, Function],
  15780. // 格式化显示内容
  15781. formatter: [Function, Array, String],
  15782. // 自定义索引方法
  15783. seqMethod: Function,
  15784. // 在 v3.0 中废弃 indexMethod
  15785. indexMethod: Function,
  15786. // 是否允许排序
  15787. sortable: Boolean,
  15788. // 在 v3 中废弃
  15789. remoteSort: {
  15790. type: Boolean,
  15791. default: null
  15792. },
  15793. // 在 v3 中只支持字符串类型
  15794. sortBy: [String, Array],
  15795. // 排序的字段类型,比如字符串转数值等
  15796. sortType: String,
  15797. // 在 v3 中废弃
  15798. sortMethod: Function,
  15799. // 配置筛选条件数组
  15800. filters: {
  15801. type: Array,
  15802. default: null
  15803. },
  15804. // 筛选是否允许多选
  15805. filterMultiple: {
  15806. type: Boolean,
  15807. default: true
  15808. },
  15809. // 自定义筛选方法
  15810. filterMethod: Function,
  15811. // 筛选重置方法
  15812. filterResetMethod: Function,
  15813. // 筛选复原方法
  15814. filterRecoverMethod: Function,
  15815. // 筛选模板配置项
  15816. filterRender: Object,
  15817. // 指定为树节点
  15818. treeNode: Boolean,
  15819. // 是否可视
  15820. visible: {
  15821. type: Boolean,
  15822. default: null
  15823. },
  15824. // 单元格数据导出方法
  15825. exportMethod: Function,
  15826. // 表尾单元格数据导出方法
  15827. footerExportMethod: Function,
  15828. // 标题帮助图标配置项
  15829. titleHelp: Object,
  15830. // 单元格值类型
  15831. cellType: String,
  15832. // 单元格渲染配置项
  15833. cellRender: Object,
  15834. // 单元格编辑渲染配置项
  15835. editRender: Object,
  15836. // 内容渲染配置项
  15837. contentRender: Object,
  15838. // 额外的参数
  15839. params: Object
  15840. };
  15841. var watch = {};
  15842. Object.keys(column_props).forEach(function (name) {
  15843. watch[name] = function (value) {
  15844. this.columnConfig.update(name, value);
  15845. };
  15846. });
  15847. /* harmony default export */ var src_column = ({
  15848. name: 'VxeColumn',
  15849. props: column_props,
  15850. provide: function provide() {
  15851. return {
  15852. $xecolumn: this
  15853. };
  15854. },
  15855. inject: {
  15856. $xetable: {
  15857. default: null
  15858. },
  15859. $xecolumn: {
  15860. default: null
  15861. }
  15862. },
  15863. watch: watch,
  15864. created: function created() {
  15865. this.$xetable.isSC = true;
  15866. this.columnConfig = this.createColumn(this.$xetable, this);
  15867. },
  15868. mounted: function mounted() {
  15869. UtilTools.assemColumn(this);
  15870. if (this.type === 'expand' && !this.$scopedSlots.content && this.$scopedSlots.default) {
  15871. UtilTools.warn('vxe.error.expandContent');
  15872. }
  15873. },
  15874. destroyed: function destroyed() {
  15875. UtilTools.destroyColumn(this);
  15876. },
  15877. render: function render(h) {
  15878. return h('div', this.$slots.default);
  15879. },
  15880. methods: packages_cell
  15881. });
  15882. // CONCATENATED MODULE: ./packages/column/src/group.js
  15883. /* harmony default export */ var src_group = ({
  15884. name: 'VxeColgroup',
  15885. extends: src_column,
  15886. provide: function provide() {
  15887. return {
  15888. xecolgroup: this
  15889. };
  15890. }
  15891. });
  15892. // CONCATENATED MODULE: ./packages/column/index.js
  15893. src_column.install = function (Vue) {
  15894. Vue.component(src_column.name, src_column);
  15895. Vue.component('VxeTableColumn', src_column);
  15896. Vue.component(src_group.name, src_group);
  15897. Vue.component('VxeTableColgroup', src_group);
  15898. };
  15899. var Column = src_column;
  15900. /* harmony default export */ var packages_column = (src_column);
  15901. // CONCATENATED MODULE: ./packages/header/src/util.js
  15902. var util_getAllColumns = function getAllColumns(columns, parentColumn) {
  15903. var result = [];
  15904. columns.forEach(function (column) {
  15905. column.parentId = parentColumn ? parentColumn.id : null;
  15906. if (column.visible) {
  15907. if (column.children && column.children.length && column.children.some(function (column) {
  15908. return column.visible;
  15909. })) {
  15910. result.push(column);
  15911. result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
  15912. } else {
  15913. result.push(column);
  15914. }
  15915. }
  15916. });
  15917. return result;
  15918. };
  15919. var convertToRows = function convertToRows(originColumns) {
  15920. var maxLevel = 1;
  15921. var traverse = function traverse(column, parent) {
  15922. if (parent) {
  15923. column.level = parent.level + 1;
  15924. if (maxLevel < column.level) {
  15925. maxLevel = column.level;
  15926. }
  15927. }
  15928. if (column.children && column.children.length && column.children.some(function (column) {
  15929. return column.visible;
  15930. })) {
  15931. var colSpan = 0;
  15932. column.children.forEach(function (subColumn) {
  15933. if (subColumn.visible) {
  15934. traverse(subColumn, column);
  15935. colSpan += subColumn.colSpan;
  15936. }
  15937. });
  15938. column.colSpan = colSpan;
  15939. } else {
  15940. column.colSpan = 1;
  15941. }
  15942. };
  15943. originColumns.forEach(function (column) {
  15944. column.level = 1;
  15945. traverse(column);
  15946. });
  15947. var rows = [];
  15948. for (var i = 0; i < maxLevel; i++) {
  15949. rows.push([]);
  15950. }
  15951. var allColumns = util_getAllColumns(originColumns);
  15952. allColumns.forEach(function (column) {
  15953. if (column.children && column.children.length && column.children.some(function (column) {
  15954. return column.visible;
  15955. })) {
  15956. column.rowSpan = 1;
  15957. } else {
  15958. column.rowSpan = maxLevel - column.level + 1;
  15959. }
  15960. rows[column.level - 1].push(column);
  15961. });
  15962. return rows;
  15963. };
  15964. // CONCATENATED MODULE: ./packages/header/src/header.js
  15965. var header_cellType = 'header';
  15966. /* harmony default export */ var header = ({
  15967. name: 'VxeTableHeader',
  15968. props: {
  15969. tableData: Array,
  15970. tableColumn: Array,
  15971. visibleColumn: Array,
  15972. tableGroupColumn: Array,
  15973. fixedColumn: Array,
  15974. size: String,
  15975. fixedType: String,
  15976. isGroup: Boolean
  15977. },
  15978. data: function data() {
  15979. return {
  15980. headerColumn: []
  15981. };
  15982. },
  15983. watch: {
  15984. tableColumn: function tableColumn() {
  15985. this.uploadColumn();
  15986. }
  15987. },
  15988. created: function created() {
  15989. this.uploadColumn();
  15990. },
  15991. mounted: function mounted() {
  15992. var $xetable = this.$parent,
  15993. $el = this.$el,
  15994. $refs = this.$refs,
  15995. fixedType = this.fixedType;
  15996. var elemStore = $xetable.elemStore;
  15997. var prefix = "".concat(fixedType || 'main', "-header-");
  15998. elemStore["".concat(prefix, "wrapper")] = $el;
  15999. elemStore["".concat(prefix, "table")] = $refs.table;
  16000. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  16001. elemStore["".concat(prefix, "list")] = $refs.thead;
  16002. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  16003. elemStore["".concat(prefix, "repair")] = $refs.repair;
  16004. },
  16005. render: function render(h) {
  16006. var _this = this;
  16007. var _e = this._e,
  16008. $xetable = this.$parent,
  16009. fixedType = this.fixedType,
  16010. headerColumn = this.headerColumn,
  16011. fixedColumn = this.fixedColumn;
  16012. var tableColumn = this.tableColumn;
  16013. var tableListeners = $xetable.$listeners,
  16014. tId = $xetable.tId,
  16015. resizable = $xetable.resizable,
  16016. border = $xetable.border,
  16017. columnKey = $xetable.columnKey,
  16018. headerRowClassName = $xetable.headerRowClassName,
  16019. headerCellClassName = $xetable.headerCellClassName,
  16020. headerRowStyle = $xetable.headerRowStyle,
  16021. headerCellStyle = $xetable.headerCellStyle,
  16022. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  16023. allHeaderAlign = $xetable.headerAlign,
  16024. allAlign = $xetable.align,
  16025. highlightCurrentColumn = $xetable.highlightCurrentColumn,
  16026. currentColumn = $xetable.currentColumn,
  16027. mouseConfig = $xetable.mouseConfig,
  16028. scrollXLoad = $xetable.scrollXLoad,
  16029. overflowX = $xetable.overflowX,
  16030. scrollbarWidth = $xetable.scrollbarWidth,
  16031. getColumnIndex = $xetable.getColumnIndex,
  16032. sortOpts = $xetable.sortOpts; // 横向滚动渲染
  16033. if (scrollXLoad) {
  16034. if (fixedType) {
  16035. tableColumn = fixedColumn;
  16036. }
  16037. }
  16038. return h('div', {
  16039. class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  16040. attrs: {
  16041. 'data-tid': tId
  16042. }
  16043. }, [fixedType ? _e() : h('div', {
  16044. class: 'vxe-body--x-space',
  16045. ref: 'xSpace'
  16046. }), h('table', {
  16047. class: 'vxe-table--header',
  16048. attrs: {
  16049. 'data-tid': tId,
  16050. cellspacing: 0,
  16051. cellpadding: 0,
  16052. border: 0
  16053. },
  16054. ref: 'table'
  16055. }, [
  16056. /**
  16057. * 列宽
  16058. */
  16059. h('colgroup', {
  16060. ref: 'colgroup'
  16061. }, tableColumn.map(function (column, $columnIndex) {
  16062. return h('col', {
  16063. attrs: {
  16064. name: column.id
  16065. },
  16066. key: $columnIndex
  16067. });
  16068. }).concat(scrollbarWidth ? [h('col', {
  16069. attrs: {
  16070. name: 'col_gutter'
  16071. }
  16072. })] : [])),
  16073. /**
  16074. * 头部
  16075. */
  16076. h('thead', {
  16077. ref: 'thead'
  16078. }, headerColumn.map(function (cols, $rowIndex) {
  16079. return h('tr', {
  16080. class: ['vxe-header--row', headerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
  16081. $table: $xetable,
  16082. $rowIndex: $rowIndex,
  16083. fixed: fixedType,
  16084. type: header_cellType
  16085. }) : headerRowClassName : ''],
  16086. style: headerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(headerRowStyle) ? headerRowStyle({
  16087. $table: $xetable,
  16088. $rowIndex: $rowIndex,
  16089. fixed: fixedType,
  16090. type: header_cellType
  16091. }) : headerRowStyle : null
  16092. }, cols.map(function (column, $columnIndex) {
  16093. var _ref;
  16094. var showHeaderOverflow = column.showHeaderOverflow,
  16095. headerAlign = column.headerAlign,
  16096. align = column.align,
  16097. headerClassName = column.headerClassName;
  16098. var isColGroup = column.children && column.children.length;
  16099. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  16100. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  16101. var headAlign = headerAlign || align || allHeaderAlign || allAlign;
  16102. var showEllipsis = headOverflow === 'ellipsis';
  16103. var showTitle = headOverflow === 'title';
  16104. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  16105. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  16106. var thOns = {};
  16107. var hasFilter = column.filters && column.filters.some(function (item) {
  16108. return item.checked;
  16109. }); // 确保任何情况下 columnIndex 都精准指向真实列索引
  16110. var columnIndex = getColumnIndex(column);
  16111. var _columnIndex = $xetable.getVTColumnIndex(column);
  16112. var params = {
  16113. $table: $xetable,
  16114. $rowIndex: $rowIndex,
  16115. column: column,
  16116. columnIndex: columnIndex,
  16117. $columnIndex: $columnIndex,
  16118. _columnIndex: _columnIndex,
  16119. fixed: fixedType,
  16120. type: header_cellType,
  16121. isHidden: fixedHiddenColumn,
  16122. hasFilter: hasFilter
  16123. }; // 虚拟滚动不支持动态高度
  16124. if (scrollXLoad && !hasEllipsis) {
  16125. showEllipsis = hasEllipsis = true;
  16126. }
  16127. if (highlightCurrentColumn || tableListeners['header-cell-click'] || mouseConfig || sortOpts.trigger === 'cell') {
  16128. thOns.click = function (evnt) {
  16129. return $xetable.triggerHeaderCellClickEvent(evnt, params);
  16130. };
  16131. }
  16132. if (tableListeners['header-cell-dblclick']) {
  16133. thOns.dblclick = function (evnt) {
  16134. return $xetable.triggerHeaderCellDBLClickEvent(evnt, params);
  16135. };
  16136. } // 按下事件处理
  16137. if (mouseConfig) {
  16138. thOns.mousedown = function (evnt) {
  16139. return $xetable.triggerHeaderCellMousedownEvent(evnt, params);
  16140. };
  16141. }
  16142. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  16143. return h('th', {
  16144. 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)],
  16145. attrs: {
  16146. 'data-colid': column.id,
  16147. colspan: column.colSpan > 1 ? column.colSpan : null,
  16148. rowspan: column.rowSpan > 1 ? column.rowSpan : null
  16149. },
  16150. style: headerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
  16151. on: thOns,
  16152. key: columnKey || isColGroup ? column.id : $columnIndex
  16153. }, [h('div', {
  16154. class: ['vxe-cell', {
  16155. 'c--title': showTitle,
  16156. 'c--tooltip': showTooltip,
  16157. 'c--ellipsis': showEllipsis
  16158. }]
  16159. }, column.renderHeader(h, params)),
  16160. /**
  16161. * 列宽拖动
  16162. */
  16163. !fixedHiddenColumn && !isColGroup && (ctor_amd_xe_utils_default.a.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
  16164. class: ['vxe-resizable', {
  16165. 'is--line': !border || border === 'none'
  16166. }],
  16167. on: {
  16168. mousedown: function mousedown(evnt) {
  16169. return _this.resizeMousedown(evnt, params);
  16170. }
  16171. }
  16172. }) : null]);
  16173. }).concat(scrollbarWidth ? [h('th', {
  16174. class: 'vxe-header--gutter col--gutter'
  16175. })] : []));
  16176. }))]),
  16177. /**
  16178. * 其他
  16179. */
  16180. h('div', {
  16181. class: 'vxe-table--header-border-line',
  16182. ref: 'repair'
  16183. })]);
  16184. },
  16185. methods: {
  16186. uploadColumn: function uploadColumn() {
  16187. this.headerColumn = this.isGroup ? convertToRows(this.tableGroupColumn) : [this.$parent.scrollXLoad && this.fixedType ? this.fixedColumn : this.tableColumn];
  16188. },
  16189. resizeMousedown: function resizeMousedown(evnt, params) {
  16190. var column = params.column;
  16191. var $xetable = this.$parent,
  16192. $el = this.$el,
  16193. fixedType = this.fixedType;
  16194. var _$xetable$$refs = $xetable.$refs,
  16195. tableBody = _$xetable$$refs.tableBody,
  16196. leftContainer = _$xetable$$refs.leftContainer,
  16197. rightContainer = _$xetable$$refs.rightContainer,
  16198. resizeBarElem = _$xetable$$refs.resizeBar;
  16199. var dragBtnElem = evnt.target,
  16200. dragClientX = evnt.clientX;
  16201. var cell = params.cell = dragBtnElem.parentNode;
  16202. var dragLeft = 0;
  16203. var tableBodyElem = tableBody.$el;
  16204. var pos = DomTools.getOffsetPos(dragBtnElem, $el);
  16205. var dragBtnWidth = dragBtnElem.clientWidth;
  16206. var dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
  16207. var minInterval = UtilTools.getColMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
  16208. var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
  16209. var dragPosLeft = pos.left + dragBtnOffsetWidth;
  16210. var domMousemove = document.onmousemove;
  16211. var domMouseup = document.onmouseup;
  16212. var isLeftFixed = fixedType === 'left';
  16213. var isRightFixed = fixedType === 'right'; // 计算左右侧固定列偏移量
  16214. var fixedOffsetWidth = 0;
  16215. if (isLeftFixed || isRightFixed) {
  16216. var siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
  16217. var tempCellElem = cell[siblingProp];
  16218. while (tempCellElem) {
  16219. if (DomTools.hasClass(tempCellElem, 'fixed--hidden')) {
  16220. break;
  16221. } else if (!DomTools.hasClass(tempCellElem, 'col--group')) {
  16222. fixedOffsetWidth += tempCellElem.offsetWidth;
  16223. }
  16224. tempCellElem = tempCellElem[siblingProp];
  16225. }
  16226. if (isRightFixed && rightContainer) {
  16227. dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth;
  16228. }
  16229. } // 处理拖动事件
  16230. var updateEvent = function updateEvent(evnt) {
  16231. evnt.stopPropagation();
  16232. evnt.preventDefault();
  16233. var offsetX = evnt.clientX - dragClientX;
  16234. var left = dragPosLeft + offsetX;
  16235. var scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
  16236. if (isLeftFixed) {
  16237. // 左固定列(不允许超过右侧固定列、不允许超过右边距)
  16238. left = Math.min(left, (rightContainer ? rightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
  16239. } else if (isRightFixed) {
  16240. // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
  16241. dragMinLeft = (leftContainer ? leftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
  16242. left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
  16243. } else {
  16244. dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft); // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
  16245. }
  16246. dragLeft = Math.max(left, dragMinLeft);
  16247. resizeBarElem.style.left = "".concat(dragLeft - scrollLeft, "px");
  16248. };
  16249. $xetable._isResize = true;
  16250. DomTools.addClass($xetable.$el, 'drag--resize');
  16251. resizeBarElem.style.display = 'block';
  16252. document.onmousemove = updateEvent;
  16253. document.onmouseup = function () {
  16254. document.onmousemove = domMousemove;
  16255. document.onmouseup = domMouseup;
  16256. column.resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
  16257. resizeBarElem.style.display = 'none';
  16258. $xetable._isResize = false;
  16259. $xetable._lastResizeTime = Date.now();
  16260. $xetable.analyColumnWidth();
  16261. $xetable.recalculate(true).then(function () {
  16262. $xetable.saveCustomResizable();
  16263. $xetable.updateCellAreas();
  16264. $xetable.emitEvent('resizable-change', params, evnt);
  16265. });
  16266. DomTools.removeClass($xetable.$el, 'drag--resize');
  16267. };
  16268. updateEvent(evnt);
  16269. $xetable.closeMenu();
  16270. }
  16271. }
  16272. });
  16273. // CONCATENATED MODULE: ./packages/header/index.js
  16274. header.install = function (Vue) {
  16275. Vue.component(header.name, header);
  16276. };
  16277. var Header = header;
  16278. /* harmony default export */ var packages_header = (header);
  16279. // CONCATENATED MODULE: ./packages/footer/src/footer.js
  16280. var footer_cellType = 'footer';
  16281. function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
  16282. for (var mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
  16283. var _mergeFooterList$mInd = mergeFooterList[mIndex],
  16284. mergeRowIndex = _mergeFooterList$mInd.row,
  16285. mergeColIndex = _mergeFooterList$mInd.col,
  16286. mergeRowspan = _mergeFooterList$mInd.rowspan,
  16287. mergeColspan = _mergeFooterList$mInd.colspan;
  16288. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  16289. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  16290. return {
  16291. rowspan: mergeRowspan,
  16292. colspan: mergeColspan
  16293. };
  16294. }
  16295. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  16296. return {
  16297. rowspan: 0,
  16298. colspan: 0
  16299. };
  16300. }
  16301. }
  16302. }
  16303. }
  16304. /* harmony default export */ var footer = ({
  16305. name: 'VxeTableFooter',
  16306. props: {
  16307. footerTableData: Array,
  16308. tableColumn: Array,
  16309. visibleColumn: Array,
  16310. fixedColumn: Array,
  16311. size: String,
  16312. fixedType: String
  16313. },
  16314. mounted: function mounted() {
  16315. var $xetable = this.$parent,
  16316. $el = this.$el,
  16317. $refs = this.$refs,
  16318. fixedType = this.fixedType;
  16319. var elemStore = $xetable.elemStore;
  16320. var prefix = "".concat(fixedType || 'main', "-footer-");
  16321. elemStore["".concat(prefix, "wrapper")] = $el;
  16322. elemStore["".concat(prefix, "table")] = $refs.table;
  16323. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  16324. elemStore["".concat(prefix, "list")] = $refs.tfoot;
  16325. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  16326. },
  16327. render: function render(h) {
  16328. var _e = this._e,
  16329. $xetable = this.$parent,
  16330. fixedType = this.fixedType,
  16331. fixedColumn = this.fixedColumn,
  16332. tableColumn = this.tableColumn,
  16333. footerTableData = this.footerTableData;
  16334. var tableListeners = $xetable.$listeners,
  16335. tId = $xetable.tId,
  16336. footerRowClassName = $xetable.footerRowClassName,
  16337. footerCellClassName = $xetable.footerCellClassName,
  16338. footerRowStyle = $xetable.footerRowStyle,
  16339. footerCellStyle = $xetable.footerCellStyle,
  16340. allFooterAlign = $xetable.footerAlign,
  16341. mergeFooterList = $xetable.mergeFooterList,
  16342. footerSpanMethod = $xetable.footerSpanMethod,
  16343. allAlign = $xetable.align,
  16344. scrollXLoad = $xetable.scrollXLoad,
  16345. columnKey = $xetable.columnKey,
  16346. allColumnFooterOverflow = $xetable.showFooterOverflow,
  16347. currentColumn = $xetable.currentColumn,
  16348. overflowX = $xetable.overflowX,
  16349. scrollbarWidth = $xetable.scrollbarWidth,
  16350. tooltipOpts = $xetable.tooltipOpts; // 如果是使用优化模式
  16351. if (!mergeFooterList.length || !footerSpanMethod) {
  16352. if (fixedType && allColumnFooterOverflow) {
  16353. tableColumn = fixedColumn;
  16354. } else if (scrollXLoad) {
  16355. if (fixedType) {
  16356. tableColumn = fixedColumn;
  16357. }
  16358. }
  16359. }
  16360. return h('div', {
  16361. class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  16362. attrs: {
  16363. 'data-tid': tId
  16364. },
  16365. on: {
  16366. scroll: this.scrollEvent
  16367. }
  16368. }, [fixedType ? _e() : h('div', {
  16369. class: 'vxe-body--x-space',
  16370. ref: 'xSpace'
  16371. }), h('table', {
  16372. class: 'vxe-table--footer',
  16373. attrs: {
  16374. 'data-tid': tId,
  16375. cellspacing: 0,
  16376. cellpadding: 0,
  16377. border: 0
  16378. },
  16379. ref: 'table'
  16380. }, [
  16381. /**
  16382. * 列宽
  16383. */
  16384. h('colgroup', {
  16385. ref: 'colgroup'
  16386. }, tableColumn.map(function (column, columnIndex) {
  16387. return h('col', {
  16388. attrs: {
  16389. name: column.id
  16390. },
  16391. key: columnIndex
  16392. });
  16393. }).concat(scrollbarWidth ? [h('col', {
  16394. attrs: {
  16395. name: 'col_gutter'
  16396. }
  16397. })] : [])),
  16398. /**
  16399. * 底部
  16400. */
  16401. h('tfoot', {
  16402. ref: 'tfoot'
  16403. }, footerTableData.map(function (list, _rowIndex) {
  16404. var $rowIndex = _rowIndex;
  16405. return h('tr', {
  16406. class: ['vxe-footer--row', footerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
  16407. $table: $xetable,
  16408. _rowIndex: _rowIndex,
  16409. $rowIndex: $rowIndex,
  16410. fixed: fixedType,
  16411. type: footer_cellType
  16412. }) : footerRowClassName : ''],
  16413. style: footerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(footerRowStyle) ? footerRowStyle({
  16414. $table: $xetable,
  16415. _rowIndex: _rowIndex,
  16416. $rowIndex: $rowIndex,
  16417. fixed: fixedType,
  16418. type: footer_cellType
  16419. }) : footerRowStyle : null
  16420. }, tableColumn.map(function (column, $columnIndex) {
  16421. var _ref2;
  16422. var showFooterOverflow = column.showFooterOverflow,
  16423. footerAlign = column.footerAlign,
  16424. align = column.align,
  16425. footerClassName = column.footerClassName;
  16426. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  16427. var isColGroup = column.children && column.children.length;
  16428. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  16429. var footOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  16430. var footAlign = footerAlign || align || allFooterAlign || allAlign;
  16431. var showEllipsis = footOverflow === 'ellipsis';
  16432. var showTitle = footOverflow === 'title';
  16433. var showTooltip = footOverflow === true || footOverflow === 'tooltip';
  16434. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  16435. var attrs = {
  16436. 'data-colid': column.id
  16437. };
  16438. var tfOns = {};
  16439. var columnIndex = $xetable.getColumnIndex(column);
  16440. var _columnIndex = $xetable.getVTColumnIndex(column);
  16441. var itemIndex = _columnIndex;
  16442. var params = {
  16443. $table: $xetable,
  16444. _rowIndex: _rowIndex,
  16445. $rowIndex: $rowIndex,
  16446. column: column,
  16447. columnIndex: columnIndex,
  16448. $columnIndex: $columnIndex,
  16449. _columnIndex: _columnIndex,
  16450. itemIndex: itemIndex,
  16451. items: list,
  16452. fixed: fixedType,
  16453. type: footer_cellType,
  16454. data: footerTableData
  16455. }; // 虚拟滚动不支持动态高度
  16456. if (scrollXLoad && !hasEllipsis) {
  16457. showEllipsis = hasEllipsis = true;
  16458. }
  16459. if (showTitle || showTooltip || showAllTip) {
  16460. tfOns.mouseenter = function (evnt) {
  16461. if (showTitle) {
  16462. DomTools.updateCellTitle(evnt.currentTarget, column);
  16463. } else if (showTooltip || showAllTip) {
  16464. $xetable.triggerFooterTooltipEvent(evnt, params);
  16465. }
  16466. };
  16467. }
  16468. if (showTooltip || showAllTip) {
  16469. tfOns.mouseleave = function (evnt) {
  16470. if (showTooltip || showAllTip) {
  16471. $xetable.handleTargetLeaveEvent(evnt);
  16472. }
  16473. };
  16474. }
  16475. if (tableListeners['footer-cell-click']) {
  16476. tfOns.click = function (evnt) {
  16477. $xetable.emitEvent('footer-cell-click', Object.assign({
  16478. cell: evnt.currentTarget
  16479. }, params), evnt);
  16480. };
  16481. }
  16482. if (tableListeners['footer-cell-dblclick']) {
  16483. tfOns.dblclick = function (evnt) {
  16484. $xetable.emitEvent('footer-cell-dblclick', Object.assign({
  16485. cell: evnt.currentTarget
  16486. }, params), evnt);
  16487. };
  16488. } // 合并行或列
  16489. if (mergeFooterList.length) {
  16490. var spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
  16491. if (spanRest) {
  16492. var rowspan = spanRest.rowspan,
  16493. colspan = spanRest.colspan;
  16494. if (!rowspan || !colspan) {
  16495. return null;
  16496. }
  16497. if (rowspan > 1) {
  16498. attrs.rowspan = rowspan;
  16499. }
  16500. if (colspan > 1) {
  16501. attrs.colspan = colspan;
  16502. }
  16503. }
  16504. } else if (footerSpanMethod) {
  16505. // 自定义合并函数
  16506. var _ref = footerSpanMethod(params) || {},
  16507. _ref$rowspan = _ref.rowspan,
  16508. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  16509. _ref$colspan = _ref.colspan,
  16510. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  16511. if (!_rowspan || !_colspan) {
  16512. return null;
  16513. }
  16514. if (_rowspan > 1) {
  16515. attrs.rowspan = _rowspan;
  16516. }
  16517. if (_colspan > 1) {
  16518. attrs.colspan = _colspan;
  16519. }
  16520. }
  16521. var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
  16522. return h('td', {
  16523. 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)],
  16524. attrs: attrs,
  16525. style: footerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle : null,
  16526. on: tfOns,
  16527. key: columnKey ? column.id : $columnIndex
  16528. }, [h('div', {
  16529. class: ['vxe-cell', {
  16530. 'c--title': showTitle,
  16531. 'c--tooltip': showTooltip,
  16532. 'c--ellipsis': showEllipsis
  16533. }]
  16534. }, column.renderFooter(h, params))]);
  16535. }).concat(scrollbarWidth ? [h('td', {
  16536. class: 'vxe-footer--gutter col--gutter'
  16537. })] : []));
  16538. }))])]);
  16539. },
  16540. methods: {
  16541. /**
  16542. * 滚动处理
  16543. * 如果存在列固定左侧,同步更新滚动状态
  16544. * 如果存在列固定右侧,同步更新滚动状态
  16545. */
  16546. scrollEvent: function scrollEvent(evnt) {
  16547. var $xetable = this.$parent,
  16548. fixedType = this.fixedType;
  16549. var $refs = $xetable.$refs,
  16550. scrollXLoad = $xetable.scrollXLoad,
  16551. triggerScrollXEvent = $xetable.triggerScrollXEvent,
  16552. lastScrollLeft = $xetable.lastScrollLeft;
  16553. var tableHeader = $refs.tableHeader,
  16554. tableBody = $refs.tableBody,
  16555. tableFooter = $refs.tableFooter,
  16556. validTip = $refs.validTip;
  16557. var headerElem = tableHeader ? tableHeader.$el : null;
  16558. var footerElem = tableFooter ? tableFooter.$el : null;
  16559. var bodyElem = tableBody.$el;
  16560. var scrollLeft = footerElem.scrollLeft;
  16561. var isX = scrollLeft !== lastScrollLeft;
  16562. $xetable.lastScrollLeft = scrollLeft;
  16563. $xetable.lastScrollTime = Date.now();
  16564. if (headerElem) {
  16565. headerElem.scrollLeft = scrollLeft;
  16566. }
  16567. if (bodyElem) {
  16568. bodyElem.scrollLeft = scrollLeft;
  16569. }
  16570. if (scrollXLoad && isX) {
  16571. triggerScrollXEvent(evnt);
  16572. }
  16573. if (isX && validTip && validTip.visible) {
  16574. validTip.updatePlacement();
  16575. }
  16576. $xetable.emitEvent('scroll', {
  16577. type: footer_cellType,
  16578. fixed: fixedType,
  16579. scrollTop: bodyElem.scrollTop,
  16580. scrollLeft: scrollLeft,
  16581. isX: isX,
  16582. isY: false
  16583. }, evnt);
  16584. }
  16585. }
  16586. });
  16587. // CONCATENATED MODULE: ./packages/footer/index.js
  16588. footer.install = function (Vue) {
  16589. Vue.component(footer.name, footer);
  16590. };
  16591. var Footer = footer;
  16592. /* harmony default export */ var packages_footer = (footer);
  16593. // CONCATENATED MODULE: ./packages/filter/src/panel.js
  16594. /* harmony default export */ var panel = ({
  16595. name: 'VxeTableFilter',
  16596. props: {
  16597. filterStore: Object
  16598. },
  16599. computed: {
  16600. hasCheckOption: function hasCheckOption() {
  16601. var filterStore = this.filterStore;
  16602. return filterStore && filterStore.options.some(function (option) {
  16603. return option.checked;
  16604. });
  16605. }
  16606. },
  16607. render: function render(h) {
  16608. var $xetable = this.$parent,
  16609. filterStore = this.filterStore;
  16610. var column = filterStore.column;
  16611. var filterRender = column ? column.filterRender : null;
  16612. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16613. return h('div', {
  16614. class: ['vxe-table--filter-wrapper', 'filter--prevent-default', compConf && compConf.className ? compConf.className : '', {
  16615. 't--animat': $xetable.animat,
  16616. 'is--multiple': filterStore.multiple,
  16617. 'filter--active': filterStore.visible
  16618. }],
  16619. style: filterStore.style
  16620. }, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : []);
  16621. },
  16622. methods: {
  16623. renderOptions: function renderOptions(h, filterRender, compConf) {
  16624. var _this = this;
  16625. var $xetable = this.$parent,
  16626. filterStore = this.filterStore;
  16627. var args = filterStore.args,
  16628. column = filterStore.column,
  16629. multiple = filterStore.multiple;
  16630. var slots = column.slots;
  16631. if (slots && slots.filter) {
  16632. return [h('div', {
  16633. class: 'vxe-table--filter-template'
  16634. }, slots.filter.call($xetable, Object.assign({
  16635. $panel: this,
  16636. context: this
  16637. }, args), h))];
  16638. } else if (compConf && compConf.renderFilter) {
  16639. return [h('div', {
  16640. class: 'vxe-table--filter-template'
  16641. }, compConf.renderFilter.call($xetable, h, filterRender, Object.assign({
  16642. $panel: this,
  16643. context: this
  16644. }, args), this))];
  16645. }
  16646. return [h('ul', {
  16647. class: 'vxe-table--filter-header'
  16648. }, [h('li', {
  16649. class: ['vxe-table--filter-option', {
  16650. 'is--checked': multiple ? filterStore.isAllSelected : !filterStore.options.some(function (item) {
  16651. return item._checked;
  16652. }),
  16653. 'is--indeterminate': multiple && filterStore.isIndeterminate
  16654. }],
  16655. attrs: {
  16656. title: conf.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
  16657. },
  16658. on: {
  16659. click: function click(evnt) {
  16660. _this.changeAllOption(evnt, !filterStore.isAllSelected);
  16661. }
  16662. }
  16663. }, (multiple ? [h('span', {
  16664. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  16665. }), h('span', {
  16666. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  16667. }), h('span', {
  16668. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  16669. })] : []).concat([h('span', {
  16670. class: 'vxe-checkbox--label'
  16671. }, conf.i18n('vxe.table.allFilter'))]))]), h('ul', {
  16672. class: 'vxe-table--filter-body'
  16673. }, filterStore.options.map(function (item) {
  16674. return h('li', {
  16675. class: ['vxe-table--filter-option', {
  16676. 'is--checked': item._checked
  16677. }],
  16678. attrs: {
  16679. title: item.label
  16680. },
  16681. on: {
  16682. click: function click(evnt) {
  16683. _this.changeOption(evnt, !item._checked, item);
  16684. }
  16685. }
  16686. }, (multiple ? [h('span', {
  16687. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  16688. }), h('span', {
  16689. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  16690. }), h('span', {
  16691. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  16692. })] : []).concat([h('span', {
  16693. class: 'vxe-checkbox--label'
  16694. }, UtilTools.formatText(item.label, 1))]));
  16695. }))];
  16696. },
  16697. renderFooter: function renderFooter(h) {
  16698. var hasCheckOption = this.hasCheckOption,
  16699. filterStore = this.filterStore;
  16700. var column = filterStore.column,
  16701. multiple = filterStore.multiple;
  16702. var filterRender = column.filterRender;
  16703. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16704. var isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
  16705. return multiple && (!compConf || (ctor_amd_xe_utils_default.a.isBoolean(compConf.showFilterFooter) ? compConf.showFilterFooter !== false : compConf.isFooter !== false)) ? [h('div', {
  16706. class: 'vxe-table--filter-footer'
  16707. }, [h('button', {
  16708. class: {
  16709. 'is--disabled': isDisabled
  16710. },
  16711. attrs: {
  16712. disabled: isDisabled
  16713. },
  16714. on: {
  16715. click: this.confirmFilter
  16716. }
  16717. }, conf.i18n('vxe.table.confirmFilter')), h('button', {
  16718. on: {
  16719. click: this.resetFilter
  16720. }
  16721. }, conf.i18n('vxe.table.resetFilter'))])] : [];
  16722. },
  16723. // 全部筛选事件
  16724. filterCheckAllEvent: function filterCheckAllEvent(evnt, value) {
  16725. var filterStore = this.filterStore;
  16726. filterStore.options.forEach(function (option) {
  16727. option._checked = value;
  16728. option.checked = value;
  16729. });
  16730. filterStore.isAllSelected = value;
  16731. filterStore.isIndeterminate = false;
  16732. },
  16733. /*************************
  16734. * Publish methods
  16735. *************************/
  16736. // (单选)筛选发生改变
  16737. changeRadioOption: function changeRadioOption(evnt, checked, item) {
  16738. var $xetable = this.$parent,
  16739. filterStore = this.filterStore;
  16740. filterStore.options.forEach(function (option) {
  16741. option._checked = false;
  16742. });
  16743. item._checked = checked;
  16744. $xetable.checkFilterOptions();
  16745. this.confirmFilter(evnt);
  16746. },
  16747. // (多选)筛选发生改变
  16748. changeMultipleOption: function changeMultipleOption(evnt, checked, item) {
  16749. var $xetable = this.$parent;
  16750. item._checked = checked;
  16751. $xetable.checkFilterOptions();
  16752. },
  16753. changeAllOption: function changeAllOption(evnt, checked) {
  16754. if (this.filterStore.multiple) {
  16755. this.filterCheckAllEvent(evnt, checked);
  16756. } else {
  16757. this.resetFilter(evnt);
  16758. }
  16759. },
  16760. // 筛选发生改变
  16761. changeOption: function changeOption(evnt, checked, item) {
  16762. if (this.filterStore.multiple) {
  16763. this.changeMultipleOption(evnt, checked, item);
  16764. } else {
  16765. this.changeRadioOption(evnt, checked, item);
  16766. }
  16767. },
  16768. // 确认筛选
  16769. confirmFilter: function confirmFilter(evnt) {
  16770. var $xetable = this.$parent,
  16771. filterStore = this.filterStore;
  16772. filterStore.options.forEach(function (option) {
  16773. option.checked = option._checked;
  16774. });
  16775. $xetable.confirmFilterEvent(evnt);
  16776. },
  16777. // 重置筛选
  16778. resetFilter: function resetFilter(evnt) {
  16779. var $xetable = this.$parent;
  16780. $xetable.resetFilterEvent(evnt);
  16781. }
  16782. /*************************
  16783. * Publish methods
  16784. *************************/
  16785. }
  16786. });
  16787. // CONCATENATED MODULE: ./packages/filter/src/mixin.js
  16788. /* harmony default export */ var src_mixin = ({
  16789. methods: {
  16790. /**
  16791. * v3 废弃 filter 方法,被 setFilter 取代
  16792. * 手动调用筛选的方法
  16793. * 如果不传回调则返回一个选项列表的 Promise 对象
  16794. * 如果传回调则通过回调返回的值更新选项列表,并返回一个新选项列表的 Promise 对象
  16795. * @param {String} field 字段名
  16796. * @param {Function} callback 重置列表的回调函数,返回新的选项列表
  16797. */
  16798. _filter: function _filter(field, callback) {
  16799. UtilTools.warn('vxe.error.delFunc', ['filter', 'setFilter']);
  16800. var column = this.getColumnByField(field);
  16801. if (column) {
  16802. var options = column.filters;
  16803. if (options && callback) {
  16804. var rest = callback(options);
  16805. if (ctor_amd_xe_utils_default.a.isArray(rest)) {
  16806. column.filters = UtilTools.getFilters(rest);
  16807. }
  16808. return this.$nextTick().then(function () {
  16809. return options;
  16810. });
  16811. }
  16812. }
  16813. return this.$nextTick();
  16814. },
  16815. /**
  16816. * 修改筛选条件列表
  16817. * @param {ColumnInfo} column 列
  16818. * @param {Array} options 选项
  16819. */
  16820. _setFilter: function _setFilter(column, options) {
  16821. if (column.filters && options) {
  16822. column.filters = UtilTools.getFilters(options);
  16823. }
  16824. return this.$nextTick();
  16825. },
  16826. checkFilterOptions: function checkFilterOptions() {
  16827. var filterStore = this.filterStore;
  16828. filterStore.isAllSelected = filterStore.options.every(function (item) {
  16829. return item._checked;
  16830. });
  16831. filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) {
  16832. return item._checked;
  16833. });
  16834. },
  16835. /**
  16836. * 点击筛选事件
  16837. * 当筛选图标被点击时触发
  16838. * 更新选项是否全部状态
  16839. * 打开筛选面板
  16840. * @param {Event} evnt 事件
  16841. * @param {ColumnInfo} column 列配置
  16842. * @param {Object} params 参数
  16843. */
  16844. triggerFilterEvent: function triggerFilterEvent(evnt, column, params) {
  16845. var _this = this;
  16846. var $refs = this.$refs,
  16847. filterStore = this.filterStore;
  16848. if (filterStore.column === column && filterStore.visible) {
  16849. filterStore.visible = false;
  16850. } else {
  16851. var bodyElem = $refs.tableBody.$el;
  16852. var targetElem = evnt.target,
  16853. pageX = evnt.pageX;
  16854. var filters = column.filters,
  16855. filterMultiple = column.filterMultiple,
  16856. filterRender = column.filterRender;
  16857. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16858. var filterRecoverMethod = column.filterRecoverMethod || (compConf ? compConf.filterRecoverMethod : null);
  16859. var _DomTools$getDomNode = DomTools.getDomNode(),
  16860. visibleWidth = _DomTools$getDomNode.visibleWidth;
  16861. Object.assign(filterStore, {
  16862. args: params,
  16863. multiple: filterMultiple,
  16864. options: filters,
  16865. column: column,
  16866. style: null,
  16867. visible: true
  16868. }); // 复原状态
  16869. filterStore.options.forEach(function (option) {
  16870. var _checked = option._checked,
  16871. checked = option.checked;
  16872. option._checked = checked;
  16873. if (!checked && _checked !== checked) {
  16874. if (filterRecoverMethod) {
  16875. filterRecoverMethod({
  16876. option: option,
  16877. column: column,
  16878. $table: _this
  16879. });
  16880. }
  16881. }
  16882. });
  16883. this.checkFilterOptions();
  16884. this.hasFilterPanel = true;
  16885. this.$nextTick(function () {
  16886. var filterWrapperElem = $refs.filterWrapper.$el;
  16887. var filterWidth = filterWrapperElem.offsetWidth;
  16888. var centerWidth = filterWidth / 2;
  16889. var minMargin = 32;
  16890. var left, right;
  16891. var style = {
  16892. top: "".concat(targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight + 8, "px")
  16893. };
  16894. if (column.fixed === 'left') {
  16895. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth;
  16896. } else if (column.fixed === 'right') {
  16897. right = targetElem.offsetParent.offsetWidth - targetElem.offsetLeft + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth;
  16898. } else {
  16899. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft;
  16900. }
  16901. if (left) {
  16902. var overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16903. if (overflowWidth > 0) {
  16904. left -= overflowWidth;
  16905. }
  16906. style.left = "".concat(Math.max(minMargin, left), "px");
  16907. } else if (right) {
  16908. var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16909. if (_overflowWidth > 0) {
  16910. right += _overflowWidth;
  16911. }
  16912. style.right = "".concat(right, "px");
  16913. }
  16914. filterStore.style = style;
  16915. });
  16916. }
  16917. },
  16918. _getCheckedFilters: function _getCheckedFilters() {
  16919. var tableFullColumn = this.tableFullColumn;
  16920. var filterList = [];
  16921. tableFullColumn.filter(function (column) {
  16922. var property = column.property,
  16923. filters = column.filters;
  16924. var valueList = [];
  16925. var dataList = [];
  16926. if (filters && filters.length) {
  16927. filters.forEach(function (item) {
  16928. if (item.checked) {
  16929. valueList.push(item.value);
  16930. dataList.push(item.data);
  16931. }
  16932. });
  16933. if (valueList.length) {
  16934. filterList.push({
  16935. column: column,
  16936. property: property,
  16937. values: valueList,
  16938. datas: dataList
  16939. });
  16940. }
  16941. }
  16942. });
  16943. return filterList;
  16944. },
  16945. /**
  16946. * 确认筛选
  16947. * 当筛选面板中的确定按钮被按下时触发
  16948. * @param {Event} evnt 事件
  16949. */
  16950. confirmFilterEvent: function confirmFilterEvent(evnt) {
  16951. var _this2 = this;
  16952. var filterStore = this.filterStore,
  16953. remoteFilter = this.remoteFilter,
  16954. filterOpts = this.filterOpts,
  16955. scrollXLoad = this.scrollXLoad,
  16956. scrollYLoad = this.scrollYLoad;
  16957. var column = filterStore.column;
  16958. var property = column.property;
  16959. var values = [];
  16960. var datas = [];
  16961. column.filters.forEach(function (item) {
  16962. if (item.checked) {
  16963. values.push(item.value);
  16964. datas.push(item.data);
  16965. }
  16966. });
  16967. filterStore.visible = false;
  16968. var filterList = this.getCheckedFilters(); // 如果是服务端筛选,则跳过本地筛选处理
  16969. if (!(filterOpts.remote || remoteFilter)) {
  16970. this.handleTableData(true);
  16971. this.checkSelectionStatus();
  16972. } // 在 v3.0 中废弃 prop
  16973. this.emitEvent('filter-change', {
  16974. column: column,
  16975. property: property,
  16976. field: property,
  16977. prop: property,
  16978. values: values,
  16979. datas: datas,
  16980. filters: filterList,
  16981. filterList: filterList
  16982. }, evnt);
  16983. this.updateFooter();
  16984. if (scrollXLoad || scrollYLoad) {
  16985. this.clearScroll();
  16986. if (scrollYLoad) {
  16987. this.updateScrollYSpace();
  16988. }
  16989. }
  16990. this.closeFilter();
  16991. this.$nextTick(function () {
  16992. _this2.recalculate();
  16993. _this2.updateCellAreas();
  16994. });
  16995. },
  16996. handleClearFilter: function handleClearFilter(column) {
  16997. if (column) {
  16998. var filters = column.filters,
  16999. filterRender = column.filterRender;
  17000. if (filters) {
  17001. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  17002. var filterResetMethod = column.filterResetMethod || (compConf ? compConf.filterResetMethod : null);
  17003. filters.forEach(function (item) {
  17004. item._checked = false;
  17005. item.checked = false;
  17006. if (!filterResetMethod) {
  17007. item.data = ctor_amd_xe_utils_default.a.clone(item.resetValue, true);
  17008. }
  17009. });
  17010. if (filterResetMethod) {
  17011. filterResetMethod({
  17012. options: filters,
  17013. column: column,
  17014. $table: this
  17015. });
  17016. }
  17017. }
  17018. }
  17019. },
  17020. /**
  17021. * 重置筛选
  17022. * 当筛选面板中的重置按钮被按下时触发
  17023. * @param {Event} evnt 事件
  17024. */
  17025. resetFilterEvent: function resetFilterEvent(evnt) {
  17026. this.handleClearFilter(this.filterStore.column);
  17027. this.confirmFilterEvent(evnt);
  17028. },
  17029. /**
  17030. * 清空指定列的筛选条件
  17031. * 如果为空则清空所有列的筛选条件
  17032. * @param {String} column 列
  17033. */
  17034. _clearFilter: function _clearFilter(column) {
  17035. if (arguments.length && ctor_amd_xe_utils_default.a.isString(column)) {
  17036. column = this.getColumnByField(column);
  17037. }
  17038. var filterStore = this.filterStore;
  17039. if (column) {
  17040. this.handleClearFilter(column);
  17041. } else {
  17042. this.visibleColumn.forEach(this.handleClearFilter);
  17043. }
  17044. if (!column || column !== filterStore.column) {
  17045. Object.assign(filterStore, {
  17046. isAllSelected: false,
  17047. isIndeterminate: false,
  17048. style: null,
  17049. options: [],
  17050. column: null,
  17051. multiple: false,
  17052. visible: false
  17053. });
  17054. }
  17055. return this.updateData();
  17056. }
  17057. }
  17058. });
  17059. // CONCATENATED MODULE: ./packages/filter/index.js
  17060. panel.install = function (Vue) {
  17061. v_x_e_table.reg('filter');
  17062. packages_table.mixins.push(src_mixin);
  17063. Vue.component(panel.name, panel);
  17064. };
  17065. var Filter = panel;
  17066. /* harmony default export */ var filter = (panel);
  17067. // CONCATENATED MODULE: ./packages/loading/index.js
  17068. var VxeLoading = {
  17069. /* eslint-disable @typescript-eslint/no-empty-function */
  17070. install: function install() {}
  17071. };
  17072. var Loading = VxeLoading;
  17073. /* harmony default export */ var packages_loading = (VxeLoading);
  17074. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
  17075. var es_object_get_own_property_descriptor = __webpack_require__("e439");
  17076. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
  17077. var es_object_get_own_property_descriptors = __webpack_require__("dbb4");
  17078. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
  17079. function ownKeys(object, enumerableOnly) {
  17080. var keys = Object.keys(object);
  17081. if (Object.getOwnPropertySymbols) {
  17082. var symbols = Object.getOwnPropertySymbols(object);
  17083. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  17084. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  17085. });
  17086. keys.push.apply(keys, symbols);
  17087. }
  17088. return keys;
  17089. }
  17090. function _objectSpread2(target) {
  17091. for (var i = 1; i < arguments.length; i++) {
  17092. var source = arguments[i] != null ? arguments[i] : {};
  17093. if (i % 2) {
  17094. ownKeys(Object(source), true).forEach(function (key) {
  17095. _defineProperty(target, key, source[key]);
  17096. });
  17097. } else if (Object.getOwnPropertyDescriptors) {
  17098. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  17099. } else {
  17100. ownKeys(Object(source)).forEach(function (key) {
  17101. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  17102. });
  17103. }
  17104. }
  17105. return target;
  17106. }
  17107. // CONCATENATED MODULE: ./packages/grid/src/grid.js
  17108. var grid_methods = {};
  17109. var propKeys = Object.keys(packages_table.props);
  17110. function getOffsetHeight(elem) {
  17111. return elem ? elem.offsetHeight : 0;
  17112. }
  17113. function getPaddingTopBottomSize(elem) {
  17114. var computedStyle = getComputedStyle(elem);
  17115. var paddingTop = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
  17116. var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
  17117. return paddingTop + paddingBottom;
  17118. }
  17119. function renderDefaultForm(h, _vm) {
  17120. var proxyConfig = _vm.proxyConfig,
  17121. proxyOpts = _vm.proxyOpts,
  17122. formData = _vm.formData,
  17123. formConfig = _vm.formConfig,
  17124. formOpts = _vm.formOpts;
  17125. if (formOpts.items && formOpts.items.length) {
  17126. if (!formOpts.inited) {
  17127. formOpts.inited = true;
  17128. if (proxyOpts && proxyOpts.beforeItem) {
  17129. formOpts.items.forEach(function (item) {
  17130. proxyOpts.beforeItem.apply(_vm, [{
  17131. $grid: _vm,
  17132. item: item
  17133. }]);
  17134. });
  17135. }
  17136. }
  17137. return [h('vxe-form', {
  17138. props: Object.assign({}, formOpts, {
  17139. data: proxyConfig && proxyOpts.form ? formData : formConfig.data
  17140. }),
  17141. on: {
  17142. submit: _vm.submitEvent,
  17143. reset: _vm.resetEvent,
  17144. 'submit-invalid': _vm.submitInvalidEvent,
  17145. 'toggle-collapse': _vm.togglCollapseEvent
  17146. },
  17147. ref: 'form'
  17148. })];
  17149. }
  17150. return [];
  17151. }
  17152. function getToolbarSlots(_vm) {
  17153. var $scopedSlots = _vm.$scopedSlots,
  17154. toolbarOpts = _vm.toolbarOpts;
  17155. var toolbarOptSlots = toolbarOpts.slots; // v3.0 中废弃 buttons、tools
  17156. var $buttons = $scopedSlots.buttons;
  17157. var $tools = $scopedSlots.tools;
  17158. if ($buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
  17159. UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
  17160. }
  17161. if ($tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
  17162. UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.tools']);
  17163. }
  17164. var slots = {};
  17165. if (toolbarOptSlots) {
  17166. if (!$buttons) {
  17167. $buttons = toolbarOptSlots.buttons;
  17168. }
  17169. if (!$tools) {
  17170. $tools = toolbarOptSlots.tools;
  17171. }
  17172. if ($buttons && $scopedSlots[$buttons]) {
  17173. $buttons = $scopedSlots[$buttons];
  17174. }
  17175. if ($tools && $scopedSlots[$tools]) {
  17176. $tools = $scopedSlots[$tools];
  17177. }
  17178. }
  17179. if ($buttons) {
  17180. slots.buttons = $buttons;
  17181. }
  17182. if ($tools) {
  17183. slots.tools = $tools;
  17184. }
  17185. return slots;
  17186. }
  17187. function getPagerSlots(_vm) {
  17188. var $scopedSlots = _vm.$scopedSlots,
  17189. pagerOpts = _vm.pagerOpts;
  17190. var pagerOptSlots = pagerOpts.slots;
  17191. var slots = {};
  17192. var $left;
  17193. var $right;
  17194. if (pagerOptSlots) {
  17195. $left = pagerOptSlots.left;
  17196. $right = pagerOptSlots.right;
  17197. if ($left && $scopedSlots[$left]) {
  17198. $left = $scopedSlots[$left];
  17199. }
  17200. if ($right && $scopedSlots[$right]) {
  17201. $right = $scopedSlots[$right];
  17202. }
  17203. }
  17204. if ($left) {
  17205. slots.left = $left;
  17206. }
  17207. if ($right) {
  17208. slots.right = $right;
  17209. }
  17210. return slots;
  17211. }
  17212. function getTableOns(_vm) {
  17213. var $listeners = _vm.$listeners,
  17214. proxyConfig = _vm.proxyConfig,
  17215. proxyOpts = _vm.proxyOpts;
  17216. var ons = {};
  17217. ctor_amd_xe_utils_default.a.each($listeners, function (cb, type) {
  17218. ons[type] = function () {
  17219. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  17220. args[_key] = arguments[_key];
  17221. }
  17222. _vm.$emit.apply(_vm, [type].concat(args));
  17223. };
  17224. });
  17225. if (proxyConfig) {
  17226. if (proxyOpts.sort) {
  17227. ons['sort-change'] = _vm.sortChangeEvent;
  17228. }
  17229. if (proxyOpts.filter) {
  17230. ons['filter-change'] = _vm.filterChangeEvent;
  17231. }
  17232. }
  17233. return ons;
  17234. }
  17235. Object.keys(packages_table.methods).forEach(function (name) {
  17236. grid_methods[name] = function () {
  17237. var _this$$refs$xTable;
  17238. return this.$refs.xTable && (_this$$refs$xTable = this.$refs.xTable)[name].apply(_this$$refs$xTable, arguments);
  17239. };
  17240. });
  17241. /* harmony default export */ var grid = ({
  17242. name: 'VxeGrid',
  17243. props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
  17244. columns: Array,
  17245. pagerConfig: [Boolean, Object],
  17246. proxyConfig: Object,
  17247. toolbar: [Boolean, Object],
  17248. toolbarConfig: [Boolean, Object],
  17249. formConfig: [Boolean, Object],
  17250. size: {
  17251. type: String,
  17252. default: function _default() {
  17253. return conf.grid.size || conf.size;
  17254. }
  17255. }
  17256. }),
  17257. provide: function provide() {
  17258. return {
  17259. $xegrid: this
  17260. };
  17261. },
  17262. data: function data() {
  17263. return {
  17264. isCloak: false,
  17265. tableLoading: false,
  17266. isZMax: false,
  17267. tableData: [],
  17268. pendingRecords: [],
  17269. filterData: [],
  17270. formData: {},
  17271. sortData: {},
  17272. tZindex: 0,
  17273. tablePage: {
  17274. total: 0,
  17275. pageSize: 10,
  17276. currentPage: 1
  17277. }
  17278. };
  17279. },
  17280. computed: {
  17281. vSize: function vSize() {
  17282. return this.size || this.$parent.size || this.$parent.vSize;
  17283. },
  17284. isMsg: function isMsg() {
  17285. return this.proxyOpts.message !== false;
  17286. },
  17287. proxyOpts: function proxyOpts() {
  17288. return Object.assign({}, conf.grid.proxyConfig, this.proxyConfig);
  17289. },
  17290. pagerOpts: function pagerOpts() {
  17291. return Object.assign({}, conf.grid.pagerConfig, this.pagerConfig);
  17292. },
  17293. formOpts: function formOpts() {
  17294. return Object.assign({}, conf.grid.formConfig, this.formConfig);
  17295. },
  17296. toolbarOpts: function toolbarOpts() {
  17297. return Object.assign({}, conf.grid.toolbarConfig, this.toolbarConfig || this.toolbar);
  17298. },
  17299. zoomOpts: function zoomOpts() {
  17300. return Object.assign({}, conf.grid.zoomConfig, this.zoomConfig);
  17301. },
  17302. renderStyle: function renderStyle() {
  17303. return this.isZMax ? {
  17304. zIndex: this.tZindex
  17305. } : null;
  17306. },
  17307. tableExtendProps: function tableExtendProps() {
  17308. var _this = this;
  17309. var rest = {};
  17310. propKeys.forEach(function (key) {
  17311. rest[key] = _this[key];
  17312. });
  17313. return rest;
  17314. },
  17315. tableProps: function tableProps() {
  17316. var isZMax = this.isZMax,
  17317. seqConfig = this.seqConfig,
  17318. pagerConfig = this.pagerConfig,
  17319. loading = this.loading,
  17320. isCloak = this.isCloak,
  17321. editConfig = this.editConfig,
  17322. proxyConfig = this.proxyConfig,
  17323. proxyOpts = this.proxyOpts,
  17324. tableExtendProps = this.tableExtendProps,
  17325. tableLoading = this.tableLoading,
  17326. tablePage = this.tablePage,
  17327. tableData = this.tableData;
  17328. var props = Object.assign({}, tableExtendProps);
  17329. if (isZMax) {
  17330. if (tableExtendProps.maxHeight) {
  17331. props.maxHeight = 'auto';
  17332. } else {
  17333. props.height = 'auto';
  17334. }
  17335. }
  17336. if (proxyConfig) {
  17337. Object.assign(props, {
  17338. loading: isCloak || loading || tableLoading,
  17339. data: tableData,
  17340. rowClassName: this.handleRowClassName
  17341. });
  17342. if ((proxyOpts.seq || proxyOpts.index) && UtilTools.isEnableConf(pagerConfig)) {
  17343. props.seqConfig = Object.assign({}, seqConfig, {
  17344. startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
  17345. });
  17346. }
  17347. }
  17348. if (editConfig) {
  17349. props.editConfig = Object.assign({}, editConfig, {
  17350. activeMethod: this.handleActiveMethod
  17351. });
  17352. }
  17353. return props;
  17354. },
  17355. pagerProps: function pagerProps() {
  17356. return Object.assign({}, this.pagerOpts, this.proxyConfig ? this.tablePage : {});
  17357. }
  17358. },
  17359. watch: {
  17360. columns: function columns(value) {
  17361. var _this2 = this;
  17362. this.$nextTick(function () {
  17363. return _this2.loadColumn(value);
  17364. });
  17365. },
  17366. toolbar: function toolbar(value) {
  17367. if (value) {
  17368. this.initToolbar();
  17369. }
  17370. },
  17371. toolbarConfig: function toolbarConfig(value) {
  17372. if (value) {
  17373. this.initToolbar();
  17374. }
  17375. },
  17376. proxyConfig: function proxyConfig() {
  17377. this.initProxy();
  17378. },
  17379. pagerConfig: function pagerConfig() {
  17380. this.initPages();
  17381. }
  17382. },
  17383. created: function created() {
  17384. var _this3 = this;
  17385. var customs = this.customs,
  17386. data = this.data,
  17387. formOpts = this.formOpts,
  17388. proxyConfig = this.proxyConfig,
  17389. proxyOpts = this.proxyOpts;
  17390. var props = proxyOpts.props;
  17391. if (customs) {
  17392. UtilTools.warn('vxe.error.removeProp', ['customs']);
  17393. }
  17394. if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
  17395. console.warn('[vxe-grid] There is a conflict between the props proxy-config and data.');
  17396. } // v3.0 中废弃 proxy-config.index
  17397. if (proxyOpts.index) {
  17398. UtilTools.warn('vxe.error.delProp', ['proxy-config.index', 'proxy-config.seq']);
  17399. } // (v3.0 中废弃 proxyConfig.props.data)
  17400. if (props && props.data) {
  17401. UtilTools.warn('vxe.error.delProp', ['proxy-config.props.data', 'proxy-config.props.result']);
  17402. }
  17403. if (this.cloak) {
  17404. this.isCloak = true;
  17405. setTimeout(function () {
  17406. _this3.isCloak = false;
  17407. }, DomTools.browse ? 500 : 300);
  17408. } // 检查错误使用
  17409. this.$nextTick(function () {
  17410. var xTable = _this3.$refs.xTable;
  17411. if (xTable && xTable.isSC) {
  17412. UtilTools.warn('vxe.error.errProp', ['<vxe-table-column ...>', 'columns']);
  17413. }
  17414. });
  17415. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  17416. },
  17417. mounted: function mounted() {
  17418. if (this.columns && this.columns.length) {
  17419. this.loadColumn(this.columns);
  17420. }
  17421. this.initToolbar();
  17422. this.initPages();
  17423. this.initProxy();
  17424. },
  17425. destroyed: function destroyed() {
  17426. GlobalEvent.off(this, 'keydown');
  17427. },
  17428. render: function render(h) {
  17429. var _ref;
  17430. var $scopedSlots = this.$scopedSlots,
  17431. vSize = this.vSize,
  17432. isZMax = this.isZMax;
  17433. var hasForm = !!($scopedSlots.form || UtilTools.isEnableConf(this.formConfig));
  17434. var hasToolbar = !!($scopedSlots.toolbar || UtilTools.isEnableConf(this.toolbarConfig) || this.toolbar);
  17435. var hasTop = !!$scopedSlots.top;
  17436. var hasBottom = !!$scopedSlots.bottom;
  17437. var hasPager = !!($scopedSlots.pager || UtilTools.isEnableConf(this.pagerConfig));
  17438. return h('div', {
  17439. 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)],
  17440. style: this.renderStyle
  17441. }, [
  17442. /**
  17443. * 渲染表单
  17444. */
  17445. hasForm ? h('div', {
  17446. ref: 'formWrapper',
  17447. class: 'vxe-grid--form-wrapper'
  17448. }, $scopedSlots.form ? $scopedSlots.form.call(this, {
  17449. $grid: this
  17450. }, h) : renderDefaultForm(h, this)) : null,
  17451. /**
  17452. * 渲染工具栏
  17453. */
  17454. hasToolbar ? h('div', {
  17455. ref: 'toolbarWrapper',
  17456. class: 'vxe-grid--toolbar-wrapper'
  17457. }, $scopedSlots.toolbar ? $scopedSlots.toolbar.call(this, {
  17458. $grid: this
  17459. }, h) : [h('vxe-toolbar', {
  17460. props: this.toolbarOpts,
  17461. ref: 'xToolbar',
  17462. scopedSlots: getToolbarSlots(this)
  17463. })]) : null,
  17464. /**
  17465. * 渲染表格顶部区域
  17466. */
  17467. hasTop ? h('div', {
  17468. ref: 'topWrapper',
  17469. class: 'vxe-grid--top-wrapper'
  17470. }, $scopedSlots.top.call(this, {
  17471. $grid: this
  17472. }, h)) : null,
  17473. /**
  17474. * 渲染表格
  17475. */
  17476. h('vxe-table', {
  17477. props: this.tableProps,
  17478. on: getTableOns(this),
  17479. scopedSlots: $scopedSlots,
  17480. ref: 'xTable'
  17481. }, this.$slots.default),
  17482. /**
  17483. * 渲染表格底部区域
  17484. */
  17485. hasBottom ? h('div', {
  17486. ref: 'bottomWrapper',
  17487. class: 'vxe-grid--bottom-wrapper'
  17488. }, $scopedSlots.bottom.call(this, {
  17489. $grid: this
  17490. }, h)) : null,
  17491. /**
  17492. * 渲染分页
  17493. */
  17494. hasPager ? h('div', {
  17495. ref: 'pagerWrapper',
  17496. class: 'vxe-grid--pager-wrapper'
  17497. }, $scopedSlots.pager ? $scopedSlots.pager.call(this, {
  17498. $grid: this
  17499. }, h) : [h('vxe-pager', {
  17500. props: this.pagerProps,
  17501. on: {
  17502. 'page-change': this.pageChangeEvent
  17503. },
  17504. scopedSlots: getPagerSlots(this)
  17505. })]) : null]);
  17506. },
  17507. methods: _objectSpread2(_objectSpread2({}, grid_methods), {}, {
  17508. getParentHeight: function getParentHeight() {
  17509. return (this.isZMax ? DomTools.getDomNode().visibleHeight : this.$el.parentNode.clientHeight) - this.getExcludeHeight();
  17510. },
  17511. /**
  17512. * 获取需要排除的高度
  17513. */
  17514. getExcludeHeight: function getExcludeHeight() {
  17515. var $refs = this.$refs,
  17516. $el = this.$el,
  17517. isZMax = this.isZMax,
  17518. height = this.height;
  17519. var formWrapper = $refs.formWrapper,
  17520. toolbarWrapper = $refs.toolbarWrapper,
  17521. topWrapper = $refs.topWrapper,
  17522. bottomWrapper = $refs.bottomWrapper,
  17523. pagerWrapper = $refs.pagerWrapper;
  17524. var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
  17525. return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
  17526. },
  17527. handleRowClassName: function handleRowClassName(params) {
  17528. var rowClassName = this.rowClassName;
  17529. var clss = [];
  17530. if (this.pendingRecords.some(function (item) {
  17531. return item === params.row;
  17532. })) {
  17533. clss.push('row--pending');
  17534. }
  17535. clss.push(rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
  17536. return clss;
  17537. },
  17538. handleActiveMethod: function handleActiveMethod(params) {
  17539. var activeMethod = this.editConfig.activeMethod;
  17540. return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
  17541. },
  17542. loadColumn: function loadColumn(columns) {
  17543. var $scopedSlots = this.$scopedSlots;
  17544. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  17545. if (column.slots) {
  17546. ctor_amd_xe_utils_default.a.each(column.slots, function (func, name, colSlots) {
  17547. if (!ctor_amd_xe_utils_default.a.isFunction(func)) {
  17548. if ($scopedSlots[func]) {
  17549. colSlots[name] = $scopedSlots[func];
  17550. } else {
  17551. colSlots[name] = null;
  17552. UtilTools.error('vxe.error.notSlot', [func]);
  17553. }
  17554. }
  17555. });
  17556. }
  17557. });
  17558. return this.$refs.xTable.loadColumn(columns);
  17559. },
  17560. reloadColumn: function reloadColumn(columns) {
  17561. this.clearAll();
  17562. return this.loadColumn(columns);
  17563. },
  17564. initToolbar: function initToolbar() {
  17565. var _this4 = this;
  17566. this.$nextTick(function () {
  17567. var _this4$$refs = _this4.$refs,
  17568. xTable = _this4$$refs.xTable,
  17569. xToolbar = _this4$$refs.xToolbar;
  17570. if (xTable && xToolbar) {
  17571. xTable.connect(xToolbar);
  17572. }
  17573. });
  17574. },
  17575. initPages: function initPages() {
  17576. var tablePage = this.tablePage,
  17577. pagerConfig = this.pagerConfig,
  17578. pagerOpts = this.pagerOpts;
  17579. var currentPage = pagerOpts.currentPage,
  17580. pageSize = pagerOpts.pageSize;
  17581. if (pagerConfig) {
  17582. if (currentPage) {
  17583. tablePage.currentPage = currentPage;
  17584. }
  17585. if (pageSize) {
  17586. tablePage.pageSize = pageSize;
  17587. }
  17588. }
  17589. },
  17590. initProxy: function initProxy() {
  17591. var _this5 = this;
  17592. var proxyInited = this.proxyInited,
  17593. proxyConfig = this.proxyConfig,
  17594. proxyOpts = this.proxyOpts,
  17595. formConfig = this.formConfig,
  17596. formOpts = this.formOpts;
  17597. if (proxyConfig) {
  17598. if (UtilTools.isEnableConf(formConfig) && proxyOpts.form && formOpts.items) {
  17599. var formData = {};
  17600. formOpts.items.forEach(function (_ref2) {
  17601. var field = _ref2.field,
  17602. itemRender = _ref2.itemRender;
  17603. if (field) {
  17604. formData[field] = itemRender && !ctor_amd_xe_utils_default.a.isUndefined(itemRender.defaultValue) ? itemRender.defaultValue : undefined;
  17605. }
  17606. });
  17607. this.formData = formData;
  17608. }
  17609. if (!proxyInited && proxyOpts.autoLoad !== false) {
  17610. this.proxyInited = true;
  17611. this.$nextTick(function () {
  17612. return _this5.initLoad();
  17613. });
  17614. }
  17615. }
  17616. },
  17617. initLoad: function initLoad() {
  17618. var $refs = this.$refs;
  17619. var $xetable = $refs.xTable;
  17620. var defaultSort = $xetable.sortOpts.defaultSort;
  17621. var sortParams = {}; // 如果使用默认排序
  17622. if (defaultSort) {
  17623. sortParams = {
  17624. property: defaultSort.field,
  17625. order: defaultSort.order
  17626. };
  17627. }
  17628. this.sortData = sortParams;
  17629. this.filterData = [];
  17630. this.pendingRecords = [];
  17631. this.commitProxy('query');
  17632. },
  17633. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  17634. var isEsc = evnt.keyCode === 27;
  17635. if (isEsc && this.isZMax && this.zoomOpts.escRestore !== false) {
  17636. this.triggerZoomEvent(evnt);
  17637. }
  17638. },
  17639. /**
  17640. * 提交指令,支持 code 或 button
  17641. * @param {String/Object} code 字符串或对象
  17642. */
  17643. commitProxy: function commitProxy(code) {
  17644. var _this6 = this;
  17645. var $refs = this.$refs,
  17646. toolbar = this.toolbar,
  17647. toolbarConfig = this.toolbarConfig,
  17648. toolbarOpts = this.toolbarOpts,
  17649. proxyOpts = this.proxyOpts,
  17650. tablePage = this.tablePage,
  17651. pagerConfig = this.pagerConfig,
  17652. sortData = this.sortData,
  17653. filterData = this.filterData,
  17654. formData = this.formData,
  17655. isMsg = this.isMsg;
  17656. var beforeQuery = proxyOpts.beforeQuery,
  17657. afterQuery = proxyOpts.afterQuery,
  17658. beforeDelete = proxyOpts.beforeDelete,
  17659. afterDelete = proxyOpts.afterDelete,
  17660. beforeSave = proxyOpts.beforeSave,
  17661. afterSave = proxyOpts.afterSave,
  17662. _proxyOpts$ajax = proxyOpts.ajax,
  17663. ajax = _proxyOpts$ajax === void 0 ? {} : _proxyOpts$ajax,
  17664. _proxyOpts$props = proxyOpts.props,
  17665. props = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
  17666. var $xetable = $refs.xTable;
  17667. var button;
  17668. if (ctor_amd_xe_utils_default.a.isString(code)) {
  17669. var matchObj = toolbarConfig || toolbar ? ctor_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
  17670. return item.code === code;
  17671. }, {
  17672. children: 'dropdowns'
  17673. }) : null;
  17674. button = matchObj ? matchObj.item : null;
  17675. } else {
  17676. button = code;
  17677. code = button.code;
  17678. }
  17679. var btnParams = button ? button.params : null;
  17680. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  17681. args[_key2 - 1] = arguments[_key2];
  17682. }
  17683. switch (code) {
  17684. case 'insert':
  17685. this.insert();
  17686. break;
  17687. case 'insert_actived':
  17688. this.insert().then(function (_ref3) {
  17689. var row = _ref3.row;
  17690. return _this6.setActiveRow(row);
  17691. });
  17692. break;
  17693. case 'mark_cancel':
  17694. this.triggerPendingEvent(code);
  17695. break;
  17696. // 在 v3 中废弃 remove_selection
  17697. case 'remove_selection':
  17698. case 'remove':
  17699. this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
  17700. return _this6.removeCheckboxRow();
  17701. });
  17702. break;
  17703. case 'import':
  17704. this.importData(btnParams);
  17705. break;
  17706. case 'open_import':
  17707. this.openImport(btnParams);
  17708. break;
  17709. case 'export':
  17710. this.exportData(btnParams);
  17711. break;
  17712. case 'open_export':
  17713. this.openExport(btnParams);
  17714. break;
  17715. case 'reset_custom':
  17716. this.resetColumn(true);
  17717. break;
  17718. case 'init':
  17719. case 'reload':
  17720. case 'query':
  17721. {
  17722. var isInited = code === 'init';
  17723. var isReload = code === 'reload';
  17724. var ajaxMethods = ajax.query;
  17725. if (ajaxMethods) {
  17726. var params = {
  17727. code: code,
  17728. button: button,
  17729. $grid: this,
  17730. sort: sortData,
  17731. sorts: proxyOpts.sort && sortData && (sortData.property || sortData.order) ? [sortData] : [],
  17732. filters: filterData,
  17733. form: formData,
  17734. options: ajaxMethods
  17735. };
  17736. if (pagerConfig) {
  17737. if (isReload) {
  17738. tablePage.currentPage = 1;
  17739. }
  17740. if (UtilTools.isEnableConf(pagerConfig)) {
  17741. params.page = tablePage;
  17742. }
  17743. }
  17744. if (isInited || isReload) {
  17745. var defaultSort = $xetable.sortOpts.defaultSort;
  17746. var sortParams = {};
  17747. if (isReload) {
  17748. tablePage.currentPage = 1;
  17749. } // 如果使用默认排序
  17750. if (defaultSort) {
  17751. sortParams = {
  17752. property: defaultSort.field,
  17753. order: defaultSort.order
  17754. };
  17755. }
  17756. this.sortData = params.sort = sortParams;
  17757. this.filterData = params.filters = [];
  17758. this.pendingRecords = [];
  17759. if (proxyOpts.sort) {
  17760. params.sorts = sortParams && (sortParams.property || sortParams.order) ? [sortParams] : [];
  17761. }
  17762. this.clearAll();
  17763. }
  17764. var applyArgs = [params].concat(args);
  17765. this.tableLoading = true;
  17766. return Promise.resolve((beforeQuery || ajaxMethods).apply(this, applyArgs)).catch(function (e) {
  17767. return e;
  17768. }).then(function (rest) {
  17769. _this6.tableLoading = false;
  17770. if (rest) {
  17771. if (UtilTools.isEnableConf(pagerConfig)) {
  17772. var total = ctor_amd_xe_utils_default.a.get(rest, props.total || 'page.total') || 0;
  17773. tablePage.total = total;
  17774. _this6.tableData = ctor_amd_xe_utils_default.a.get(rest, props.result || props.data || 'result') || []; // 检验当前页码,不能超出当前最大页数
  17775. var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
  17776. if (tablePage.currentPage > pageCount) {
  17777. tablePage.currentPage = pageCount;
  17778. }
  17779. } else {
  17780. _this6.tableData = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  17781. }
  17782. } else {
  17783. _this6.tableData = [];
  17784. }
  17785. if (afterQuery) {
  17786. afterQuery.apply(void 0, _toConsumableArray(applyArgs));
  17787. }
  17788. });
  17789. } else {
  17790. UtilTools.error('vxe.error.notFunc', ['query']);
  17791. }
  17792. break;
  17793. }
  17794. // 在 v3 中废弃 delete_selection
  17795. case 'delete_selection':
  17796. case 'delete':
  17797. {
  17798. var _ajaxMethods = ajax.delete;
  17799. if (_ajaxMethods) {
  17800. var selectRecords = $xetable.getCheckboxRecords();
  17801. var removeRecords = selectRecords.filter(function (row) {
  17802. return !$xetable.isInsertByRow(row);
  17803. });
  17804. var body = {
  17805. removeRecords: removeRecords
  17806. };
  17807. var _applyArgs = [{
  17808. $grid: this,
  17809. code: code,
  17810. button: button,
  17811. body: body,
  17812. options: _ajaxMethods
  17813. }].concat(args);
  17814. if (selectRecords.length) {
  17815. return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
  17816. if (!removeRecords.length) {
  17817. return $xetable.remove(selectRecords);
  17818. }
  17819. _this6.tableLoading = true;
  17820. return Promise.resolve((beforeDelete || _ajaxMethods).apply(_this6, _applyArgs)).then(function (rest) {
  17821. _this6.tableLoading = false;
  17822. _this6.pendingRecords = _this6.pendingRecords.filter(function (row) {
  17823. return removeRecords.indexOf(row) === -1;
  17824. });
  17825. if (isMsg) {
  17826. v_x_e_table.modal.message({
  17827. message: _this6.getRespMsg(rest, 'vxe.grid.delSuccess'),
  17828. status: 'success'
  17829. });
  17830. }
  17831. if (afterDelete) {
  17832. afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
  17833. } else {
  17834. _this6.commitProxy('query');
  17835. }
  17836. }).catch(function (rest) {
  17837. _this6.tableLoading = false;
  17838. if (isMsg) {
  17839. v_x_e_table.modal.message({
  17840. id: code,
  17841. message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
  17842. status: 'error'
  17843. });
  17844. }
  17845. });
  17846. });
  17847. } else {
  17848. if (isMsg) {
  17849. v_x_e_table.modal.message({
  17850. id: code,
  17851. message: conf.i18n('vxe.grid.selectOneRecord'),
  17852. status: 'warning'
  17853. });
  17854. }
  17855. }
  17856. } else {
  17857. UtilTools.error('vxe.error.notFunc', [code]);
  17858. }
  17859. break;
  17860. }
  17861. case 'save':
  17862. {
  17863. var _ajaxMethods2 = ajax.save;
  17864. if (_ajaxMethods2) {
  17865. var _body = Object.assign({
  17866. pendingRecords: this.pendingRecords
  17867. }, this.getRecordset());
  17868. var insertRecords = _body.insertRecords,
  17869. _removeRecords = _body.removeRecords,
  17870. updateRecords = _body.updateRecords,
  17871. pendingRecords = _body.pendingRecords;
  17872. var _applyArgs2 = [{
  17873. $grid: this,
  17874. code: code,
  17875. button: button,
  17876. body: _body,
  17877. options: _ajaxMethods2
  17878. }].concat(args); // 排除掉新增且标记为删除的数据
  17879. if (insertRecords.length) {
  17880. _body.pendingRecords = pendingRecords.filter(function (row) {
  17881. return insertRecords.indexOf(row) === -1;
  17882. });
  17883. } // 排除已标记为删除的数据
  17884. if (pendingRecords.length) {
  17885. _body.insertRecords = insertRecords.filter(function (row) {
  17886. return pendingRecords.indexOf(row) === -1;
  17887. });
  17888. } // 只校验新增和修改的数据
  17889. return this.validate(_body.insertRecords.concat(updateRecords)).then(function () {
  17890. if (_body.insertRecords.length || _removeRecords.length || updateRecords.length || _body.pendingRecords.length) {
  17891. _this6.tableLoading = true;
  17892. return Promise.resolve((beforeSave || _ajaxMethods2).apply(_this6, _applyArgs2)).then(function (rest) {
  17893. _this6.tableLoading = false;
  17894. _this6.pendingRecords = [];
  17895. if (isMsg) {
  17896. v_x_e_table.modal.message({
  17897. message: _this6.getRespMsg(rest, 'vxe.grid.saveSuccess'),
  17898. status: 'success'
  17899. });
  17900. }
  17901. if (afterSave) {
  17902. afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
  17903. } else {
  17904. _this6.commitProxy('query');
  17905. }
  17906. }).catch(function (rest) {
  17907. _this6.tableLoading = false;
  17908. if (isMsg) {
  17909. v_x_e_table.modal.message({
  17910. id: code,
  17911. message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
  17912. status: 'error'
  17913. });
  17914. }
  17915. });
  17916. } else {
  17917. if (isMsg) {
  17918. v_x_e_table.modal.message({
  17919. id: code,
  17920. message: conf.i18n('vxe.grid.dataUnchanged'),
  17921. status: 'info'
  17922. });
  17923. }
  17924. }
  17925. }).catch(function (errMap) {
  17926. return errMap;
  17927. });
  17928. } else {
  17929. UtilTools.error('vxe.error.notFunc', [code]);
  17930. }
  17931. break;
  17932. }
  17933. default:
  17934. {
  17935. var btnMethod = v_x_e_table.commands.get(code);
  17936. if (btnMethod) {
  17937. btnMethod.apply(this, [{
  17938. code: code,
  17939. button: button,
  17940. $grid: this,
  17941. $table: $xetable
  17942. }].concat(args));
  17943. }
  17944. }
  17945. }
  17946. return this.$nextTick();
  17947. },
  17948. getRespMsg: function getRespMsg(rest, defaultMsg) {
  17949. var _this$proxyOpts$props = this.proxyOpts.props,
  17950. props = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
  17951. var msg;
  17952. if (rest && props.message) {
  17953. msg = ctor_amd_xe_utils_default.a.get(rest, props.message);
  17954. }
  17955. return msg || conf.i18n(defaultMsg);
  17956. },
  17957. handleDeleteRow: function handleDeleteRow(code, alertKey, callback) {
  17958. var selectRecords = this.getCheckboxRecords();
  17959. if (this.isMsg) {
  17960. if (selectRecords.length) {
  17961. return v_x_e_table.modal.confirm({
  17962. id: "cfm_".concat(code),
  17963. message: conf.i18n(alertKey),
  17964. escClosable: true
  17965. }).then(function (type) {
  17966. if (type === 'confirm') {
  17967. callback();
  17968. }
  17969. });
  17970. } else {
  17971. v_x_e_table.modal.message({
  17972. id: "msg_".concat(code),
  17973. message: conf.i18n('vxe.grid.selectOneRecord'),
  17974. status: 'warning'
  17975. });
  17976. }
  17977. } else {
  17978. if (selectRecords.length) {
  17979. callback();
  17980. }
  17981. }
  17982. },
  17983. getFormItems: function getFormItems(index) {
  17984. var formConfig = this.formConfig;
  17985. var items = UtilTools.isEnableConf(formConfig) && formConfig.items ? formConfig.items : [];
  17986. return arguments.length ? items[index] : items;
  17987. },
  17988. getPendingRecords: function getPendingRecords() {
  17989. return this.pendingRecords;
  17990. },
  17991. triggerToolbarBtnEvent: function triggerToolbarBtnEvent(button, evnt) {
  17992. this.commitProxy(button, evnt);
  17993. this.$emit('toolbar-button-click', {
  17994. code: button.code,
  17995. button: button,
  17996. $grid: this,
  17997. $event: evnt
  17998. }, evnt);
  17999. },
  18000. triggerPendingEvent: function triggerPendingEvent(code) {
  18001. var pendingRecords = this.pendingRecords,
  18002. isMsg = this.isMsg;
  18003. var selectRecords = this.getCheckboxRecords();
  18004. if (selectRecords.length) {
  18005. var plus = [];
  18006. var minus = [];
  18007. selectRecords.forEach(function (data) {
  18008. if (pendingRecords.some(function (item) {
  18009. return data === item;
  18010. })) {
  18011. minus.push(data);
  18012. } else {
  18013. plus.push(data);
  18014. }
  18015. });
  18016. if (minus.length) {
  18017. this.pendingRecords = pendingRecords.filter(function (item) {
  18018. return minus.indexOf(item) === -1;
  18019. }).concat(plus);
  18020. } else if (plus.length) {
  18021. this.pendingRecords = pendingRecords.concat(plus);
  18022. }
  18023. this.clearCheckboxRow();
  18024. } else {
  18025. if (isMsg) {
  18026. v_x_e_table.modal.message({
  18027. id: code,
  18028. message: conf.i18n('vxe.grid.selectOneRecord'),
  18029. status: 'warning'
  18030. });
  18031. }
  18032. }
  18033. },
  18034. pageChangeEvent: function pageChangeEvent(params) {
  18035. var proxyConfig = this.proxyConfig,
  18036. tablePage = this.tablePage;
  18037. var currentPage = params.currentPage,
  18038. pageSize = params.pageSize;
  18039. tablePage.currentPage = currentPage;
  18040. tablePage.pageSize = pageSize;
  18041. if (params.type === 'current-change') {
  18042. if (this.$listeners['current-page-change']) {
  18043. UtilTools.warn('vxe.error.delEvent', ['current-page-change', 'page-change']);
  18044. this.$emit('current-page-change', currentPage);
  18045. }
  18046. } else {
  18047. if (this.$listeners['page-size-change']) {
  18048. UtilTools.warn('vxe.error.delEvent', ['page-size-change', 'page-change']);
  18049. this.$emit('page-size-change', pageSize);
  18050. }
  18051. }
  18052. this.$emit('page-change', Object.assign({
  18053. $grid: this
  18054. }, params));
  18055. if (proxyConfig) {
  18056. this.commitProxy('query');
  18057. }
  18058. },
  18059. sortChangeEvent: function sortChangeEvent(params) {
  18060. var remoteSort = this.remoteSort;
  18061. var $table = params.$table,
  18062. column = params.column;
  18063. var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote || remoteSort;
  18064. var property = params.order ? params.property : null; // 如果是服务端排序
  18065. if (isRemote) {
  18066. this.sortData = property ? {
  18067. property: property,
  18068. field: property,
  18069. // v3 废弃 prop
  18070. prop: property,
  18071. order: params.order,
  18072. sortBy: params.sortBy
  18073. } : {};
  18074. if (this.proxyConfig) {
  18075. this.tablePage.currentPage = 1;
  18076. this.commitProxy('query');
  18077. }
  18078. }
  18079. this.$emit('sort-change', Object.assign({
  18080. $grid: this
  18081. }, params));
  18082. },
  18083. filterChangeEvent: function filterChangeEvent(params) {
  18084. var $table = params.$table,
  18085. filterList = params.filterList; // 如果是服务端过滤
  18086. if ($table.filterOpts.remote || this.remoteFilter) {
  18087. this.filterData = filterList;
  18088. if (this.proxyConfig) {
  18089. this.tablePage.currentPage = 1;
  18090. this.commitProxy('query');
  18091. }
  18092. }
  18093. this.$emit('filter-change', Object.assign({
  18094. $grid: this
  18095. }, params));
  18096. },
  18097. submitEvent: function submitEvent(params, evnt) {
  18098. var proxyConfig = this.proxyConfig;
  18099. if (proxyConfig) {
  18100. this.commitProxy('reload');
  18101. }
  18102. this.$emit('form-submit', Object.assign({
  18103. $grid: this
  18104. }, params), evnt);
  18105. },
  18106. resetEvent: function resetEvent(params, evnt) {
  18107. var proxyConfig = this.proxyConfig;
  18108. if (proxyConfig) {
  18109. this.commitProxy('reload');
  18110. }
  18111. this.$emit('form-reset', Object.assign({
  18112. $grid: this
  18113. }, params), evnt);
  18114. },
  18115. submitInvalidEvent: function submitInvalidEvent(params, evnt) {
  18116. this.$emit('form-submit-invalid', Object.assign({
  18117. $grid: this
  18118. }, params), evnt);
  18119. },
  18120. togglCollapseEvent: function togglCollapseEvent(params, evnt) {
  18121. var _this7 = this;
  18122. this.$nextTick(function () {
  18123. return _this7.recalculate(true);
  18124. });
  18125. this.$emit('form-toggle-collapse', Object.assign({
  18126. $grid: this
  18127. }, params), evnt);
  18128. },
  18129. triggerZoomEvent: function triggerZoomEvent(evnt) {
  18130. this.zoom();
  18131. this.$emit('zoom', {
  18132. $grid: this,
  18133. maximize: this.isZMax,
  18134. type: this.isZMax ? 'max' : 'revert',
  18135. $event: evnt
  18136. });
  18137. },
  18138. zoom: function zoom() {
  18139. return this[this.isZMax ? 'revert' : 'maximize']();
  18140. },
  18141. isMaximized: function isMaximized() {
  18142. return this.isZMax;
  18143. },
  18144. maximize: function maximize() {
  18145. return this.handleZoom(true);
  18146. },
  18147. revert: function revert() {
  18148. return this.handleZoom();
  18149. },
  18150. handleZoom: function handleZoom(isMax) {
  18151. var _this8 = this;
  18152. var isZMax = this.isZMax;
  18153. if (isMax ? !isZMax : isZMax) {
  18154. this.isZMax = !isZMax;
  18155. if (this.tZindex < UtilTools.getLastZIndex()) {
  18156. this.tZindex = UtilTools.nextZIndex();
  18157. }
  18158. }
  18159. return this.$nextTick().then(function () {
  18160. return _this8.recalculate(true);
  18161. }).then(function () {
  18162. return _this8.isZMax;
  18163. });
  18164. },
  18165. getProxyInfo: function getProxyInfo() {
  18166. return this.proxyConfig ? {
  18167. data: this.tableData,
  18168. filter: this.filterData,
  18169. form: this.formData,
  18170. sort: this.sortData,
  18171. sorts: this.proxyOpts.sort ? [this.sortData] : [],
  18172. pager: this.tablePage,
  18173. pendingRecords: this.pendingRecords
  18174. } : null;
  18175. }
  18176. })
  18177. });
  18178. // CONCATENATED MODULE: ./packages/grid/index.js
  18179. grid.install = function (Vue) {
  18180. v_x_e_table.Grid = grid;
  18181. v_x_e_table.GridComponent = grid;
  18182. Vue.component(grid.name, grid);
  18183. };
  18184. var Grid = grid;
  18185. /* harmony default export */ var packages_grid = (grid);
  18186. // CONCATENATED MODULE: ./packages/menu/src/panel.js
  18187. /* harmony default export */ var src_panel = ({
  18188. name: 'VxeTableContextMenu',
  18189. props: {
  18190. ctxMenuStore: Object,
  18191. ctxMenuOpts: Object
  18192. },
  18193. render: function render(h) {
  18194. var $xetable = this.$parent;
  18195. var _e = this._e,
  18196. ctxMenuOpts = this.ctxMenuOpts,
  18197. ctxMenuStore = this.ctxMenuStore;
  18198. return h('div', {
  18199. class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
  18200. 'is--show': ctxMenuStore.visible
  18201. }],
  18202. style: ctxMenuStore.style
  18203. }, ctxMenuStore.list.map(function (options, gIndex) {
  18204. return options.every(function (item) {
  18205. return item.visible === false;
  18206. }) ? _e() : h('ul', {
  18207. class: 'vxe-context-menu--option-wrapper',
  18208. key: gIndex
  18209. }, options.map(function (item, index) {
  18210. var hasChildMenus = item.children && item.children.some(function (child) {
  18211. return child.visible !== false;
  18212. });
  18213. return item.visible === false ? _e() : h('li', {
  18214. class: [item.className, {
  18215. 'link--disabled': item.disabled,
  18216. 'link--active': item === ctxMenuStore.selected
  18217. }],
  18218. key: "".concat(gIndex, "_").concat(index)
  18219. }, [h('a', {
  18220. class: 'vxe-context-menu--link',
  18221. on: {
  18222. click: function click(evnt) {
  18223. $xetable.ctxMenuLinkEvent(evnt, item);
  18224. },
  18225. mouseover: function mouseover(evnt) {
  18226. $xetable.ctxMenuMouseoverEvent(evnt, item);
  18227. },
  18228. mouseout: function mouseout(evnt) {
  18229. $xetable.ctxMenuMouseoutEvent(evnt, item);
  18230. }
  18231. }
  18232. }, [h('i', {
  18233. class: ['vxe-context-menu--link-prefix', item.prefixIcon]
  18234. }), h('span', {
  18235. class: 'vxe-context-menu--link-content'
  18236. }, UtilTools.getFuncText(item.name)), h('i', {
  18237. class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
  18238. })]), hasChildMenus ? h('ul', {
  18239. class: ['vxe-table--context-menu-clild-wrapper', {
  18240. 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
  18241. }]
  18242. }, item.children.map(function (child, cIndex) {
  18243. return child.visible === false ? _e() : h('li', {
  18244. class: [child.className, {
  18245. 'link--disabled': child.disabled,
  18246. 'link--active': child === ctxMenuStore.selectChild
  18247. }],
  18248. key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
  18249. }, [h('a', {
  18250. class: 'vxe-context-menu--link',
  18251. on: {
  18252. click: function click(evnt) {
  18253. $xetable.ctxMenuLinkEvent(evnt, child);
  18254. },
  18255. mouseover: function mouseover(evnt) {
  18256. $xetable.ctxMenuMouseoverEvent(evnt, item, child);
  18257. },
  18258. mouseout: function mouseout(evnt) {
  18259. $xetable.ctxMenuMouseoutEvent(evnt, item, child);
  18260. }
  18261. }
  18262. }, [h('i', {
  18263. class: ['vxe-context-menu--link-prefix', child.prefixIcon]
  18264. }), h('span', {
  18265. class: 'vxe-context-menu--link-content'
  18266. }, UtilTools.getFuncText(child.name))])]);
  18267. })) : _e()]);
  18268. }));
  18269. }));
  18270. }
  18271. });
  18272. // CONCATENATED MODULE: ./packages/menu/src/mixin.js
  18273. /* harmony default export */ var menu_src_mixin = ({
  18274. methods: {
  18275. /**
  18276. * 关闭快捷菜单
  18277. */
  18278. _closeMenu: function _closeMenu() {
  18279. Object.assign(this.ctxMenuStore, {
  18280. visible: false,
  18281. selected: null,
  18282. selectChild: null,
  18283. showChild: false
  18284. });
  18285. return this.$nextTick();
  18286. },
  18287. // 处理菜单的移动
  18288. moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
  18289. var selectItem;
  18290. var selectIndex = ctor_amd_xe_utils_default.a.findIndexOf(menuList, function (item) {
  18291. return ctxMenuStore[property] === item;
  18292. });
  18293. if (keyCode === operKey) {
  18294. if (operRest && UtilTools.hasChildrenList(ctxMenuStore.selected)) {
  18295. ctxMenuStore.showChild = true;
  18296. } else {
  18297. ctxMenuStore.showChild = false;
  18298. ctxMenuStore.selectChild = null;
  18299. }
  18300. } else if (keyCode === 38) {
  18301. for (var len = selectIndex - 1; len >= 0; len--) {
  18302. if (menuList[len].visible !== false) {
  18303. selectItem = menuList[len];
  18304. break;
  18305. }
  18306. }
  18307. ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
  18308. } else if (keyCode === 40) {
  18309. for (var index = selectIndex + 1; index < menuList.length; index++) {
  18310. if (menuList[index].visible !== false) {
  18311. selectItem = menuList[index];
  18312. break;
  18313. }
  18314. }
  18315. ctxMenuStore[property] = selectItem || menuList[0];
  18316. } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) {
  18317. this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
  18318. }
  18319. },
  18320. /**
  18321. * 快捷菜单事件处理
  18322. */
  18323. handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) {
  18324. var $refs = this.$refs,
  18325. tId = this.tId,
  18326. editStore = this.editStore,
  18327. menuConfig = this.menuConfig,
  18328. contextMenu = this.contextMenu,
  18329. ctxMenuStore = this.ctxMenuStore,
  18330. ctxMenuOpts = this.ctxMenuOpts,
  18331. mouseConfig = this.mouseConfig,
  18332. mouseOpts = this.mouseOpts;
  18333. var selected = editStore.selected;
  18334. var layoutList = ['header', 'body', 'footer'];
  18335. if (menuConfig || contextMenu) {
  18336. if (ctxMenuStore.visible && $refs.ctxWrapper && DomTools.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
  18337. evnt.preventDefault();
  18338. return;
  18339. }
  18340. if (this._keyCtx) {
  18341. var type = 'body';
  18342. var params = {
  18343. type: type,
  18344. $grid: this.$xegrid,
  18345. $table: this,
  18346. keyboard: true,
  18347. columns: this.visibleColumn.slice(0),
  18348. $event: evnt
  18349. }; // 如果开启单元格区域
  18350. if (mouseConfig && mouseOpts.area) {
  18351. var activeArea = this.getActiveCellArea();
  18352. if (activeArea && activeArea.row && activeArea.column) {
  18353. params.row = activeArea.row;
  18354. params.column = activeArea.column;
  18355. this.openContextMenu(evnt, type, params);
  18356. return;
  18357. }
  18358. } else if (mouseConfig && mouseOpts.selected) {
  18359. // 如果启用键盘导航且已选中单元格
  18360. if (selected.row && selected.column) {
  18361. params.row = selected.row;
  18362. params.column = selected.column;
  18363. this.openContextMenu(evnt, type, params);
  18364. return;
  18365. }
  18366. }
  18367. } // 分别匹配表尾、内容、表尾的快捷菜单
  18368. for (var index = 0; index < layoutList.length; index++) {
  18369. var layout = layoutList[index];
  18370. var columnTargetNode = DomTools.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
  18371. // target=td|th,直接向上找 table 去匹配即可
  18372. return target.parentNode.parentNode.parentNode.getAttribute('data-tid') === tId;
  18373. });
  18374. var _params = {
  18375. type: layout,
  18376. $grid: this.$xegrid,
  18377. $table: this,
  18378. columns: this.visibleColumn.slice(0),
  18379. $event: evnt
  18380. };
  18381. if (columnTargetNode.flag) {
  18382. var cell = columnTargetNode.targetElem;
  18383. var column = this.getColumnNode(cell).item;
  18384. var typePrefix = "".concat(layout, "-");
  18385. Object.assign(_params, {
  18386. column: column,
  18387. columnIndex: this.getColumnIndex(column),
  18388. cell: cell
  18389. });
  18390. if (layout === 'body') {
  18391. var row = this.getRowNode(cell.parentNode).item;
  18392. typePrefix = '';
  18393. _params.row = row;
  18394. _params.rowIndex = this.getRowIndex(row);
  18395. }
  18396. this.openContextMenu(evnt, layout, _params); // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
  18397. if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
  18398. UtilTools.warn('vxe.error.delEvent', ["".concat(typePrefix, "cell-context-menu"), "".concat(typePrefix, "cell-menu")]);
  18399. this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
  18400. } else {
  18401. this.emitEvent("".concat(typePrefix, "cell-menu"), _params, evnt);
  18402. }
  18403. return;
  18404. } else if (DomTools.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
  18405. return target.getAttribute('data-tid') === tId;
  18406. }).flag) {
  18407. if (ctxMenuOpts.trigger === 'cell') {
  18408. evnt.preventDefault();
  18409. } else {
  18410. this.openContextMenu(evnt, layout, _params);
  18411. }
  18412. return;
  18413. }
  18414. }
  18415. }
  18416. if ($refs.filterWrapper && !DomTools.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
  18417. this.closeFilter();
  18418. }
  18419. this.closeMenu();
  18420. },
  18421. /**
  18422. * 显示快捷菜单
  18423. */
  18424. openContextMenu: function openContextMenu(evnt, type, params) {
  18425. var _this = this;
  18426. var isCtxMenu = this.isCtxMenu,
  18427. ctxMenuStore = this.ctxMenuStore,
  18428. ctxMenuOpts = this.ctxMenuOpts;
  18429. var config = ctxMenuOpts[type];
  18430. var visibleMethod = ctxMenuOpts.visibleMethod;
  18431. if (config) {
  18432. var options = config.options,
  18433. disabled = config.disabled;
  18434. if (disabled) {
  18435. evnt.preventDefault();
  18436. } else if (isCtxMenu && options && options.length) {
  18437. params.options = options;
  18438. this.preventEvent(evnt, 'event.showMenu', params, function () {
  18439. if (!visibleMethod || visibleMethod(params, evnt)) {
  18440. evnt.preventDefault();
  18441. _this.updateZindex();
  18442. var _DomTools$getDomNode = DomTools.getDomNode(),
  18443. scrollTop = _DomTools$getDomNode.scrollTop,
  18444. scrollLeft = _DomTools$getDomNode.scrollLeft,
  18445. visibleHeight = _DomTools$getDomNode.visibleHeight,
  18446. visibleWidth = _DomTools$getDomNode.visibleWidth;
  18447. var top = evnt.clientY + scrollTop;
  18448. var left = evnt.clientX + scrollLeft;
  18449. var handleVisible = function handleVisible() {
  18450. Object.assign(ctxMenuStore, {
  18451. args: params,
  18452. visible: true,
  18453. list: options,
  18454. selected: null,
  18455. selectChild: null,
  18456. showChild: false,
  18457. style: {
  18458. zIndex: _this.tZindex,
  18459. top: "".concat(top, "px"),
  18460. left: "".concat(left, "px")
  18461. }
  18462. });
  18463. _this.$nextTick(function () {
  18464. var ctxElem = _this.$refs.ctxWrapper.$el;
  18465. var clientHeight = ctxElem.clientHeight;
  18466. var clientWidth = ctxElem.clientWidth;
  18467. var _DomTools$getAbsolute = DomTools.getAbsolutePos(ctxElem),
  18468. boundingTop = _DomTools$getAbsolute.boundingTop,
  18469. boundingLeft = _DomTools$getAbsolute.boundingLeft;
  18470. var offsetTop = boundingTop + clientHeight - visibleHeight;
  18471. var offsetLeft = boundingLeft + clientWidth - visibleWidth;
  18472. if (offsetTop > -10) {
  18473. ctxMenuStore.style.top = "".concat(Math.max(scrollTop + 2, top - clientHeight - 2), "px");
  18474. }
  18475. if (offsetLeft > -10) {
  18476. ctxMenuStore.style.left = "".concat(Math.max(scrollLeft + 2, left - clientWidth - 2), "px");
  18477. }
  18478. });
  18479. };
  18480. var keyboard = params.keyboard,
  18481. row = params.row,
  18482. column = params.column;
  18483. if (keyboard && row && column) {
  18484. _this.scrollToRow(row, column).then(function () {
  18485. var cell = _this.getCell(row, column);
  18486. var _DomTools$getAbsolute2 = DomTools.getAbsolutePos(cell),
  18487. boundingTop = _DomTools$getAbsolute2.boundingTop,
  18488. boundingLeft = _DomTools$getAbsolute2.boundingLeft;
  18489. top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
  18490. left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
  18491. handleVisible();
  18492. });
  18493. } else {
  18494. handleVisible();
  18495. }
  18496. } else {
  18497. _this.closeMenu();
  18498. }
  18499. });
  18500. }
  18501. }
  18502. this.closeFilter();
  18503. },
  18504. ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) {
  18505. var menuElem = evnt.currentTarget;
  18506. var ctxMenuStore = this.ctxMenuStore;
  18507. evnt.preventDefault();
  18508. evnt.stopPropagation();
  18509. ctxMenuStore.selected = item;
  18510. ctxMenuStore.selectChild = child;
  18511. if (!child) {
  18512. ctxMenuStore.showChild = UtilTools.hasChildrenList(item);
  18513. if (ctxMenuStore.showChild) {
  18514. this.$nextTick(function () {
  18515. var childWrapperElem = menuElem.nextElementSibling;
  18516. if (childWrapperElem) {
  18517. var _DomTools$getAbsolute3 = DomTools.getAbsolutePos(menuElem),
  18518. boundingTop = _DomTools$getAbsolute3.boundingTop,
  18519. boundingLeft = _DomTools$getAbsolute3.boundingLeft,
  18520. visibleHeight = _DomTools$getAbsolute3.visibleHeight,
  18521. visibleWidth = _DomTools$getAbsolute3.visibleWidth;
  18522. var posTop = boundingTop + menuElem.offsetHeight;
  18523. var posLeft = boundingLeft + menuElem.offsetWidth;
  18524. var left = '';
  18525. var right = ''; // 是否超出右侧
  18526. if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
  18527. left = 'auto';
  18528. right = "".concat(menuElem.offsetWidth, "px");
  18529. } // 是否超出底部
  18530. var top = '';
  18531. var bottom = '';
  18532. if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
  18533. top = 'auto';
  18534. bottom = '0';
  18535. }
  18536. childWrapperElem.style.left = left;
  18537. childWrapperElem.style.right = right;
  18538. childWrapperElem.style.top = top;
  18539. childWrapperElem.style.bottom = bottom;
  18540. }
  18541. });
  18542. }
  18543. }
  18544. },
  18545. ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item) {
  18546. var ctxMenuStore = this.ctxMenuStore;
  18547. if (!item.children) {
  18548. ctxMenuStore.selected = null;
  18549. }
  18550. ctxMenuStore.selectChild = null;
  18551. },
  18552. /**
  18553. * 快捷菜单点击事件
  18554. */
  18555. ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
  18556. // 如果一级菜单有配置 code 则允许点击,否则不能点击
  18557. if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
  18558. var ctxMenuMethod = v_x_e_table.menus.get(menu.code);
  18559. var params = Object.assign({
  18560. menu: menu,
  18561. $grid: this.$xegrid,
  18562. $table: this,
  18563. $event: evnt
  18564. }, this.ctxMenuStore.args);
  18565. if (ctxMenuMethod) {
  18566. ctxMenuMethod.call(this, params, evnt);
  18567. } // 在 v3 中废弃事件 context-menu-click
  18568. if (this.$listeners['context-menu-click']) {
  18569. UtilTools.warn('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
  18570. this.emitEvent('context-menu-click', params, evnt);
  18571. } else {
  18572. this.emitEvent('menu-click', params, evnt);
  18573. }
  18574. this.closeMenu();
  18575. }
  18576. }
  18577. }
  18578. });
  18579. // CONCATENATED MODULE: ./packages/menu/index.js
  18580. src_panel.install = function (Vue) {
  18581. v_x_e_table.reg('menu');
  18582. packages_table.mixins.push(menu_src_mixin);
  18583. Vue.component(src_panel.name, src_panel);
  18584. };
  18585. var Menu = src_panel;
  18586. /* harmony default export */ var packages_menu = (src_panel);
  18587. // CONCATENATED MODULE: ./packages/toolbar/src/toolbar.js
  18588. /**
  18589. * 渲染按钮
  18590. */
  18591. function renderBtns(h, _vm) {
  18592. var _e = _vm._e,
  18593. $scopedSlots = _vm.$scopedSlots,
  18594. $xegrid = _vm.$xegrid,
  18595. $xetable = _vm.$xetable,
  18596. _vm$buttons = _vm.buttons,
  18597. buttons = _vm$buttons === void 0 ? [] : _vm$buttons;
  18598. if ($scopedSlots.buttons) {
  18599. return $scopedSlots.buttons.call(_vm, {
  18600. $grid: $xegrid,
  18601. $table: $xetable
  18602. }, h);
  18603. }
  18604. return buttons.map(function (item) {
  18605. var name = item.name,
  18606. visible = item.visible,
  18607. _dropdowns = item.dropdowns,
  18608. buttonRender = item.buttonRender;
  18609. var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
  18610. if (visible === false) {
  18611. return _e();
  18612. }
  18613. if (compConf) {
  18614. var renderToolbarButton = compConf.renderToolbarButton || compConf.renderButton;
  18615. if (renderToolbarButton) {
  18616. return h('span', {
  18617. class: 'vxe-button--item'
  18618. }, renderToolbarButton.call(_vm, h, buttonRender, {
  18619. $grid: $xegrid,
  18620. $table: $xetable,
  18621. button: item
  18622. }, {
  18623. $grid: $xegrid,
  18624. $table: $xetable
  18625. }));
  18626. }
  18627. }
  18628. return h('vxe-button', {
  18629. on: {
  18630. click: function click(evnt) {
  18631. return _vm.btnEvent(evnt, item);
  18632. }
  18633. },
  18634. props: {
  18635. disabled: item.disabled,
  18636. loading: item.loading,
  18637. type: item.type,
  18638. icon: item.icon,
  18639. circle: item.circle,
  18640. round: item.round,
  18641. status: item.status,
  18642. destroyOnClose: item.destroyOnClose,
  18643. placement: item.placement,
  18644. transfer: item.transfer
  18645. },
  18646. scopedSlots: _dropdowns && _dropdowns.length ? {
  18647. default: function _default() {
  18648. return UtilTools.getFuncText(name);
  18649. },
  18650. dropdowns: function dropdowns() {
  18651. return _dropdowns.map(function (child) {
  18652. return child.visible === false ? _e() : h('vxe-button', {
  18653. on: {
  18654. click: function click(evnt) {
  18655. return _vm.btnEvent(evnt, child);
  18656. }
  18657. },
  18658. props: {
  18659. disabled: child.disabled,
  18660. loading: child.loading,
  18661. type: child.type,
  18662. icon: child.icon,
  18663. circle: child.circle,
  18664. round: child.round,
  18665. status: child.status
  18666. }
  18667. }, UtilTools.getFuncText(child.name));
  18668. });
  18669. }
  18670. } : null
  18671. }, UtilTools.getFuncText(name));
  18672. });
  18673. }
  18674. /**
  18675. * 渲染右侧工具
  18676. */
  18677. function renderRightTools(h, _vm) {
  18678. var $scopedSlots = _vm.$scopedSlots,
  18679. $xegrid = _vm.$xegrid,
  18680. $xetable = _vm.$xetable;
  18681. if ($scopedSlots.tools) {
  18682. return $scopedSlots.tools.call(_vm, {
  18683. $grid: $xegrid,
  18684. $table: $xetable
  18685. }, h);
  18686. }
  18687. return [];
  18688. }
  18689. function renderCustoms(h, _vm) {
  18690. var $xetable = _vm.$xetable,
  18691. customStore = _vm.customStore,
  18692. customOpts = _vm.customOpts,
  18693. columns = _vm.columns;
  18694. var cols = [];
  18695. var customBtnOns = {};
  18696. var customWrapperOns = {};
  18697. var checkMethod = ($xetable && $xetable.customOpts ? $xetable.customOpts.checkMethod : null) || customOpts.checkMethod;
  18698. if (customOpts.trigger === 'manual') {// 手动触发
  18699. } else if (customOpts.trigger === 'hover') {
  18700. // hover 触发
  18701. customBtnOns.mouseenter = _vm.handleMouseenterSettingEvent;
  18702. customBtnOns.mouseleave = _vm.handleMouseleaveSettingEvent;
  18703. customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
  18704. customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
  18705. } else {
  18706. // 点击触发
  18707. customBtnOns.click = _vm.handleClickSettingEvent;
  18708. }
  18709. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  18710. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  18711. var colKey = column.getKey();
  18712. var isColGroup = column.children && column.children.length;
  18713. var isDisabled = checkMethod ? !checkMethod({
  18714. column: column
  18715. }) : false;
  18716. if (isColGroup || colKey) {
  18717. cols.push(h('li', {
  18718. class: ['vxe-custom--option', "level--".concat(column.level), {
  18719. 'is--group': isColGroup,
  18720. 'is--checked': column.visible,
  18721. 'is--indeterminate': column.halfVisible,
  18722. 'is--disabled': isDisabled
  18723. }],
  18724. attrs: {
  18725. title: colTitle
  18726. },
  18727. on: {
  18728. click: function click() {
  18729. if (!isDisabled) {
  18730. _vm.changeCustomOption(column);
  18731. }
  18732. }
  18733. }
  18734. }, [h('span', {
  18735. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  18736. }), h('span', {
  18737. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  18738. }), h('span', {
  18739. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  18740. }), h('span', {
  18741. class: 'vxe-checkbox--label'
  18742. }, colTitle)]));
  18743. }
  18744. });
  18745. return h('div', {
  18746. class: ['vxe-custom--wrapper', {
  18747. 'is--active': customStore.visible
  18748. }],
  18749. ref: 'customWrapper'
  18750. }, [h('vxe-button', {
  18751. props: {
  18752. circle: true,
  18753. icon: customOpts.icon || conf.icon.TOOLBAR_TOOLS_CUSTOM
  18754. },
  18755. attrs: {
  18756. title: conf.i18n('vxe.toolbar.custom')
  18757. },
  18758. on: customBtnOns
  18759. }), h('div', {
  18760. class: 'vxe-custom--option-wrapper'
  18761. }, [h('ul', {
  18762. class: 'vxe-custom--header'
  18763. }, [h('li', {
  18764. class: ['vxe-custom--option', {
  18765. 'is--checked': customStore.isAll,
  18766. 'is--indeterminate': customStore.isIndeterminate
  18767. }],
  18768. attrs: {
  18769. title: conf.i18n('vxe.table.allTitle')
  18770. },
  18771. on: {
  18772. click: _vm.allCustomEvent
  18773. }
  18774. }, [h('span', {
  18775. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  18776. }), h('span', {
  18777. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  18778. }), h('span', {
  18779. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  18780. }), h('span', {
  18781. class: 'vxe-checkbox--label'
  18782. }, conf.i18n('vxe.toolbar.customAll'))])]), h('ul', {
  18783. class: 'vxe-custom--body',
  18784. on: customWrapperOns
  18785. }, cols), customOpts.isFooter === false ? null : h('div', {
  18786. class: 'vxe-custom--footer'
  18787. }, [h('button', {
  18788. class: 'btn--confirm',
  18789. on: {
  18790. click: _vm.confirmCustomEvent
  18791. }
  18792. }, conf.i18n('vxe.toolbar.customConfirm')), h('button', {
  18793. class: 'btn--reset',
  18794. on: {
  18795. click: _vm.resetCustomEvent
  18796. }
  18797. }, conf.i18n('vxe.toolbar.customRestore'))])])]);
  18798. }
  18799. /* harmony default export */ var src_toolbar = ({
  18800. name: 'VxeToolbar',
  18801. props: {
  18802. id: String,
  18803. loading: Boolean,
  18804. resizable: [Boolean, Object],
  18805. refresh: [Boolean, Object],
  18806. import: [Boolean, Object],
  18807. export: [Boolean, Object],
  18808. print: [Boolean, Object],
  18809. zoom: [Boolean, Object],
  18810. setting: [Boolean, Object],
  18811. custom: [Boolean, Object],
  18812. buttons: {
  18813. type: Array,
  18814. default: function _default() {
  18815. return conf.toolbar.buttons;
  18816. }
  18817. },
  18818. perfect: {
  18819. type: Boolean,
  18820. default: function _default() {
  18821. return conf.toolbar.perfect;
  18822. }
  18823. },
  18824. size: {
  18825. type: String,
  18826. default: function _default() {
  18827. return conf.toolbar.size || conf.size;
  18828. }
  18829. }
  18830. },
  18831. inject: {
  18832. $xegrid: {
  18833. default: null
  18834. }
  18835. },
  18836. data: function data() {
  18837. return {
  18838. $xetable: null,
  18839. isRefresh: false,
  18840. columns: [],
  18841. customStore: {
  18842. isAll: false,
  18843. isIndeterminate: false,
  18844. visible: false
  18845. }
  18846. };
  18847. },
  18848. computed: {
  18849. vSize: function vSize() {
  18850. return this.size || this.$parent.size || this.$parent.vSize;
  18851. },
  18852. refreshOpts: function refreshOpts() {
  18853. return Object.assign({}, conf.toolbar.refresh, this.refresh);
  18854. },
  18855. importOpts: function importOpts() {
  18856. return Object.assign({}, conf.toolbar.import, this.import);
  18857. },
  18858. exportOpts: function exportOpts() {
  18859. return Object.assign({}, conf.toolbar.export, this.export);
  18860. },
  18861. printOpts: function printOpts() {
  18862. return Object.assign({}, conf.toolbar.print, this.print);
  18863. },
  18864. // 在 v3.0 中废弃 toolbar.resizable
  18865. resizableOpts: function resizableOpts() {
  18866. return Object.assign({}, conf.toolbar.resizable, this.resizable);
  18867. },
  18868. zoomOpts: function zoomOpts() {
  18869. return Object.assign({}, conf.toolbar.zoom, this.zoom);
  18870. },
  18871. // 在 v3.0 中废弃 toolbar.custom
  18872. customOpts: function customOpts() {
  18873. return Object.assign({}, conf.toolbar.custom, this.custom);
  18874. }
  18875. },
  18876. created: function created() {
  18877. var _this = this;
  18878. var customOpts = this.customOpts,
  18879. refresh = this.refresh,
  18880. resizable = this.resizable,
  18881. setting = this.setting,
  18882. id = this.id,
  18883. refreshOpts = this.refreshOpts;
  18884. if (customOpts.storage && !id) {
  18885. return UtilTools.error('vxe.error.reqProp', ['toolbar.id']);
  18886. }
  18887. if (id) {
  18888. UtilTools.warn('vxe.error.removeProp', ['toolbar.id']);
  18889. } // 在 v3 中废弃 setting
  18890. if (setting) {
  18891. UtilTools.warn('vxe.error.delProp', ['toolbar.setting', 'toolbar.custom']);
  18892. }
  18893. if (!v_x_e_table._export && (this.export || this.import)) {
  18894. UtilTools.error('vxe.error.reqModule', ['Export']);
  18895. }
  18896. if (resizable) {
  18897. UtilTools.warn('vxe.error.delProp', ['toolbar.resizable', 'custom-config.storage']);
  18898. }
  18899. if (customOpts.storage) {
  18900. UtilTools.warn('vxe.error.delProp', ['toolbar.custom.storage', 'custom-config.storage']);
  18901. }
  18902. this.$nextTick(function () {
  18903. var $xetable = _this.fintTable();
  18904. if (refresh && !_this.$xegrid && !refreshOpts.query) {
  18905. UtilTools.warn('vxe.error.notFunc', ['query']);
  18906. }
  18907. if ($xetable) {
  18908. $xetable.connect(_this);
  18909. }
  18910. });
  18911. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  18912. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  18913. },
  18914. destroyed: function destroyed() {
  18915. GlobalEvent.off(this, 'mousedown');
  18916. GlobalEvent.off(this, 'blur');
  18917. },
  18918. render: function render(h) {
  18919. var _ref;
  18920. var $xegrid = this.$xegrid,
  18921. perfect = this.perfect,
  18922. loading = this.loading,
  18923. importOpts = this.importOpts,
  18924. exportOpts = this.exportOpts,
  18925. refresh = this.refresh,
  18926. refreshOpts = this.refreshOpts,
  18927. zoom = this.zoom,
  18928. zoomOpts = this.zoomOpts,
  18929. custom = this.custom,
  18930. setting = this.setting,
  18931. vSize = this.vSize;
  18932. return h('div', {
  18933. class: ['vxe-toolbar', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--perfect', perfect), _defineProperty(_ref, 'is--loading', loading), _ref)]
  18934. }, [h('div', {
  18935. class: 'vxe-buttons--wrapper'
  18936. }, renderBtns(h, this)), h('div', {
  18937. class: 'vxe-tools--wrapper'
  18938. }, renderRightTools(h, this)), h('div', {
  18939. class: 'vxe-tools--operate'
  18940. }, [this.import ? h('vxe-button', {
  18941. props: {
  18942. circle: true,
  18943. icon: importOpts.icon || conf.icon.TOOLBAR_TOOLS_IMPORT
  18944. },
  18945. attrs: {
  18946. title: conf.i18n('vxe.toolbar.import')
  18947. },
  18948. on: {
  18949. click: this.importEvent
  18950. }
  18951. }) : null, this.export ? h('vxe-button', {
  18952. props: {
  18953. circle: true,
  18954. icon: exportOpts.icon || conf.icon.TOOLBAR_TOOLS_EXPORT
  18955. },
  18956. attrs: {
  18957. title: conf.i18n('vxe.toolbar.export')
  18958. },
  18959. on: {
  18960. click: this.exportEvent
  18961. }
  18962. }) : null, this.print ? h('vxe-button', {
  18963. props: {
  18964. circle: true,
  18965. icon: this.printOpts.icon || conf.icon.TOOLBAR_TOOLS_PRINT
  18966. },
  18967. attrs: {
  18968. title: conf.i18n('vxe.toolbar.print')
  18969. },
  18970. on: {
  18971. click: this.printEvent
  18972. }
  18973. }) : null, refresh ? h('vxe-button', {
  18974. props: {
  18975. circle: true,
  18976. icon: this.isRefresh ? refreshOpts.iconLoading || conf.icon.TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || conf.icon.TOOLBAR_TOOLS_REFRESH
  18977. },
  18978. attrs: {
  18979. title: conf.i18n('vxe.toolbar.refresh')
  18980. },
  18981. on: {
  18982. click: this.refreshEvent
  18983. }
  18984. }) : null, zoom && $xegrid ? h('vxe-button', {
  18985. props: {
  18986. circle: true,
  18987. icon: $xegrid.isMaximized() ? zoomOpts.iconOut || conf.icon.TOOLBAR_TOOLS_ZOOM_OUT : zoomOpts.iconIn || conf.icon.TOOLBAR_TOOLS_ZOOM_IN
  18988. },
  18989. attrs: {
  18990. title: conf.i18n("vxe.toolbar.zoom".concat($xegrid.isMaximized() ? 'Out' : 'In'))
  18991. },
  18992. on: {
  18993. click: $xegrid.triggerZoomEvent
  18994. }
  18995. }) : null, custom || setting ? renderCustoms(h, this) : null])]);
  18996. },
  18997. methods: {
  18998. syncUpdate: function syncUpdate(params) {
  18999. var collectColumn = params.collectColumn,
  19000. $table = params.$table;
  19001. this.$xetable = $table;
  19002. this.columns = collectColumn;
  19003. },
  19004. fintTable: function fintTable() {
  19005. var $children = this.$parent.$children;
  19006. var selfIndex = $children.indexOf(this);
  19007. return ctor_amd_xe_utils_default.a.find($children, function (comp, index) {
  19008. return comp && comp.refreshColumn && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table';
  19009. });
  19010. },
  19011. checkTable: function checkTable() {
  19012. if (this.$xetable) {
  19013. return true;
  19014. }
  19015. UtilTools.error('vxe.error.barUnableLink');
  19016. },
  19017. showCustom: function showCustom() {
  19018. this.customStore.visible = true;
  19019. this.checkCustomStatus();
  19020. },
  19021. closeCustom: function closeCustom() {
  19022. var custom = this.custom,
  19023. setting = this.setting,
  19024. customStore = this.customStore;
  19025. if (customStore.visible) {
  19026. customStore.visible = false;
  19027. if ((custom || setting) && !customStore.immediate) {
  19028. this.handleCustoms();
  19029. }
  19030. }
  19031. },
  19032. confirmCustomEvent: function confirmCustomEvent(evnt) {
  19033. this.closeCustom();
  19034. this.emitCustomEvent('confirm', evnt);
  19035. },
  19036. customOpenEvent: function customOpenEvent(evnt) {
  19037. var customStore = this.customStore;
  19038. if (this.checkTable()) {
  19039. if (!customStore.visible) {
  19040. this.showCustom();
  19041. this.emitCustomEvent('open', evnt);
  19042. }
  19043. }
  19044. },
  19045. customColseEvent: function customColseEvent(evnt) {
  19046. var customStore = this.customStore;
  19047. if (customStore.visible) {
  19048. this.closeCustom();
  19049. this.emitCustomEvent('close', evnt);
  19050. }
  19051. },
  19052. resetCustomEvent: function resetCustomEvent(evnt) {
  19053. var $xetable = this.$xetable,
  19054. columns = this.columns,
  19055. customOpts = this.customOpts;
  19056. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19057. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  19058. if (!checkMethod || checkMethod({
  19059. column: column
  19060. })) {
  19061. column.visible = column.defaultVisible;
  19062. column.halfVisible = false;
  19063. }
  19064. column.resizeWidth = 0;
  19065. });
  19066. $xetable.saveCustomResizable(true);
  19067. this.closeCustom();
  19068. this.emitCustomEvent('reset', evnt);
  19069. },
  19070. emitCustomEvent: function emitCustomEvent(type, evnt) {
  19071. var $xetable = this.$xetable,
  19072. $xegrid = this.$xegrid;
  19073. var comp = $xegrid || $xetable;
  19074. comp.$emit('custom', {
  19075. type: type,
  19076. $table: $xetable,
  19077. $grid: $xegrid,
  19078. $event: evnt
  19079. }, evnt);
  19080. },
  19081. changeCustomOption: function changeCustomOption(column) {
  19082. var isChecked = !column.visible;
  19083. ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
  19084. item.visible = isChecked;
  19085. item.halfVisible = false;
  19086. });
  19087. this.handleOptionCheck(column);
  19088. if (this.custom && this.customOpts.immediate) {
  19089. this.handleCustoms();
  19090. }
  19091. this.checkCustomStatus();
  19092. },
  19093. handleOptionCheck: function handleOptionCheck(column) {
  19094. var matchObj = ctor_amd_xe_utils_default.a.findTree(this.columns, function (item) {
  19095. return item === column;
  19096. });
  19097. if (matchObj && matchObj.parent) {
  19098. var parent = matchObj.parent;
  19099. if (parent.children && parent.children.length) {
  19100. parent.visible = parent.children.every(function (column) {
  19101. return column.visible;
  19102. });
  19103. parent.halfVisible = !parent.visible && parent.children.some(function (column) {
  19104. return column.visible || column.halfVisible;
  19105. });
  19106. this.handleOptionCheck(parent);
  19107. }
  19108. }
  19109. },
  19110. handleCustoms: function handleCustoms() {
  19111. var $xetable = this.$xetable;
  19112. $xetable.saveCustomVisible();
  19113. $xetable.analyColumnWidth();
  19114. $xetable.refreshColumn();
  19115. },
  19116. checkCustomStatus: function checkCustomStatus() {
  19117. var $xetable = this.$xetable,
  19118. columns = this.columns,
  19119. customOpts = this.customOpts;
  19120. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19121. this.customStore.isAll = columns.every(function (column) {
  19122. return (checkMethod ? !checkMethod({
  19123. column: column
  19124. }) : false) || column.visible;
  19125. });
  19126. this.customStore.isIndeterminate = !this.customStore.isAll && columns.some(function (column) {
  19127. return (!checkMethod || checkMethod({
  19128. column: column
  19129. })) && (column.visible || column.halfVisible);
  19130. });
  19131. },
  19132. allCustomEvent: function allCustomEvent() {
  19133. var $xetable = this.$xetable,
  19134. columns = this.columns,
  19135. customOpts = this.customOpts,
  19136. customStore = this.customStore;
  19137. var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
  19138. var isAll = !customStore.isAll;
  19139. ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
  19140. if (!checkMethod || checkMethod({
  19141. column: column
  19142. })) {
  19143. column.visible = isAll;
  19144. column.halfVisible = false;
  19145. }
  19146. });
  19147. customStore.isAll = isAll;
  19148. this.checkCustomStatus();
  19149. },
  19150. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  19151. if (!DomTools.getEventTargetNode(evnt, this.$refs.customWrapper).flag) {
  19152. this.customColseEvent(evnt);
  19153. }
  19154. },
  19155. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  19156. this.customColseEvent(evnt);
  19157. },
  19158. handleClickSettingEvent: function handleClickSettingEvent(evnt) {
  19159. if (this.customStore.visible) {
  19160. this.customColseEvent(evnt);
  19161. } else {
  19162. this.customOpenEvent(evnt);
  19163. }
  19164. },
  19165. handleMouseenterSettingEvent: function handleMouseenterSettingEvent(evnt) {
  19166. this.customStore.activeBtn = true;
  19167. this.customOpenEvent(evnt);
  19168. },
  19169. handleMouseleaveSettingEvent: function handleMouseleaveSettingEvent(evnt) {
  19170. var _this2 = this;
  19171. var customStore = this.customStore;
  19172. customStore.activeBtn = false;
  19173. setTimeout(function () {
  19174. if (!customStore.activeBtn && !customStore.activeWrapper) {
  19175. _this2.customColseEvent(evnt);
  19176. }
  19177. }, 300);
  19178. },
  19179. handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
  19180. this.customStore.activeWrapper = true;
  19181. this.customOpenEvent(evnt);
  19182. },
  19183. handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
  19184. var _this3 = this;
  19185. var customStore = this.customStore;
  19186. customStore.activeWrapper = false;
  19187. setTimeout(function () {
  19188. if (!customStore.activeBtn && !customStore.activeWrapper) {
  19189. _this3.customColseEvent(evnt);
  19190. }
  19191. }, 300);
  19192. },
  19193. refreshEvent: function refreshEvent() {
  19194. var _this4 = this;
  19195. var $xegrid = this.$xegrid,
  19196. refreshOpts = this.refreshOpts,
  19197. isRefresh = this.isRefresh;
  19198. if (!isRefresh) {
  19199. if (refreshOpts.query) {
  19200. this.isRefresh = true;
  19201. try {
  19202. Promise.resolve(refreshOpts.query()).catch(function (e) {
  19203. return e;
  19204. }).then(function () {
  19205. _this4.isRefresh = false;
  19206. });
  19207. } catch (e) {
  19208. this.isRefresh = false;
  19209. }
  19210. } else if ($xegrid) {
  19211. this.isRefresh = true;
  19212. $xegrid.commitProxy('reload').catch(function (e) {
  19213. return e;
  19214. }).then(function () {
  19215. _this4.isRefresh = false;
  19216. });
  19217. }
  19218. }
  19219. },
  19220. btnEvent: function btnEvent(evnt, item) {
  19221. var $xegrid = this.$xegrid,
  19222. $xetable = this.$xetable;
  19223. var code = item.code;
  19224. if (code) {
  19225. if ($xegrid) {
  19226. $xegrid.triggerToolbarBtnEvent(item, evnt);
  19227. } else {
  19228. var commandMethod = v_x_e_table.commands.get(code);
  19229. var params = {
  19230. code: code,
  19231. button: item,
  19232. $xegrid: $xegrid,
  19233. $table: $xetable,
  19234. $event: evnt
  19235. };
  19236. if (commandMethod) {
  19237. commandMethod.call(this, params, evnt);
  19238. }
  19239. this.$emit('button-click', params, evnt);
  19240. }
  19241. }
  19242. },
  19243. importEvent: function importEvent() {
  19244. if (this.checkTable()) {
  19245. this.$xetable.openImport(this.importOpts);
  19246. }
  19247. },
  19248. exportEvent: function exportEvent() {
  19249. if (this.checkTable()) {
  19250. this.$xetable.openExport(this.exportOpts);
  19251. }
  19252. },
  19253. printEvent: function printEvent() {
  19254. if (this.checkTable()) {
  19255. this.$xetable.print(this.printOpts);
  19256. }
  19257. }
  19258. }
  19259. });
  19260. // CONCATENATED MODULE: ./packages/toolbar/index.js
  19261. src_toolbar.install = function (Vue) {
  19262. Vue.component(src_toolbar.name, src_toolbar);
  19263. };
  19264. var Toolbar = src_toolbar;
  19265. /* harmony default export */ var packages_toolbar = (src_toolbar);
  19266. // CONCATENATED MODULE: ./packages/pager/src/pager.js
  19267. /* harmony default export */ var pager = ({
  19268. name: 'VxePager',
  19269. props: {
  19270. size: {
  19271. type: String,
  19272. default: function _default() {
  19273. return conf.pager.size || conf.size;
  19274. }
  19275. },
  19276. // 自定义布局
  19277. layouts: {
  19278. type: Array,
  19279. default: function _default() {
  19280. return conf.pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total'];
  19281. }
  19282. },
  19283. // 当前页
  19284. currentPage: {
  19285. type: Number,
  19286. default: 1
  19287. },
  19288. // 加载中
  19289. loading: Boolean,
  19290. // 每页大小
  19291. pageSize: {
  19292. type: Number,
  19293. default: function _default() {
  19294. return conf.pager.pageSize || 10;
  19295. }
  19296. },
  19297. // 总条数
  19298. total: {
  19299. type: Number,
  19300. default: 0
  19301. },
  19302. // 显示页码按钮的数量
  19303. pagerCount: {
  19304. type: Number,
  19305. default: function _default() {
  19306. return conf.pager.pagerCount || 7;
  19307. }
  19308. },
  19309. // 每页大小选项列表
  19310. pageSizes: {
  19311. type: Array,
  19312. default: function _default() {
  19313. return conf.pager.pageSizes || [10, 15, 20, 50, 100];
  19314. }
  19315. },
  19316. // 列对其方式
  19317. align: {
  19318. type: String,
  19319. default: function _default() {
  19320. return conf.pager.align;
  19321. }
  19322. },
  19323. // 带边框
  19324. border: {
  19325. type: Boolean,
  19326. default: function _default() {
  19327. return conf.pager.border;
  19328. }
  19329. },
  19330. // 带背景颜色
  19331. background: {
  19332. type: Boolean,
  19333. default: function _default() {
  19334. return conf.pager.background;
  19335. }
  19336. },
  19337. // 配套的样式
  19338. perfect: {
  19339. type: Boolean,
  19340. default: function _default() {
  19341. return conf.pager.perfect;
  19342. }
  19343. },
  19344. // 当只有一页时隐藏
  19345. autoHidden: {
  19346. type: Boolean,
  19347. default: function _default() {
  19348. return conf.pager.autoHidden;
  19349. }
  19350. },
  19351. transfer: {
  19352. type: Boolean,
  19353. default: function _default() {
  19354. return conf.pager.transfer;
  19355. }
  19356. },
  19357. // 自定义图标
  19358. iconPrevPage: String,
  19359. iconJumpPrev: String,
  19360. iconJumpNext: String,
  19361. iconNextPage: String,
  19362. iconJumpMore: String
  19363. },
  19364. inject: {
  19365. $xegrid: {
  19366. default: null
  19367. }
  19368. },
  19369. computed: {
  19370. vSize: function vSize() {
  19371. return this.size || this.$parent.size || this.$parent.vSize;
  19372. },
  19373. isSizes: function isSizes() {
  19374. return this.layouts.some(function (name) {
  19375. return name === 'Sizes';
  19376. });
  19377. },
  19378. pageCount: function pageCount() {
  19379. return this.getPageCount(this.total, this.pageSize);
  19380. },
  19381. numList: function numList() {
  19382. var len = this.pageCount > this.pagerCount ? this.pagerCount - 2 : this.pagerCount;
  19383. var rest = [];
  19384. for (var index = 0; index < len; index++) {
  19385. rest.push(index);
  19386. }
  19387. return rest;
  19388. },
  19389. offsetNumber: function offsetNumber() {
  19390. return Math.floor((this.pagerCount - 2) / 2);
  19391. },
  19392. sizeList: function sizeList() {
  19393. return this.pageSizes.map(function (item) {
  19394. if (ctor_amd_xe_utils_default.a.isNumber(item)) {
  19395. return {
  19396. value: item,
  19397. label: "".concat(conf.i18n('vxe.pager.pagesize', [item]))
  19398. };
  19399. }
  19400. return _objectSpread2({
  19401. value: '',
  19402. label: ''
  19403. }, item);
  19404. });
  19405. }
  19406. },
  19407. render: function render(h) {
  19408. var _this = this,
  19409. _ref;
  19410. var $scopedSlots = this.$scopedSlots,
  19411. $xegrid = this.$xegrid,
  19412. vSize = this.vSize,
  19413. align = this.align;
  19414. var childNodes = [];
  19415. if ($scopedSlots.left) {
  19416. childNodes.push(h('span', {
  19417. class: 'vxe-pager--left-wrapper'
  19418. }, [$scopedSlots.left.call(this, {
  19419. $grid: $xegrid
  19420. })]));
  19421. }
  19422. this.layouts.forEach(function (name) {
  19423. childNodes.push(_this["render".concat(name)](h));
  19424. });
  19425. if ($scopedSlots.right) {
  19426. childNodes.push(h('span', {
  19427. class: 'vxe-pager--right-wrapper'
  19428. }, [$scopedSlots.right.call(this, {
  19429. $grid: $xegrid
  19430. })]));
  19431. }
  19432. return h('div', {
  19433. 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)]
  19434. }, [h('div', {
  19435. class: 'vxe-pager--wrapper'
  19436. }, childNodes)]);
  19437. },
  19438. methods: {
  19439. // 上一页
  19440. renderPrevPage: function renderPrevPage(h) {
  19441. return h('span', {
  19442. class: ['vxe-pager--prev-btn', {
  19443. 'is--disabled': this.currentPage <= 1
  19444. }],
  19445. attrs: {
  19446. title: conf.i18n('vxe.pager.prevPage')
  19447. },
  19448. on: {
  19449. click: this.prevPage
  19450. }
  19451. }, [h('i', {
  19452. class: ['vxe-pager--btn-icon', this.iconPrevPage || conf.icon.PAGER_PREV_PAGE]
  19453. })]);
  19454. },
  19455. // 向上翻页
  19456. renderPrevJump: function renderPrevJump(h, tagName) {
  19457. return h(tagName || 'span', {
  19458. class: ['vxe-pager--jump-prev', {
  19459. 'is--fixed': !tagName,
  19460. 'is--disabled': this.currentPage <= 1
  19461. }],
  19462. attrs: {
  19463. title: conf.i18n('vxe.pager.prevJump')
  19464. },
  19465. on: {
  19466. click: this.prevJump
  19467. }
  19468. }, [tagName ? h('i', {
  19469. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  19470. }) : null, h('i', {
  19471. class: ['vxe-pager--jump-icon', this.iconJumpPrev || conf.icon.PAGER_JUMP_PREV]
  19472. })]);
  19473. },
  19474. // number
  19475. renderNumber: function renderNumber(h) {
  19476. return h('ul', {
  19477. class: 'vxe-pager--btn-wrapper'
  19478. }, this.renderPageBtn(h));
  19479. },
  19480. // jumpNumber
  19481. renderJumpNumber: function renderJumpNumber(h) {
  19482. return h('ul', {
  19483. class: 'vxe-pager--btn-wrapper'
  19484. }, this.renderPageBtn(h, true));
  19485. },
  19486. // 向下翻页
  19487. renderNextJump: function renderNextJump(h, tagName) {
  19488. return h(tagName || 'span', {
  19489. class: ['vxe-pager--jump-next', {
  19490. 'is--fixed': !tagName,
  19491. 'is--disabled': this.currentPage >= this.pageCount
  19492. }],
  19493. attrs: {
  19494. title: conf.i18n('vxe.pager.nextJump')
  19495. },
  19496. on: {
  19497. click: this.nextJump
  19498. }
  19499. }, [tagName ? h('i', {
  19500. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  19501. }) : null, h('i', {
  19502. class: ['vxe-pager--jump-icon', this.iconJumpNext || conf.icon.PAGER_JUMP_NEXT]
  19503. })]);
  19504. },
  19505. // 下一页
  19506. renderNextPage: function renderNextPage(h) {
  19507. return h('span', {
  19508. class: ['vxe-pager--next-btn', {
  19509. 'is--disabled': this.currentPage >= this.pageCount
  19510. }],
  19511. attrs: {
  19512. title: conf.i18n('vxe.pager.nextPage')
  19513. },
  19514. on: {
  19515. click: this.nextPage
  19516. }
  19517. }, [h('i', {
  19518. class: ['vxe-pager--btn-icon', this.iconNextPage || conf.icon.PAGER_NEXT_PAGE]
  19519. })]);
  19520. },
  19521. // sizes
  19522. renderSizes: function renderSizes(h) {
  19523. var _this2 = this;
  19524. return h('vxe-select', {
  19525. class: 'vxe-pager--sizes',
  19526. props: {
  19527. value: this.pageSize,
  19528. placement: 'top',
  19529. transfer: this.transfer,
  19530. options: this.sizeList
  19531. },
  19532. on: {
  19533. change: function change(_ref2) {
  19534. var value = _ref2.value;
  19535. _this2.pageSizeEvent(value);
  19536. }
  19537. }
  19538. });
  19539. },
  19540. // FullJump
  19541. renderFullJump: function renderFullJump(h) {
  19542. return this.renderJump(h, true);
  19543. },
  19544. // Jump
  19545. renderJump: function renderJump(h, isFull) {
  19546. return h('span', {
  19547. class: 'vxe-pager--jump'
  19548. }, [isFull ? h('span', {
  19549. class: 'vxe-pager--goto-text'
  19550. }, conf.i18n('vxe.pager.goto')) : null, h('input', {
  19551. class: 'vxe-pager--goto',
  19552. domProps: {
  19553. value: this.currentPage
  19554. },
  19555. attrs: {
  19556. type: 'text',
  19557. autocomplete: 'off'
  19558. },
  19559. on: {
  19560. keydown: this.jumpKeydownEvent,
  19561. blur: this.triggerJumpEvent
  19562. }
  19563. }), isFull ? h('span', {
  19564. class: 'vxe-pager--classifier-text'
  19565. }, conf.i18n('vxe.pager.pageClassifier')) : null]);
  19566. },
  19567. // PageCount
  19568. renderPageCount: function renderPageCount(h) {
  19569. return h('span', {
  19570. class: 'vxe-pager--count'
  19571. }, [h('span', {
  19572. class: 'vxe-pager--separator'
  19573. }), h('span', this.pageCount)]);
  19574. },
  19575. // total
  19576. renderTotal: function renderTotal(h) {
  19577. return h('span', {
  19578. class: 'vxe-pager--total'
  19579. }, conf.i18n('vxe.pager.total', [this.total]));
  19580. },
  19581. // number
  19582. renderPageBtn: function renderPageBtn(h, showJump) {
  19583. var _this3 = this;
  19584. var numList = this.numList,
  19585. currentPage = this.currentPage,
  19586. pageCount = this.pageCount,
  19587. pagerCount = this.pagerCount,
  19588. offsetNumber = this.offsetNumber;
  19589. var nums = [];
  19590. var isOv = pageCount > pagerCount;
  19591. var isLt = isOv && currentPage > offsetNumber + 1;
  19592. var isGt = isOv && currentPage < pageCount - offsetNumber;
  19593. var startNumber = 1;
  19594. if (isOv) {
  19595. if (currentPage >= pageCount - offsetNumber) {
  19596. startNumber = Math.max(pageCount - numList.length + 1, 1);
  19597. } else {
  19598. startNumber = Math.max(currentPage - offsetNumber, 1);
  19599. }
  19600. }
  19601. if (showJump && isLt) {
  19602. nums.push(h('li', {
  19603. class: 'vxe-pager--num-btn',
  19604. on: {
  19605. click: function click() {
  19606. return _this3.jumpPage(1);
  19607. }
  19608. }
  19609. }, 1), this.renderPrevJump(h, 'li'));
  19610. }
  19611. numList.forEach(function (item, index) {
  19612. var number = startNumber + index;
  19613. if (number <= pageCount) {
  19614. nums.push(h('li', {
  19615. class: ['vxe-pager--num-btn', {
  19616. 'is--active': currentPage === number
  19617. }],
  19618. on: {
  19619. click: function click() {
  19620. return _this3.jumpPage(number);
  19621. }
  19622. },
  19623. key: number
  19624. }, number));
  19625. }
  19626. });
  19627. if (showJump && isGt) {
  19628. nums.push(this.renderNextJump(h, 'li'), h('li', {
  19629. class: 'vxe-pager--num-btn',
  19630. on: {
  19631. click: function click() {
  19632. return _this3.jumpPage(pageCount);
  19633. }
  19634. }
  19635. }, pageCount));
  19636. }
  19637. return nums;
  19638. },
  19639. getPageCount: function getPageCount(total, size) {
  19640. return Math.max(Math.ceil(total / size), 1);
  19641. },
  19642. prevPage: function prevPage() {
  19643. var currentPage = this.currentPage,
  19644. pageCount = this.pageCount;
  19645. if (currentPage > 1) {
  19646. this.jumpPage(Math.min(pageCount, Math.max(currentPage - 1, 1)));
  19647. }
  19648. },
  19649. nextPage: function nextPage() {
  19650. var currentPage = this.currentPage,
  19651. pageCount = this.pageCount;
  19652. if (currentPage < pageCount) {
  19653. this.jumpPage(Math.min(pageCount, currentPage + 1));
  19654. }
  19655. },
  19656. prevJump: function prevJump() {
  19657. this.jumpPage(Math.max(this.currentPage - this.numList.length, 1));
  19658. },
  19659. nextJump: function nextJump() {
  19660. this.jumpPage(Math.min(this.currentPage + this.numList.length, this.pageCount));
  19661. },
  19662. jumpPage: function jumpPage(currentPage) {
  19663. if (currentPage !== this.currentPage) {
  19664. this.$emit('update:currentPage', currentPage);
  19665. if (this.$listeners['current-change']) {
  19666. UtilTools.warn('vxe.error.delEvent', ['current-change', 'page-change']);
  19667. this.$emit('current-change', currentPage);
  19668. }
  19669. this.$emit('page-change', {
  19670. type: 'current',
  19671. pageSize: this.pageSize,
  19672. currentPage: currentPage,
  19673. $event: {
  19674. type: 'current'
  19675. }
  19676. });
  19677. }
  19678. },
  19679. pageSizeEvent: function pageSizeEvent(pageSize) {
  19680. this.changePageSize(pageSize);
  19681. },
  19682. changePageSize: function changePageSize(pageSize) {
  19683. if (pageSize !== this.pageSize) {
  19684. this.$emit('update:pageSize', pageSize);
  19685. if (this.$listeners['size-change']) {
  19686. UtilTools.warn('vxe.error.delEvent', ['size-change', 'page-change']);
  19687. this.$emit('size-change', pageSize);
  19688. }
  19689. this.$emit('page-change', {
  19690. type: 'size',
  19691. pageSize: pageSize,
  19692. currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize)),
  19693. $event: {
  19694. type: 'size'
  19695. }
  19696. });
  19697. }
  19698. },
  19699. jumpKeydownEvent: function jumpKeydownEvent(evnt) {
  19700. if (evnt.keyCode === 13) {
  19701. this.triggerJumpEvent(evnt);
  19702. } else if (evnt.keyCode === 38) {
  19703. evnt.preventDefault();
  19704. this.nextPage();
  19705. } else if (evnt.keyCode === 40) {
  19706. evnt.preventDefault();
  19707. this.prevPage();
  19708. }
  19709. },
  19710. triggerJumpEvent: function triggerJumpEvent(evnt) {
  19711. var value = ctor_amd_xe_utils_default.a.toNumber(evnt.target.value);
  19712. var current = value <= 0 ? 1 : value >= this.pageCount ? this.pageCount : value;
  19713. evnt.target.value = current;
  19714. this.jumpPage(current);
  19715. }
  19716. }
  19717. });
  19718. // CONCATENATED MODULE: ./packages/pager/index.js
  19719. pager.install = function (Vue) {
  19720. Vue.component(pager.name, pager);
  19721. };
  19722. var Pager = pager;
  19723. /* harmony default export */ var packages_pager = (pager);
  19724. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.js
  19725. /* harmony default export */ var src_checkbox = ({
  19726. name: 'VxeCheckbox',
  19727. props: {
  19728. value: [String, Number, Boolean],
  19729. label: [String, Number],
  19730. indeterminate: Boolean,
  19731. title: [String, Number],
  19732. content: [String, Number],
  19733. checkedValue: {
  19734. type: [String, Number, Boolean],
  19735. default: true
  19736. },
  19737. uncheckedValue: {
  19738. type: [String, Number, Boolean],
  19739. default: false
  19740. },
  19741. disabled: Boolean,
  19742. size: {
  19743. type: String,
  19744. default: function _default() {
  19745. return conf.checkbox.size || conf.size;
  19746. }
  19747. }
  19748. },
  19749. inject: {
  19750. $xegroup: {
  19751. default: null
  19752. }
  19753. },
  19754. computed: {
  19755. vSize: function vSize() {
  19756. return this.size || this.$parent.size || this.$parent.vSize;
  19757. },
  19758. isGroup: function isGroup() {
  19759. return this.$xegroup;
  19760. },
  19761. isDisabled: function isDisabled() {
  19762. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19763. }
  19764. },
  19765. render: function render(h) {
  19766. var _ref,
  19767. _this = this;
  19768. var $slots = this.$slots,
  19769. $xegroup = this.$xegroup,
  19770. isGroup = this.isGroup,
  19771. isDisabled = this.isDisabled,
  19772. title = this.title,
  19773. vSize = this.vSize,
  19774. indeterminate = this.indeterminate,
  19775. value = this.value,
  19776. label = this.label,
  19777. content = this.content,
  19778. checkedValue = this.checkedValue,
  19779. uncheckedValue = this.uncheckedValue;
  19780. var attrs = {};
  19781. if (title) {
  19782. attrs.title = title;
  19783. }
  19784. return h('label', {
  19785. class: ['vxe-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  19786. attrs: attrs
  19787. }, [h('input', {
  19788. class: 'vxe-checkbox--input',
  19789. attrs: {
  19790. type: 'checkbox',
  19791. disabled: isDisabled
  19792. },
  19793. domProps: {
  19794. checked: isGroup ? $xegroup.value && $xegroup.value.some(function (item) {
  19795. return item === label;
  19796. }) : value === checkedValue
  19797. },
  19798. on: {
  19799. change: function change(evnt) {
  19800. if (!isDisabled) {
  19801. var checked = evnt.target.checked;
  19802. var _value = checked ? checkedValue : uncheckedValue;
  19803. var params = {
  19804. checked: checked,
  19805. value: _value,
  19806. label: label,
  19807. $event: evnt
  19808. };
  19809. if (isGroup) {
  19810. $xegroup.handleChecked(params, evnt);
  19811. } else {
  19812. _this.$emit('input', _value);
  19813. _this.$emit('change', params, evnt);
  19814. }
  19815. }
  19816. }
  19817. }
  19818. }), h('span', {
  19819. class: 'vxe-checkbox--icon'
  19820. }), h('span', {
  19821. class: 'vxe-checkbox--label'
  19822. }, $slots.default || [UtilTools.getFuncText(content)])]);
  19823. }
  19824. });
  19825. // CONCATENATED MODULE: ./packages/checkbox/src/group.js
  19826. /* harmony default export */ var checkbox_src_group = ({
  19827. name: 'VxeCheckboxGroup',
  19828. props: {
  19829. value: Array,
  19830. disabled: Boolean,
  19831. size: {
  19832. type: String,
  19833. default: function _default() {
  19834. return conf.checkbox.size || conf.size;
  19835. }
  19836. }
  19837. },
  19838. provide: function provide() {
  19839. return {
  19840. $xegroup: this
  19841. };
  19842. },
  19843. computed: {
  19844. vSize: function vSize() {
  19845. return this.size || this.$parent.size || this.$parent.vSize;
  19846. }
  19847. },
  19848. render: function render(h) {
  19849. return h('div', {
  19850. class: 'vxe-checkbox-group'
  19851. }, this.$slots.default);
  19852. },
  19853. methods: {
  19854. handleChecked: function handleChecked(params, evnt) {
  19855. var checked = params.checked,
  19856. label = params.label;
  19857. var checklist = this.value || [];
  19858. var checkIndex = checklist.indexOf(label);
  19859. if (checked) {
  19860. if (checkIndex === -1) {
  19861. checklist.push(label);
  19862. }
  19863. } else {
  19864. checklist.splice(checkIndex, 1);
  19865. }
  19866. this.$emit('input', checklist);
  19867. this.$emit('change', Object.assign({
  19868. checklist: checklist
  19869. }, params), evnt);
  19870. }
  19871. }
  19872. });
  19873. // CONCATENATED MODULE: ./packages/checkbox/index.js
  19874. src_checkbox.install = function (Vue) {
  19875. Vue.component(src_checkbox.name, src_checkbox);
  19876. Vue.component(checkbox_src_group.name, checkbox_src_group);
  19877. };
  19878. var Checkbox = src_checkbox;
  19879. /* harmony default export */ var packages_checkbox = (src_checkbox);
  19880. // CONCATENATED MODULE: ./packages/radio/src/radio.js
  19881. /* harmony default export */ var src_radio = ({
  19882. name: 'VxeRadio',
  19883. props: {
  19884. value: [String, Number],
  19885. label: [String, Number],
  19886. title: [String, Number],
  19887. content: [String, Number],
  19888. disabled: Boolean,
  19889. name: String,
  19890. size: {
  19891. type: String,
  19892. default: function _default() {
  19893. return conf.radio.size || conf.size;
  19894. }
  19895. }
  19896. },
  19897. inject: {
  19898. $xegroup: {
  19899. default: null
  19900. }
  19901. },
  19902. computed: {
  19903. vSize: function vSize() {
  19904. return this.size || this.$parent.size || this.$parent.vSize;
  19905. },
  19906. isGroup: function isGroup() {
  19907. return this.$xegroup;
  19908. },
  19909. isDisabled: function isDisabled() {
  19910. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19911. }
  19912. },
  19913. render: function render(h) {
  19914. var _ref,
  19915. _this = this;
  19916. var $slots = this.$slots,
  19917. $xegroup = this.$xegroup,
  19918. isGroup = this.isGroup,
  19919. isDisabled = this.isDisabled,
  19920. title = this.title,
  19921. vSize = this.vSize,
  19922. value = this.value,
  19923. label = this.label,
  19924. name = this.name,
  19925. content = this.content;
  19926. var attrs = {};
  19927. if (title) {
  19928. attrs.title = title;
  19929. }
  19930. return h('label', {
  19931. class: ['vxe-radio', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  19932. attrs: attrs
  19933. }, [h('input', {
  19934. class: 'vxe-radio--input',
  19935. attrs: {
  19936. type: 'radio',
  19937. name: isGroup ? $xegroup.name : name,
  19938. disabled: isDisabled
  19939. },
  19940. domProps: {
  19941. checked: isGroup ? $xegroup.value === label : value === label
  19942. },
  19943. on: {
  19944. change: function change(evnt) {
  19945. if (!isDisabled) {
  19946. var params = {
  19947. label: label,
  19948. $event: evnt
  19949. };
  19950. if (isGroup) {
  19951. $xegroup.handleChecked(params, evnt);
  19952. } else {
  19953. _this.$emit('input', label);
  19954. _this.$emit('change', params, evnt);
  19955. }
  19956. }
  19957. }
  19958. }
  19959. }), h('span', {
  19960. class: 'vxe-radio--icon'
  19961. }), h('span', {
  19962. class: 'vxe-radio--label'
  19963. }, $slots.default || [UtilTools.getFuncText(content)])]);
  19964. }
  19965. });
  19966. // CONCATENATED MODULE: ./packages/radio/src/button.js
  19967. /* harmony default export */ var src_button = ({
  19968. name: 'VxeRadioButton',
  19969. props: {
  19970. label: [String, Number],
  19971. title: [String, Number],
  19972. content: [String, Number],
  19973. disabled: Boolean,
  19974. size: {
  19975. type: String,
  19976. default: function _default() {
  19977. return conf.radio.size || conf.size;
  19978. }
  19979. }
  19980. },
  19981. inject: {
  19982. $xegroup: {
  19983. default: null
  19984. }
  19985. },
  19986. computed: {
  19987. vSize: function vSize() {
  19988. return this.size || this.$parent.size || this.$parent.vSize;
  19989. },
  19990. isGroup: function isGroup() {
  19991. return this.$xegroup;
  19992. },
  19993. isDisabled: function isDisabled() {
  19994. return this.disabled || this.isGroup && this.$xegroup.disabled;
  19995. }
  19996. },
  19997. render: function render(h) {
  19998. var _ref;
  19999. var $slots = this.$slots,
  20000. $xegroup = this.$xegroup,
  20001. isGroup = this.isGroup,
  20002. isDisabled = this.isDisabled,
  20003. title = this.title,
  20004. vSize = this.vSize,
  20005. label = this.label,
  20006. content = this.content;
  20007. var attrs = {};
  20008. if (title) {
  20009. attrs.title = title;
  20010. }
  20011. return h('label', {
  20012. class: ['vxe-radio', 'vxe-radio-button', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  20013. attrs: attrs
  20014. }, [h('input', {
  20015. class: 'vxe-radio--input',
  20016. attrs: {
  20017. type: 'radio',
  20018. name: isGroup ? $xegroup.name : null,
  20019. disabled: isDisabled
  20020. },
  20021. domProps: {
  20022. checked: isGroup && $xegroup.value === label
  20023. },
  20024. on: {
  20025. change: function change(evnt) {
  20026. if (!isDisabled) {
  20027. if (isGroup) {
  20028. $xegroup.handleChecked({
  20029. label: label,
  20030. $event: evnt
  20031. });
  20032. }
  20033. }
  20034. }
  20035. }
  20036. }), h('span', {
  20037. class: 'vxe-radio--label'
  20038. }, $slots.default || [UtilTools.getFuncText(content)])]);
  20039. }
  20040. });
  20041. // CONCATENATED MODULE: ./packages/radio/src/group.js
  20042. /* harmony default export */ var radio_src_group = ({
  20043. name: 'VxeRadioGroup',
  20044. props: {
  20045. value: [String, Number],
  20046. disabled: Boolean,
  20047. size: {
  20048. type: String,
  20049. default: function _default() {
  20050. return conf.radio.size || conf.size;
  20051. }
  20052. }
  20053. },
  20054. provide: function provide() {
  20055. return {
  20056. $xegroup: this
  20057. };
  20058. },
  20059. computed: {
  20060. vSize: function vSize() {
  20061. return this.size || this.$parent.size || this.$parent.vSize;
  20062. }
  20063. },
  20064. data: function data() {
  20065. return {
  20066. name: ctor_amd_xe_utils_default.a.uniqueId('xegroup_')
  20067. };
  20068. },
  20069. render: function render(h) {
  20070. return h('div', {
  20071. class: 'vxe-radio-group'
  20072. }, this.$slots.default);
  20073. },
  20074. methods: {
  20075. handleChecked: function handleChecked(params, evnt) {
  20076. this.$emit('input', params.label);
  20077. this.$emit('change', params, evnt);
  20078. }
  20079. }
  20080. });
  20081. // CONCATENATED MODULE: ./packages/radio/index.js
  20082. src_radio.install = function (Vue) {
  20083. Vue.component(src_radio.name, src_radio);
  20084. Vue.component(src_button.name, src_button);
  20085. Vue.component(radio_src_group.name, radio_src_group);
  20086. };
  20087. var Radio = src_radio;
  20088. /* harmony default export */ var packages_radio = (src_radio);
  20089. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
  20090. var es_string_pad_start = __webpack_require__("4d90");
  20091. // CONCATENATED MODULE: ./packages/input/src/input.js
  20092. var input_browse = DomTools.browse;
  20093. var input_wheelName = input_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  20094. var yearSize = 20;
  20095. var monthSize = 20;
  20096. function toStringTime(str) {
  20097. if (str) {
  20098. var rest = new Date();
  20099. var h, m, s;
  20100. if (ctor_amd_xe_utils_default.a.isDate(str)) {
  20101. h = str.getHours();
  20102. m = str.getMinutes();
  20103. s = str.getSeconds();
  20104. } else {
  20105. str = ctor_amd_xe_utils_default.a.toString(str);
  20106. var parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/);
  20107. if (parses) {
  20108. h = parses[1];
  20109. m = parses[3];
  20110. s = parses[5];
  20111. }
  20112. }
  20113. rest.setHours(h || 0);
  20114. rest.setMinutes(m || 0);
  20115. rest.setSeconds(s || 0);
  20116. return rest;
  20117. }
  20118. return new Date('');
  20119. }
  20120. function toFloatValueFixed(inputValue, digitsValue) {
  20121. if (/^-/.test('' + inputValue)) {
  20122. return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.ceil(inputValue, digitsValue), digitsValue);
  20123. }
  20124. return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(inputValue, digitsValue), digitsValue);
  20125. }
  20126. function renderDefaultInput(h, _vm) {
  20127. var inpAttrs = _vm.inpAttrs,
  20128. inpEvents = _vm.inpEvents,
  20129. value = _vm.value;
  20130. return h('input', {
  20131. ref: 'input',
  20132. class: 'vxe-input--inner',
  20133. domProps: {
  20134. value: value
  20135. },
  20136. attrs: inpAttrs,
  20137. on: inpEvents
  20138. });
  20139. }
  20140. function renderDateInput(h, _vm) {
  20141. var inpAttrs = _vm.inpAttrs,
  20142. inpEvents = _vm.inpEvents,
  20143. inputValue = _vm.inputValue;
  20144. return h('input', {
  20145. ref: 'input',
  20146. class: 'vxe-input--inner',
  20147. domProps: {
  20148. value: inputValue
  20149. },
  20150. attrs: inpAttrs,
  20151. on: inpEvents
  20152. });
  20153. }
  20154. function renderDateLabel(h, _vm, item, label) {
  20155. var festivalMethod = _vm.festivalMethod;
  20156. if (festivalMethod) {
  20157. var festivalRest = festivalMethod(_objectSpread2({
  20158. $input: _vm,
  20159. type: _vm.datePanelType,
  20160. viewType: _vm.datePanelType
  20161. }, item));
  20162. var festivalItem = festivalRest ? ctor_amd_xe_utils_default.a.isString(festivalRest) ? {
  20163. label: festivalRest
  20164. } : festivalRest : {};
  20165. var extraItem = festivalItem.extra ? ctor_amd_xe_utils_default.a.isString(festivalItem.extra) ? {
  20166. label: festivalItem.extra
  20167. } : festivalItem.extra : null;
  20168. var labels = [h('span', {
  20169. class: ['vxe-input--date-label', {
  20170. 'is-notice': festivalItem.notice
  20171. }]
  20172. }, extraItem && extraItem.label ? [h('span', label), h('span', {
  20173. class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
  20174. style: extraItem.style
  20175. }, ctor_amd_xe_utils_default.a.toString(extraItem.label))] : label)];
  20176. var festivalLabel = festivalItem.label;
  20177. if (festivalLabel) {
  20178. // 默认最多支持3个节日重叠
  20179. var festivalLabels = ctor_amd_xe_utils_default.a.toString(festivalLabel).split(',');
  20180. labels.push(h('span', {
  20181. class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
  20182. style: festivalItem.style
  20183. }, [festivalLabels.length > 1 ? h('span', {
  20184. class: ['vxe-input--date-festival--overlap', "overlap--".concat(festivalLabels.length)]
  20185. }, festivalLabels.map(function (label) {
  20186. return h('span', label.substring(0, 3));
  20187. })) : h('span', {
  20188. class: 'vxe-input--date-festival--label'
  20189. }, festivalLabels[0].substring(0, 3))]));
  20190. }
  20191. return labels;
  20192. }
  20193. return label;
  20194. }
  20195. function isDateDisabled(_vm, item) {
  20196. var disabledMethod = _vm.disabledMethod || _vm.dateOpts.disabledMethod;
  20197. return disabledMethod && disabledMethod({
  20198. $input: _vm,
  20199. type: _vm.datePanelType,
  20200. viewType: _vm.datePanelType,
  20201. date: item.date
  20202. });
  20203. }
  20204. function renderDateDayTable(h, _vm) {
  20205. var datePanelType = _vm.datePanelType,
  20206. dateValue = _vm.dateValue,
  20207. datePanelValue = _vm.datePanelValue,
  20208. dateHeaders = _vm.dateHeaders,
  20209. dayDatas = _vm.dayDatas;
  20210. var matchFormat = 'yyyy-MM-dd';
  20211. return [h('table', {
  20212. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20213. attrs: {
  20214. cellspacing: 0,
  20215. cellpadding: 0,
  20216. border: 0
  20217. }
  20218. }, [h('thead', [h('tr', dateHeaders.map(function (item) {
  20219. return h('th', item.label);
  20220. }))]), h('tbody', dayDatas.map(function (rows) {
  20221. return h('tr', rows.map(function (item) {
  20222. return h('td', {
  20223. class: {
  20224. 'is--prev': item.isPrev,
  20225. 'is--current': item.isCurrent,
  20226. 'is--now': item.isNow,
  20227. 'is--next': item.isNext,
  20228. 'is--disabled': isDateDisabled(_vm, item),
  20229. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20230. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20231. },
  20232. on: {
  20233. click: function click() {
  20234. return _vm.dateSelectEvent(item);
  20235. },
  20236. mouseenter: function mouseenter() {
  20237. return _vm.dateMouseenterEvent(item);
  20238. }
  20239. }
  20240. }, renderDateLabel(h, _vm, item, item.label));
  20241. }));
  20242. }))])];
  20243. }
  20244. function renderDateWeekTable(h, _vm) {
  20245. var datePanelType = _vm.datePanelType,
  20246. dateValue = _vm.dateValue,
  20247. datePanelValue = _vm.datePanelValue,
  20248. weekHeaders = _vm.weekHeaders,
  20249. weekDates = _vm.weekDates;
  20250. var matchFormat = 'yyyy-MM-dd';
  20251. return [h('table', {
  20252. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20253. attrs: {
  20254. cellspacing: 0,
  20255. cellpadding: 0,
  20256. border: 0
  20257. }
  20258. }, [h('thead', [h('tr', weekHeaders.map(function (item) {
  20259. return h('th', item.label);
  20260. }))]), h('tbody', weekDates.map(function (rows) {
  20261. var isSelected = rows.some(function (item) {
  20262. return ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
  20263. });
  20264. var isHover = rows.some(function (item) {
  20265. return ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat);
  20266. });
  20267. return h('tr', rows.map(function (item) {
  20268. return h('td', {
  20269. class: {
  20270. 'is--prev': item.isPrev,
  20271. 'is--current': item.isCurrent,
  20272. 'is--now': item.isNow,
  20273. 'is--next': item.isNext,
  20274. 'is--disabled': isDateDisabled(_vm, item),
  20275. 'is--selected': isSelected,
  20276. 'is--hover': isHover
  20277. },
  20278. on: {
  20279. click: function click() {
  20280. return _vm.dateSelectEvent(item);
  20281. },
  20282. mouseenter: function mouseenter() {
  20283. return _vm.dateMouseenterEvent(item);
  20284. }
  20285. }
  20286. }, renderDateLabel(h, _vm, item, item.label));
  20287. }));
  20288. }))])];
  20289. }
  20290. function renderDateMonthTable(h, _vm) {
  20291. var dateValue = _vm.dateValue,
  20292. datePanelType = _vm.datePanelType,
  20293. monthDatas = _vm.monthDatas,
  20294. datePanelValue = _vm.datePanelValue;
  20295. var matchFormat = 'yyyy-MM';
  20296. return [h('table', {
  20297. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20298. attrs: {
  20299. cellspacing: 0,
  20300. cellpadding: 0,
  20301. border: 0
  20302. }
  20303. }, [h('tbody', monthDatas.map(function (rows) {
  20304. return h('tr', rows.map(function (item) {
  20305. return h('td', {
  20306. class: {
  20307. 'is--prev': item.isPrev,
  20308. 'is--current': item.isCurrent,
  20309. 'is--now': item.isNow,
  20310. 'is--next': item.isNext,
  20311. 'is--disabled': isDateDisabled(_vm, item),
  20312. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20313. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20314. },
  20315. on: {
  20316. click: function click() {
  20317. return _vm.dateSelectEvent(item);
  20318. },
  20319. mouseenter: function mouseenter() {
  20320. return _vm.dateMouseenterEvent(item);
  20321. }
  20322. }
  20323. }, renderDateLabel(h, _vm, item, conf.i18n("vxe.input.date.months.m".concat(item.month))));
  20324. }));
  20325. }))])];
  20326. }
  20327. function renderDateYearTable(h, _vm) {
  20328. var dateValue = _vm.dateValue,
  20329. datePanelType = _vm.datePanelType,
  20330. yearDatas = _vm.yearDatas,
  20331. datePanelValue = _vm.datePanelValue;
  20332. var matchFormat = 'yyyy';
  20333. return [h('table', {
  20334. class: "vxe-input--date-".concat(datePanelType, "-view"),
  20335. attrs: {
  20336. cellspacing: 0,
  20337. cellpadding: 0,
  20338. border: 0
  20339. }
  20340. }, [h('tbody', yearDatas.map(function (rows) {
  20341. return h('tr', rows.map(function (item) {
  20342. return h('td', {
  20343. class: {
  20344. 'is--disabled': isDateDisabled(_vm, item),
  20345. 'is--current': item.isCurrent,
  20346. 'is--now': item.isNow,
  20347. 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  20348. 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  20349. },
  20350. on: {
  20351. click: function click() {
  20352. return _vm.dateSelectEvent(item);
  20353. },
  20354. mouseenter: function mouseenter() {
  20355. return _vm.dateMouseenterEvent(item);
  20356. }
  20357. }
  20358. }, renderDateLabel(h, _vm, item, item.year));
  20359. }));
  20360. }))])];
  20361. }
  20362. function renderDateTable(h, _vm) {
  20363. var datePanelType = _vm.datePanelType;
  20364. switch (datePanelType) {
  20365. case 'week':
  20366. return renderDateWeekTable(h, _vm);
  20367. case 'month':
  20368. return renderDateMonthTable(h, _vm);
  20369. case 'year':
  20370. return renderDateYearTable(h, _vm);
  20371. }
  20372. return renderDateDayTable(h, _vm);
  20373. }
  20374. function renderDatePanel(h, _vm) {
  20375. var datePanelType = _vm.datePanelType,
  20376. selectDatePanelLabel = _vm.selectDatePanelLabel,
  20377. isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
  20378. isDisabledNextDateBtn = _vm.isDisabledNextDateBtn;
  20379. return [h('div', {
  20380. class: 'vxe-input--date-picker-header'
  20381. }, [h('div', {
  20382. class: 'vxe-input--date-picker-type-wrapper'
  20383. }, [datePanelType === 'year' ? h('span', {
  20384. class: 'vxe-input--date-picker-label'
  20385. }, selectDatePanelLabel) : h('span', {
  20386. class: 'vxe-input--date-picker-btn',
  20387. on: {
  20388. click: _vm.dateToggleTypeEvent
  20389. }
  20390. }, selectDatePanelLabel)]), h('div', {
  20391. class: 'vxe-input--date-picker-btn-wrapper'
  20392. }, [h('span', {
  20393. class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
  20394. 'is--disabled': isDisabledPrevDateBtn
  20395. }],
  20396. on: {
  20397. click: _vm.datePrevEvent
  20398. }
  20399. }, [h('i', {
  20400. class: 'vxe-icon--caret-left'
  20401. })]), h('span', {
  20402. class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
  20403. on: {
  20404. click: _vm.dateTodayMonthEvent
  20405. }
  20406. }, [h('i', {
  20407. class: 'vxe-icon--dot'
  20408. })]), h('span', {
  20409. class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
  20410. 'is--disabled': isDisabledNextDateBtn
  20411. }],
  20412. on: {
  20413. click: _vm.dateNextEvent
  20414. }
  20415. }, [h('i', {
  20416. class: 'vxe-icon--caret-right'
  20417. })])])]), h('div', {
  20418. class: 'vxe-input--date-picker-body'
  20419. }, renderDateTable(h, _vm))];
  20420. }
  20421. function renderTimePanel(h, _vm) {
  20422. var dateTimeLabel = _vm.dateTimeLabel,
  20423. datetimePanelValue = _vm.datetimePanelValue,
  20424. hourList = _vm.hourList,
  20425. minuteList = _vm.minuteList,
  20426. secondList = _vm.secondList;
  20427. return [h('div', {
  20428. class: 'vxe-input--time-picker-header'
  20429. }, [h('span', {
  20430. class: 'vxe-input--time-picker-title'
  20431. }, dateTimeLabel), h('button', {
  20432. class: 'vxe-input--time-picker-confirm',
  20433. attrs: {
  20434. type: 'button'
  20435. },
  20436. on: {
  20437. click: _vm.dateConfirmEvent
  20438. }
  20439. }, conf.i18n('vxe.button.confirm'))]), h('div', {
  20440. ref: 'timeBody',
  20441. class: 'vxe-input--time-picker-body'
  20442. }, [h('ul', {
  20443. class: 'vxe-input--time-picker-hour-list'
  20444. }, hourList.map(function (item, index) {
  20445. return h('li', {
  20446. key: index,
  20447. class: {
  20448. 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
  20449. },
  20450. on: {
  20451. click: function click(evnt) {
  20452. return _vm.dateHourEvent(evnt, item);
  20453. }
  20454. }
  20455. }, item.label);
  20456. })), h('ul', {
  20457. class: 'vxe-input--time-picker-minute-list'
  20458. }, minuteList.map(function (item, index) {
  20459. return h('li', {
  20460. key: index,
  20461. class: {
  20462. 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
  20463. },
  20464. on: {
  20465. click: function click(evnt) {
  20466. return _vm.dateMinuteEvent(evnt, item);
  20467. }
  20468. }
  20469. }, item.label);
  20470. })), h('ul', {
  20471. class: 'vxe-input--time-picker-second-list'
  20472. }, secondList.map(function (item, index) {
  20473. return h('li', {
  20474. key: index,
  20475. class: {
  20476. 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
  20477. },
  20478. on: {
  20479. click: function click(evnt) {
  20480. return _vm.dateSecondEvent(evnt, item);
  20481. }
  20482. }
  20483. }, item.label);
  20484. }))])];
  20485. }
  20486. function renderPanel(h, _vm) {
  20487. var type = _vm.type,
  20488. vSize = _vm.vSize,
  20489. isDatePicker = _vm.isDatePicker,
  20490. transfer = _vm.transfer,
  20491. animatVisible = _vm.animatVisible,
  20492. visiblePanel = _vm.visiblePanel,
  20493. panelPlacement = _vm.panelPlacement,
  20494. panelStyle = _vm.panelStyle;
  20495. var renders = [];
  20496. if (isDatePicker) {
  20497. var _ref;
  20498. if (type === 'datetime') {
  20499. renders.push(h('div', {
  20500. class: 'vxe-input--panel-layout-wrapper'
  20501. }, [h('div', {
  20502. class: 'vxe-input--panel-left-wrapper'
  20503. }, renderDatePanel(h, _vm)), h('div', {
  20504. class: 'vxe-input--panel-right-wrapper'
  20505. }, renderTimePanel(h, _vm))]));
  20506. } else if (type === 'time') {
  20507. renders.push(h('div', {
  20508. class: 'vxe-input--panel-wrapper'
  20509. }, renderTimePanel(h, _vm)));
  20510. } else {
  20511. renders.push(h('div', {
  20512. class: 'vxe-input--panel-wrapper'
  20513. }, renderDatePanel(h, _vm)));
  20514. }
  20515. return h('div', {
  20516. ref: 'panel',
  20517. 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)],
  20518. attrs: {
  20519. 'data-placement': panelPlacement
  20520. },
  20521. style: panelStyle
  20522. }, renders);
  20523. }
  20524. return null;
  20525. }
  20526. function renderNumberIcon(h, _vm) {
  20527. return h('span', {
  20528. class: 'vxe-input--number-suffix'
  20529. }, [h('span', {
  20530. class: 'vxe-input--number-prev is--prev',
  20531. on: {
  20532. mousedown: _vm.numberMousedownEvent,
  20533. mouseup: _vm.numberStopDown,
  20534. mouseleave: _vm.numberStopDown
  20535. }
  20536. }, [h('i', {
  20537. class: ['vxe-input--number-prev-icon', conf.icon.INPUT_PREV_NUM]
  20538. })]), h('span', {
  20539. class: 'vxe-input--number-next is--next',
  20540. on: {
  20541. mousedown: _vm.numberMousedownEvent,
  20542. mouseup: _vm.numberStopDown,
  20543. mouseleave: _vm.numberStopDown
  20544. }
  20545. }, [h('i', {
  20546. class: ['vxe-input--number-next-icon', conf.icon.INPUT_NEXT_NUM]
  20547. })])]);
  20548. }
  20549. function renderDatePickerIcon(h, _vm) {
  20550. return h('span', {
  20551. class: 'vxe-input--date-picker-suffix',
  20552. on: {
  20553. click: _vm.datePickerOpenEvent
  20554. }
  20555. }, [h('i', {
  20556. class: ['vxe-input--date-picker-icon', conf.icon.INPUT_DATE]
  20557. })]);
  20558. }
  20559. function renderSearchIcon(h, _vm) {
  20560. return h('span', {
  20561. class: 'vxe-input--search-suffix',
  20562. on: {
  20563. click: _vm.searchEvent
  20564. }
  20565. }, [h('i', {
  20566. class: ['vxe-input--search-icon', conf.icon.INPUT_SEARCH]
  20567. })]);
  20568. }
  20569. function renderPasswordIcon(h, _vm) {
  20570. var showPwd = _vm.showPwd;
  20571. return h('span', {
  20572. class: 'vxe-input--password-suffix',
  20573. on: {
  20574. click: _vm.passwordToggleEvent
  20575. }
  20576. }, [h('i', {
  20577. class: ['vxe-input--password-icon', showPwd ? conf.icon.INPUT_SHOW_PWD : conf.icon.INPUT_PWD]
  20578. })]);
  20579. }
  20580. function rendePrefixIcon(h, _vm) {
  20581. var $scopedSlots = _vm.$scopedSlots,
  20582. prefixIcon = _vm.prefixIcon;
  20583. var icons = [];
  20584. if ($scopedSlots.prefix) {
  20585. icons.push(h('span', {
  20586. class: 'vxe-input--prefix-icon'
  20587. }, $scopedSlots.prefix.call(this, {}, h)));
  20588. } else if (prefixIcon) {
  20589. icons.push(h('i', {
  20590. class: ['vxe-input--prefix-icon', prefixIcon]
  20591. }));
  20592. }
  20593. return icons.length ? h('span', {
  20594. class: 'vxe-input--prefix',
  20595. on: {
  20596. click: _vm.clickPrefixEvent
  20597. }
  20598. }, icons) : null;
  20599. }
  20600. function renderSuffixIcon(h, _vm) {
  20601. var $scopedSlots = _vm.$scopedSlots,
  20602. value = _vm.value,
  20603. isClearable = _vm.isClearable,
  20604. disabled = _vm.disabled,
  20605. suffixIcon = _vm.suffixIcon;
  20606. var icons = [];
  20607. if ($scopedSlots.suffix) {
  20608. icons.push(h('span', {
  20609. class: 'vxe-input--suffix-icon'
  20610. }, $scopedSlots.suffix.call(this, {}, h)));
  20611. } else if (suffixIcon) {
  20612. icons.push(h('i', {
  20613. class: ['vxe-input--suffix-icon', suffixIcon]
  20614. }));
  20615. }
  20616. if (isClearable) {
  20617. icons.push(h('i', {
  20618. class: ['vxe-input--clear-icon', conf.icon.INPUT_CLEAR]
  20619. }));
  20620. }
  20621. return icons.length ? h('span', {
  20622. class: ['vxe-input--suffix', {
  20623. 'is--clear': isClearable && !disabled && !(value === '' || ctor_amd_xe_utils_default.a.eqNull(value))
  20624. }],
  20625. on: {
  20626. click: _vm.clickSuffixEvent
  20627. }
  20628. }, icons) : null;
  20629. }
  20630. function renderExtraSuffixIcon(h, _vm) {
  20631. var controls = _vm.controls,
  20632. isPassword = _vm.isPassword,
  20633. isNumber = _vm.isNumber,
  20634. isDatePicker = _vm.isDatePicker,
  20635. isSearch = _vm.isSearch;
  20636. var icons;
  20637. if (isPassword) {
  20638. icons = renderPasswordIcon(h, _vm);
  20639. } else if (isNumber) {
  20640. if (controls) {
  20641. icons = renderNumberIcon(h, _vm);
  20642. }
  20643. } else if (isDatePicker) {
  20644. icons = renderDatePickerIcon(h, _vm);
  20645. } else if (isSearch) {
  20646. icons = renderSearchIcon(h, _vm);
  20647. }
  20648. return icons ? h('span', {
  20649. class: 'vxe-input--extra-suffix'
  20650. }, [icons]) : null;
  20651. }
  20652. /* harmony default export */ var input = ({
  20653. name: 'VxeInput',
  20654. props: {
  20655. value: [String, Number, Date],
  20656. name: String,
  20657. type: {
  20658. type: String,
  20659. default: 'text'
  20660. },
  20661. clearable: {
  20662. type: Boolean,
  20663. default: function _default() {
  20664. return conf.input.clearable;
  20665. }
  20666. },
  20667. readonly: Boolean,
  20668. disabled: Boolean,
  20669. placeholder: String,
  20670. maxlength: [String, Number],
  20671. autocomplete: {
  20672. type: String,
  20673. default: 'off'
  20674. },
  20675. align: String,
  20676. form: String,
  20677. size: {
  20678. type: String,
  20679. default: function _default() {
  20680. return conf.input.size || conf.size;
  20681. }
  20682. },
  20683. // number、integer、float
  20684. min: {
  20685. type: [String, Number],
  20686. default: null
  20687. },
  20688. max: {
  20689. type: [String, Number],
  20690. default: null
  20691. },
  20692. step: [String, Number],
  20693. // number、integer、float、password
  20694. controls: {
  20695. type: Boolean,
  20696. default: function _default() {
  20697. return conf.input.controls;
  20698. }
  20699. },
  20700. // float
  20701. digits: {
  20702. type: [String, Number],
  20703. default: function _default() {
  20704. return conf.input.digits;
  20705. }
  20706. },
  20707. // date、week、month、year
  20708. dateConfig: Object,
  20709. minDate: {
  20710. type: [String, Number, Date],
  20711. default: function _default() {
  20712. return conf.input.minDate;
  20713. }
  20714. },
  20715. maxDate: {
  20716. type: [String, Number, Date],
  20717. default: function _default() {
  20718. return conf.input.maxDate;
  20719. }
  20720. },
  20721. // 已废弃 startWeek,被 startDay 替换
  20722. startWeek: Number,
  20723. startDay: {
  20724. type: [String, Number],
  20725. default: function _default() {
  20726. return conf.input.startDay;
  20727. }
  20728. },
  20729. labelFormat: {
  20730. type: String,
  20731. default: function _default() {
  20732. return conf.input.labelFormat;
  20733. }
  20734. },
  20735. parseFormat: {
  20736. type: String,
  20737. default: function _default() {
  20738. return conf.input.parseFormat;
  20739. }
  20740. },
  20741. valueFormat: {
  20742. type: String,
  20743. default: function _default() {
  20744. return conf.input.valueFormat;
  20745. }
  20746. },
  20747. editable: {
  20748. type: Boolean,
  20749. default: true
  20750. },
  20751. festivalMethod: {
  20752. type: Function,
  20753. default: function _default() {
  20754. return conf.input.festivalMethod;
  20755. }
  20756. },
  20757. disabledMethod: {
  20758. type: Function,
  20759. default: function _default() {
  20760. return conf.input.disabledMethod;
  20761. }
  20762. },
  20763. prefixIcon: String,
  20764. suffixIcon: String,
  20765. placement: String,
  20766. transfer: {
  20767. type: Boolean,
  20768. default: function _default() {
  20769. return conf.input.transfer;
  20770. }
  20771. }
  20772. },
  20773. data: function data() {
  20774. return {
  20775. panelIndex: 0,
  20776. showPwd: false,
  20777. visiblePanel: false,
  20778. animatVisible: false,
  20779. panelStyle: null,
  20780. panelPlacement: null,
  20781. isActivated: false,
  20782. inputValue: '',
  20783. datetimePanelValue: null,
  20784. datePanelValue: null,
  20785. datePanelLabel: '',
  20786. datePanelType: 'day',
  20787. selectMonth: null,
  20788. currentDate: null
  20789. };
  20790. },
  20791. computed: {
  20792. vSize: function vSize() {
  20793. return this.size || this.$parent.size || this.$parent.vSize;
  20794. },
  20795. isNumber: function isNumber() {
  20796. return ['number', 'integer', 'float'].indexOf(this.type) > -1;
  20797. },
  20798. isDatePicker: function isDatePicker() {
  20799. return this.hasTime || ['date', 'week', 'month', 'year'].indexOf(this.type) > -1;
  20800. },
  20801. hasTime: function hasTime() {
  20802. var type = this.type;
  20803. return type === 'time' || type === 'datetime';
  20804. },
  20805. isPassword: function isPassword() {
  20806. return this.type === 'password';
  20807. },
  20808. isSearch: function isSearch() {
  20809. return this.type === 'search';
  20810. },
  20811. stepValue: function stepValue() {
  20812. var type = this.type,
  20813. step = this.step;
  20814. if (type === 'integer') {
  20815. return ctor_amd_xe_utils_default.a.toInteger(step) || 1;
  20816. } else if (type === 'float') {
  20817. return ctor_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
  20818. }
  20819. return ctor_amd_xe_utils_default.a.toNumber(step) || 1;
  20820. },
  20821. digitsValue: function digitsValue() {
  20822. return ctor_amd_xe_utils_default.a.toInteger(this.digits) || 1;
  20823. },
  20824. isClearable: function isClearable() {
  20825. return this.clearable && (this.isPassword || this.isNumber || this.isDatePicker || this.type === 'text' || this.type === 'search');
  20826. },
  20827. isDisabledPrevDateBtn: function isDisabledPrevDateBtn() {
  20828. var selectMonth = this.selectMonth,
  20829. dateMinTime = this.dateMinTime;
  20830. if (selectMonth) {
  20831. return selectMonth <= dateMinTime;
  20832. }
  20833. return false;
  20834. },
  20835. isDisabledNextDateBtn: function isDisabledNextDateBtn() {
  20836. var selectMonth = this.selectMonth,
  20837. dateMaxTime = this.dateMaxTime;
  20838. if (selectMonth) {
  20839. return selectMonth >= dateMaxTime;
  20840. }
  20841. return false;
  20842. },
  20843. dateMinTime: function dateMinTime() {
  20844. return this.minDate ? ctor_amd_xe_utils_default.a.toStringDate(this.minDate) : null;
  20845. },
  20846. dateMaxTime: function dateMaxTime() {
  20847. return this.maxDate ? ctor_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
  20848. },
  20849. dateValue: function dateValue() {
  20850. var value = this.value,
  20851. isDatePicker = this.isDatePicker,
  20852. type = this.type,
  20853. dateValueFormat = this.dateValueFormat;
  20854. var val = null;
  20855. if (value && isDatePicker) {
  20856. var date;
  20857. if (type === 'time') {
  20858. date = toStringTime(value);
  20859. } else {
  20860. date = ctor_amd_xe_utils_default.a.toStringDate(value, dateValueFormat);
  20861. }
  20862. if (ctor_amd_xe_utils_default.a.isValidDate(date)) {
  20863. val = date;
  20864. }
  20865. }
  20866. return val;
  20867. },
  20868. dateTimeLabel: function dateTimeLabel() {
  20869. var datetimePanelValue = this.datetimePanelValue;
  20870. if (datetimePanelValue) {
  20871. return ctor_amd_xe_utils_default.a.toDateString(datetimePanelValue, 'HH:mm:ss');
  20872. }
  20873. return '';
  20874. },
  20875. hmsTime: function hmsTime() {
  20876. var dateValue = this.dateValue;
  20877. return dateValue && this.hasTime ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
  20878. },
  20879. dateLabelFormat: function dateLabelFormat() {
  20880. if (this.isDatePicker) {
  20881. return this.labelFormat || this.dateOpts.labelFormat || conf.i18n("vxe.input.date.labelFormat.".concat(this.type));
  20882. }
  20883. return null;
  20884. },
  20885. dateValueFormat: function dateValueFormat() {
  20886. var type = this.type;
  20887. return type === 'time' ? 'HH:mm:ss' : this.valueFormat || this.dateOpts.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
  20888. },
  20889. selectDatePanelLabel: function selectDatePanelLabel() {
  20890. if (this.isDatePicker) {
  20891. var datePanelType = this.datePanelType,
  20892. selectMonth = this.selectMonth,
  20893. yearList = this.yearList;
  20894. var year = '';
  20895. var month;
  20896. if (selectMonth) {
  20897. year = selectMonth.getFullYear();
  20898. month = selectMonth.getMonth() + 1;
  20899. }
  20900. if (datePanelType === 'month') {
  20901. return conf.i18n('vxe.input.date.monthLabel', [year]);
  20902. } else if (datePanelType === 'year') {
  20903. return yearList.length ? "".concat(yearList[0].year, " - ").concat(yearList[yearList.length - 1].year) : '';
  20904. }
  20905. return conf.i18n('vxe.input.date.dayLabel', [year, month ? conf.i18n("vxe.input.date.m".concat(month)) : '-']);
  20906. }
  20907. return '';
  20908. },
  20909. weekDatas: function weekDatas() {
  20910. var weeks = [];
  20911. if (this.isDatePicker) {
  20912. var startDay = this.startDay,
  20913. startWeek = this.startWeek;
  20914. 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);
  20915. weeks.push(sWeek);
  20916. for (var index = 0; index < 6; index++) {
  20917. if (sWeek >= 6) {
  20918. sWeek = 0;
  20919. } else {
  20920. sWeek++;
  20921. }
  20922. weeks.push(sWeek);
  20923. }
  20924. }
  20925. return weeks;
  20926. },
  20927. dateHeaders: function dateHeaders() {
  20928. if (this.isDatePicker) {
  20929. return this.weekDatas.map(function (day) {
  20930. return {
  20931. value: day,
  20932. label: conf.i18n("vxe.input.date.weeks.w".concat(day))
  20933. };
  20934. });
  20935. }
  20936. return [];
  20937. },
  20938. weekHeaders: function weekHeaders() {
  20939. if (this.isDatePicker) {
  20940. return [{
  20941. label: conf.i18n('vxe.input.date.weeks.w')
  20942. }].concat(this.dateHeaders);
  20943. }
  20944. return [];
  20945. },
  20946. yearList: function yearList() {
  20947. var selectMonth = this.selectMonth,
  20948. currentDate = this.currentDate;
  20949. var months = [];
  20950. if (selectMonth && currentDate) {
  20951. var currFullYear = currentDate.getFullYear();
  20952. var startYear = new Date(('' + selectMonth.getFullYear()).replace(/\d{1}$/, '0'), 0, 1);
  20953. for (var index = -10; index < yearSize - 10; index++) {
  20954. var date = ctor_amd_xe_utils_default.a.getWhatYear(startYear, index, 'first');
  20955. var itemFullYear = date.getFullYear();
  20956. months.push({
  20957. date: date,
  20958. isCurrent: true,
  20959. isNow: currFullYear === itemFullYear,
  20960. year: itemFullYear
  20961. });
  20962. }
  20963. }
  20964. return months;
  20965. },
  20966. yearDatas: function yearDatas() {
  20967. return ctor_amd_xe_utils_default.a.chunk(this.yearList, 4);
  20968. },
  20969. monthList: function monthList() {
  20970. var selectMonth = this.selectMonth,
  20971. currentDate = this.currentDate;
  20972. var months = [];
  20973. if (selectMonth && currentDate) {
  20974. var currFullYear = currentDate.getFullYear();
  20975. var currMonth = currentDate.getMonth();
  20976. var selFullYear = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
  20977. for (var index = -4; index < monthSize - 4; index++) {
  20978. var date = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, index);
  20979. var itemFullYear = date.getFullYear();
  20980. var itemMonth = date.getMonth();
  20981. var isPrev = itemFullYear < selFullYear;
  20982. months.push({
  20983. date: date,
  20984. isPrev: isPrev,
  20985. isCurrent: itemFullYear === selFullYear,
  20986. isNow: itemFullYear === currFullYear && itemMonth === currMonth,
  20987. isNext: !isPrev && itemFullYear > selFullYear,
  20988. month: itemMonth
  20989. });
  20990. }
  20991. }
  20992. return months;
  20993. },
  20994. monthDatas: function monthDatas() {
  20995. return ctor_amd_xe_utils_default.a.chunk(this.monthList, 4);
  20996. },
  20997. dayList: function dayList() {
  20998. var weekDatas = this.weekDatas,
  20999. selectMonth = this.selectMonth,
  21000. currentDate = this.currentDate,
  21001. hmsTime = this.hmsTime;
  21002. var days = [];
  21003. if (selectMonth && currentDate) {
  21004. var currFullYear = currentDate.getFullYear();
  21005. var currMonth = currentDate.getMonth();
  21006. var currDate = currentDate.getDate();
  21007. var selFullYear = selectMonth.getFullYear();
  21008. var selMonth = selectMonth.getMonth();
  21009. var selDay = selectMonth.getDay();
  21010. var prevOffsetDate = -weekDatas.indexOf(selDay);
  21011. var startDate = new Date(ctor_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
  21012. for (var index = 0; index < 42; index++) {
  21013. var date = ctor_amd_xe_utils_default.a.getWhatDay(startDate, index);
  21014. var itemFullYear = date.getFullYear();
  21015. var itemMonth = date.getMonth();
  21016. var itemDate = date.getDate();
  21017. var isPrev = date < selectMonth;
  21018. days.push({
  21019. date: date,
  21020. isPrev: isPrev,
  21021. isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
  21022. isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
  21023. isNext: !isPrev && selMonth !== itemMonth,
  21024. label: itemDate
  21025. });
  21026. }
  21027. }
  21028. return days;
  21029. },
  21030. dayDatas: function dayDatas() {
  21031. return ctor_amd_xe_utils_default.a.chunk(this.dayList, 7);
  21032. },
  21033. weekDates: function weekDates() {
  21034. return this.dayDatas.map(function (list) {
  21035. var firstItem = list[0];
  21036. var item = {
  21037. date: firstItem.date,
  21038. isWeekNumber: true,
  21039. isPrev: false,
  21040. isCurrent: false,
  21041. isNow: false,
  21042. isNext: false,
  21043. label: ctor_amd_xe_utils_default.a.getYearWeek(firstItem.date)
  21044. };
  21045. return [item].concat(list);
  21046. });
  21047. },
  21048. dateOpts: function dateOpts() {
  21049. return Object.assign({}, this.dateConfig, conf.input.dateConfig);
  21050. },
  21051. hourList: function hourList() {
  21052. var list = [];
  21053. if (this.hasTime) {
  21054. for (var index = 0; index < 24; index++) {
  21055. list.push({
  21056. value: index,
  21057. label: ('' + index).padStart(2, 0)
  21058. });
  21059. }
  21060. }
  21061. return list;
  21062. },
  21063. minuteList: function minuteList() {
  21064. var list = [];
  21065. if (this.hasTime) {
  21066. for (var index = 0; index < 60; index++) {
  21067. list.push({
  21068. value: index,
  21069. label: ('' + index).padStart(2, 0)
  21070. });
  21071. }
  21072. }
  21073. return list;
  21074. },
  21075. secondList: function secondList() {
  21076. return this.minuteList;
  21077. },
  21078. inpAttrs: function inpAttrs() {
  21079. var isDatePicker = this.isDatePicker,
  21080. isNumber = this.isNumber,
  21081. isPassword = this.isPassword,
  21082. type = this.type,
  21083. name = this.name,
  21084. placeholder = this.placeholder,
  21085. readonly = this.readonly,
  21086. disabled = this.disabled,
  21087. maxlength = this.maxlength,
  21088. form = this.form,
  21089. autocomplete = this.autocomplete,
  21090. showPwd = this.showPwd,
  21091. editable = this.editable;
  21092. var inputType = type;
  21093. if (isDatePicker || isNumber || isPassword && showPwd || type === 'number') {
  21094. inputType = 'text';
  21095. }
  21096. var attrs = {
  21097. name: name,
  21098. form: form,
  21099. type: inputType,
  21100. placeholder: placeholder,
  21101. maxlength: isNumber && !ctor_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength,
  21102. // 数值最大长度限制 16 位,包含小数
  21103. readonly: readonly || type === 'week' || !editable || this.dateOpts.editable === false,
  21104. disabled: disabled,
  21105. autocomplete: autocomplete
  21106. };
  21107. if (placeholder) {
  21108. attrs.placeholder = UtilTools.getFuncText(placeholder);
  21109. }
  21110. return attrs;
  21111. },
  21112. inpEvents: function inpEvents() {
  21113. var _this = this;
  21114. var evnts = {};
  21115. ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  21116. if (['change', 'clear', 'prefix-click', 'suffix-click'].indexOf(name) === -1) {
  21117. evnts[name] = _this.triggerEvent;
  21118. }
  21119. });
  21120. if (this.isNumber) {
  21121. evnts.keydown = this.keydownEvent;
  21122. evnts[input_wheelName] = this.mousewheelEvent;
  21123. } else if (this.isDatePicker) {
  21124. evnts.click = this.clickEvent;
  21125. }
  21126. evnts.input = this.inputEvent;
  21127. evnts.focus = this.focusEvent;
  21128. evnts.blur = this.blurEvent;
  21129. return evnts;
  21130. }
  21131. },
  21132. watch: {
  21133. value: function value() {
  21134. this.changeValue();
  21135. },
  21136. dateLabelFormat: function dateLabelFormat() {
  21137. this.dateParseValue(this.datePanelValue);
  21138. this.inputValue = this.datePanelLabel;
  21139. }
  21140. },
  21141. created: function created() {
  21142. this.initValue();
  21143. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  21144. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  21145. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  21146. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  21147. },
  21148. mounted: function mounted() {
  21149. if (this.dateConfig) {
  21150. UtilTools.warn('vxe.error.removeProp', ['date-config']);
  21151. }
  21152. if (this.isDatePicker) {
  21153. if (this.transfer) {
  21154. document.body.appendChild(this.$refs.panel);
  21155. }
  21156. }
  21157. },
  21158. beforeDestroy: function beforeDestroy() {
  21159. var panelElem = this.$refs.panel;
  21160. if (panelElem && panelElem.parentNode) {
  21161. panelElem.parentNode.removeChild(panelElem);
  21162. }
  21163. },
  21164. destroyed: function destroyed() {
  21165. this.numberStopDown();
  21166. GlobalEvent.off(this, 'mousewheel');
  21167. GlobalEvent.off(this, 'mousedown');
  21168. GlobalEvent.off(this, 'keydown');
  21169. GlobalEvent.off(this, 'blur');
  21170. },
  21171. render: function render(h) {
  21172. var _ref2;
  21173. var controls = this.controls,
  21174. isDatePicker = this.isDatePicker,
  21175. visiblePanel = this.visiblePanel,
  21176. isActivated = this.isActivated,
  21177. vSize = this.vSize,
  21178. type = this.type,
  21179. align = this.align,
  21180. readonly = this.readonly,
  21181. disabled = this.disabled;
  21182. var childs = [];
  21183. var prefix = rendePrefixIcon(h, this);
  21184. var suffix = renderSuffixIcon(h, this); // 前缀图标
  21185. if (prefix) {
  21186. childs.push(prefix);
  21187. } // 输入框
  21188. childs.push(isDatePicker ? renderDateInput(h, this) : renderDefaultInput(h, this)); // 后缀图标
  21189. if (suffix) {
  21190. childs.push(suffix);
  21191. } // 特殊功能图标
  21192. childs.push(renderExtraSuffixIcon(h, this)); // 面板容器
  21193. if (isDatePicker) {
  21194. childs.push(renderPanel(h, this));
  21195. }
  21196. return h('div', {
  21197. 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)]
  21198. }, childs);
  21199. },
  21200. methods: {
  21201. focus: function focus() {
  21202. this.isActivated = true;
  21203. this.$refs.input.focus();
  21204. return this.$nextTick();
  21205. },
  21206. blur: function blur() {
  21207. this.$refs.input.blur();
  21208. this.isActivated = false;
  21209. return this.$nextTick();
  21210. },
  21211. triggerEvent: function triggerEvent(evnt) {
  21212. var $refs = this.$refs,
  21213. value = this.value;
  21214. this.$emit(evnt.type, {
  21215. $panel: $refs.panel,
  21216. value: value,
  21217. $event: evnt
  21218. }, evnt);
  21219. },
  21220. emitUpdate: function emitUpdate(value, evnt) {
  21221. this.$emit('input', value);
  21222. if (ctor_amd_xe_utils_default.a.toString(this.value) !== value) {
  21223. this.$emit('change', {
  21224. value: value,
  21225. $event: evnt
  21226. });
  21227. }
  21228. },
  21229. inputEvent: function inputEvent(evnt) {
  21230. var isDatePicker = this.isDatePicker;
  21231. var value = evnt.target.value;
  21232. this.inputValue = value;
  21233. if (!isDatePicker) {
  21234. this.emitUpdate(value, evnt);
  21235. }
  21236. },
  21237. focusEvent: function focusEvent(evnt) {
  21238. this.isActivated = true;
  21239. this.triggerEvent(evnt);
  21240. },
  21241. blurEvent: function blurEvent(evnt) {
  21242. this.afterCheckValue();
  21243. if (!this.visiblePanel) {
  21244. this.isActivated = false;
  21245. }
  21246. this.triggerEvent(evnt);
  21247. },
  21248. keydownEvent: function keydownEvent(evnt) {
  21249. if (this.isNumber) {
  21250. var isCtrlKey = evnt.ctrlKey;
  21251. var isShiftKey = evnt.shiftKey;
  21252. var isAltKey = evnt.altKey;
  21253. var keyCode = evnt.keyCode;
  21254. if (!isCtrlKey && !isShiftKey && !isAltKey && (keyCode === 32 || keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191)) {
  21255. evnt.preventDefault();
  21256. }
  21257. this.numberKeydownEvent(evnt);
  21258. }
  21259. this.triggerEvent(evnt);
  21260. },
  21261. mousewheelEvent: function mousewheelEvent(evnt) {
  21262. if (this.isNumber && this.controls) {
  21263. if (this.isActivated) {
  21264. var delta = -evnt.wheelDelta || evnt.detail;
  21265. if (delta > 0) {
  21266. this.numberNextEvent(evnt);
  21267. } else if (delta < 0) {
  21268. this.numberPrevEvent(evnt);
  21269. }
  21270. evnt.preventDefault();
  21271. }
  21272. }
  21273. },
  21274. clickEvent: function clickEvent(evnt) {
  21275. var isDatePicker = this.isDatePicker;
  21276. if (isDatePicker) {
  21277. this.datePickerOpenEvent(evnt);
  21278. }
  21279. this.triggerEvent(evnt);
  21280. },
  21281. clickPrefixEvent: function clickPrefixEvent(evnt) {
  21282. var $refs = this.$refs,
  21283. disabled = this.disabled,
  21284. value = this.value;
  21285. if (!disabled) {
  21286. this.$emit('prefix-click', {
  21287. $panel: $refs.panel,
  21288. value: value,
  21289. $event: evnt
  21290. }, evnt);
  21291. }
  21292. },
  21293. clickSuffixEvent: function clickSuffixEvent(evnt) {
  21294. var $refs = this.$refs,
  21295. disabled = this.disabled,
  21296. value = this.value;
  21297. if (!disabled) {
  21298. if (DomTools.hasClass(evnt.currentTarget, 'is--clear')) {
  21299. this.emitUpdate('', evnt);
  21300. this.clearValueEvent(evnt, '');
  21301. } else {
  21302. this.$emit('suffix-click', {
  21303. $panel: $refs.panel,
  21304. value: value,
  21305. $event: evnt
  21306. }, evnt);
  21307. }
  21308. }
  21309. },
  21310. clearValueEvent: function clearValueEvent(evnt, value) {
  21311. var $refs = this.$refs,
  21312. type = this.type,
  21313. isNumber = this.isNumber;
  21314. if (this.isDatePicker) {
  21315. this.hidePanel();
  21316. }
  21317. if (isNumber || ['text', 'password'].indexOf(type) > -1) {
  21318. this.focus();
  21319. }
  21320. this.$emit('clear', {
  21321. $panel: $refs.panel,
  21322. value: value,
  21323. $event: evnt
  21324. }, evnt);
  21325. },
  21326. /**
  21327. * 检查初始值
  21328. */
  21329. initValue: function initValue() {
  21330. var type = this.type,
  21331. isDatePicker = this.isDatePicker,
  21332. value = this.value,
  21333. digitsValue = this.digitsValue;
  21334. if (isDatePicker) {
  21335. this.changeValue();
  21336. } else if (type === 'float') {
  21337. if (value) {
  21338. var validValue = toFloatValueFixed(value, digitsValue);
  21339. if (value !== validValue) {
  21340. this.emitUpdate(validValue, {
  21341. type: 'init'
  21342. });
  21343. }
  21344. }
  21345. }
  21346. },
  21347. /**
  21348. * 值变化时处理
  21349. */
  21350. changeValue: function changeValue() {
  21351. if (this.isDatePicker) {
  21352. this.dateParseValue(this.value);
  21353. this.inputValue = this.datePanelLabel;
  21354. }
  21355. },
  21356. afterCheckValue: function afterCheckValue() {
  21357. var type = this.type,
  21358. inpAttrs = this.inpAttrs,
  21359. value = this.value,
  21360. inputValue = this.inputValue,
  21361. isDatePicker = this.isDatePicker,
  21362. isNumber = this.isNumber,
  21363. datetimePanelValue = this.datetimePanelValue,
  21364. dateLabelFormat = this.dateLabelFormat,
  21365. min = this.min,
  21366. max = this.max,
  21367. digitsValue = this.digitsValue;
  21368. if (!inpAttrs.readonly) {
  21369. if (isNumber) {
  21370. if (value) {
  21371. var inpVal = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
  21372. if (!this.vaildMinNum(inpVal)) {
  21373. inpVal = min;
  21374. } else if (!this.vaildMaxNum(inpVal)) {
  21375. inpVal = max;
  21376. }
  21377. this.emitUpdate(type === 'float' ? toFloatValueFixed(inpVal, digitsValue) : ctor_amd_xe_utils_default.a.toString(inpVal), {
  21378. type: 'check'
  21379. });
  21380. }
  21381. } else if (isDatePicker) {
  21382. var _inpVal = inputValue;
  21383. if (_inpVal) {
  21384. if (type === 'time') {
  21385. _inpVal = toStringTime(_inpVal, dateLabelFormat);
  21386. } else {
  21387. _inpVal = ctor_amd_xe_utils_default.a.toStringDate(_inpVal, dateLabelFormat);
  21388. }
  21389. if (ctor_amd_xe_utils_default.a.isValidDate(_inpVal)) {
  21390. if (type === 'time') {
  21391. _inpVal = ctor_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
  21392. if (value !== _inpVal) {
  21393. this.emitUpdate(_inpVal, {
  21394. type: 'check'
  21395. });
  21396. }
  21397. this.inputValue = _inpVal;
  21398. } else {
  21399. if (!ctor_amd_xe_utils_default.a.isDateSame(value, _inpVal, dateLabelFormat)) {
  21400. if (type === 'datetime') {
  21401. datetimePanelValue.setHours(_inpVal.getHours());
  21402. datetimePanelValue.setMinutes(_inpVal.getMinutes());
  21403. datetimePanelValue.setSeconds(_inpVal.getSeconds());
  21404. }
  21405. this.dateChange(_inpVal);
  21406. } else {
  21407. this.inputValue = ctor_amd_xe_utils_default.a.toDateString(value, dateLabelFormat);
  21408. }
  21409. }
  21410. } else {
  21411. this.dateRevert();
  21412. }
  21413. } else {
  21414. this.emitUpdate('', {
  21415. type: 'check'
  21416. });
  21417. }
  21418. }
  21419. }
  21420. },
  21421. // 密码
  21422. passwordToggleEvent: function passwordToggleEvent(evnt) {
  21423. var disabled = this.disabled,
  21424. readonly = this.readonly,
  21425. showPwd = this.showPwd;
  21426. if (!disabled && !readonly) {
  21427. this.showPwd = !showPwd;
  21428. }
  21429. this.$emit('toggle-visible', {
  21430. visible: this.showPwd,
  21431. $event: evnt
  21432. });
  21433. },
  21434. // 密码
  21435. // 搜索
  21436. searchEvent: function searchEvent(evnt) {
  21437. this.$emit('search-click', {
  21438. $event: evnt
  21439. });
  21440. },
  21441. // 搜索
  21442. // 数值
  21443. vaildMinNum: function vaildMinNum(num) {
  21444. return this.min === null || num >= ctor_amd_xe_utils_default.a.toNumber(this.min);
  21445. },
  21446. vaildMaxNum: function vaildMaxNum(num) {
  21447. return this.max === null || num <= ctor_amd_xe_utils_default.a.toNumber(this.max);
  21448. },
  21449. numberStopDown: function numberStopDown() {
  21450. clearTimeout(this.downbumTimeout);
  21451. },
  21452. numberDownPrevEvent: function numberDownPrevEvent(evnt) {
  21453. var _this2 = this;
  21454. this.downbumTimeout = setTimeout(function () {
  21455. _this2.numberPrevEvent(evnt);
  21456. _this2.numberDownPrevEvent(evnt);
  21457. }, 60);
  21458. },
  21459. numberDownNextEvent: function numberDownNextEvent(evnt) {
  21460. var _this3 = this;
  21461. this.downbumTimeout = setTimeout(function () {
  21462. _this3.numberNextEvent(evnt);
  21463. _this3.numberDownNextEvent(evnt);
  21464. }, 60);
  21465. },
  21466. numberKeydownEvent: function numberKeydownEvent(evnt) {
  21467. var keyCode = evnt.keyCode;
  21468. var isUpArrow = keyCode === 38;
  21469. var isDwArrow = keyCode === 40;
  21470. if (isUpArrow || isDwArrow) {
  21471. evnt.preventDefault();
  21472. if (isUpArrow) {
  21473. this.numberPrevEvent(evnt);
  21474. } else {
  21475. this.numberNextEvent(evnt);
  21476. }
  21477. }
  21478. },
  21479. numberMousedownEvent: function numberMousedownEvent(evnt) {
  21480. var _this4 = this;
  21481. this.numberStopDown();
  21482. if (evnt.button === 0) {
  21483. var isPrevNumber = DomTools.hasClass(evnt.currentTarget, 'is--prev');
  21484. if (isPrevNumber) {
  21485. this.numberPrevEvent(evnt);
  21486. } else {
  21487. this.numberNextEvent(evnt);
  21488. }
  21489. this.downbumTimeout = setTimeout(function () {
  21490. if (isPrevNumber) {
  21491. _this4.numberDownPrevEvent(evnt);
  21492. } else {
  21493. _this4.numberDownNextEvent(evnt);
  21494. }
  21495. }, 500);
  21496. }
  21497. },
  21498. numberPrevEvent: function numberPrevEvent(evnt) {
  21499. var disabled = this.disabled,
  21500. readonly = this.readonly;
  21501. clearTimeout(this.downbumTimeout);
  21502. if (!disabled && !readonly) {
  21503. this.numberChange(true, evnt);
  21504. }
  21505. this.$emit('prev-number', {
  21506. $event: evnt
  21507. });
  21508. },
  21509. numberNextEvent: function numberNextEvent(evnt) {
  21510. var disabled = this.disabled,
  21511. readonly = this.readonly;
  21512. clearTimeout(this.downbumTimeout);
  21513. if (!disabled && !readonly) {
  21514. this.numberChange(false, evnt);
  21515. }
  21516. this.$emit('next-number', {
  21517. $event: evnt
  21518. });
  21519. },
  21520. numberChange: function numberChange(isPlus, evnt) {
  21521. var type = this.type,
  21522. digitsValue = this.digitsValue,
  21523. value = this.value,
  21524. stepValue = this.stepValue;
  21525. var inputValue = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
  21526. var newValue = isPlus ? ctor_amd_xe_utils_default.a.add(inputValue, stepValue) : ctor_amd_xe_utils_default.a.subtract(inputValue, stepValue);
  21527. if (this.vaildMinNum(newValue) && this.vaildMaxNum(newValue)) {
  21528. this.emitUpdate(type === 'float' ? toFloatValueFixed(newValue, digitsValue) : ctor_amd_xe_utils_default.a.toString(newValue), evnt);
  21529. }
  21530. },
  21531. // 数值
  21532. // 日期
  21533. datePickerOpenEvent: function datePickerOpenEvent(evnt) {
  21534. var readonly = this.readonly;
  21535. if (!readonly) {
  21536. evnt.preventDefault();
  21537. this.showPanel();
  21538. }
  21539. },
  21540. dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
  21541. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
  21542. },
  21543. dateNowHandle: function dateNowHandle() {
  21544. var currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21545. this.currentDate = currentDate;
  21546. this.dateMonthHandle(currentDate, 0);
  21547. },
  21548. dateToggleTypeEvent: function dateToggleTypeEvent() {
  21549. var datePanelType = this.datePanelType;
  21550. if (datePanelType === 'month') {
  21551. datePanelType = 'year';
  21552. } else {
  21553. datePanelType = 'month';
  21554. }
  21555. this.datePanelType = datePanelType;
  21556. },
  21557. datePrevEvent: function datePrevEvent(evnt) {
  21558. var isDisabledPrevDateBtn = this.isDisabledPrevDateBtn,
  21559. type = this.type,
  21560. datePanelType = this.datePanelType;
  21561. if (!isDisabledPrevDateBtn) {
  21562. if (type === 'year') {
  21563. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21564. } else if (type === 'month') {
  21565. if (datePanelType === 'year') {
  21566. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21567. } else {
  21568. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  21569. }
  21570. } else {
  21571. if (datePanelType === 'year') {
  21572. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  21573. } else if (datePanelType === 'month') {
  21574. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  21575. } else {
  21576. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, -1, 'first');
  21577. }
  21578. }
  21579. this.$emit('date-prev', {
  21580. type: type,
  21581. $event: evnt
  21582. });
  21583. }
  21584. },
  21585. dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
  21586. this.dateNowHandle();
  21587. this.dateChange(this.currentDate);
  21588. this.hidePanel();
  21589. this.$emit('date-today', {
  21590. type: this.type,
  21591. $event: evnt
  21592. });
  21593. },
  21594. dateNextEvent: function dateNextEvent(evnt) {
  21595. var isDisabledNextDateBtn = this.isDisabledNextDateBtn,
  21596. type = this.type,
  21597. datePanelType = this.datePanelType;
  21598. if (!isDisabledNextDateBtn) {
  21599. if (type === 'year') {
  21600. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21601. } else if (type === 'month') {
  21602. if (datePanelType === 'year') {
  21603. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21604. } else {
  21605. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  21606. }
  21607. } else {
  21608. if (datePanelType === 'year') {
  21609. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  21610. } else if (datePanelType === 'month') {
  21611. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  21612. } else {
  21613. this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
  21614. }
  21615. }
  21616. this.$emit('date-prev', {
  21617. type: type,
  21618. $event: evnt
  21619. });
  21620. }
  21621. },
  21622. dateSelectEvent: function dateSelectEvent(item) {
  21623. if (!isDateDisabled(this, item)) {
  21624. this.dateSelectItem(item.date);
  21625. }
  21626. },
  21627. dateSelectItem: function dateSelectItem(date) {
  21628. var type = this.type,
  21629. datePanelType = this.datePanelType;
  21630. if (type === 'month') {
  21631. if (datePanelType === 'year') {
  21632. this.datePanelType = 'month';
  21633. this.dateCheckMonth(date);
  21634. } else {
  21635. this.dateChange(date);
  21636. this.hidePanel();
  21637. }
  21638. } else if (type === 'year') {
  21639. this.hidePanel();
  21640. this.dateChange(date);
  21641. } else {
  21642. if (datePanelType === 'month') {
  21643. this.datePanelType = type === 'week' ? type : 'day';
  21644. this.dateCheckMonth(date);
  21645. } else if (datePanelType === 'year') {
  21646. this.datePanelType = 'month';
  21647. this.dateCheckMonth(date);
  21648. } else {
  21649. this.dateChange(date);
  21650. this.hidePanel();
  21651. }
  21652. }
  21653. },
  21654. dateMouseenterEvent: function dateMouseenterEvent(item) {
  21655. if (!isDateDisabled(this, item)) {
  21656. var datePanelType = this.datePanelType;
  21657. if (datePanelType === 'month') {
  21658. this.dateMoveMonth(item.date);
  21659. } else if (datePanelType === 'year') {
  21660. this.dateMoveYear(item.date);
  21661. } else {
  21662. this.dateMoveDay(item.date);
  21663. }
  21664. }
  21665. },
  21666. dateHourEvent: function dateHourEvent(evnt, item) {
  21667. this.datetimePanelValue.setHours(item.value);
  21668. this.dateTimeChangeEvent(evnt);
  21669. },
  21670. dateConfirmEvent: function dateConfirmEvent() {
  21671. this.dateChange(this.dateValue || this.currentDate);
  21672. this.hidePanel();
  21673. },
  21674. dateMinuteEvent: function dateMinuteEvent(evnt, item) {
  21675. this.datetimePanelValue.setMinutes(item.value);
  21676. this.dateTimeChangeEvent(evnt);
  21677. },
  21678. dateSecondEvent: function dateSecondEvent(evnt, item) {
  21679. this.datetimePanelValue.setSeconds(item.value);
  21680. this.dateTimeChangeEvent(evnt);
  21681. },
  21682. dateTimeChangeEvent: function dateTimeChangeEvent(evnt) {
  21683. this.datetimePanelValue = new Date(this.datetimePanelValue.getTime());
  21684. this.updateTimePos(evnt.currentTarget);
  21685. },
  21686. updateTimePos: function updateTimePos(liElem) {
  21687. if (liElem) {
  21688. var height = liElem.offsetHeight;
  21689. liElem.parentNode.scrollTop = liElem.offsetTop - height * 4;
  21690. }
  21691. },
  21692. dateMoveDay: function dateMoveDay(offsetDay) {
  21693. if (!isDateDisabled(this, {
  21694. date: offsetDay
  21695. })) {
  21696. if (!this.dayList.some(function (item) {
  21697. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetDay, 'yyyy-MM-dd');
  21698. })) {
  21699. this.dateCheckMonth(offsetDay);
  21700. }
  21701. this.dateParseValue(offsetDay);
  21702. }
  21703. },
  21704. dateMoveMonth: function dateMoveMonth(offsetMonth) {
  21705. if (!isDateDisabled(this, {
  21706. date: offsetMonth
  21707. })) {
  21708. if (!this.monthList.some(function (item) {
  21709. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetMonth, 'yyyy-MM');
  21710. })) {
  21711. this.dateCheckMonth(offsetMonth);
  21712. }
  21713. this.dateParseValue(offsetMonth);
  21714. }
  21715. },
  21716. dateMoveYear: function dateMoveYear(offsetYear) {
  21717. if (!isDateDisabled(this, {
  21718. date: offsetYear
  21719. })) {
  21720. if (!this.yearList.some(function (item) {
  21721. return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetYear, 'yyyy');
  21722. })) {
  21723. this.dateCheckMonth(offsetYear);
  21724. }
  21725. this.dateParseValue(offsetYear);
  21726. }
  21727. },
  21728. dateParseValue: function dateParseValue(date) {
  21729. var type = this.type,
  21730. dateLabelFormat = this.dateLabelFormat,
  21731. valueFormat = this.valueFormat,
  21732. parseFormat = this.parseFormat;
  21733. var dValue = null;
  21734. var dLabel = '';
  21735. if (date) {
  21736. if (type === 'time') {
  21737. dValue = toStringTime(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
  21738. } else {
  21739. dValue = ctor_amd_xe_utils_default.a.toStringDate(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
  21740. }
  21741. }
  21742. if (ctor_amd_xe_utils_default.a.isValidDate(dValue)) {
  21743. dLabel = ctor_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat);
  21744. } else {
  21745. dValue = null;
  21746. }
  21747. this.datePanelValue = dValue;
  21748. this.datePanelLabel = dLabel;
  21749. },
  21750. dateOffsetEvent: function dateOffsetEvent(evnt) {
  21751. var isActivated = this.isActivated,
  21752. datePanelValue = this.datePanelValue,
  21753. datePanelType = this.datePanelType;
  21754. if (isActivated) {
  21755. evnt.preventDefault();
  21756. var keyCode = evnt.keyCode;
  21757. var isLeftArrow = keyCode === 37;
  21758. var isUpArrow = keyCode === 38;
  21759. var isRightArrow = keyCode === 39;
  21760. var isDwArrow = keyCode === 40;
  21761. if (datePanelType === 'year') {
  21762. var offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
  21763. if (isLeftArrow) {
  21764. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
  21765. } else if (isUpArrow) {
  21766. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
  21767. } else if (isRightArrow) {
  21768. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
  21769. } else if (isDwArrow) {
  21770. offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
  21771. }
  21772. this.dateMoveYear(offsetYear);
  21773. } else if (datePanelType === 'month') {
  21774. var offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
  21775. if (isLeftArrow) {
  21776. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
  21777. } else if (isUpArrow) {
  21778. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
  21779. } else if (isRightArrow) {
  21780. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
  21781. } else if (isDwArrow) {
  21782. offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
  21783. }
  21784. this.dateMoveMonth(offsetMonth);
  21785. } else {
  21786. var offsetDay = datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21787. if (isLeftArrow) {
  21788. offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
  21789. } else if (isUpArrow) {
  21790. offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
  21791. } else if (isRightArrow) {
  21792. offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
  21793. } else if (isDwArrow) {
  21794. offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1);
  21795. }
  21796. this.dateMoveDay(offsetDay);
  21797. }
  21798. }
  21799. },
  21800. datePgOffsetEvent: function datePgOffsetEvent(evnt) {
  21801. var isActivated = this.isActivated;
  21802. if (isActivated) {
  21803. var isPgUp = evnt.keyCode === 33;
  21804. evnt.preventDefault();
  21805. if (isPgUp) {
  21806. this.datePrevEvent(evnt);
  21807. } else {
  21808. this.dateNextEvent(evnt);
  21809. }
  21810. }
  21811. },
  21812. dateChange: function dateChange(date) {
  21813. var value = this.value,
  21814. datetimePanelValue = this.datetimePanelValue,
  21815. dateValueFormat = this.dateValueFormat;
  21816. if (this.type === 'week') {
  21817. var sWeek = ctor_amd_xe_utils_default.a.toNumber(ctor_amd_xe_utils_default.a.isNumber(this.startWeek) ? this.startWeek : this.dateOpts.startWeek);
  21818. date = ctor_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek);
  21819. } else if (this.hasTime) {
  21820. date.setHours(datetimePanelValue.getHours());
  21821. date.setMinutes(datetimePanelValue.getMinutes());
  21822. date.setSeconds(datetimePanelValue.getSeconds());
  21823. }
  21824. var inpVal = ctor_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
  21825. this.dateCheckMonth(date);
  21826. if (!ctor_amd_xe_utils_default.a.isEqual(value, inpVal)) {
  21827. this.emitUpdate(inpVal, {
  21828. type: 'update'
  21829. });
  21830. }
  21831. },
  21832. dateCheckMonth: function dateCheckMonth(date) {
  21833. var month = ctor_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
  21834. if (!ctor_amd_xe_utils_default.a.isEqual(month, this.selectMonth)) {
  21835. this.selectMonth = month;
  21836. }
  21837. },
  21838. dateOpenPanel: function dateOpenPanel() {
  21839. var _this5 = this;
  21840. var type = this.type,
  21841. dateValue = this.dateValue;
  21842. if (['year', 'month', 'week'].indexOf(type) > -1) {
  21843. this.datePanelType = type;
  21844. } else {
  21845. this.datePanelType = 'day';
  21846. }
  21847. this.currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21848. if (dateValue) {
  21849. this.dateMonthHandle(dateValue, 0);
  21850. this.dateParseValue(dateValue);
  21851. } else {
  21852. this.dateNowHandle();
  21853. }
  21854. if (this.hasTime) {
  21855. this.datetimePanelValue = this.datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  21856. this.$nextTick(function () {
  21857. ctor_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
  21858. });
  21859. }
  21860. },
  21861. dateRevert: function dateRevert() {
  21862. this.inputValue = this.datePanelLabel;
  21863. },
  21864. // 日期
  21865. // 弹出面板
  21866. updateZindex: function updateZindex() {
  21867. if (this.panelIndex < UtilTools.getLastZIndex()) {
  21868. this.panelIndex = UtilTools.nextZIndex();
  21869. }
  21870. },
  21871. showPanel: function showPanel() {
  21872. var _this6 = this;
  21873. var disabled = this.disabled,
  21874. visiblePanel = this.visiblePanel,
  21875. isDatePicker = this.isDatePicker;
  21876. if (!disabled && !visiblePanel) {
  21877. clearTimeout(this.hidePanelTimeout);
  21878. this.isActivated = true;
  21879. this.animatVisible = true;
  21880. if (isDatePicker) {
  21881. this.dateOpenPanel();
  21882. }
  21883. setTimeout(function () {
  21884. _this6.visiblePanel = true;
  21885. }, 10);
  21886. this.updateZindex();
  21887. this.updatePlacement();
  21888. }
  21889. },
  21890. hidePanel: function hidePanel() {
  21891. var _this7 = this;
  21892. this.visiblePanel = false;
  21893. this.hidePanelTimeout = setTimeout(function () {
  21894. _this7.animatVisible = false;
  21895. }, 350);
  21896. },
  21897. updatePlacement: function updatePlacement() {
  21898. var _this8 = this;
  21899. return this.$nextTick().then(function () {
  21900. var $refs = _this8.$refs,
  21901. transfer = _this8.transfer,
  21902. placement = _this8.placement,
  21903. panelIndex = _this8.panelIndex;
  21904. var targetElem = $refs.input;
  21905. var panelElem = $refs.panel;
  21906. if (targetElem && panelElem) {
  21907. var targetHeight = targetElem.offsetHeight;
  21908. var targetWidth = targetElem.offsetWidth;
  21909. var panelHeight = panelElem.offsetHeight;
  21910. var panelWidth = panelElem.offsetWidth;
  21911. var marginSize = 5;
  21912. var panelStyle = {
  21913. zIndex: panelIndex
  21914. };
  21915. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  21916. boundingTop = _DomTools$getAbsolute.boundingTop,
  21917. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  21918. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  21919. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  21920. var panelPlacement = 'bottom';
  21921. if (transfer) {
  21922. var left = boundingLeft;
  21923. var top = boundingTop + targetHeight;
  21924. if (placement === 'top') {
  21925. panelPlacement = 'top';
  21926. top = boundingTop - panelHeight;
  21927. } else if (!placement) {
  21928. // 如果下面不够放,则向上
  21929. if (top + panelHeight + marginSize > visibleHeight) {
  21930. panelPlacement = 'top';
  21931. top = boundingTop - panelHeight;
  21932. } // 如果上面不够放,则向下(优先)
  21933. if (top < marginSize) {
  21934. panelPlacement = 'bottom';
  21935. top = boundingTop + targetHeight;
  21936. }
  21937. } // 如果溢出右边
  21938. if (left + panelWidth + marginSize > visibleWidth) {
  21939. left -= left + panelWidth + marginSize - visibleWidth;
  21940. } // 如果溢出左边
  21941. if (left < marginSize) {
  21942. left = marginSize;
  21943. }
  21944. Object.assign(panelStyle, {
  21945. left: "".concat(left, "px"),
  21946. top: "".concat(top, "px"),
  21947. minWidth: "".concat(targetWidth, "px")
  21948. });
  21949. } else {
  21950. if (placement === 'top') {
  21951. panelPlacement = 'top';
  21952. panelStyle.bottom = "".concat(targetHeight, "px");
  21953. } else if (!placement) {
  21954. // 如果下面不够放,则向上
  21955. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  21956. // 如果上面不够放,则向下(优先)
  21957. if (boundingTop - targetHeight - panelHeight > marginSize) {
  21958. panelPlacement = 'top';
  21959. panelStyle.bottom = "".concat(targetHeight, "px");
  21960. }
  21961. }
  21962. }
  21963. }
  21964. _this8.panelStyle = panelStyle;
  21965. _this8.panelPlacement = panelPlacement;
  21966. return _this8.$nextTick();
  21967. }
  21968. });
  21969. },
  21970. // 弹出面板
  21971. // 全局事件
  21972. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  21973. var $refs = this.$refs,
  21974. $el = this.$el,
  21975. disabled = this.disabled,
  21976. visiblePanel = this.visiblePanel,
  21977. isActivated = this.isActivated;
  21978. if (!disabled && isActivated) {
  21979. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  21980. if (!this.isActivated) {
  21981. // 如果是日期类型
  21982. if (this.isDatePicker) {
  21983. if (visiblePanel) {
  21984. this.hidePanel();
  21985. this.afterCheckValue();
  21986. }
  21987. } else {
  21988. this.afterCheckValue();
  21989. }
  21990. }
  21991. }
  21992. },
  21993. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  21994. var isDatePicker = this.isDatePicker,
  21995. visiblePanel = this.visiblePanel,
  21996. clearable = this.clearable,
  21997. disabled = this.disabled;
  21998. if (!disabled) {
  21999. var keyCode = evnt.keyCode;
  22000. var isTab = keyCode === 9;
  22001. var isDel = keyCode === 46;
  22002. var isEsc = keyCode === 27;
  22003. var isEnter = keyCode === 13;
  22004. var isLeftArrow = keyCode === 37;
  22005. var isUpArrow = keyCode === 38;
  22006. var isRightArrow = keyCode === 39;
  22007. var isDwArrow = keyCode === 40;
  22008. var isPgUp = keyCode === 33;
  22009. var isPgDn = keyCode === 34;
  22010. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  22011. var isActivated = this.isActivated;
  22012. if (isTab) {
  22013. if (isActivated) {
  22014. this.afterCheckValue();
  22015. }
  22016. isActivated = false;
  22017. this.isActivated = isActivated;
  22018. } else if (operArrow) {
  22019. if (isDatePicker) {
  22020. if (isActivated) {
  22021. if (visiblePanel) {
  22022. this.dateOffsetEvent(evnt);
  22023. } else if (isUpArrow || isDwArrow) {
  22024. this.datePickerOpenEvent(evnt);
  22025. }
  22026. }
  22027. }
  22028. } else if (isEnter) {
  22029. if (isDatePicker) {
  22030. if (visiblePanel) {
  22031. if (this.datePanelValue) {
  22032. this.dateSelectItem(this.datePanelValue);
  22033. } else {
  22034. this.hidePanel();
  22035. }
  22036. } else if (isActivated) {
  22037. this.datePickerOpenEvent(evnt);
  22038. }
  22039. }
  22040. } else if (isPgUp || isPgDn) {
  22041. if (isDatePicker) {
  22042. if (isActivated) {
  22043. this.datePgOffsetEvent(evnt);
  22044. }
  22045. }
  22046. }
  22047. if (isTab || isEsc) {
  22048. if (visiblePanel) {
  22049. this.hidePanel();
  22050. }
  22051. } else if (isDel && clearable) {
  22052. if (isActivated) {
  22053. this.clearValueEvent(evnt, null);
  22054. }
  22055. }
  22056. }
  22057. },
  22058. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  22059. var $refs = this.$refs,
  22060. disabled = this.disabled,
  22061. visiblePanel = this.visiblePanel;
  22062. if (!disabled) {
  22063. if (visiblePanel) {
  22064. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  22065. this.updatePlacement();
  22066. } else {
  22067. this.hidePanel();
  22068. this.afterCheckValue();
  22069. }
  22070. }
  22071. }
  22072. },
  22073. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  22074. var isActivated = this.isActivated,
  22075. visiblePanel = this.visiblePanel;
  22076. if (visiblePanel) {
  22077. this.hidePanel();
  22078. this.afterCheckValue();
  22079. } else if (isActivated) {
  22080. this.afterCheckValue();
  22081. }
  22082. } // 全局事件
  22083. }
  22084. });
  22085. // CONCATENATED MODULE: ./packages/input/index.js
  22086. input.install = function (Vue) {
  22087. Vue.component(input.name, input);
  22088. };
  22089. var Input = input;
  22090. /* harmony default export */ var packages_input = (input);
  22091. // CONCATENATED MODULE: ./packages/textarea/src/textarea.js
  22092. var autoTxtElem;
  22093. /* harmony default export */ var src_textarea = ({
  22094. name: 'VxeTextarea',
  22095. props: {
  22096. value: [String, Number],
  22097. name: String,
  22098. readonly: Boolean,
  22099. disabled: Boolean,
  22100. placeholder: String,
  22101. maxlength: [String, Number],
  22102. rows: {
  22103. type: [String, Number],
  22104. default: 2
  22105. },
  22106. showWordCount: Boolean,
  22107. autosize: [Boolean, Object],
  22108. form: String,
  22109. resize: {
  22110. type: String,
  22111. default: function _default() {
  22112. return conf.textarea.resize;
  22113. }
  22114. },
  22115. size: {
  22116. type: String,
  22117. default: function _default() {
  22118. return conf.textarea.size || conf.size;
  22119. }
  22120. }
  22121. },
  22122. computed: {
  22123. vSize: function vSize() {
  22124. return this.size || this.$parent.size || this.$parent.vSize;
  22125. },
  22126. inputCount: function inputCount() {
  22127. return ctor_amd_xe_utils_default.a.getSize(this.value);
  22128. },
  22129. isCountError: function isCountError() {
  22130. return this.maxlength && this.inputCount > ctor_amd_xe_utils_default.a.toNumber(this.maxlength);
  22131. },
  22132. defaultEvents: function defaultEvents() {
  22133. var _this = this;
  22134. var evnts = {};
  22135. ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  22136. if (['change'].indexOf(name) === -1) {
  22137. evnts[name] = _this.triggerEvent;
  22138. }
  22139. });
  22140. evnts.input = this.inputEvent;
  22141. return evnts;
  22142. },
  22143. sizeOpts: function sizeOpts() {
  22144. return Object.assign({
  22145. minRows: 1,
  22146. maxRows: 10
  22147. }, conf.textarea.autosize, this.autosize);
  22148. }
  22149. },
  22150. watch: {
  22151. value: function value() {
  22152. this.updateAutoTxt();
  22153. }
  22154. },
  22155. created: function created() {
  22156. if (!autoTxtElem) {
  22157. autoTxtElem = document.createElement('div');
  22158. document.body.appendChild(autoTxtElem);
  22159. }
  22160. },
  22161. mounted: function mounted() {
  22162. this.updateAutoTxt();
  22163. this.handleResize();
  22164. },
  22165. render: function render(h) {
  22166. var _ref;
  22167. var defaultEvents = this.defaultEvents,
  22168. value = this.value,
  22169. vSize = this.vSize,
  22170. name = this.name,
  22171. form = this.form,
  22172. resize = this.resize,
  22173. placeholder = this.placeholder,
  22174. readonly = this.readonly,
  22175. disabled = this.disabled,
  22176. maxlength = this.maxlength,
  22177. autosize = this.autosize,
  22178. showWordCount = this.showWordCount;
  22179. var attrs = {
  22180. name: name,
  22181. form: form,
  22182. placeholder: placeholder,
  22183. maxlength: maxlength,
  22184. readonly: readonly,
  22185. disabled: disabled
  22186. };
  22187. if (placeholder) {
  22188. attrs.placeholder = UtilTools.getFuncText(placeholder);
  22189. }
  22190. return h('div', {
  22191. class: ['vxe-textarea', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--autosize', autosize), _defineProperty(_ref, 'is--disabled', disabled), _ref)]
  22192. }, [h('textarea', {
  22193. ref: 'textarea',
  22194. class: 'vxe-textarea--inner',
  22195. domProps: {
  22196. value: value
  22197. },
  22198. attrs: attrs,
  22199. style: resize ? {
  22200. resize: resize
  22201. } : null,
  22202. on: defaultEvents
  22203. }), showWordCount ? h('span', {
  22204. class: ['vxe-textarea--count', {
  22205. 'is--error': this.isCountError
  22206. }]
  22207. }, "".concat(this.inputCount).concat(maxlength ? "/".concat(maxlength) : '')) : null]);
  22208. },
  22209. methods: {
  22210. focus: function focus() {
  22211. this.$refs.textarea.focus();
  22212. return this.$nextTick();
  22213. },
  22214. blur: function blur() {
  22215. this.$refs.textarea.blur();
  22216. return this.$nextTick();
  22217. },
  22218. triggerEvent: function triggerEvent(evnt) {
  22219. var value = this.value;
  22220. this.$emit(evnt.type, {
  22221. value: value,
  22222. $event: evnt
  22223. }, evnt);
  22224. },
  22225. emitUpdate: function emitUpdate(value, evnt) {
  22226. if (this.value !== value) {
  22227. this.$emit('input', value);
  22228. this.$emit('change', {
  22229. value: value,
  22230. $event: evnt
  22231. });
  22232. }
  22233. },
  22234. inputEvent: function inputEvent(evnt) {
  22235. this.emitUpdate(evnt.target.value, evnt);
  22236. this.handleResize();
  22237. },
  22238. updateAutoTxt: function updateAutoTxt() {
  22239. var $refs = this.$refs,
  22240. value = this.value,
  22241. size = this.size,
  22242. autosize = this.autosize;
  22243. if (autosize) {
  22244. var textElem = $refs.textarea;
  22245. var textStyle = getComputedStyle(textElem);
  22246. autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
  22247. autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
  22248. autoTxtElem.style.padding = textStyle.padding;
  22249. autoTxtElem.innerHTML = ('' + (value || ' ')).replace(/\n$/, '\n ');
  22250. }
  22251. },
  22252. handleResize: function handleResize() {
  22253. var _this2 = this;
  22254. if (this.autosize) {
  22255. this.$nextTick(function () {
  22256. var $refs = _this2.$refs,
  22257. sizeOpts = _this2.sizeOpts;
  22258. var minRows = sizeOpts.minRows,
  22259. maxRows = sizeOpts.maxRows;
  22260. var textElem = $refs.textarea;
  22261. var sizeHeight = autoTxtElem.clientHeight;
  22262. var textStyle = getComputedStyle(textElem);
  22263. var lineHeight = ctor_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
  22264. var paddingTop = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
  22265. var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
  22266. var borderTopWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
  22267. var borderBottomWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderBottomWidth);
  22268. var intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
  22269. var rowNum = (sizeHeight - intervalHeight) / lineHeight;
  22270. var textRows = rowNum && /[0-9]/.test(rowNum) ? rowNum : Math.floor(rowNum) + 1;
  22271. var vaildRows = textRows;
  22272. if (textRows < minRows) {
  22273. vaildRows = minRows;
  22274. } else if (textRows > maxRows) {
  22275. vaildRows = maxRows;
  22276. }
  22277. textElem.style.height = "".concat(vaildRows * lineHeight + intervalHeight, "px");
  22278. });
  22279. }
  22280. }
  22281. }
  22282. });
  22283. // CONCATENATED MODULE: ./packages/textarea/index.js
  22284. src_textarea.install = function (Vue) {
  22285. Vue.component(src_textarea.name, src_textarea);
  22286. };
  22287. var Textarea = src_textarea;
  22288. /* harmony default export */ var packages_textarea = (src_textarea);
  22289. // CONCATENATED MODULE: ./packages/button/src/button.js
  22290. /* harmony default export */ var button_src_button = ({
  22291. name: 'VxeButton',
  22292. props: {
  22293. type: String,
  22294. size: {
  22295. type: String,
  22296. default: function _default() {
  22297. return conf.button.size || conf.size;
  22298. }
  22299. },
  22300. name: [String, Number],
  22301. content: String,
  22302. placement: String,
  22303. status: String,
  22304. icon: String,
  22305. round: Boolean,
  22306. circle: Boolean,
  22307. disabled: Boolean,
  22308. loading: Boolean,
  22309. destroyOnClose: Boolean,
  22310. transfer: {
  22311. type: Boolean,
  22312. default: function _default() {
  22313. return conf.button.transfer;
  22314. }
  22315. }
  22316. },
  22317. data: function data() {
  22318. return {
  22319. inited: false,
  22320. showPanel: false,
  22321. animatVisible: false,
  22322. panelIndex: 0,
  22323. panelStyle: null,
  22324. panelPlacement: null
  22325. };
  22326. },
  22327. computed: {
  22328. vSize: function vSize() {
  22329. return this.size || this.$parent.size || this.$parent.vSize;
  22330. },
  22331. isText: function isText() {
  22332. return this.type === 'text';
  22333. },
  22334. isFormBtn: function isFormBtn() {
  22335. return ['submit', 'reset', 'button'].indexOf(this.type) > -1;
  22336. },
  22337. btnType: function btnType() {
  22338. return this.isText ? this.type : 'button';
  22339. },
  22340. btnStatus: function btnStatus() {
  22341. return this.status || (this.type === 'primary' ? this.type : null);
  22342. }
  22343. },
  22344. created: function created() {
  22345. if (this.type === 'primary') {
  22346. UtilTools.warn('vxe.error.delProp', ['type=primary', 'status=primary']);
  22347. }
  22348. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  22349. },
  22350. beforeDestroy: function beforeDestroy() {
  22351. var panelElem = this.$refs.panel;
  22352. if (panelElem && panelElem.parentNode) {
  22353. panelElem.parentNode.removeChild(panelElem);
  22354. }
  22355. },
  22356. destroyed: function destroyed() {
  22357. GlobalEvent.off(this, 'mousewheel');
  22358. },
  22359. render: function render(h) {
  22360. var _ref,
  22361. _ref2,
  22362. _this = this,
  22363. _ref3,
  22364. _ref4;
  22365. var $scopedSlots = this.$scopedSlots,
  22366. $listeners = this.$listeners,
  22367. inited = this.inited,
  22368. type = this.type,
  22369. destroyOnClose = this.destroyOnClose,
  22370. isFormBtn = this.isFormBtn,
  22371. btnStatus = this.btnStatus,
  22372. btnType = this.btnType,
  22373. vSize = this.vSize,
  22374. name = this.name,
  22375. disabled = this.disabled,
  22376. loading = this.loading,
  22377. showPanel = this.showPanel,
  22378. animatVisible = this.animatVisible,
  22379. panelPlacement = this.panelPlacement;
  22380. var downsSlot = $scopedSlots.dropdowns;
  22381. return downsSlot ? h('div', {
  22382. class: ['vxe-button--dropdown', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
  22383. }, [h('button', {
  22384. ref: 'btn',
  22385. 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)],
  22386. attrs: {
  22387. name: name,
  22388. type: isFormBtn ? type : 'button',
  22389. disabled: disabled || loading
  22390. },
  22391. on: Object.assign({
  22392. mouseenter: this.mouseenterTargetEvent,
  22393. mouseleave: this.mouseleaveEvent
  22394. }, ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  22395. return function (evnt) {
  22396. return _this.$emit(type, {
  22397. $event: evnt
  22398. }, evnt);
  22399. };
  22400. }))
  22401. }, this.renderContent(h).concat([h('i', {
  22402. class: "vxe-button--dropdown-arrow ".concat(conf.icon.BUTTON_DROPDOWN)
  22403. })])), h('div', {
  22404. ref: 'panel',
  22405. class: ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
  22406. attrs: {
  22407. 'data-placement': panelPlacement
  22408. },
  22409. style: this.panelStyle
  22410. }, inited ? [h('div', {
  22411. class: 'vxe-button--dropdown-wrapper',
  22412. on: {
  22413. click: this.clickDropdownEvent,
  22414. mouseenter: this.mouseenterEvent,
  22415. mouseleave: this.mouseleaveEvent
  22416. }
  22417. }, destroyOnClose && !showPanel ? [] : downsSlot.call(this, {}, h))] : null)]) : h('button', {
  22418. ref: 'btn',
  22419. 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)],
  22420. attrs: {
  22421. name: name,
  22422. type: isFormBtn ? type : 'button',
  22423. disabled: disabled || loading
  22424. },
  22425. on: ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  22426. return function (evnt) {
  22427. return _this.$emit(type, {
  22428. $event: evnt
  22429. }, evnt);
  22430. };
  22431. })
  22432. }, this.renderContent(h));
  22433. },
  22434. methods: {
  22435. renderContent: function renderContent(h) {
  22436. var $scopedSlots = this.$scopedSlots,
  22437. content = this.content,
  22438. icon = this.icon,
  22439. loading = this.loading;
  22440. var contents = [];
  22441. if (loading) {
  22442. contents.push(h('i', {
  22443. class: ['vxe-button--loading-icon', conf.icon.BUTTON_LOADING]
  22444. }));
  22445. } else if (icon) {
  22446. contents.push(h('i', {
  22447. class: ['vxe-button--icon', icon]
  22448. }));
  22449. }
  22450. if ($scopedSlots.default) {
  22451. contents.push(h('span', {
  22452. class: 'vxe-button--content'
  22453. }, $scopedSlots.default.call(this)));
  22454. } else if (content) {
  22455. contents.push(h('span', {
  22456. class: 'vxe-button--content'
  22457. }, [UtilTools.getFuncText(content)]));
  22458. }
  22459. return contents;
  22460. },
  22461. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  22462. if (this.showPanel && !DomTools.getEventTargetNode(evnt, this.$refs.panel).flag) {
  22463. this.closePanel();
  22464. }
  22465. },
  22466. updateZindex: function updateZindex() {
  22467. if (this.panelIndex < UtilTools.getLastZIndex()) {
  22468. this.panelIndex = UtilTools.nextZIndex();
  22469. }
  22470. },
  22471. clickDropdownEvent: function clickDropdownEvent(evnt) {
  22472. var _this2 = this;
  22473. var dropdownElem = evnt.currentTarget;
  22474. var panelElem = this.$refs.panel;
  22475. var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
  22476. flag = _DomTools$getEventTar.flag,
  22477. targetElem = _DomTools$getEventTar.targetElem;
  22478. if (flag) {
  22479. if (panelElem) {
  22480. panelElem.dataset.active = 'N';
  22481. }
  22482. this.showPanel = false;
  22483. setTimeout(function () {
  22484. if (!panelElem || panelElem.dataset.active !== 'Y') {
  22485. _this2.animatVisible = false;
  22486. }
  22487. }, 350);
  22488. this.$emit('dropdown-click', {
  22489. name: targetElem.getAttribute('name'),
  22490. $event: evnt
  22491. }, evnt);
  22492. }
  22493. },
  22494. mouseenterTargetEvent: function mouseenterTargetEvent() {
  22495. var _this3 = this;
  22496. var panelElem = this.$refs.panel;
  22497. panelElem.dataset.active = 'Y';
  22498. if (!this.inited) {
  22499. this.inited = true;
  22500. if (this.transfer) {
  22501. document.body.appendChild(panelElem);
  22502. }
  22503. }
  22504. this.showTime = setTimeout(function () {
  22505. if (panelElem.dataset.active === 'Y') {
  22506. _this3.mouseenterEvent();
  22507. } else {
  22508. _this3.animatVisible = false;
  22509. }
  22510. }, 250);
  22511. },
  22512. mouseenterEvent: function mouseenterEvent() {
  22513. var _this4 = this;
  22514. var panelElem = this.$refs.panel;
  22515. panelElem.dataset.active = 'Y';
  22516. this.animatVisible = true;
  22517. setTimeout(function () {
  22518. if (panelElem.dataset.active === 'Y') {
  22519. _this4.showPanel = true;
  22520. _this4.updateZindex();
  22521. _this4.updatePlacement();
  22522. setTimeout(function () {
  22523. if (_this4.showPanel) {
  22524. _this4.updatePlacement();
  22525. }
  22526. }, 50);
  22527. }
  22528. }, 20);
  22529. },
  22530. mouseleaveEvent: function mouseleaveEvent() {
  22531. this.closePanel();
  22532. },
  22533. closePanel: function closePanel() {
  22534. var _this5 = this;
  22535. var panelElem = this.$refs.panel;
  22536. clearTimeout(this.showTime);
  22537. if (panelElem) {
  22538. panelElem.dataset.active = 'N';
  22539. setTimeout(function () {
  22540. if (panelElem.dataset.active !== 'Y') {
  22541. _this5.showPanel = false;
  22542. setTimeout(function () {
  22543. if (panelElem.dataset.active !== 'Y') {
  22544. _this5.animatVisible = false;
  22545. }
  22546. }, 350);
  22547. }
  22548. }, 100);
  22549. } else {
  22550. this.animatVisible = false;
  22551. this.showPanel = false;
  22552. }
  22553. },
  22554. updatePlacement: function updatePlacement() {
  22555. var _this6 = this;
  22556. return this.$nextTick().then(function () {
  22557. var $refs = _this6.$refs,
  22558. transfer = _this6.transfer,
  22559. placement = _this6.placement,
  22560. panelIndex = _this6.panelIndex;
  22561. var targetElem = $refs.btn;
  22562. var panelElem = $refs.panel;
  22563. if (panelElem && targetElem) {
  22564. var targetHeight = targetElem.offsetHeight;
  22565. var targetWidth = targetElem.offsetWidth;
  22566. var panelHeight = panelElem.offsetHeight;
  22567. var panelWidth = panelElem.offsetWidth;
  22568. var marginSize = 5;
  22569. var panelStyle = {
  22570. zIndex: panelIndex
  22571. };
  22572. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  22573. boundingTop = _DomTools$getAbsolute.boundingTop,
  22574. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  22575. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  22576. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  22577. var panelPlacement = 'bottom';
  22578. if (transfer) {
  22579. var left = boundingLeft;
  22580. var top = boundingTop + targetHeight;
  22581. if (placement === 'top') {
  22582. panelPlacement = 'top';
  22583. top = boundingTop - panelHeight;
  22584. } else if (!placement) {
  22585. // 如果下面不够放,则向上
  22586. if (top + panelHeight + marginSize > visibleHeight) {
  22587. panelPlacement = 'top';
  22588. top = boundingTop - panelHeight;
  22589. } // 如果上面不够放,则向下(优先)
  22590. if (top < marginSize) {
  22591. panelPlacement = 'bottom';
  22592. top = boundingTop + targetHeight;
  22593. }
  22594. } // 如果溢出右边
  22595. if (left + panelWidth + marginSize > visibleWidth) {
  22596. left -= left + panelWidth + marginSize - visibleWidth;
  22597. } // 如果溢出左边
  22598. if (left < marginSize) {
  22599. left = marginSize;
  22600. }
  22601. Object.assign(panelStyle, {
  22602. left: "".concat(left, "px"),
  22603. top: "".concat(top, "px"),
  22604. minWidth: "".concat(targetWidth, "px")
  22605. });
  22606. } else {
  22607. if (placement === 'top') {
  22608. panelPlacement = 'top';
  22609. panelStyle.bottom = "".concat(targetHeight, "px");
  22610. } else if (!placement) {
  22611. // 如果下面不够放,则向上
  22612. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  22613. // 如果上面不够放,则向下(优先)
  22614. if (boundingTop - targetHeight - panelHeight > marginSize) {
  22615. panelPlacement = 'top';
  22616. panelStyle.bottom = "".concat(targetHeight, "px");
  22617. }
  22618. }
  22619. }
  22620. }
  22621. _this6.panelStyle = panelStyle;
  22622. _this6.panelPlacement = panelPlacement;
  22623. return _this6.$nextTick();
  22624. }
  22625. });
  22626. },
  22627. focus: function focus() {
  22628. this.$el.focus();
  22629. return this.$nextTick();
  22630. },
  22631. blur: function blur() {
  22632. this.$el.blur();
  22633. return this.$nextTick();
  22634. }
  22635. }
  22636. });
  22637. // CONCATENATED MODULE: ./packages/button/index.js
  22638. button_src_button.install = function (Vue) {
  22639. Vue.component(button_src_button.name, button_src_button);
  22640. };
  22641. var Button = button_src_button;
  22642. /* harmony default export */ var packages_button = (button_src_button);
  22643. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  22644. function _arrayWithHoles(arr) {
  22645. if (Array.isArray(arr)) return arr;
  22646. }
  22647. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  22648. function _iterableToArrayLimit(arr, i) {
  22649. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  22650. var _arr = [];
  22651. var _n = true;
  22652. var _d = false;
  22653. var _e = undefined;
  22654. try {
  22655. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  22656. _arr.push(_s.value);
  22657. if (i && _arr.length === i) break;
  22658. }
  22659. } catch (err) {
  22660. _d = true;
  22661. _e = err;
  22662. } finally {
  22663. try {
  22664. if (!_n && _i["return"] != null) _i["return"]();
  22665. } finally {
  22666. if (_d) throw _e;
  22667. }
  22668. }
  22669. return _arr;
  22670. }
  22671. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  22672. function _nonIterableRest() {
  22673. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  22674. }
  22675. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  22676. function _slicedToArray(arr, i) {
  22677. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  22678. }
  22679. // CONCATENATED MODULE: ./packages/modal/src/queue.js
  22680. var queue = [];
  22681. /* harmony default export */ var src_queue = (queue);
  22682. // CONCATENATED MODULE: ./packages/modal/src/activities.js
  22683. var allActivedModals = [];
  22684. /* harmony default export */ var activities = (allActivedModals);
  22685. // CONCATENATED MODULE: ./packages/modal/src/modal.js
  22686. var activeModals = [];
  22687. /* harmony default export */ var modal = ({
  22688. name: 'VxeModal',
  22689. props: {
  22690. value: Boolean,
  22691. id: String,
  22692. type: {
  22693. type: String,
  22694. default: 'modal'
  22695. },
  22696. loading: {
  22697. type: Boolean,
  22698. default: null
  22699. },
  22700. status: String,
  22701. iconStatus: String,
  22702. className: String,
  22703. top: {
  22704. type: [Number, String],
  22705. default: function _default() {
  22706. return conf.modal.top;
  22707. }
  22708. },
  22709. position: [String, Object],
  22710. title: String,
  22711. duration: {
  22712. type: [Number, String],
  22713. default: function _default() {
  22714. return conf.modal.duration;
  22715. }
  22716. },
  22717. // 请使用 content
  22718. message: [String, Function],
  22719. content: [String, Function],
  22720. cancelButtonText: {
  22721. type: String,
  22722. default: function _default() {
  22723. return conf.modal.cancelButtonText;
  22724. }
  22725. },
  22726. confirmButtonText: {
  22727. type: String,
  22728. default: function _default() {
  22729. return conf.modal.confirmButtonText;
  22730. }
  22731. },
  22732. lockView: {
  22733. type: Boolean,
  22734. default: function _default() {
  22735. return conf.modal.lockView;
  22736. }
  22737. },
  22738. lockScroll: Boolean,
  22739. mask: {
  22740. type: Boolean,
  22741. default: function _default() {
  22742. return conf.modal.mask;
  22743. }
  22744. },
  22745. maskClosable: {
  22746. type: Boolean,
  22747. default: function _default() {
  22748. return conf.modal.maskClosable;
  22749. }
  22750. },
  22751. escClosable: {
  22752. type: Boolean,
  22753. default: function _default() {
  22754. return conf.modal.escClosable;
  22755. }
  22756. },
  22757. resize: {
  22758. type: Boolean,
  22759. default: function _default() {
  22760. return conf.modal.resize;
  22761. }
  22762. },
  22763. showHeader: {
  22764. type: Boolean,
  22765. default: function _default() {
  22766. return conf.modal.showHeader;
  22767. }
  22768. },
  22769. showFooter: {
  22770. type: Boolean,
  22771. default: function _default() {
  22772. return conf.modal.showFooter;
  22773. }
  22774. },
  22775. showZoom: {
  22776. type: Boolean,
  22777. default: null
  22778. },
  22779. dblclickZoom: {
  22780. type: Boolean,
  22781. default: function _default() {
  22782. return conf.modal.dblclickZoom;
  22783. }
  22784. },
  22785. width: [Number, String],
  22786. height: [Number, String],
  22787. minWidth: {
  22788. type: [Number, String],
  22789. default: function _default() {
  22790. return conf.modal.minWidth;
  22791. }
  22792. },
  22793. minHeight: {
  22794. type: [Number, String],
  22795. default: function _default() {
  22796. return conf.modal.minHeight;
  22797. }
  22798. },
  22799. zIndex: Number,
  22800. marginSize: {
  22801. type: [Number, String],
  22802. default: conf.modal.marginSize
  22803. },
  22804. fullscreen: Boolean,
  22805. remember: {
  22806. type: Boolean,
  22807. default: function _default() {
  22808. return conf.modal.remember;
  22809. }
  22810. },
  22811. destroyOnClose: {
  22812. type: Boolean,
  22813. default: function _default() {
  22814. return conf.modal.destroyOnClose;
  22815. }
  22816. },
  22817. showTitleOverflow: {
  22818. type: Boolean,
  22819. default: function _default() {
  22820. return conf.modal.showTitleOverflow;
  22821. }
  22822. },
  22823. transfer: {
  22824. type: Boolean,
  22825. default: function _default() {
  22826. return conf.modal.transfer;
  22827. }
  22828. },
  22829. storage: {
  22830. type: Boolean,
  22831. default: function _default() {
  22832. return conf.modal.storage;
  22833. }
  22834. },
  22835. storageKey: {
  22836. type: String,
  22837. default: function _default() {
  22838. return conf.modal.storageKey;
  22839. }
  22840. },
  22841. animat: {
  22842. type: Boolean,
  22843. default: function _default() {
  22844. return conf.modal.animat;
  22845. }
  22846. },
  22847. size: {
  22848. type: String,
  22849. default: function _default() {
  22850. return conf.modal.size || conf.size;
  22851. }
  22852. },
  22853. beforeHideMethod: {
  22854. type: Function,
  22855. default: function _default() {
  22856. return conf.modal.beforeHideMethod;
  22857. }
  22858. },
  22859. slots: Object,
  22860. events: Object
  22861. },
  22862. data: function data() {
  22863. return {
  22864. inited: false,
  22865. visible: false,
  22866. contentVisible: false,
  22867. modalTop: 0,
  22868. modalZindex: 0,
  22869. zoomLocat: null,
  22870. firstOpen: false
  22871. };
  22872. },
  22873. computed: {
  22874. vSize: function vSize() {
  22875. return this.size || this.$parent && (this.$parent.size || this.$parent.vSize);
  22876. },
  22877. isMsg: function isMsg() {
  22878. return this.type === 'message';
  22879. }
  22880. },
  22881. watch: {
  22882. width: function width() {
  22883. this.recalculate();
  22884. },
  22885. height: function height() {
  22886. this.recalculate();
  22887. },
  22888. value: function value(visible) {
  22889. this[visible ? 'open' : 'close']();
  22890. }
  22891. },
  22892. created: function created() {
  22893. if (this.storage && !this.id) {
  22894. UtilTools.error('vxe.error.reqProp', ['modal.id']);
  22895. }
  22896. activeModals.push(this);
  22897. },
  22898. mounted: function mounted() {
  22899. var $listeners = this.$listeners,
  22900. _this$events = this.events,
  22901. events = _this$events === void 0 ? {} : _this$events;
  22902. if (this.value) {
  22903. this.open();
  22904. }
  22905. this.recalculate();
  22906. if (this.escClosable) {
  22907. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  22908. } // 触发 inserted 事件
  22909. var type = 'inserted';
  22910. var params = {
  22911. type: type,
  22912. $modal: this,
  22913. $event: {
  22914. type: type
  22915. }
  22916. };
  22917. if ($listeners.inserted) {
  22918. this.$emit('inserted', params);
  22919. } else if (events.inserted) {
  22920. events.inserted.call(this, params);
  22921. }
  22922. },
  22923. beforeDestroy: function beforeDestroy() {
  22924. var _this = this;
  22925. var $el = this.$el;
  22926. GlobalEvent.off(this, 'keydown');
  22927. this.removeMsgQueue();
  22928. if ($el.parentNode === document.body) {
  22929. $el.parentNode.removeChild($el);
  22930. }
  22931. ctor_amd_xe_utils_default.a.remove(activeModals, function ($modal) {
  22932. return $modal === _this;
  22933. });
  22934. },
  22935. render: function render(h) {
  22936. var _ref,
  22937. _this2 = this;
  22938. var $scopedSlots = this.$scopedSlots,
  22939. _this$slots = this.slots,
  22940. slots = _this$slots === void 0 ? {} : _this$slots,
  22941. inited = this.inited,
  22942. vSize = this.vSize,
  22943. className = this.className,
  22944. type = this.type,
  22945. resize = this.resize,
  22946. showZoom = this.showZoom,
  22947. animat = this.animat,
  22948. loading = this.loading,
  22949. status = this.status,
  22950. iconStatus = this.iconStatus,
  22951. showFooter = this.showFooter,
  22952. zoomLocat = this.zoomLocat,
  22953. modalTop = this.modalTop,
  22954. dblclickZoom = this.dblclickZoom,
  22955. contentVisible = this.contentVisible,
  22956. visible = this.visible,
  22957. title = this.title,
  22958. lockScroll = this.lockScroll,
  22959. lockView = this.lockView,
  22960. mask = this.mask,
  22961. isMsg = this.isMsg,
  22962. showTitleOverflow = this.showTitleOverflow,
  22963. destroyOnClose = this.destroyOnClose;
  22964. var content = this.content || this.message;
  22965. var defaultSlot = $scopedSlots.default || slots.default;
  22966. var footerSlot = $scopedSlots.footer || slots.footer;
  22967. var headerSlot = $scopedSlots.header || slots.header;
  22968. var titleSlot = $scopedSlots.title || slots.title;
  22969. var headerOns = {
  22970. mousedown: this.mousedownEvent
  22971. };
  22972. if ((showZoom === null ? resize : showZoom) && dblclickZoom && type === 'modal') {
  22973. headerOns.dblclick = this.toggleZoomEvent;
  22974. }
  22975. return h('div', {
  22976. 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)],
  22977. style: {
  22978. zIndex: this.modalZindex,
  22979. top: modalTop ? "".concat(modalTop, "px") : null
  22980. },
  22981. on: {
  22982. click: this.selfClickEvent
  22983. }
  22984. }, [h('div', {
  22985. class: 'vxe-modal--box',
  22986. on: {
  22987. mousedown: this.boxMousedownEvent
  22988. },
  22989. ref: 'modalBox'
  22990. }, [this.showHeader ? h('div', {
  22991. class: ['vxe-modal--header', !isMsg && showTitleOverflow ? 'is--ellipsis' : ''],
  22992. on: headerOns
  22993. }, headerSlot ? !inited || destroyOnClose && !visible ? [] : headerSlot.call(this, {
  22994. $modal: this
  22995. }, h) : [titleSlot ? titleSlot.call(this, {
  22996. $modal: this
  22997. }, h) : h('span', {
  22998. class: 'vxe-modal--title'
  22999. }, title ? UtilTools.getFuncText(title) : conf.i18n('vxe.alert.title')), (showZoom === null ? resize : showZoom) ? h('i', {
  23000. class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? conf.icon.MODAL_ZOOM_OUT : conf.icon.MODAL_ZOOM_IN],
  23001. attrs: {
  23002. title: conf.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
  23003. },
  23004. on: {
  23005. click: this.toggleZoomEvent
  23006. }
  23007. }) : null, h('i', {
  23008. class: ['vxe-modal--close-btn', 'trigger--btn', conf.icon.MODAL_CLOSE],
  23009. attrs: {
  23010. title: conf.i18n('vxe.modal.close')
  23011. },
  23012. on: {
  23013. click: this.closeEvent
  23014. }
  23015. })]) : null, h('div', {
  23016. class: 'vxe-modal--body'
  23017. }, [status ? h('div', {
  23018. class: 'vxe-modal--status-wrapper'
  23019. }, [h('i', {
  23020. class: ['vxe-modal--status-icon', iconStatus || conf.icon["MODAL_".concat(status).toLocaleUpperCase()]]
  23021. })]) : null, h('div', {
  23022. class: 'vxe-modal--content'
  23023. }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
  23024. $modal: this
  23025. }, h) : UtilTools.getFuncText(content)), !isMsg ? h('div', {
  23026. class: ['vxe-loading', {
  23027. 'is--visible': loading
  23028. }]
  23029. }, [h('div', {
  23030. class: 'vxe-loading--spinner'
  23031. })]) : null]), showFooter ? h('div', {
  23032. class: 'vxe-modal--footer'
  23033. }, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
  23034. $modal: this
  23035. }, h) : [type === 'confirm' ? h('vxe-button', {
  23036. ref: 'cancelBtn',
  23037. on: {
  23038. click: this.cancelEvent
  23039. }
  23040. }, this.cancelButtonText || conf.i18n('vxe.button.cancel')) : null, h('vxe-button', {
  23041. ref: 'confirmBtn',
  23042. props: {
  23043. status: 'primary'
  23044. },
  23045. on: {
  23046. click: this.confirmEvent
  23047. }
  23048. }, this.confirmButtonText || conf.i18n('vxe.button.confirm'))]) : null, !isMsg && resize ? h('span', {
  23049. class: 'vxe-modal--resize'
  23050. }, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(function (type) {
  23051. return h('span', {
  23052. class: "".concat(type, "-resize"),
  23053. attrs: {
  23054. 'data-type': type
  23055. },
  23056. on: {
  23057. mousedown: _this2.dragEvent
  23058. }
  23059. });
  23060. })) : null])]);
  23061. },
  23062. methods: {
  23063. recalculate: function recalculate() {
  23064. var width = this.width,
  23065. height = this.height;
  23066. var modalBoxElem = this.getBox();
  23067. modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
  23068. modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
  23069. return this.$nextTick();
  23070. },
  23071. selfClickEvent: function selfClickEvent(evnt) {
  23072. if (this.maskClosable && evnt.target === this.$el) {
  23073. var type = 'mask';
  23074. this.close(type);
  23075. }
  23076. },
  23077. updateZindex: function updateZindex() {
  23078. var zIndex = this.zIndex,
  23079. modalZindex = this.modalZindex;
  23080. if (zIndex) {
  23081. this.modalZindex = zIndex;
  23082. } else if (modalZindex < UtilTools.getLastZIndex()) {
  23083. this.modalZindex = UtilTools.nextZIndex();
  23084. }
  23085. },
  23086. closeEvent: function closeEvent(evnt) {
  23087. var type = 'close';
  23088. this.$emit(type, {
  23089. type: type,
  23090. $modal: this,
  23091. $event: evnt
  23092. }, evnt);
  23093. this.close(type);
  23094. },
  23095. confirmEvent: function confirmEvent(evnt) {
  23096. var type = 'confirm';
  23097. this.$emit(type, {
  23098. type: type,
  23099. $modal: this,
  23100. $event: evnt
  23101. }, evnt);
  23102. this.close(type);
  23103. },
  23104. cancelEvent: function cancelEvent(evnt) {
  23105. var type = 'cancel';
  23106. this.$emit(type, {
  23107. type: type,
  23108. $modal: this,
  23109. $event: evnt
  23110. }, evnt);
  23111. this.close(type);
  23112. },
  23113. open: function open() {
  23114. var _this3 = this;
  23115. var $refs = this.$refs,
  23116. _this$events2 = this.events,
  23117. events = _this$events2 === void 0 ? {} : _this$events2,
  23118. inited = this.inited,
  23119. duration = this.duration,
  23120. visible = this.visible,
  23121. isMsg = this.isMsg,
  23122. remember = this.remember,
  23123. showFooter = this.showFooter;
  23124. if (!inited) {
  23125. this.inited = true;
  23126. if (this.transfer) {
  23127. document.body.appendChild(this.$el);
  23128. }
  23129. }
  23130. if (!visible) {
  23131. var type = 'show';
  23132. var params = {
  23133. type: type,
  23134. $modal: this,
  23135. $event: {
  23136. type: type
  23137. }
  23138. };
  23139. if (!remember) {
  23140. this.recalculate();
  23141. }
  23142. this.visible = true;
  23143. this.contentVisible = false;
  23144. this.updateZindex();
  23145. activities.push(this);
  23146. this.$emit('activated', params);
  23147. setTimeout(function () {
  23148. _this3.contentVisible = true;
  23149. _this3.$nextTick(function () {
  23150. if (showFooter) {
  23151. var operBtn = $refs.confirmBtn || $refs.cancelBtn;
  23152. if (operBtn) {
  23153. operBtn.focus();
  23154. }
  23155. }
  23156. if (events.show) {
  23157. events.show.call(_this3, params);
  23158. } else {
  23159. _this3.$emit('input', true);
  23160. _this3.$emit('show', params);
  23161. }
  23162. });
  23163. }, 10);
  23164. if (isMsg) {
  23165. this.addMsgQueue();
  23166. if (duration !== -1) {
  23167. setTimeout(this.close, ctor_amd_xe_utils_default.a.toNumber(duration));
  23168. }
  23169. } else {
  23170. this.$nextTick(function () {
  23171. var firstOpen = _this3.firstOpen,
  23172. fullscreen = _this3.fullscreen;
  23173. if (!remember || !firstOpen) {
  23174. _this3.updatePosition().then(function () {
  23175. setTimeout(function () {
  23176. return _this3.updatePosition();
  23177. }, 20);
  23178. });
  23179. }
  23180. if (!firstOpen) {
  23181. _this3.firstOpen = true;
  23182. if (_this3.hasPosStorage()) {
  23183. _this3.restorePosStorage();
  23184. } else if (fullscreen) {
  23185. _this3.$nextTick(function () {
  23186. return _this3.maximize();
  23187. });
  23188. }
  23189. }
  23190. });
  23191. }
  23192. }
  23193. },
  23194. addMsgQueue: function addMsgQueue() {
  23195. if (src_queue.indexOf(this) === -1) {
  23196. src_queue.push(this);
  23197. }
  23198. this.updateStyle();
  23199. },
  23200. removeMsgQueue: function removeMsgQueue() {
  23201. var _this4 = this;
  23202. if (src_queue.indexOf(this) > -1) {
  23203. ctor_amd_xe_utils_default.a.remove(src_queue, function (comp) {
  23204. return comp === _this4;
  23205. });
  23206. }
  23207. this.updateStyle();
  23208. },
  23209. updateStyle: function updateStyle() {
  23210. this.$nextTick(function () {
  23211. var offsetTop = 0;
  23212. src_queue.forEach(function (comp) {
  23213. offsetTop += ctor_amd_xe_utils_default.a.toNumber(comp.top);
  23214. comp.modalTop = offsetTop;
  23215. offsetTop += comp.$refs.modalBox.clientHeight;
  23216. });
  23217. });
  23218. },
  23219. updatePosition: function updatePosition() {
  23220. var _this5 = this;
  23221. return this.$nextTick().then(function () {
  23222. var marginSize = _this5.marginSize,
  23223. position = _this5.position;
  23224. var modalBoxElem = _this5.getBox();
  23225. var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
  23226. var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
  23227. var isPosCenter = position === 'center';
  23228. var _ref2 = isPosCenter ? {
  23229. top: position,
  23230. left: position
  23231. } : Object.assign({}, position),
  23232. top = _ref2.top,
  23233. left = _ref2.left;
  23234. var topCenter = isPosCenter || top === 'center';
  23235. var leftCenter = isPosCenter || left === 'center';
  23236. var posTop = '';
  23237. var posLeft = '';
  23238. if (left && !leftCenter) {
  23239. posLeft = isNaN(left) ? left : "".concat(left, "px");
  23240. } else {
  23241. posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
  23242. }
  23243. if (top && !topCenter) {
  23244. posTop = isNaN(top) ? top : "".concat(top, "px");
  23245. } else {
  23246. posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
  23247. }
  23248. modalBoxElem.style.top = posTop;
  23249. modalBoxElem.style.left = posLeft;
  23250. });
  23251. },
  23252. close: function close(type) {
  23253. var _this6 = this;
  23254. var _this$events3 = this.events,
  23255. events = _this$events3 === void 0 ? {} : _this$events3,
  23256. remember = this.remember,
  23257. visible = this.visible,
  23258. isMsg = this.isMsg,
  23259. beforeHideMethod = this.beforeHideMethod;
  23260. var params = {
  23261. type: type,
  23262. $modal: this,
  23263. $event: {
  23264. type: type
  23265. }
  23266. };
  23267. if (visible) {
  23268. Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
  23269. if (!ctor_amd_xe_utils_default.a.isError(rest)) {
  23270. if (isMsg) {
  23271. _this6.removeMsgQueue();
  23272. }
  23273. _this6.contentVisible = false;
  23274. if (!remember) {
  23275. _this6.zoomLocat = null;
  23276. }
  23277. _this6.$emit('deactivated', params);
  23278. ctor_amd_xe_utils_default.a.remove(activities, function (item) {
  23279. return item === _this6;
  23280. });
  23281. setTimeout(function () {
  23282. _this6.visible = false;
  23283. if (events.hide) {
  23284. events.hide.call(_this6, params);
  23285. } else {
  23286. _this6.$emit('input', false);
  23287. _this6.$emit('hide', params);
  23288. }
  23289. }, 200);
  23290. }
  23291. }).catch(function (e) {
  23292. return e;
  23293. });
  23294. }
  23295. },
  23296. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  23297. var _this7 = this;
  23298. if (evnt.keyCode === 27) {
  23299. var lastModal = ctor_amd_xe_utils_default.a.max(activities, function (item) {
  23300. return item.modalZindex;
  23301. }); // 多个时,只关掉最上层的窗口
  23302. if (lastModal) {
  23303. setTimeout(function () {
  23304. if (lastModal === _this7 && lastModal.escClosable) {
  23305. _this7.close();
  23306. }
  23307. }, 10);
  23308. }
  23309. }
  23310. },
  23311. getBox: function getBox() {
  23312. return this.$refs.modalBox;
  23313. },
  23314. isMaximized: function isMaximized() {
  23315. return !!this.zoomLocat;
  23316. },
  23317. maximize: function maximize() {
  23318. var _this8 = this;
  23319. return this.$nextTick().then(function () {
  23320. var zoomLocat = _this8.zoomLocat;
  23321. if (!zoomLocat) {
  23322. var marginSize = _this8.marginSize;
  23323. var modalBoxElem = _this8.getBox();
  23324. var _DomTools$getDomNode = DomTools.getDomNode(),
  23325. visibleHeight = _DomTools$getDomNode.visibleHeight,
  23326. visibleWidth = _DomTools$getDomNode.visibleWidth;
  23327. _this8.zoomLocat = {
  23328. top: modalBoxElem.offsetTop,
  23329. left: modalBoxElem.offsetLeft,
  23330. width: modalBoxElem.offsetWidth + (modalBoxElem.style.width ? 0 : 1),
  23331. height: modalBoxElem.offsetHeight + (modalBoxElem.style.height ? 0 : 1)
  23332. };
  23333. Object.assign(modalBoxElem.style, {
  23334. top: "".concat(marginSize, "px"),
  23335. left: "".concat(marginSize, "px"),
  23336. width: "".concat(visibleWidth - marginSize * 2, "px"),
  23337. height: "".concat(visibleHeight - marginSize * 2, "px")
  23338. });
  23339. _this8.savePosStorage();
  23340. }
  23341. });
  23342. },
  23343. revert: function revert() {
  23344. var _this9 = this;
  23345. return this.$nextTick().then(function () {
  23346. var zoomLocat = _this9.zoomLocat;
  23347. if (zoomLocat) {
  23348. var modalBoxElem = _this9.getBox();
  23349. _this9.zoomLocat = null;
  23350. Object.assign(modalBoxElem.style, {
  23351. top: "".concat(zoomLocat.top, "px"),
  23352. left: "".concat(zoomLocat.left, "px"),
  23353. width: "".concat(zoomLocat.width, "px"),
  23354. height: "".concat(zoomLocat.height, "px")
  23355. });
  23356. _this9.savePosStorage();
  23357. }
  23358. });
  23359. },
  23360. zoom: function zoom() {
  23361. var _this10 = this;
  23362. return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
  23363. return _this10.isMaximized();
  23364. });
  23365. },
  23366. toggleZoomEvent: function toggleZoomEvent(evnt) {
  23367. var _this11 = this;
  23368. var $listeners = this.$listeners,
  23369. zoomLocat = this.zoomLocat,
  23370. _this$events4 = this.events,
  23371. events = _this$events4 === void 0 ? {} : _this$events4;
  23372. var params = {
  23373. type: zoomLocat ? 'revert' : 'max',
  23374. $modal: this,
  23375. $event: evnt
  23376. };
  23377. return this.zoom().then(function () {
  23378. if ($listeners.zoom) {
  23379. _this11.$emit('zoom', params, evnt);
  23380. } else if (events.zoom) {
  23381. events.zoom.call(_this11, params, evnt);
  23382. }
  23383. });
  23384. },
  23385. getPosition: function getPosition() {
  23386. if (!this.isMsg) {
  23387. var modalBoxElem = this.getBox();
  23388. if (modalBoxElem) {
  23389. return {
  23390. top: modalBoxElem.offsetTop,
  23391. left: modalBoxElem.offsetLeft
  23392. };
  23393. }
  23394. }
  23395. return null;
  23396. },
  23397. setPosition: function setPosition(top, left) {
  23398. if (!this.isMsg) {
  23399. var modalBoxElem = this.getBox();
  23400. if (ctor_amd_xe_utils_default.a.isNumber(top)) {
  23401. modalBoxElem.style.top = "".concat(top, "px");
  23402. }
  23403. if (ctor_amd_xe_utils_default.a.isNumber(left)) {
  23404. modalBoxElem.style.left = "".concat(left, "px");
  23405. }
  23406. }
  23407. return this.$nextTick();
  23408. },
  23409. boxMousedownEvent: function boxMousedownEvent() {
  23410. var modalZindex = this.modalZindex;
  23411. if (activeModals.some(function (_vm) {
  23412. return _vm.visible && _vm.modalZindex > modalZindex;
  23413. })) {
  23414. this.updateZindex();
  23415. }
  23416. },
  23417. mousedownEvent: function mousedownEvent(evnt) {
  23418. var _this12 = this;
  23419. var remember = this.remember,
  23420. storage = this.storage,
  23421. marginSize = this.marginSize,
  23422. zoomLocat = this.zoomLocat;
  23423. var modalBoxElem = this.getBox();
  23424. if (!zoomLocat && evnt.button === 0 && !DomTools.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
  23425. evnt.preventDefault();
  23426. var domMousemove = document.onmousemove;
  23427. var domMouseup = document.onmouseup;
  23428. var disX = evnt.clientX - modalBoxElem.offsetLeft;
  23429. var disY = evnt.clientY - modalBoxElem.offsetTop;
  23430. var _DomTools$getDomNode2 = DomTools.getDomNode(),
  23431. visibleHeight = _DomTools$getDomNode2.visibleHeight,
  23432. visibleWidth = _DomTools$getDomNode2.visibleWidth;
  23433. document.onmousemove = function (evnt) {
  23434. evnt.preventDefault();
  23435. var offsetWidth = modalBoxElem.offsetWidth;
  23436. var offsetHeight = modalBoxElem.offsetHeight;
  23437. var minX = marginSize;
  23438. var maxX = visibleWidth - offsetWidth - marginSize - 1;
  23439. var minY = marginSize;
  23440. var maxY = visibleHeight - offsetHeight - marginSize - 1;
  23441. var left = evnt.clientX - disX;
  23442. var top = evnt.clientY - disY;
  23443. if (left > maxX) {
  23444. left = maxX;
  23445. }
  23446. if (left < minX) {
  23447. left = minX;
  23448. }
  23449. if (top > maxY) {
  23450. top = maxY;
  23451. }
  23452. if (top < minY) {
  23453. top = minY;
  23454. }
  23455. modalBoxElem.style.left = "".concat(left, "px");
  23456. modalBoxElem.style.top = "".concat(top, "px");
  23457. };
  23458. document.onmouseup = function () {
  23459. document.onmousemove = domMousemove;
  23460. document.onmouseup = domMouseup;
  23461. if (remember && storage) {
  23462. _this12.$nextTick(function () {
  23463. _this12.savePosStorage();
  23464. });
  23465. }
  23466. };
  23467. }
  23468. },
  23469. dragEvent: function dragEvent(evnt) {
  23470. var _this13 = this;
  23471. evnt.preventDefault();
  23472. var $listeners = this.$listeners,
  23473. marginSize = this.marginSize,
  23474. _this$events5 = this.events,
  23475. events = _this$events5 === void 0 ? {} : _this$events5,
  23476. remember = this.remember,
  23477. storage = this.storage;
  23478. var _DomTools$getDomNode3 = DomTools.getDomNode(),
  23479. visibleHeight = _DomTools$getDomNode3.visibleHeight,
  23480. visibleWidth = _DomTools$getDomNode3.visibleWidth;
  23481. var type = evnt.target.dataset.type;
  23482. var minWidth = ctor_amd_xe_utils_default.a.toNumber(this.minWidth);
  23483. var minHeight = ctor_amd_xe_utils_default.a.toNumber(this.minHeight);
  23484. var maxWidth = visibleWidth;
  23485. var maxHeight = visibleHeight;
  23486. var modalBoxElem = this.getBox();
  23487. var domMousemove = document.onmousemove;
  23488. var domMouseup = document.onmouseup;
  23489. var clientWidth = modalBoxElem.clientWidth;
  23490. var clientHeight = modalBoxElem.clientHeight;
  23491. var disX = evnt.clientX;
  23492. var disY = evnt.clientY;
  23493. var offsetTop = modalBoxElem.offsetTop;
  23494. var offsetLeft = modalBoxElem.offsetLeft;
  23495. var params = {
  23496. type: 'resize',
  23497. $modal: this
  23498. };
  23499. document.onmousemove = function (evnt) {
  23500. evnt.preventDefault();
  23501. var dragLeft;
  23502. var dragTop;
  23503. var width;
  23504. var height;
  23505. switch (type) {
  23506. case 'wl':
  23507. dragLeft = disX - evnt.clientX;
  23508. width = dragLeft + clientWidth;
  23509. if (offsetLeft - dragLeft > marginSize) {
  23510. if (width > minWidth) {
  23511. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23512. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23513. }
  23514. }
  23515. break;
  23516. case 'swst':
  23517. dragLeft = disX - evnt.clientX;
  23518. dragTop = disY - evnt.clientY;
  23519. width = dragLeft + clientWidth;
  23520. height = dragTop + clientHeight;
  23521. if (offsetLeft - dragLeft > marginSize) {
  23522. if (width > minWidth) {
  23523. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23524. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23525. }
  23526. }
  23527. if (offsetTop - dragTop > marginSize) {
  23528. if (height > minHeight) {
  23529. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23530. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23531. }
  23532. }
  23533. break;
  23534. case 'swlb':
  23535. dragLeft = disX - evnt.clientX;
  23536. dragTop = evnt.clientY - disY;
  23537. width = dragLeft + clientWidth;
  23538. height = dragTop + clientHeight;
  23539. if (offsetLeft - dragLeft > marginSize) {
  23540. if (width > minWidth) {
  23541. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23542. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  23543. }
  23544. }
  23545. if (offsetTop + height + marginSize < visibleHeight) {
  23546. if (height > minHeight) {
  23547. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23548. }
  23549. }
  23550. break;
  23551. case 'st':
  23552. dragTop = disY - evnt.clientY;
  23553. height = clientHeight + dragTop;
  23554. if (offsetTop - dragTop > marginSize) {
  23555. if (height > minHeight) {
  23556. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23557. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23558. }
  23559. }
  23560. break;
  23561. case 'wr':
  23562. dragLeft = evnt.clientX - disX;
  23563. width = dragLeft + clientWidth;
  23564. if (offsetLeft + width + marginSize < visibleWidth) {
  23565. if (width > minWidth) {
  23566. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23567. }
  23568. }
  23569. break;
  23570. case 'sest':
  23571. dragLeft = evnt.clientX - disX;
  23572. dragTop = disY - evnt.clientY;
  23573. width = dragLeft + clientWidth;
  23574. height = dragTop + clientHeight;
  23575. if (offsetLeft + width + marginSize < visibleWidth) {
  23576. if (width > minWidth) {
  23577. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23578. }
  23579. }
  23580. if (offsetTop - dragTop > marginSize) {
  23581. if (height > minHeight) {
  23582. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23583. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  23584. }
  23585. }
  23586. break;
  23587. case 'selb':
  23588. dragLeft = evnt.clientX - disX;
  23589. dragTop = evnt.clientY - disY;
  23590. width = dragLeft + clientWidth;
  23591. height = dragTop + clientHeight;
  23592. if (offsetLeft + width + marginSize < visibleWidth) {
  23593. if (width > minWidth) {
  23594. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  23595. }
  23596. }
  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. case 'sb':
  23604. dragTop = evnt.clientY - disY;
  23605. height = dragTop + clientHeight;
  23606. if (offsetTop + height + marginSize < visibleHeight) {
  23607. if (height > minHeight) {
  23608. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  23609. }
  23610. }
  23611. break;
  23612. }
  23613. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
  23614. if (remember && storage) {
  23615. _this13.savePosStorage();
  23616. }
  23617. if ($listeners.zoom) {
  23618. _this13.$emit('zoom', params, evnt);
  23619. } else if (events.zoom) {
  23620. events.zoom.call(_this13, params, evnt);
  23621. }
  23622. };
  23623. document.onmouseup = function () {
  23624. _this13.zoomLocat = null;
  23625. document.onmousemove = domMousemove;
  23626. document.onmouseup = domMouseup;
  23627. setTimeout(function () {
  23628. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
  23629. }, 50);
  23630. };
  23631. },
  23632. getStorageMap: function getStorageMap(key) {
  23633. var version = conf.version;
  23634. var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  23635. return rest && rest._v === version ? rest : {
  23636. _v: version
  23637. };
  23638. },
  23639. hasPosStorage: function hasPosStorage() {
  23640. var id = this.id,
  23641. remember = this.remember,
  23642. storage = this.storage,
  23643. storageKey = this.storageKey;
  23644. return !!(remember && storage && this.getStorageMap(storageKey)[id]);
  23645. },
  23646. restorePosStorage: function restorePosStorage() {
  23647. var id = this.id,
  23648. remember = this.remember,
  23649. storage = this.storage,
  23650. storageKey = this.storageKey;
  23651. if (remember && storage) {
  23652. var posStorage = this.getStorageMap(storageKey)[id];
  23653. if (posStorage) {
  23654. var modalBoxElem = this.getBox();
  23655. var _posStorage$split = posStorage.split(','),
  23656. _posStorage$split2 = _slicedToArray(_posStorage$split, 8),
  23657. left = _posStorage$split2[0],
  23658. top = _posStorage$split2[1],
  23659. width = _posStorage$split2[2],
  23660. height = _posStorage$split2[3],
  23661. zoomLeft = _posStorage$split2[4],
  23662. zoomTop = _posStorage$split2[5],
  23663. zoomWidth = _posStorage$split2[6],
  23664. zoomHeight = _posStorage$split2[7];
  23665. if (left) {
  23666. modalBoxElem.style.left = "".concat(left, "px");
  23667. }
  23668. if (top) {
  23669. modalBoxElem.style.top = "".concat(top, "px");
  23670. }
  23671. if (width) {
  23672. modalBoxElem.style.width = "".concat(width, "px");
  23673. }
  23674. if (height) {
  23675. modalBoxElem.style.height = "".concat(height, "px");
  23676. }
  23677. if (zoomLeft && zoomTop) {
  23678. this.zoomLocat = {
  23679. left: zoomLeft,
  23680. top: zoomTop,
  23681. width: zoomWidth,
  23682. height: zoomHeight
  23683. };
  23684. }
  23685. }
  23686. }
  23687. },
  23688. savePosStorage: function savePosStorage() {
  23689. var id = this.id,
  23690. remember = this.remember,
  23691. storage = this.storage,
  23692. storageKey = this.storageKey,
  23693. zoomLocat = this.zoomLocat;
  23694. if (remember && storage) {
  23695. var modalBoxElem = this.getBox();
  23696. var posStorageMap = this.getStorageMap(storageKey);
  23697. 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) {
  23698. return val ? ctor_amd_xe_utils_default.a.toNumber(val) : '';
  23699. }).join(',');
  23700. localStorage.setItem(storageKey, ctor_amd_xe_utils_default.a.toJSONString(posStorageMap));
  23701. }
  23702. }
  23703. }
  23704. });
  23705. // CONCATENATED MODULE: ./packages/modal/index.js
  23706. /* eslint-disable @typescript-eslint/no-use-before-define */
  23707. var ModalClass = null;
  23708. function openModal(opts) {
  23709. var options = Object.assign({}, opts, {
  23710. transfer: true
  23711. });
  23712. return new Promise(function (resolve) {
  23713. if (options && options.id && activities.some(function (comp) {
  23714. return comp.id === options.id;
  23715. })) {
  23716. resolve('exist');
  23717. } else {
  23718. var events = options.events || {};
  23719. options.events = Object.assign({}, events, {
  23720. hide: function hide(params) {
  23721. if (events.hide) {
  23722. events.hide.call(this, params);
  23723. }
  23724. setTimeout(function () {
  23725. return $modal.$destroy();
  23726. }, $modal.isMsg ? 500 : 100);
  23727. resolve(params.type);
  23728. }
  23729. });
  23730. var $modal = new ModalClass({
  23731. el: document.createElement('div'),
  23732. propsData: options
  23733. });
  23734. setTimeout(function () {
  23735. if ($modal.isDestroy) {
  23736. $modal.close();
  23737. } else {
  23738. $modal.open();
  23739. }
  23740. });
  23741. }
  23742. });
  23743. }
  23744. function ModalController(options) {
  23745. UtilTools.warn('vxe.error.delFunc', ['Modal', 'Modal.open']);
  23746. return openModal(options);
  23747. }
  23748. ['alert', 'confirm', 'message'].forEach(function (type, index) {
  23749. var defOpts = index === 2 ? {
  23750. mask: false,
  23751. lockView: false,
  23752. showHeader: false
  23753. } : {
  23754. showFooter: true
  23755. };
  23756. defOpts.type = type;
  23757. defOpts.dblclickZoom = false;
  23758. if (index === 1) {
  23759. defOpts.status = 'question';
  23760. }
  23761. ModalController[type] = function (content, title, options) {
  23762. var opts = {};
  23763. if (ctor_amd_xe_utils_default.a.isObject(content)) {
  23764. opts = content;
  23765. } else {
  23766. if (title) {
  23767. opts = index === 2 ? {
  23768. status: title
  23769. } : {
  23770. title: title
  23771. };
  23772. }
  23773. opts.content = ctor_amd_xe_utils_default.a.toString(content);
  23774. }
  23775. return openModal(Object.assign({
  23776. type: type
  23777. }, defOpts, opts, options));
  23778. };
  23779. });
  23780. /**
  23781. * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
  23782. * 如果传 id 则关闭指定的窗口
  23783. * 如果不传则关闭所有窗口
  23784. */
  23785. function closeModal(id) {
  23786. var modals = arguments.length ? [getModal(id)] : activities;
  23787. modals.forEach(function ($modal) {
  23788. if ($modal) {
  23789. $modal.isDestroy = true;
  23790. $modal.close('close');
  23791. }
  23792. });
  23793. return Promise.resolve();
  23794. }
  23795. function getModal(id) {
  23796. return ctor_amd_xe_utils_default.a.find(activities, function ($modal) {
  23797. return $modal.id === id;
  23798. });
  23799. }
  23800. ModalController.closeAll = function () {
  23801. UtilTools.warn('vxe.error.delFunc', ['closeAll', 'close']);
  23802. closeModal();
  23803. };
  23804. ModalController.get = getModal;
  23805. ModalController.close = closeModal;
  23806. ModalController.open = openModal;
  23807. ModalController.install = function (Vue) {
  23808. v_x_e_table._modal = 1;
  23809. Vue.component('vxe-message', modal);
  23810. Vue.component(modal.name, modal);
  23811. ModalClass = Vue.extend(modal);
  23812. Vue.prototype.$XMsg = ModalController;
  23813. Vue.prototype.$XModal = ModalController;
  23814. v_x_e_table.$modal = ModalController;
  23815. v_x_e_table.modal = ModalController;
  23816. if (!Vue.prototype.$vxe) {
  23817. Vue.prototype.$vxe = {
  23818. modal: ModalController
  23819. };
  23820. } else {
  23821. Vue.prototype.$vxe.modal = ModalController;
  23822. }
  23823. };
  23824. var Modal = ModalController;
  23825. /* harmony default export */ var packages_modal = (ModalController);
  23826. // CONCATENATED MODULE: ./packages/tooltip/src/tooltip.js
  23827. function updateTipStyle(_vm) {
  23828. var wrapperElem = _vm.$el,
  23829. tipTarget = _vm.tipTarget,
  23830. tipStore = _vm.tipStore;
  23831. if (tipTarget) {
  23832. var _DomTools$getDomNode = DomTools.getDomNode(),
  23833. scrollTop = _DomTools$getDomNode.scrollTop,
  23834. scrollLeft = _DomTools$getDomNode.scrollLeft,
  23835. visibleWidth = _DomTools$getDomNode.visibleWidth;
  23836. var _DomTools$getAbsolute = DomTools.getAbsolutePos(tipTarget),
  23837. top = _DomTools$getAbsolute.top,
  23838. left = _DomTools$getAbsolute.left;
  23839. var marginSize = 6;
  23840. var offsetHeight = wrapperElem.offsetHeight;
  23841. var offsetWidth = wrapperElem.offsetWidth;
  23842. var tipLeft = left;
  23843. var tipTop = top - offsetHeight - marginSize;
  23844. tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
  23845. if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
  23846. tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
  23847. }
  23848. if (top - offsetHeight < scrollTop + marginSize) {
  23849. tipStore.placement = 'bottom';
  23850. tipTop = top + tipTarget.offsetHeight + marginSize;
  23851. }
  23852. tipStore.style.top = "".concat(tipTop, "px");
  23853. tipStore.style.left = "".concat(tipLeft, "px");
  23854. tipStore.arrowStyle.left = "".concat(left - tipLeft + tipTarget.offsetWidth / 2, "px");
  23855. }
  23856. }
  23857. /* harmony default export */ var src_tooltip = ({
  23858. name: 'VxeTooltip',
  23859. props: {
  23860. value: Boolean,
  23861. size: {
  23862. type: String,
  23863. default: function _default() {
  23864. return conf.tooltip.size || conf.size;
  23865. }
  23866. },
  23867. trigger: {
  23868. type: String,
  23869. default: function _default() {
  23870. return conf.tooltip.trigger;
  23871. }
  23872. },
  23873. theme: {
  23874. type: String,
  23875. default: function _default() {
  23876. return conf.tooltip.theme;
  23877. }
  23878. },
  23879. content: [String, Function],
  23880. zIndex: [String, Number],
  23881. isArrow: {
  23882. type: Boolean,
  23883. default: true
  23884. },
  23885. enterable: Boolean,
  23886. leaveDelay: {
  23887. type: Number,
  23888. default: conf.tooltip.leaveDelay
  23889. }
  23890. },
  23891. data: function data() {
  23892. return {
  23893. isUpdate: false,
  23894. isHover: false,
  23895. visible: false,
  23896. message: '',
  23897. tipTarget: null,
  23898. tipZindex: 0,
  23899. tipStore: {
  23900. style: {},
  23901. placement: '',
  23902. arrowStyle: null
  23903. }
  23904. };
  23905. },
  23906. computed: {
  23907. vSize: function vSize() {
  23908. return this.size || this.$parent.size || this.$parent.vSize;
  23909. }
  23910. },
  23911. watch: {
  23912. content: function content(value) {
  23913. this.message = value;
  23914. },
  23915. value: function value(_value) {
  23916. if (!this.isUpdate) {
  23917. this[_value ? 'open' : 'close']();
  23918. }
  23919. this.isUpdate = false;
  23920. }
  23921. },
  23922. mounted: function mounted() {
  23923. var $el = this.$el,
  23924. trigger = this.trigger,
  23925. content = this.content,
  23926. value = this.value;
  23927. var parentNode = $el.parentNode;
  23928. var target;
  23929. this.message = content;
  23930. this.tipZindex = UtilTools.nextZIndex();
  23931. ctor_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
  23932. if (index > 1) {
  23933. parentNode.insertBefore(elem, $el);
  23934. if (!target) {
  23935. target = elem;
  23936. }
  23937. }
  23938. });
  23939. parentNode.removeChild($el);
  23940. this.target = target;
  23941. if (target) {
  23942. if (trigger === 'hover') {
  23943. target.onmouseleave = this.targetMouseleaveEvent;
  23944. target.onmouseenter = this.targetMouseenterEvent;
  23945. } else if (trigger === 'click') {
  23946. target.onclick = this.clickEvent;
  23947. }
  23948. }
  23949. if (value) {
  23950. this.open();
  23951. }
  23952. },
  23953. beforeDestroy: function beforeDestroy() {
  23954. var $el = this.$el,
  23955. target = this.target,
  23956. trigger = this.trigger;
  23957. var parentNode = $el.parentNode;
  23958. if (parentNode) {
  23959. parentNode.removeChild($el);
  23960. }
  23961. if (target) {
  23962. if (trigger === 'hover') {
  23963. target.onmouseenter = null;
  23964. target.onmouseleave = null;
  23965. } else if (trigger === 'click') {
  23966. target.onclick = null;
  23967. }
  23968. }
  23969. },
  23970. render: function render(h) {
  23971. var _ref;
  23972. var vSize = this.vSize,
  23973. theme = this.theme,
  23974. message = this.message,
  23975. isHover = this.isHover,
  23976. isArrow = this.isArrow,
  23977. visible = this.visible,
  23978. tipStore = this.tipStore,
  23979. enterable = this.enterable;
  23980. var on;
  23981. if (enterable) {
  23982. on = {
  23983. mouseenter: this.wrapperMouseenterEvent,
  23984. mouseleave: this.wrapperMouseleaveEvent
  23985. };
  23986. }
  23987. return h('div', {
  23988. 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)],
  23989. style: tipStore.style,
  23990. ref: 'tipWrapper',
  23991. on: on
  23992. }, [h('div', {
  23993. class: 'vxe-table--tooltip-content'
  23994. }, this.$slots.content || message), h('div', {
  23995. class: 'vxe-table--tooltip-arrow',
  23996. style: tipStore.arrowStyle
  23997. })].concat(this.$slots.default));
  23998. },
  23999. methods: {
  24000. show: function show(target, message) {
  24001. return this.open(target, message);
  24002. },
  24003. open: function open(target, message) {
  24004. return this.toVisible(target || this.target, message);
  24005. },
  24006. close: function close() {
  24007. this.tipTarget = null;
  24008. Object.assign(this.tipStore, {
  24009. style: {},
  24010. placement: '',
  24011. arrowStyle: null
  24012. });
  24013. this.update(false);
  24014. return this.$nextTick();
  24015. },
  24016. update: function update(value) {
  24017. if (value !== this.visible) {
  24018. this.visible = value;
  24019. this.isUpdate = true;
  24020. if (this.$listeners.input) {
  24021. this.$emit('input', this.visible);
  24022. }
  24023. }
  24024. },
  24025. updateZindex: function updateZindex() {
  24026. if (this.tipZindex < UtilTools.getLastZIndex()) {
  24027. this.tipZindex = UtilTools.nextZIndex();
  24028. }
  24029. },
  24030. toVisible: function toVisible(target, message) {
  24031. this.targetActive = true;
  24032. if (target) {
  24033. var $el = this.$el,
  24034. tipStore = this.tipStore,
  24035. zIndex = this.zIndex;
  24036. var parentNode = $el.parentNode;
  24037. if (!parentNode) {
  24038. document.body.appendChild($el);
  24039. }
  24040. if (message) {
  24041. this.message = message;
  24042. }
  24043. this.tipTarget = target;
  24044. this.update(true);
  24045. this.updateZindex();
  24046. tipStore.placement = 'top';
  24047. tipStore.style = {
  24048. width: 'auto',
  24049. left: 0,
  24050. top: 0,
  24051. zIndex: zIndex || this.tipZindex
  24052. };
  24053. tipStore.arrowStyle = {
  24054. left: '50%'
  24055. };
  24056. return this.updatePlacement();
  24057. }
  24058. return this.$nextTick();
  24059. },
  24060. updatePlacement: function updatePlacement() {
  24061. var _this = this;
  24062. return this.$nextTick().then(function () {
  24063. var wrapperElem = _this.$el,
  24064. tipTarget = _this.tipTarget;
  24065. if (tipTarget && wrapperElem) {
  24066. updateTipStyle(_this);
  24067. return _this.$nextTick().then(function () {
  24068. return updateTipStyle(_this);
  24069. });
  24070. }
  24071. });
  24072. },
  24073. clickEvent: function clickEvent() {
  24074. this[this.visible ? 'close' : 'open']();
  24075. },
  24076. targetMouseenterEvent: function targetMouseenterEvent() {
  24077. this.open();
  24078. },
  24079. targetMouseleaveEvent: function targetMouseleaveEvent() {
  24080. var _this2 = this;
  24081. var trigger = this.trigger,
  24082. enterable = this.enterable,
  24083. leaveDelay = this.leaveDelay;
  24084. this.targetActive = false;
  24085. if (enterable && trigger === 'hover') {
  24086. setTimeout(function () {
  24087. if (!_this2.isHover) {
  24088. _this2.close();
  24089. }
  24090. }, leaveDelay);
  24091. } else {
  24092. this.close();
  24093. }
  24094. },
  24095. wrapperMouseenterEvent: function wrapperMouseenterEvent() {
  24096. this.isHover = true;
  24097. },
  24098. wrapperMouseleaveEvent: function wrapperMouseleaveEvent(evnt) {
  24099. var _this3 = this;
  24100. var $listeners = this.$listeners,
  24101. trigger = this.trigger,
  24102. enterable = this.enterable,
  24103. leaveDelay = this.leaveDelay;
  24104. this.isHover = false;
  24105. if ($listeners.leave) {
  24106. this.$emit('leave', {
  24107. $event: evnt
  24108. });
  24109. } else if (enterable && trigger === 'hover') {
  24110. setTimeout(function () {
  24111. if (!_this3.targetActive) {
  24112. _this3.close();
  24113. }
  24114. }, leaveDelay);
  24115. }
  24116. }
  24117. }
  24118. });
  24119. // CONCATENATED MODULE: ./packages/tooltip/index.js
  24120. src_tooltip.install = function (Vue) {
  24121. v_x_e_table._tooltip = 1;
  24122. Vue.component(src_tooltip.name, src_tooltip);
  24123. };
  24124. var Tooltip = src_tooltip;
  24125. /* harmony default export */ var packages_tooltip = (src_tooltip);
  24126. // CONCATENATED MODULE: ./packages/form/src/form.js
  24127. var form_Rule = /*#__PURE__*/function () {
  24128. function Rule(rule) {
  24129. _classCallCheck(this, Rule);
  24130. Object.assign(this, {
  24131. $options: rule,
  24132. required: rule.required,
  24133. min: rule.min,
  24134. max: rule.min,
  24135. type: rule.type,
  24136. pattern: rule.pattern,
  24137. validator: rule.validator,
  24138. trigger: rule.trigger,
  24139. maxWidth: rule.maxWidth
  24140. });
  24141. }
  24142. _createClass(Rule, [{
  24143. key: "content",
  24144. get: function get() {
  24145. return UtilTools.getFuncText(this.$options.content || this.$options.message);
  24146. }
  24147. }, {
  24148. key: "message",
  24149. get: function get() {
  24150. return this.content;
  24151. }
  24152. }]);
  24153. return Rule;
  24154. }();
  24155. function getResetValue(value, resetValue) {
  24156. if (ctor_amd_xe_utils_default.a.isArray(value)) {
  24157. resetValue = [];
  24158. }
  24159. return resetValue;
  24160. }
  24161. function getItemSlots(_vm, item) {
  24162. var $scopedSlots = _vm.$scopedSlots;
  24163. var itemSlots = item.slots;
  24164. var slots = {};
  24165. var $default;
  24166. if (itemSlots) {
  24167. $default = itemSlots.default;
  24168. if ($default && $scopedSlots[$default]) {
  24169. $default = $scopedSlots[$default];
  24170. }
  24171. }
  24172. if ($default) {
  24173. slots.default = $default;
  24174. }
  24175. return slots;
  24176. }
  24177. function renderItems(h, _vm) {
  24178. var items = _vm.items;
  24179. return items ? items.map(function (item) {
  24180. return h('vxe-form-item', {
  24181. props: item,
  24182. scopedSlots: getItemSlots(_vm, item)
  24183. });
  24184. }) : [];
  24185. }
  24186. /* harmony default export */ var src_form = ({
  24187. name: 'VxeForm',
  24188. props: {
  24189. loading: Boolean,
  24190. data: Object,
  24191. size: {
  24192. type: String,
  24193. default: function _default() {
  24194. return conf.form.size || conf.size;
  24195. }
  24196. },
  24197. span: [String, Number],
  24198. align: {
  24199. type: String,
  24200. default: function _default() {
  24201. return conf.form.align;
  24202. }
  24203. },
  24204. titleAlign: {
  24205. type: String,
  24206. default: function _default() {
  24207. return conf.form.titleAlign;
  24208. }
  24209. },
  24210. titleWidth: [String, Number],
  24211. titleColon: {
  24212. type: Boolean,
  24213. default: function _default() {
  24214. return conf.form.titleColon;
  24215. }
  24216. },
  24217. titleAsterisk: {
  24218. type: Boolean,
  24219. default: function _default() {
  24220. return conf.form.titleAsterisk;
  24221. }
  24222. },
  24223. titleOverflow: {
  24224. type: [Boolean, String],
  24225. default: null
  24226. },
  24227. items: Array,
  24228. rules: Object,
  24229. preventSubmit: {
  24230. type: Boolean,
  24231. default: function _default() {
  24232. return conf.form.preventSubmit;
  24233. }
  24234. },
  24235. validConfig: Object
  24236. },
  24237. data: function data() {
  24238. return {
  24239. collapseAll: true,
  24240. invalids: [],
  24241. tooltipTimeout: null,
  24242. tooltipActive: false,
  24243. tooltipStore: {
  24244. item: null,
  24245. visible: false
  24246. }
  24247. };
  24248. },
  24249. provide: function provide() {
  24250. return {
  24251. $vxeform: this
  24252. };
  24253. },
  24254. computed: {
  24255. vSize: function vSize() {
  24256. return this.size || this.$parent.size || this.$parent.vSize;
  24257. },
  24258. validOpts: function validOpts() {
  24259. return Object.assign({}, conf.form.validConfig, this.validConfig);
  24260. },
  24261. tooltipOpts: function tooltipOpts() {
  24262. var opts = Object.assign({
  24263. leaveDelay: 300
  24264. }, conf.form.tooltipConfig, this.tooltipConfig);
  24265. if (opts.enterable) {
  24266. opts.leaveMethod = this.handleTooltipLeaveMethod;
  24267. }
  24268. return opts;
  24269. }
  24270. },
  24271. render: function render(h) {
  24272. var _ref;
  24273. var _e = this._e,
  24274. $slots = this.$slots,
  24275. loading = this.loading,
  24276. vSize = this.vSize,
  24277. tooltipOpts = this.tooltipOpts;
  24278. var hasUseTooltip = v_x_e_table._tooltip;
  24279. return h('form', {
  24280. 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)],
  24281. on: {
  24282. submit: this.submitEvent,
  24283. reset: this.resetEvent
  24284. }
  24285. }, [].concat($slots.default || renderItems(h, this)).concat([h('div', {
  24286. class: ['vxe-loading', {
  24287. 'is--visible': loading
  24288. }]
  24289. }, [h('div', {
  24290. class: 'vxe-loading--spinner'
  24291. })]),
  24292. /**
  24293. * 工具提示
  24294. */
  24295. hasUseTooltip ? h('vxe-tooltip', _objectSpread2({
  24296. ref: 'tooltip'
  24297. }, tooltipOpts)) : _e()]));
  24298. },
  24299. methods: {
  24300. getItems: function getItems() {
  24301. return this.$children.map(function (_ref2) {
  24302. var field = _ref2.field,
  24303. title = _ref2.title,
  24304. itemRender = _ref2.itemRender;
  24305. return {
  24306. field: field,
  24307. title: title,
  24308. itemRender: itemRender
  24309. };
  24310. });
  24311. },
  24312. toggleCollapse: function toggleCollapse() {
  24313. this.collapseAll = !this.collapseAll;
  24314. return this.$nextTick();
  24315. },
  24316. submitEvent: function submitEvent(evnt) {
  24317. var _this = this;
  24318. evnt.preventDefault();
  24319. if (!this.preventSubmit) {
  24320. this.beginValidate().then(function () {
  24321. _this.$emit('submit', {
  24322. data: _this.data,
  24323. $form: _this,
  24324. $event: evnt
  24325. }, evnt);
  24326. }).catch(function (errMap) {
  24327. _this.$emit('submit-invalid', {
  24328. data: _this.data,
  24329. errMap: errMap,
  24330. $form: _this,
  24331. $event: evnt
  24332. }, evnt);
  24333. });
  24334. }
  24335. },
  24336. reset: function reset() {
  24337. var _this2 = this;
  24338. var data = this.data;
  24339. if (data) {
  24340. this.$children.forEach(function (_ref3) {
  24341. var field = _ref3.field,
  24342. resetValue = _ref3.resetValue,
  24343. itemRender = _ref3.itemRender;
  24344. if (field) {
  24345. ctor_amd_xe_utils_default.a.set(data, field, resetValue === null ? getResetValue(ctor_amd_xe_utils_default.a.get(data, field), undefined) : resetValue);
  24346. var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
  24347. if (compConf && compConf.itemResetMethod) {
  24348. compConf.itemResetMethod({
  24349. data: data,
  24350. property: field,
  24351. $form: _this2
  24352. });
  24353. }
  24354. }
  24355. });
  24356. }
  24357. return this.clearValidate();
  24358. },
  24359. resetEvent: function resetEvent(evnt) {
  24360. evnt.preventDefault();
  24361. this.reset();
  24362. this.$emit('reset', {
  24363. data: this.data,
  24364. $form: this,
  24365. $event: evnt
  24366. }, evnt);
  24367. },
  24368. handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
  24369. var _this3 = this;
  24370. var tooltipOpts = this.tooltipOpts;
  24371. setTimeout(function () {
  24372. if (!_this3.tooltipActive) {
  24373. _this3.closeTooltip();
  24374. }
  24375. }, tooltipOpts.leaveDelay);
  24376. return false;
  24377. },
  24378. closeTooltip: function closeTooltip() {
  24379. var tooltipStore = this.tooltipStore;
  24380. var $tooltip = this.$refs.tooltip;
  24381. if (tooltipStore.visible) {
  24382. Object.assign(tooltipStore, {
  24383. item: null,
  24384. visible: false
  24385. });
  24386. if ($tooltip) {
  24387. $tooltip.close();
  24388. }
  24389. }
  24390. return this.$nextTick();
  24391. },
  24392. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  24393. var item = params.item;
  24394. var tooltipStore = this.tooltipStore;
  24395. var $tooltip = this.$refs.tooltip;
  24396. var overflowElem = evnt.currentTarget;
  24397. var content = (overflowElem.textContent || '').trim();
  24398. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  24399. clearTimeout(this.tooltipTimeout);
  24400. this.tooltipActive = true;
  24401. this.closeTooltip();
  24402. if (content && isCellOverflow) {
  24403. Object.assign(tooltipStore, {
  24404. item: item,
  24405. visible: true
  24406. });
  24407. if ($tooltip) {
  24408. $tooltip.open(overflowElem, content);
  24409. }
  24410. }
  24411. },
  24412. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  24413. var _this4 = this;
  24414. var tooltipOpts = this.tooltipOpts;
  24415. this.tooltipActive = false;
  24416. if (tooltipOpts.enterable) {
  24417. this.tooltipTimeout = setTimeout(function () {
  24418. var $tooltip = _this4.$refs.tooltip;
  24419. if ($tooltip && !$tooltip.isHover) {
  24420. _this4.closeTooltip();
  24421. }
  24422. }, tooltipOpts.leaveDelay);
  24423. } else {
  24424. this.closeTooltip();
  24425. }
  24426. },
  24427. clearValidate: function clearValidate(field) {
  24428. if (field) {
  24429. ctor_amd_xe_utils_default.a.remove(this.invalids, function (_ref4) {
  24430. var property = _ref4.property;
  24431. return property === field;
  24432. });
  24433. } else {
  24434. this.invalids = [];
  24435. }
  24436. return this.$nextTick();
  24437. },
  24438. validate: function validate(callback) {
  24439. return this.beginValidate('', callback);
  24440. },
  24441. beginValidate: function beginValidate(type, callback) {
  24442. var _this5 = this;
  24443. var data = this.data,
  24444. formRules = this.rules,
  24445. validOpts = this.validOpts;
  24446. var validRest = {};
  24447. var validFields = [];
  24448. var itemValids = [];
  24449. this.clearValidate();
  24450. if (data && formRules) {
  24451. this.$children.forEach(function (_ref5) {
  24452. var field = _ref5.field;
  24453. if (field) {
  24454. itemValids.push(_this5.validItemRules(type || 'all', field).catch(function (_ref6) {
  24455. var rule = _ref6.rule,
  24456. rules = _ref6.rules;
  24457. var rest = {
  24458. rule: rule,
  24459. rules: rules,
  24460. data: data,
  24461. property: field,
  24462. $form: _this5
  24463. };
  24464. if (!validRest[field]) {
  24465. validRest[field] = [];
  24466. }
  24467. validRest[field].push(rest);
  24468. validFields.push(field);
  24469. _this5.invalids.push(rest);
  24470. return Promise.reject(rest);
  24471. }));
  24472. }
  24473. });
  24474. return Promise.all(itemValids).then(function () {
  24475. if (callback) {
  24476. callback();
  24477. }
  24478. }).catch(function () {
  24479. if (callback) {
  24480. callback(validRest);
  24481. }
  24482. if (validOpts.autoPos) {
  24483. _this5.$nextTick(function () {
  24484. _this5.handleFocus(validFields);
  24485. });
  24486. }
  24487. return Promise.reject(validRest);
  24488. });
  24489. }
  24490. if (callback) {
  24491. callback();
  24492. }
  24493. return Promise.resolve();
  24494. },
  24495. /**
  24496. * 校验数据
  24497. * 按表格行、列顺序依次校验(同步或异步)
  24498. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  24499. * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
  24500. * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
  24501. *
  24502. * rule 配置:
  24503. * required=Boolean 是否必填
  24504. * min=Number 最小长度
  24505. * max=Number 最大长度
  24506. * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
  24507. * trigger=change 触发方式
  24508. */
  24509. validItemRules: function validItemRules(type, property, val) {
  24510. var _this6 = this;
  24511. var data = this.data,
  24512. formRules = this.rules;
  24513. var errorRules = [];
  24514. var syncVailds = [];
  24515. if (property && formRules) {
  24516. var rules = ctor_amd_xe_utils_default.a.get(formRules, property);
  24517. if (rules) {
  24518. var itemValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(data, property) : val;
  24519. rules.forEach(function (rule) {
  24520. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  24521. if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
  24522. var customValid = rule.validator({
  24523. itemValue: itemValue,
  24524. rule: rule,
  24525. rules: rules,
  24526. data: data,
  24527. property: property,
  24528. $form: _this6
  24529. });
  24530. if (customValid) {
  24531. if (ctor_amd_xe_utils_default.a.isError(customValid)) {
  24532. errorRules.push(new form_Rule({
  24533. type: 'custom',
  24534. trigger: rule.trigger,
  24535. message: customValid.message,
  24536. rule: new form_Rule(rule)
  24537. }));
  24538. } else if (customValid.catch) {
  24539. // 如果为异步校验(注:异步校验是并发无序的)
  24540. syncVailds.push(customValid.catch(function (e) {
  24541. errorRules.push(new form_Rule({
  24542. type: 'custom',
  24543. trigger: rule.trigger,
  24544. message: e ? e.message : rule.content || rule.message,
  24545. rule: new form_Rule(rule)
  24546. }));
  24547. }));
  24548. }
  24549. }
  24550. } else {
  24551. var isNumber = rule.type === 'number';
  24552. var numVal = isNumber ? ctor_amd_xe_utils_default.a.toNumber(itemValue) : ctor_amd_xe_utils_default.a.getSize(itemValue);
  24553. if (itemValue === null || itemValue === undefined || itemValue === '') {
  24554. if (rule.required) {
  24555. errorRules.push(new form_Rule(rule));
  24556. }
  24557. } 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)) {
  24558. errorRules.push(new form_Rule(rule));
  24559. }
  24560. }
  24561. }
  24562. });
  24563. }
  24564. }
  24565. return Promise.all(syncVailds).then(function () {
  24566. if (errorRules.length) {
  24567. var rest = {
  24568. rules: errorRules,
  24569. rule: errorRules[0]
  24570. };
  24571. return Promise.reject(rest);
  24572. }
  24573. });
  24574. },
  24575. handleFocus: function handleFocus(fields) {
  24576. var $children = this.$children;
  24577. fields.some(function (property) {
  24578. var comp = ctor_amd_xe_utils_default.a.find($children, function (item) {
  24579. return item.field === property;
  24580. });
  24581. if (comp && comp.itemRender) {
  24582. var $el = comp.$el,
  24583. itemRender = comp.itemRender;
  24584. var compConf = v_x_e_table.renderer.get(itemRender.name);
  24585. var inputElem; // 如果指定了聚焦 class
  24586. if (itemRender.autofocus) {
  24587. inputElem = $el.querySelector(itemRender.autofocus);
  24588. } // 渲染器的聚焦处理
  24589. if (!inputElem && compConf && compConf.autofocus) {
  24590. inputElem = $el.querySelector(compConf.autofocus);
  24591. }
  24592. if (inputElem) {
  24593. inputElem.focus(); // 保持一致行为,光标移到末端
  24594. if (DomTools.browse.msie) {
  24595. var textRange = inputElem.createTextRange();
  24596. textRange.collapse(false);
  24597. textRange.select();
  24598. }
  24599. return true;
  24600. }
  24601. }
  24602. });
  24603. },
  24604. /**
  24605. * 更新项状态
  24606. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
  24607. * 如果单元格配置了校验规则,则会进行校验
  24608. */
  24609. updateStatus: function updateStatus(scope, itemValue) {
  24610. var _this7 = this;
  24611. var property = scope.property;
  24612. if (property) {
  24613. this.validItemRules('change', property, itemValue).then(function () {
  24614. _this7.clearValidate(property);
  24615. }).catch(function (_ref7) {
  24616. var rule = _ref7.rule,
  24617. rules = _ref7.rules;
  24618. var rest = ctor_amd_xe_utils_default.a.find(_this7.invalids, function (rest) {
  24619. return rest.property === property;
  24620. });
  24621. if (rest) {
  24622. rest.rule = rule;
  24623. rest.rules = rules;
  24624. } else {
  24625. _this7.invalids.push({
  24626. rule: rule,
  24627. rules: rules,
  24628. property: property
  24629. });
  24630. }
  24631. });
  24632. }
  24633. }
  24634. }
  24635. });
  24636. // CONCATENATED MODULE: ./packages/form/src/form-item.js
  24637. function renderPrefixIcon(h, titlePrefix) {
  24638. return h('span', {
  24639. class: 'vxe-form--item-title-prefix'
  24640. }, [h('i', {
  24641. class: titlePrefix.icon || conf.icon.FORM_PREFIX
  24642. })]);
  24643. }
  24644. function form_item_renderSuffixIcon(h, titleSuffix) {
  24645. return h('span', {
  24646. class: 'vxe-form--item-title-suffix'
  24647. }, [h('i', {
  24648. class: titleSuffix.icon || conf.icon.FORM_SUFFIX
  24649. })]);
  24650. }
  24651. function renderTitle(h, _vm) {
  24652. var title = _vm.title,
  24653. titlePrefix = _vm.titlePrefix,
  24654. titleSuffix = _vm.titleSuffix;
  24655. var titles = [];
  24656. if (titlePrefix) {
  24657. titles.push(titlePrefix.content || titlePrefix.message ? h('vxe-tooltip', {
  24658. props: {
  24659. content: UtilTools.getFuncText(titlePrefix.content || titlePrefix.message),
  24660. enterable: titlePrefix.enterable,
  24661. theme: titlePrefix.theme
  24662. }
  24663. }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
  24664. }
  24665. titles.push(h('span', {
  24666. class: 'vxe-form--item-title-label'
  24667. }, UtilTools.getFuncText(title)));
  24668. if (titleSuffix) {
  24669. titles.push(titleSuffix.content || titleSuffix.message ? h('vxe-tooltip', {
  24670. props: {
  24671. content: UtilTools.getFuncText(titleSuffix.content || titleSuffix.message),
  24672. enterable: titleSuffix.enterable,
  24673. theme: titleSuffix.theme
  24674. }
  24675. }, [form_item_renderSuffixIcon(h, titleSuffix)]) : form_item_renderSuffixIcon(h, titleSuffix));
  24676. }
  24677. return titles;
  24678. }
  24679. /* harmony default export */ var form_item = ({
  24680. name: 'VxeFormItem',
  24681. props: {
  24682. title: String,
  24683. field: String,
  24684. size: String,
  24685. span: [String, Number],
  24686. align: String,
  24687. titleAlign: String,
  24688. titleWidth: [String, Number],
  24689. className: [String, Function],
  24690. titleOverflow: {
  24691. type: [Boolean, String],
  24692. default: null
  24693. },
  24694. titlePrefix: Object,
  24695. titleSuffix: Object,
  24696. resetValue: {
  24697. default: null
  24698. },
  24699. visible: {
  24700. type: Boolean,
  24701. default: null
  24702. },
  24703. visibleMethod: Function,
  24704. folding: Boolean,
  24705. collapseNode: Boolean,
  24706. itemRender: Object
  24707. },
  24708. inject: {
  24709. $vxeform: {
  24710. default: null
  24711. }
  24712. },
  24713. data: function data() {
  24714. return {
  24715. showError: false,
  24716. showRule: null
  24717. };
  24718. },
  24719. computed: {
  24720. vSize: function vSize() {
  24721. return this.size || this.$parent.size || this.$parent.vSize;
  24722. },
  24723. isRequired: function isRequired() {
  24724. var $vxeform = this.$vxeform,
  24725. field = this.field;
  24726. if ($vxeform && $vxeform.rules) {
  24727. var rules = $vxeform.rules[field];
  24728. if (rules) {
  24729. return rules.some(function (rule) {
  24730. return rule.required;
  24731. });
  24732. }
  24733. }
  24734. return false;
  24735. },
  24736. errRule: function errRule() {
  24737. var $vxeform = this.$vxeform,
  24738. field = this.field;
  24739. if ($vxeform) {
  24740. return ctor_amd_xe_utils_default.a.find($vxeform.invalids, function (_ref) {
  24741. var property = _ref.property;
  24742. return field === property;
  24743. });
  24744. }
  24745. return null;
  24746. }
  24747. },
  24748. watch: {
  24749. errRule: function errRule(value) {
  24750. var _this = this;
  24751. clearTimeout(this.showErrTimeout);
  24752. this.showError = false;
  24753. if (value) {
  24754. this.showRule = value.rule;
  24755. setTimeout(function () {
  24756. _this.showError = true;
  24757. }, 30);
  24758. } else {
  24759. this.showErrTimeout = setTimeout(function () {
  24760. _this.showRule = null;
  24761. }, 350);
  24762. }
  24763. }
  24764. },
  24765. render: function render(h) {
  24766. var _e = this._e,
  24767. $scopedSlots = this.$scopedSlots,
  24768. $vxeform = this.$vxeform,
  24769. title = this.title,
  24770. folding = this.folding,
  24771. visible = this.visible,
  24772. visibleMethod = this.visibleMethod,
  24773. field = this.field,
  24774. className = this.className,
  24775. collapseNode = this.collapseNode,
  24776. itemRender = this.itemRender,
  24777. isRequired = this.isRequired,
  24778. showError = this.showError,
  24779. showRule = this.showRule,
  24780. titleOverflow = this.titleOverflow;
  24781. var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
  24782. var span = this.span || $vxeform.span;
  24783. var align = this.align || $vxeform.align;
  24784. var titleAlign = this.titleAlign || $vxeform.titleAlign;
  24785. var titleWidth = this.titleWidth || $vxeform.titleWidth;
  24786. var collapseAll = $vxeform.collapseAll;
  24787. var itemVisibleMethod = visibleMethod;
  24788. var itemOverflow = ctor_amd_xe_utils_default.a.isUndefined(titleOverflow) || ctor_amd_xe_utils_default.a.isNull(titleOverflow) ? $vxeform.titleOverflow : titleOverflow;
  24789. var showEllipsis = itemOverflow === 'ellipsis';
  24790. var showTitle = itemOverflow === 'title';
  24791. var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
  24792. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  24793. var params = {
  24794. data: $vxeform.data,
  24795. property: field,
  24796. item: this,
  24797. $form: $vxeform
  24798. };
  24799. if (visible === false) {
  24800. return _e();
  24801. }
  24802. if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
  24803. itemVisibleMethod = compConf.itemVisibleMethod;
  24804. }
  24805. var contentVNs = [];
  24806. if (compConf && compConf.renderItemContent) {
  24807. contentVNs = compConf.renderItemContent.call(this, h, itemRender, params);
  24808. } else if (compConf && compConf.renderItem) {
  24809. // 在 v4 中废弃 renderItem
  24810. UtilTools.warn('vxe.error.delFunc', ['renderItem', 'renderItemContent']);
  24811. contentVNs = compConf.renderItem.call(this, h, itemRender, params);
  24812. } else if ($scopedSlots && $scopedSlots.default) {
  24813. contentVNs = $scopedSlots.default.call(this, params, h);
  24814. } else if (field) {
  24815. contentVNs = ["".concat(ctor_amd_xe_utils_default.a.get($vxeform.data, field))];
  24816. }
  24817. var ons = showTooltip && $vxeform ? {
  24818. mouseenter: function mouseenter(evnt) {
  24819. $vxeform.triggerHeaderHelpEvent(evnt, params);
  24820. },
  24821. mouseleave: $vxeform.handleTargetLeaveEvent
  24822. } : {};
  24823. return h('div', {
  24824. class: ['vxe-form--item', span ? "vxe-col--".concat(span, " is--span") : null, className, {
  24825. 'is--title': title,
  24826. 'is--required': isRequired,
  24827. 'is--hidden': folding && collapseAll,
  24828. 'is--active': !itemVisibleMethod || itemVisibleMethod(params),
  24829. 'is--error': showError
  24830. }]
  24831. }, [h('div', {
  24832. class: 'vxe-form--item-inner'
  24833. }, [title ? h('div', {
  24834. class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
  24835. 'is--ellipsis': hasEllipsis
  24836. }],
  24837. style: titleWidth ? {
  24838. width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
  24839. } : null,
  24840. attrs: {
  24841. title: showTitle ? UtilTools.getFuncText(title) : null
  24842. },
  24843. on: ons
  24844. }, renderTitle(h, this)) : null, h('div', {
  24845. class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
  24846. }, contentVNs.concat([collapseNode ? h('div', {
  24847. class: 'vxe-form--item-trigger-node',
  24848. on: {
  24849. click: this.toggleCollapseEvent
  24850. }
  24851. }, [h('span', {
  24852. class: 'vxe-form--item-trigger-text'
  24853. }, collapseAll ? conf.i18n('vxe.form.unfolding') : conf.i18n('vxe.form.folding')), h('i', {
  24854. class: ['vxe-form--item-trigger-icon', collapseAll ? conf.icon.FORM_FOLDING : conf.icon.FORM_UNFOLDING]
  24855. })]) : null, showRule && $vxeform.validOpts.showMessage ? h('div', {
  24856. class: 'vxe-form--item-valid',
  24857. style: showRule.maxWidth ? {
  24858. width: "".concat(showRule.maxWidth, "px")
  24859. } : null
  24860. }, showRule.message) : null]))])]);
  24861. },
  24862. methods: {
  24863. toggleCollapseEvent: function toggleCollapseEvent(evnt) {
  24864. var $form = this.$vxeform;
  24865. $form.toggleCollapse();
  24866. $form.$emit('toggle-collapse', {
  24867. collapse: !$form.collapseAll,
  24868. data: $form.data,
  24869. $form: $form,
  24870. $event: evnt
  24871. }, evnt);
  24872. }
  24873. }
  24874. });
  24875. // CONCATENATED MODULE: ./packages/form/index.js
  24876. src_form.install = function (Vue) {
  24877. Vue.component(src_form.name, src_form);
  24878. Vue.component(form_item.name, form_item);
  24879. };
  24880. var Form = src_form;
  24881. /* harmony default export */ var packages_form = (src_form);
  24882. // CONCATENATED MODULE: ./packages/select/src/select.js
  24883. function isOptionVisible(option) {
  24884. return option.visible !== false;
  24885. }
  24886. function getOptUniqueId() {
  24887. return ctor_amd_xe_utils_default.a.uniqueId('opt_');
  24888. }
  24889. function getOptkey(_vm) {
  24890. return _vm.optionId || _vm.optId || '_XID';
  24891. }
  24892. function getOptid(_vm, option) {
  24893. var optid = option[getOptkey(_vm)];
  24894. return optid ? encodeURIComponent(optid) : '';
  24895. }
  24896. function findOffsetOption(_vm, optionValue, isUpArrow) {
  24897. var isGroup = _vm.isGroup,
  24898. visibleOptionList = _vm.visibleOptionList,
  24899. visibleGroupList = _vm.visibleGroupList,
  24900. valueField = _vm.valueField,
  24901. groupOptionsField = _vm.groupOptionsField;
  24902. var firstOption;
  24903. var prevOption;
  24904. var nextOption;
  24905. var currOption;
  24906. if (isGroup) {
  24907. for (var gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
  24908. var group = visibleGroupList[gIndex];
  24909. var groupOptionList = group[groupOptionsField];
  24910. var isGroupDisabled = group.disabled;
  24911. if (groupOptionList) {
  24912. for (var index = 0; index < groupOptionList.length; index++) {
  24913. var option = groupOptionList[index];
  24914. var isVisible = isOptionVisible(option);
  24915. var isDisabled = isGroupDisabled || option.disabled;
  24916. if (!firstOption && !isDisabled) {
  24917. firstOption = option;
  24918. }
  24919. if (currOption) {
  24920. if (isVisible && !isDisabled) {
  24921. nextOption = option;
  24922. if (!isUpArrow) {
  24923. return {
  24924. offsetOption: nextOption
  24925. };
  24926. }
  24927. }
  24928. }
  24929. if (optionValue === option[valueField]) {
  24930. currOption = option;
  24931. if (isUpArrow) {
  24932. return {
  24933. offsetOption: prevOption
  24934. };
  24935. }
  24936. } else {
  24937. if (isVisible && !isDisabled) {
  24938. prevOption = option;
  24939. }
  24940. }
  24941. }
  24942. }
  24943. }
  24944. } else {
  24945. for (var _index = 0; _index < visibleOptionList.length; _index++) {
  24946. var _option = visibleOptionList[_index];
  24947. var _isDisabled = _option.disabled;
  24948. if (!firstOption && !_isDisabled) {
  24949. firstOption = _option;
  24950. }
  24951. if (currOption) {
  24952. if (!_isDisabled) {
  24953. nextOption = _option;
  24954. if (!isUpArrow) {
  24955. return {
  24956. offsetOption: nextOption
  24957. };
  24958. }
  24959. }
  24960. }
  24961. if (optionValue === _option[valueField]) {
  24962. currOption = _option;
  24963. if (isUpArrow) {
  24964. return {
  24965. offsetOption: prevOption
  24966. };
  24967. }
  24968. } else {
  24969. if (!_isDisabled) {
  24970. prevOption = _option;
  24971. }
  24972. }
  24973. }
  24974. }
  24975. return {
  24976. firstOption: firstOption
  24977. };
  24978. }
  24979. function findOption(_vm, optionValue) {
  24980. var isGroup = _vm.isGroup,
  24981. fullOptionList = _vm.fullOptionList,
  24982. fullGroupList = _vm.fullGroupList,
  24983. valueField = _vm.valueField;
  24984. if (isGroup) {
  24985. for (var gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
  24986. var group = fullGroupList[gIndex];
  24987. if (group.options) {
  24988. for (var index = 0; index < group.options.length; index++) {
  24989. var option = group.options[index];
  24990. if (optionValue === option[valueField]) {
  24991. return option;
  24992. }
  24993. }
  24994. }
  24995. }
  24996. }
  24997. return fullOptionList.find(function (item) {
  24998. return optionValue === item[valueField];
  24999. });
  25000. }
  25001. function getSelectLabel(_vm, value) {
  25002. var item = findOption(_vm, value);
  25003. return ctor_amd_xe_utils_default.a.toString(item ? item[_vm.labelField] : value);
  25004. }
  25005. function renderOption(h, _vm, list, group) {
  25006. var isGroup = _vm.isGroup,
  25007. labelField = _vm.labelField,
  25008. valueField = _vm.valueField,
  25009. optkey = _vm.optkey,
  25010. optionKey = _vm.optionKey,
  25011. value = _vm.value,
  25012. multiple = _vm.multiple,
  25013. currentValue = _vm.currentValue;
  25014. return list.map(function (option, cIndex) {
  25015. var isVisible = !isGroup || isOptionVisible(option);
  25016. var isDisabled = group && group.disabled || option.disabled;
  25017. var optionValue = option[valueField];
  25018. var optid = getOptid(_vm, option);
  25019. return isVisible ? h('div', {
  25020. key: optionKey || optkey ? optid : cIndex,
  25021. class: ['vxe-select-option', {
  25022. 'is--disabled': isDisabled,
  25023. 'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
  25024. 'is--hover': currentValue === optionValue
  25025. }],
  25026. attrs: {
  25027. 'data-optid': optid
  25028. },
  25029. on: {
  25030. mousedown: function mousedown(evnt) {
  25031. var isLeftBtn = evnt.button === 0;
  25032. if (isLeftBtn) {
  25033. evnt.stopPropagation();
  25034. }
  25035. },
  25036. click: function click(evnt) {
  25037. if (!isDisabled) {
  25038. _vm.changeOptionEvent(evnt, optionValue);
  25039. }
  25040. },
  25041. mouseenter: function mouseenter() {
  25042. if (!isDisabled) {
  25043. _vm.setCurrentOption(option);
  25044. }
  25045. }
  25046. }
  25047. }, UtilTools.formatText(UtilTools.getFuncText(option[labelField]))) : null;
  25048. });
  25049. }
  25050. function renderOptgroup(h, _vm) {
  25051. var optionKey = _vm.optionKey,
  25052. optkey = _vm.optkey,
  25053. visibleGroupList = _vm.visibleGroupList,
  25054. groupLabelField = _vm.groupLabelField,
  25055. groupOptionsField = _vm.groupOptionsField;
  25056. return visibleGroupList.map(function (group, gIndex) {
  25057. var optid = getOptid(_vm, group);
  25058. var isGroupDisabled = group.disabled;
  25059. return h('div', {
  25060. key: optionKey || optkey ? optid : gIndex,
  25061. class: ['vxe-optgroup', {
  25062. 'is--disabled': isGroupDisabled
  25063. }],
  25064. attrs: {
  25065. 'data-optid': optid
  25066. }
  25067. }, [h('div', {
  25068. class: 'vxe-optgroup--title'
  25069. }, UtilTools.getFuncText(group[groupLabelField])), h('div', {
  25070. class: 'vxe-optgroup--wrapper'
  25071. }, renderOption(h, _vm, group[groupOptionsField], group))]);
  25072. });
  25073. }
  25074. function select_renderOpts(h, _vm) {
  25075. var isGroup = _vm.isGroup,
  25076. visibleGroupList = _vm.visibleGroupList,
  25077. visibleOptionList = _vm.visibleOptionList;
  25078. if (isGroup) {
  25079. if (visibleGroupList.length) {
  25080. return renderOptgroup(h, _vm);
  25081. }
  25082. } else {
  25083. if (visibleOptionList.length) {
  25084. return renderOption(h, _vm, visibleOptionList);
  25085. }
  25086. }
  25087. return [h('div', {
  25088. class: 'vxe-select--empty-placeholder'
  25089. }, _vm.emptyText || conf.i18n('vxe.select.emptyText'))];
  25090. }
  25091. /* harmony default export */ var src_select = ({
  25092. name: 'VxeSelect',
  25093. props: {
  25094. value: null,
  25095. clearable: Boolean,
  25096. placeholder: String,
  25097. disabled: Boolean,
  25098. multiple: Boolean,
  25099. multiCharOverflow: {
  25100. type: [Number, String],
  25101. default: function _default() {
  25102. return conf.select.multiCharOverflow;
  25103. }
  25104. },
  25105. prefixIcon: String,
  25106. placement: String,
  25107. options: Array,
  25108. optionProps: Object,
  25109. optionGroups: Array,
  25110. optionGroupProps: Object,
  25111. size: {
  25112. type: String,
  25113. default: function _default() {
  25114. return conf.select.size || conf.size;
  25115. }
  25116. },
  25117. emptyText: String,
  25118. optId: {
  25119. type: String,
  25120. default: function _default() {
  25121. return conf.select.optionId;
  25122. }
  25123. },
  25124. optionId: {
  25125. type: String,
  25126. default: function _default() {
  25127. return conf.select.optionId;
  25128. }
  25129. },
  25130. optKey: Boolean,
  25131. optionKey: Boolean,
  25132. transfer: {
  25133. type: Boolean,
  25134. default: function _default() {
  25135. return conf.select.transfer;
  25136. }
  25137. }
  25138. },
  25139. components: {
  25140. VxeInput: input
  25141. },
  25142. provide: function provide() {
  25143. return {
  25144. $xeselect: this
  25145. };
  25146. },
  25147. data: function data() {
  25148. return {
  25149. inited: false,
  25150. collectOption: [],
  25151. fullGroupList: [],
  25152. fullOptionList: [],
  25153. visibleGroupList: [],
  25154. visibleOptionList: [],
  25155. panelIndex: 0,
  25156. panelStyle: null,
  25157. panelPlacement: null,
  25158. currentValue: null,
  25159. visiblePanel: false,
  25160. animatVisible: false,
  25161. isActivated: false
  25162. };
  25163. },
  25164. computed: {
  25165. vSize: function vSize() {
  25166. return this.size || this.$parent.size || this.$parent.vSize;
  25167. },
  25168. propsOpts: function propsOpts() {
  25169. return this.optionProps || {};
  25170. },
  25171. groupPropsOpts: function groupPropsOpts() {
  25172. return this.optionGroupProps || {};
  25173. },
  25174. labelField: function labelField() {
  25175. return this.propsOpts.label || 'label';
  25176. },
  25177. valueField: function valueField() {
  25178. return this.propsOpts.value || 'value';
  25179. },
  25180. groupLabelField: function groupLabelField() {
  25181. return this.groupPropsOpts.label || 'label';
  25182. },
  25183. groupOptionsField: function groupOptionsField() {
  25184. return this.groupPropsOpts.options || 'options';
  25185. },
  25186. isGroup: function isGroup() {
  25187. return this.fullGroupList.some(function (item) {
  25188. return item.options && item.options.length;
  25189. });
  25190. },
  25191. multiMaxCharNum: function multiMaxCharNum() {
  25192. return ctor_amd_xe_utils_default.a.toNumber(this.multiCharOverflow);
  25193. },
  25194. selectLabel: function selectLabel() {
  25195. var _this = this;
  25196. var value = this.value,
  25197. multiple = this.multiple,
  25198. multiMaxCharNum = this.multiMaxCharNum;
  25199. if (value && multiple) {
  25200. return value.map(function (val) {
  25201. var label = getSelectLabel(_this, val);
  25202. if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
  25203. return "".concat(label.substring(0, multiMaxCharNum), "...");
  25204. }
  25205. return label;
  25206. }).join(', ');
  25207. }
  25208. return getSelectLabel(this, value);
  25209. }
  25210. },
  25211. watch: {
  25212. collectOption: function collectOption(value) {
  25213. if (value.some(function (item) {
  25214. return item.options && item.options.length;
  25215. })) {
  25216. this.fullOptionList = [];
  25217. this.fullGroupList = value;
  25218. } else {
  25219. this.fullGroupList = [];
  25220. this.fullOptionList = value;
  25221. }
  25222. this.updateCache();
  25223. },
  25224. options: function options(value) {
  25225. this.fullGroupList = [];
  25226. this.fullOptionList = value;
  25227. this.updateCache();
  25228. },
  25229. optionGroups: function optionGroups(value) {
  25230. this.fullOptionList = [];
  25231. this.fullGroupList = value;
  25232. this.updateCache();
  25233. }
  25234. },
  25235. created: function created() {
  25236. var options = this.options,
  25237. optionGroups = this.optionGroups;
  25238. if (optionGroups) {
  25239. this.fullGroupList = optionGroups;
  25240. } else if (options) {
  25241. this.fullOptionList = options;
  25242. }
  25243. this.updateCache();
  25244. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  25245. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  25246. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  25247. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  25248. },
  25249. beforeDestroy: function beforeDestroy() {
  25250. var panelElem = this.$refs.panel;
  25251. if (panelElem && panelElem.parentNode) {
  25252. panelElem.parentNode.removeChild(panelElem);
  25253. }
  25254. },
  25255. destroyed: function destroyed() {
  25256. GlobalEvent.off(this, 'mousewheel');
  25257. GlobalEvent.off(this, 'mousedown');
  25258. GlobalEvent.off(this, 'keydown');
  25259. GlobalEvent.off(this, 'blur');
  25260. },
  25261. render: function render(h) {
  25262. var _ref, _ref2;
  25263. var vSize = this.vSize,
  25264. inited = this.inited,
  25265. loading = this.loading,
  25266. isActivated = this.isActivated,
  25267. disabled = this.disabled,
  25268. visiblePanel = this.visiblePanel;
  25269. return h('div', {
  25270. 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)]
  25271. }, [h('div', {
  25272. class: 'vxe-select-slots',
  25273. ref: 'hideOption'
  25274. }, this.$slots.default), h('vxe-input', {
  25275. ref: 'input',
  25276. props: {
  25277. clearable: this.clearable,
  25278. placeholder: this.placeholder,
  25279. readonly: true,
  25280. disabled: disabled,
  25281. type: 'text',
  25282. prefixIcon: this.prefixIcon,
  25283. suffixIcon: visiblePanel ? conf.icon.SELECT_OPEN : conf.icon.SELECT_CLOSE,
  25284. value: this.selectLabel
  25285. },
  25286. on: {
  25287. clear: this.clearEvent,
  25288. click: this.togglePanelEvent,
  25289. focus: this.focusEvent,
  25290. blur: this.blurEvent,
  25291. 'suffix-click': this.togglePanelEvent
  25292. }
  25293. }), h('div', {
  25294. ref: 'panel',
  25295. 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)],
  25296. attrs: {
  25297. 'data-placement': this.panelPlacement
  25298. },
  25299. style: this.panelStyle
  25300. }, inited ? [h('div', {
  25301. ref: 'optWrapper',
  25302. class: 'vxe-select-option--wrapper'
  25303. }, select_renderOpts(h, this))] : [])]);
  25304. },
  25305. methods: {
  25306. updateCache: function updateCache() {
  25307. var _this2 = this;
  25308. var fullOptionList = this.fullOptionList,
  25309. fullGroupList = this.fullGroupList,
  25310. groupOptionsField = this.groupOptionsField;
  25311. var optkey = getOptkey(this);
  25312. var handleOptis = function handleOptis(item) {
  25313. if (!getOptid(_this2, item)) {
  25314. item[optkey] = getOptUniqueId();
  25315. }
  25316. };
  25317. if (fullGroupList.length) {
  25318. fullGroupList.forEach(function (group) {
  25319. handleOptis(group);
  25320. if (group[groupOptionsField]) {
  25321. group[groupOptionsField].forEach(handleOptis);
  25322. }
  25323. });
  25324. } else if (fullOptionList.length) {
  25325. fullOptionList.forEach(handleOptis);
  25326. }
  25327. this.refreshOption();
  25328. },
  25329. /**
  25330. * 刷新选项,当选项被动态显示/隐藏时可能会用到
  25331. */
  25332. refreshOption: function refreshOption() {
  25333. var isGroup = this.isGroup,
  25334. fullOptionList = this.fullOptionList,
  25335. fullGroupList = this.fullGroupList;
  25336. if (isGroup) {
  25337. this.visibleGroupList = fullGroupList.filter(isOptionVisible);
  25338. } else {
  25339. this.visibleOptionList = fullOptionList.filter(isOptionVisible);
  25340. }
  25341. return this.$nextTick();
  25342. },
  25343. setCurrentOption: function setCurrentOption(option) {
  25344. if (option) {
  25345. this.currentValue = option[this.valueField];
  25346. }
  25347. },
  25348. scrollToOption: function scrollToOption(option, isAlignBottom) {
  25349. var _this3 = this;
  25350. return this.$nextTick().then(function () {
  25351. if (option) {
  25352. var $refs = _this3.$refs;
  25353. var optWrapperElem = $refs.optWrapper;
  25354. var optElem = $refs.panel.querySelector("[data-optid='".concat(getOptid(_this3, option), "']"));
  25355. if (optWrapperElem && optElem) {
  25356. var wrapperHeight = optWrapperElem.offsetHeight;
  25357. var offsetPadding = 5;
  25358. if (isAlignBottom) {
  25359. if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
  25360. optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
  25361. }
  25362. } else {
  25363. if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
  25364. optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
  25365. }
  25366. }
  25367. }
  25368. }
  25369. });
  25370. },
  25371. clearEvent: function clearEvent(params, evnt) {
  25372. this.clearValueEvent(evnt, null);
  25373. this.hideOptionPanel();
  25374. },
  25375. clearValueEvent: function clearValueEvent(evnt, selectValue) {
  25376. this.changeEvent(evnt, selectValue);
  25377. this.$emit('clear', {
  25378. value: selectValue,
  25379. $event: evnt
  25380. }, evnt);
  25381. },
  25382. changeEvent: function changeEvent(evnt, selectValue) {
  25383. if (selectValue !== this.value) {
  25384. this.$emit('input', selectValue);
  25385. this.$emit('change', {
  25386. value: selectValue,
  25387. $event: evnt
  25388. }, evnt);
  25389. }
  25390. },
  25391. changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
  25392. var _this4 = this;
  25393. var value = this.value,
  25394. multiple = this.multiple;
  25395. if (multiple) {
  25396. var multipleValue;
  25397. if (value) {
  25398. if (value.indexOf(selectValue) === -1) {
  25399. multipleValue = value.concat([selectValue]);
  25400. } else {
  25401. multipleValue = value.filter(function (val) {
  25402. return val !== selectValue;
  25403. });
  25404. }
  25405. } else {
  25406. multipleValue = [selectValue];
  25407. }
  25408. this.changeEvent(evnt, multipleValue);
  25409. } else {
  25410. this.changeEvent(evnt, selectValue); // 显示效果
  25411. setTimeout(function () {
  25412. _this4.hideOptionPanel();
  25413. }, 50);
  25414. }
  25415. },
  25416. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  25417. var $refs = this.$refs,
  25418. disabled = this.disabled,
  25419. visiblePanel = this.visiblePanel;
  25420. if (!disabled) {
  25421. if (visiblePanel) {
  25422. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  25423. this.updatePlacement();
  25424. } else {
  25425. this.hideOptionPanel();
  25426. }
  25427. }
  25428. }
  25429. },
  25430. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  25431. var $refs = this.$refs,
  25432. $el = this.$el,
  25433. disabled = this.disabled,
  25434. visiblePanel = this.visiblePanel;
  25435. if (!disabled) {
  25436. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  25437. if (visiblePanel && !this.isActivated) {
  25438. this.hideOptionPanel();
  25439. }
  25440. }
  25441. },
  25442. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  25443. var visiblePanel = this.visiblePanel,
  25444. currentValue = this.currentValue,
  25445. clearable = this.clearable,
  25446. disabled = this.disabled;
  25447. if (!disabled) {
  25448. var keyCode = evnt.keyCode;
  25449. var isTab = keyCode === 9;
  25450. var isEnter = keyCode === 13;
  25451. var isEsc = keyCode === 27;
  25452. var isUpArrow = keyCode === 38;
  25453. var isDwArrow = keyCode === 40;
  25454. var isDel = keyCode === 46;
  25455. var isSpacebar = keyCode === 32;
  25456. if (isTab) {
  25457. this.isActivated = false;
  25458. }
  25459. if (visiblePanel) {
  25460. if (isEsc || isTab) {
  25461. this.hideOptionPanel();
  25462. } else if (isEnter) {
  25463. evnt.preventDefault();
  25464. evnt.stopPropagation();
  25465. this.changeOptionEvent(evnt, currentValue);
  25466. } else if (isUpArrow || isDwArrow) {
  25467. evnt.preventDefault();
  25468. var _findOffsetOption = findOffsetOption(this, currentValue, isUpArrow),
  25469. firstOption = _findOffsetOption.firstOption,
  25470. offsetOption = _findOffsetOption.offsetOption;
  25471. if (!offsetOption && !findOption(this, currentValue)) {
  25472. offsetOption = firstOption;
  25473. }
  25474. this.setCurrentOption(offsetOption);
  25475. this.scrollToOption(offsetOption, isDwArrow);
  25476. } else if (isSpacebar) {
  25477. evnt.preventDefault();
  25478. }
  25479. } else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && this.isActivated) {
  25480. evnt.preventDefault();
  25481. this.showOptionPanel();
  25482. }
  25483. if (this.isActivated) {
  25484. if (isDel && clearable) {
  25485. this.clearValueEvent(evnt, null);
  25486. }
  25487. }
  25488. }
  25489. },
  25490. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  25491. this.hideOptionPanel();
  25492. },
  25493. updateZindex: function updateZindex() {
  25494. if (this.panelIndex < UtilTools.getLastZIndex()) {
  25495. this.panelIndex = UtilTools.nextZIndex();
  25496. }
  25497. },
  25498. focusEvent: function focusEvent() {
  25499. if (!this.disabled) {
  25500. this.isActivated = true;
  25501. }
  25502. },
  25503. blurEvent: function blurEvent() {
  25504. this.isActivated = false;
  25505. },
  25506. isPanelVisible: function isPanelVisible() {
  25507. return this.visiblePanel;
  25508. },
  25509. togglePanelEvent: function togglePanelEvent(params) {
  25510. var $event = params.$event;
  25511. $event.preventDefault();
  25512. if (this.visiblePanel) {
  25513. this.hideOptionPanel();
  25514. } else {
  25515. this.showOptionPanel();
  25516. }
  25517. },
  25518. showOptionPanel: function showOptionPanel() {
  25519. var _this5 = this;
  25520. if (!this.disabled) {
  25521. clearTimeout(this.hidePanelTimeout);
  25522. if (!this.inited) {
  25523. this.inited = true;
  25524. if (this.transfer) {
  25525. document.body.appendChild(this.$refs.panel);
  25526. }
  25527. }
  25528. this.isActivated = true;
  25529. this.animatVisible = true;
  25530. setTimeout(function () {
  25531. var value = _this5.value,
  25532. multiple = _this5.multiple;
  25533. var currOption = findOption(_this5, multiple && value ? value[0] : value);
  25534. _this5.visiblePanel = true;
  25535. if (currOption) {
  25536. _this5.setCurrentOption(currOption);
  25537. _this5.scrollToOption(currOption);
  25538. }
  25539. }, 10);
  25540. this.updateZindex();
  25541. this.updatePlacement();
  25542. }
  25543. },
  25544. hideOptionPanel: function hideOptionPanel() {
  25545. var _this6 = this;
  25546. this.visiblePanel = false;
  25547. this.hidePanelTimeout = setTimeout(function () {
  25548. _this6.animatVisible = false;
  25549. }, 350);
  25550. },
  25551. updatePlacement: function updatePlacement() {
  25552. var _this7 = this;
  25553. return this.$nextTick().then(function () {
  25554. var $refs = _this7.$refs,
  25555. transfer = _this7.transfer,
  25556. placement = _this7.placement,
  25557. panelIndex = _this7.panelIndex;
  25558. var targetElem = $refs.input.$el;
  25559. var panelElem = $refs.panel;
  25560. if (panelElem && targetElem) {
  25561. var targetHeight = targetElem.offsetHeight;
  25562. var targetWidth = targetElem.offsetWidth;
  25563. var panelHeight = panelElem.offsetHeight;
  25564. var panelWidth = panelElem.offsetWidth;
  25565. var marginSize = 5;
  25566. var panelStyle = {
  25567. zIndex: panelIndex
  25568. };
  25569. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  25570. boundingTop = _DomTools$getAbsolute.boundingTop,
  25571. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  25572. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  25573. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  25574. var panelPlacement = 'bottom';
  25575. if (transfer) {
  25576. var left = boundingLeft;
  25577. var top = boundingTop + targetHeight;
  25578. if (placement === 'top') {
  25579. panelPlacement = 'top';
  25580. top = boundingTop - panelHeight;
  25581. } else if (!placement) {
  25582. // 如果下面不够放,则向上
  25583. if (top + panelHeight + marginSize > visibleHeight) {
  25584. panelPlacement = 'top';
  25585. top = boundingTop - panelHeight;
  25586. } // 如果上面不够放,则向下(优先)
  25587. if (top < marginSize) {
  25588. panelPlacement = 'bottom';
  25589. top = boundingTop + targetHeight;
  25590. }
  25591. } // 如果溢出右边
  25592. if (left + panelWidth + marginSize > visibleWidth) {
  25593. left -= left + panelWidth + marginSize - visibleWidth;
  25594. } // 如果溢出左边
  25595. if (left < marginSize) {
  25596. left = marginSize;
  25597. }
  25598. Object.assign(panelStyle, {
  25599. left: "".concat(left, "px"),
  25600. top: "".concat(top, "px"),
  25601. minWidth: "".concat(targetWidth, "px")
  25602. });
  25603. } else {
  25604. if (placement === 'top') {
  25605. panelPlacement = 'top';
  25606. panelStyle.bottom = "".concat(targetHeight, "px");
  25607. } else if (!placement) {
  25608. // 如果下面不够放,则向上
  25609. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  25610. // 如果上面不够放,则向下(优先)
  25611. if (boundingTop - targetHeight - panelHeight > marginSize) {
  25612. panelPlacement = 'top';
  25613. panelStyle.bottom = "".concat(targetHeight, "px");
  25614. }
  25615. }
  25616. }
  25617. }
  25618. _this7.panelStyle = panelStyle;
  25619. _this7.panelPlacement = panelPlacement;
  25620. return _this7.$nextTick();
  25621. }
  25622. });
  25623. },
  25624. focus: function focus() {
  25625. this.isActivated = true;
  25626. this.$refs.input.focus();
  25627. return this.$nextTick();
  25628. },
  25629. blur: function blur() {
  25630. this.$refs.input.blur();
  25631. this.isActivated = false;
  25632. return this.$nextTick();
  25633. }
  25634. }
  25635. });
  25636. // CONCATENATED MODULE: ./packages/select/src/util.js
  25637. var util_OptionConfig = /*#__PURE__*/function () {
  25638. function OptionConfig($xeselect, _vm) {
  25639. _classCallCheck(this, OptionConfig);
  25640. Object.assign(this, {
  25641. value: _vm.value,
  25642. label: _vm.label,
  25643. visible: _vm.visible,
  25644. disabled: _vm.disabled
  25645. });
  25646. }
  25647. _createClass(OptionConfig, [{
  25648. key: "update",
  25649. value: function update(name, value) {
  25650. this[name] = value;
  25651. }
  25652. }]);
  25653. return OptionConfig;
  25654. }();
  25655. function isOption(option) {
  25656. return option instanceof util_OptionConfig;
  25657. }
  25658. function getOptionConfig($xeselect, _vm, options) {
  25659. return isOption(_vm) ? _vm : new util_OptionConfig($xeselect, _vm, options);
  25660. }
  25661. function createOption($xeselect, _vm) {
  25662. return getOptionConfig($xeselect, _vm);
  25663. }
  25664. function destroyOption(_vm) {
  25665. var $xeselect = _vm.$xeselect,
  25666. optionConfig = _vm.optionConfig;
  25667. var matchObj = ctor_amd_xe_utils_default.a.findTree($xeselect.collectOption, function (option) {
  25668. return option === optionConfig;
  25669. });
  25670. if (matchObj) {
  25671. matchObj.items.splice(matchObj.index, 1);
  25672. }
  25673. }
  25674. function assemOption(_vm) {
  25675. var $el = _vm.$el,
  25676. $xeselect = _vm.$xeselect,
  25677. $xeoptgroup = _vm.$xeoptgroup,
  25678. optionConfig = _vm.optionConfig;
  25679. var groupConfig = $xeoptgroup ? $xeoptgroup.optionConfig : null;
  25680. optionConfig.slots = _vm.$scopedSlots;
  25681. if (groupConfig) {
  25682. if (!groupConfig.options) {
  25683. groupConfig.options = [];
  25684. }
  25685. groupConfig.options.splice([].indexOf.call($xeoptgroup.$el.children, $el), 0, optionConfig);
  25686. } else {
  25687. $xeselect.collectOption.splice([].indexOf.call($xeselect.$refs.hideOption.children, $el), 0, optionConfig);
  25688. }
  25689. }
  25690. // CONCATENATED MODULE: ./packages/select/src/option.js
  25691. var option_props = {
  25692. value: null,
  25693. label: {
  25694. type: [String, Number, Boolean],
  25695. default: ''
  25696. },
  25697. visible: {
  25698. type: Boolean,
  25699. default: null
  25700. },
  25701. disabled: Boolean
  25702. };
  25703. var option_watch = {};
  25704. Object.keys(option_props).forEach(function (name) {
  25705. option_watch[name] = function (value) {
  25706. this.optionConfig.update(name, value);
  25707. };
  25708. });
  25709. /* harmony default export */ var src_option = ({
  25710. name: 'VxeOption',
  25711. props: option_props,
  25712. inject: {
  25713. $xeselect: {
  25714. default: null
  25715. },
  25716. $xeoptgroup: {
  25717. default: null
  25718. }
  25719. },
  25720. watch: option_watch,
  25721. mounted: function mounted() {
  25722. assemOption(this);
  25723. },
  25724. created: function created() {
  25725. this.optionConfig = createOption(this.$xeselect, this);
  25726. },
  25727. destroyed: function destroyed() {
  25728. destroyOption(this);
  25729. },
  25730. render: function render(h) {
  25731. return h('div');
  25732. }
  25733. });
  25734. // CONCATENATED MODULE: ./packages/select/src/optgroup.js
  25735. var optgroup_props = {
  25736. label: {
  25737. type: [String, Number, Boolean],
  25738. default: ''
  25739. },
  25740. visible: {
  25741. type: Boolean,
  25742. default: null
  25743. },
  25744. disabled: Boolean
  25745. };
  25746. var optgroup_watch = {};
  25747. Object.keys(optgroup_props).forEach(function (name) {
  25748. optgroup_watch[name] = function (value) {
  25749. this.optionConfig.update(name, value);
  25750. };
  25751. });
  25752. /* harmony default export */ var optgroup = ({
  25753. name: 'VxeOptgroup',
  25754. props: optgroup_props,
  25755. provide: function provide() {
  25756. return {
  25757. $xeoptgroup: this
  25758. };
  25759. },
  25760. inject: {
  25761. $xeselect: {
  25762. default: null
  25763. }
  25764. },
  25765. computed: {
  25766. vSize: function vSize() {
  25767. return this.size || this.$parent.size || this.$parent.vSize;
  25768. }
  25769. },
  25770. watch: optgroup_watch,
  25771. mounted: function mounted() {
  25772. assemOption(this);
  25773. },
  25774. created: function created() {
  25775. this.optionConfig = createOption(this.$xeselect, this);
  25776. },
  25777. destroyed: function destroyed() {
  25778. destroyOption(this);
  25779. },
  25780. render: function render(h) {
  25781. return h('div', this.$slots.default);
  25782. }
  25783. });
  25784. // CONCATENATED MODULE: ./packages/select/index.js
  25785. src_select.install = function (Vue) {
  25786. Vue.component(src_select.name, src_select);
  25787. Vue.component(src_option.name, src_option);
  25788. Vue.component(optgroup.name, optgroup);
  25789. };
  25790. var Select = src_select;
  25791. /* harmony default export */ var packages_select = (src_select);
  25792. // CONCATENATED MODULE: ./packages/switch/src/switch.js
  25793. var switch_browse = DomTools.browse;
  25794. /* harmony default export */ var src_switch = ({
  25795. name: 'VxeSwitch',
  25796. props: {
  25797. value: [String, Number, Boolean],
  25798. disabled: Boolean,
  25799. size: {
  25800. type: String,
  25801. default: function _default() {
  25802. return conf.switch.size || conf.size;
  25803. }
  25804. },
  25805. openLabel: String,
  25806. closeLabel: String,
  25807. openValue: {
  25808. type: [String, Number, Boolean],
  25809. default: true
  25810. },
  25811. closeValue: {
  25812. type: [String, Number, Boolean],
  25813. default: false
  25814. },
  25815. openIcon: String,
  25816. closeIcon: String,
  25817. // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
  25818. onLabel: String,
  25819. offLabel: String,
  25820. onValue: {
  25821. type: [String, Number, Boolean],
  25822. default: true
  25823. },
  25824. offValue: {
  25825. type: [String, Number, Boolean],
  25826. default: false
  25827. },
  25828. onIcon: String,
  25829. offIcon: String
  25830. },
  25831. data: function data() {
  25832. return {
  25833. isActivated: false,
  25834. hasAnimat: false,
  25835. offsetLeft: 0
  25836. };
  25837. },
  25838. computed: {
  25839. vSize: function vSize() {
  25840. return this.size || this.$parent.size || this.$parent.vSize;
  25841. },
  25842. isChecked: function isChecked() {
  25843. return ctor_amd_xe_utils_default.a.isBoolean(this.onValue) ? this.value === this.openValue : this.value === this.onValue;
  25844. },
  25845. onShowLabel: function onShowLabel() {
  25846. return UtilTools.getFuncText(this.openLabel || this.onLabel);
  25847. },
  25848. offShowLabel: function offShowLabel() {
  25849. return UtilTools.getFuncText(this.closeLabel || this.offLabel);
  25850. },
  25851. styles: function styles() {
  25852. return switch_browse.msie && this.isChecked ? {
  25853. left: "".concat(this.offsetLeft, "px")
  25854. } : null;
  25855. }
  25856. },
  25857. created: function created() {
  25858. var _this = this;
  25859. // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
  25860. var propsData = this.$options.propsData;
  25861. if (propsData.onLabel) {
  25862. UtilTools.warn('vxe.error.delProp', ['on-label', 'open-label']);
  25863. }
  25864. if (propsData.offLabel) {
  25865. UtilTools.warn('vxe.error.delProp', ['off-label', 'close-label']);
  25866. }
  25867. if (propsData.onValue) {
  25868. UtilTools.warn('vxe.error.delProp', ['on-value', 'open-value']);
  25869. }
  25870. if (propsData.offValue) {
  25871. UtilTools.warn('vxe.error.delProp', ['off-value', 'close-value']);
  25872. }
  25873. if (propsData.onIcon) {
  25874. UtilTools.warn('vxe.error.delProp', ['on-icon', 'open-icon']);
  25875. }
  25876. if (propsData.offIcon) {
  25877. UtilTools.warn('vxe.error.delProp', ['off-icon', 'close-icon']);
  25878. }
  25879. if (switch_browse.msie) {
  25880. this.$nextTick(function () {
  25881. return _this.updateStyle();
  25882. });
  25883. }
  25884. },
  25885. render: function render(h) {
  25886. var _ref;
  25887. var isChecked = this.isChecked,
  25888. vSize = this.vSize,
  25889. disabled = this.disabled,
  25890. openIcon = this.openIcon,
  25891. onIcon = this.onIcon,
  25892. closeIcon = this.closeIcon,
  25893. offIcon = this.offIcon;
  25894. return h('div', {
  25895. 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)]
  25896. }, [h('button', {
  25897. ref: 'btn',
  25898. class: 'vxe-switch--button',
  25899. attrs: {
  25900. type: 'button',
  25901. disabled: disabled
  25902. },
  25903. on: {
  25904. click: this.clickEvent
  25905. }
  25906. }, [h('span', {
  25907. class: 'vxe-switch--label vxe-switch--label-on'
  25908. }, [openIcon || onIcon ? h('i', {
  25909. class: ['vxe-switch--label-icon', openIcon || onIcon]
  25910. }) : null, this.onShowLabel]), h('span', {
  25911. class: 'vxe-switch--label vxe-switch--label-off'
  25912. }, [closeIcon || offIcon ? h('i', {
  25913. class: ['vxe-switch--label-icon', closeIcon || offIcon]
  25914. }) : null, this.offShowLabel]), h('span', {
  25915. class: 'vxe-switch--icon',
  25916. style: this.styles
  25917. })])]);
  25918. },
  25919. methods: {
  25920. updateStyle: function updateStyle() {
  25921. // 兼容 IE
  25922. this.hasAnimat = true;
  25923. this.offsetLeft = this.$refs.btn.offsetWidth;
  25924. },
  25925. clickEvent: function clickEvent(evnt) {
  25926. var _this2 = this;
  25927. if (!this.disabled) {
  25928. clearTimeout(this.activeTimeout);
  25929. 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;
  25930. this.hasAnimat = true;
  25931. if (switch_browse.msie) {
  25932. this.updateStyle();
  25933. }
  25934. this.$emit('input', value);
  25935. this.$emit('change', {
  25936. value: value,
  25937. $event: evnt
  25938. });
  25939. this.activeTimeout = setTimeout(function () {
  25940. _this2.hasAnimat = false;
  25941. }, 400);
  25942. }
  25943. }
  25944. }
  25945. });
  25946. // CONCATENATED MODULE: ./packages/switch/index.js
  25947. src_switch.install = function (Vue) {
  25948. Vue.component(src_switch.name, src_switch);
  25949. };
  25950. var Switch = src_switch;
  25951. /* harmony default export */ var packages_switch = (src_switch);
  25952. // CONCATENATED MODULE: ./packages/list/src/list.js
  25953. /* harmony default export */ var src_list = ({
  25954. name: 'VxeList',
  25955. props: {
  25956. data: Array,
  25957. height: [Number, String],
  25958. maxHeight: [Number, String],
  25959. loading: Boolean,
  25960. size: {
  25961. type: String,
  25962. default: function _default() {
  25963. return conf.list.size || conf.size;
  25964. }
  25965. },
  25966. autoResize: {
  25967. type: Boolean,
  25968. default: function _default() {
  25969. return conf.list.autoResize;
  25970. }
  25971. },
  25972. syncResize: [Boolean, String, Number],
  25973. scrollY: Object
  25974. },
  25975. data: function data() {
  25976. return {
  25977. scrollYLoad: false,
  25978. bodyHeight: 0,
  25979. topSpaceHeight: 0,
  25980. items: []
  25981. };
  25982. },
  25983. computed: {
  25984. vSize: function vSize() {
  25985. return this.size || this.$parent.size || this.$parent.vSize;
  25986. },
  25987. sYOpts: function sYOpts() {
  25988. return Object.assign({}, conf.list.scrollY, this.scrollY);
  25989. },
  25990. styles: function styles() {
  25991. var height = this.height,
  25992. maxHeight = this.maxHeight;
  25993. var style = {};
  25994. if (height) {
  25995. style.height = isNaN(height) ? height : "".concat(height, "px");
  25996. } else if (maxHeight) {
  25997. style.height = 'auto';
  25998. style.maxHeight = isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px");
  25999. }
  26000. return style;
  26001. }
  26002. },
  26003. watch: {
  26004. data: function data(value) {
  26005. this.loadData(value);
  26006. },
  26007. syncResize: function syncResize(value) {
  26008. var _this = this;
  26009. if (value) {
  26010. this.recalculate();
  26011. this.$nextTick(function () {
  26012. return setTimeout(function () {
  26013. return _this.recalculate();
  26014. });
  26015. });
  26016. }
  26017. }
  26018. },
  26019. created: function created() {
  26020. Object.assign(this, {
  26021. fullData: [],
  26022. lastScrollLeft: 0,
  26023. lastScrollTop: 0,
  26024. scrollYStore: {
  26025. startIndex: 0,
  26026. visibleIndex: 0,
  26027. renderSize: 0
  26028. }
  26029. });
  26030. this.loadData(this.data);
  26031. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  26032. },
  26033. mounted: function mounted() {
  26034. var _this2 = this;
  26035. if (this.autoResize) {
  26036. var resizeObserver = new ResizeEvent(function () {
  26037. return _this2.recalculate();
  26038. });
  26039. resizeObserver.observe(this.$el);
  26040. this.$resize = resizeObserver;
  26041. }
  26042. },
  26043. beforeDestroy: function beforeDestroy() {
  26044. if (this.$resize) {
  26045. this.$resize.disconnect();
  26046. }
  26047. },
  26048. destroyed: function destroyed() {
  26049. GlobalEvent.off(this, 'resize');
  26050. },
  26051. render: function render(h) {
  26052. var $scopedSlots = this.$scopedSlots,
  26053. styles = this.styles,
  26054. bodyHeight = this.bodyHeight,
  26055. topSpaceHeight = this.topSpaceHeight,
  26056. items = this.items,
  26057. loading = this.loading;
  26058. return h('div', {
  26059. class: ['vxe-list', {
  26060. 'is--loading': loading
  26061. }]
  26062. }, [h('div', {
  26063. ref: 'virtualWrapper',
  26064. class: 'vxe-list--virtual-wrapper',
  26065. style: styles,
  26066. on: {
  26067. scroll: this.scrollEvent
  26068. }
  26069. }, [h('div', {
  26070. ref: 'ySpace',
  26071. class: 'vxe-list--y-space',
  26072. style: {
  26073. height: bodyHeight ? "".concat(bodyHeight, "px") : ''
  26074. }
  26075. }), h('div', {
  26076. ref: 'virtualBody',
  26077. class: 'vxe-list--body',
  26078. style: {
  26079. marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
  26080. }
  26081. }, $scopedSlots.default ? $scopedSlots.default.call(this, {
  26082. items: items,
  26083. $list: this
  26084. }, h) : [])]), h('div', {
  26085. class: ['vxe-list--loading vxe-loading', {
  26086. 'is--visible': loading
  26087. }]
  26088. }, [h('div', {
  26089. class: 'vxe-loading--spinner'
  26090. })])]);
  26091. },
  26092. methods: {
  26093. getParentElem: function getParentElem() {
  26094. return this.$el.parentNode;
  26095. },
  26096. /**
  26097. * 加载数据
  26098. * @param {Array} datas 数据
  26099. */
  26100. loadData: function loadData(datas) {
  26101. var _this3 = this;
  26102. var sYOpts = this.sYOpts,
  26103. scrollYStore = this.scrollYStore;
  26104. var fullData = datas || [];
  26105. Object.assign(scrollYStore, {
  26106. startIndex: 0,
  26107. endIndex: 1,
  26108. visibleSize: 0,
  26109. visibleIndex: 0
  26110. });
  26111. this.fullData = fullData;
  26112. this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && fullData.length > sYOpts.gt;
  26113. this.handleData();
  26114. return this.computeScrollLoad().then(function () {
  26115. _this3.refreshScroll();
  26116. });
  26117. },
  26118. /**
  26119. * 重新加载数据
  26120. * @param {Array} datas 数据
  26121. */
  26122. reloadData: function reloadData(datas) {
  26123. this.clearScroll();
  26124. return this.loadData(datas);
  26125. },
  26126. handleData: function handleData() {
  26127. var fullData = this.fullData,
  26128. scrollYLoad = this.scrollYLoad,
  26129. scrollYStore = this.scrollYStore;
  26130. this.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
  26131. return this.$nextTick();
  26132. },
  26133. /**
  26134. * 重新计算列表
  26135. */
  26136. recalculate: function recalculate() {
  26137. var $el = this.$el;
  26138. if ($el.clientWidth && $el.clientHeight) {
  26139. return this.computeScrollLoad();
  26140. }
  26141. return Promise.resolve();
  26142. },
  26143. /**
  26144. * 清除滚动条
  26145. */
  26146. clearScroll: function clearScroll() {
  26147. var scrollBodyElem = this.$refs.virtualWrapper;
  26148. if (scrollBodyElem) {
  26149. scrollBodyElem.scrollTop = 0;
  26150. }
  26151. return this.$nextTick();
  26152. },
  26153. /**
  26154. * 刷新滚动条
  26155. */
  26156. refreshScroll: function refreshScroll() {
  26157. var _this4 = this;
  26158. var lastScrollLeft = this.lastScrollLeft,
  26159. lastScrollTop = this.lastScrollTop;
  26160. this.clearScroll();
  26161. return this.$nextTick().then(function () {
  26162. if (lastScrollLeft || lastScrollTop) {
  26163. _this4.lastScrollLeft = 0;
  26164. _this4.lastScrollTop = 0;
  26165. return _this4.scrollTo(lastScrollLeft, lastScrollTop);
  26166. }
  26167. });
  26168. },
  26169. /**
  26170. * 如果有滚动条,则滚动到对应的位置
  26171. * @param {Number} scrollLeft 左距离
  26172. * @param {Number} scrollTop 上距离
  26173. */
  26174. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  26175. var _this5 = this;
  26176. var scrollBodyElem = this.$refs.virtualWrapper;
  26177. if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  26178. scrollBodyElem.scrollLeft = scrollLeft;
  26179. }
  26180. if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
  26181. scrollBodyElem.scrollTop = scrollTop;
  26182. }
  26183. DomTools.triggerEvent(scrollBodyElem, 'scroll');
  26184. if (this.scrollYLoad) {
  26185. return new Promise(function (resolve) {
  26186. return setTimeout(function () {
  26187. return resolve(_this5.$nextTick());
  26188. }, 50);
  26189. });
  26190. }
  26191. return this.$nextTick();
  26192. },
  26193. computeScrollLoad: function computeScrollLoad() {
  26194. var _this6 = this;
  26195. return this.$nextTick().then(function () {
  26196. var $refs = _this6.$refs,
  26197. sYOpts = _this6.sYOpts,
  26198. scrollYLoad = _this6.scrollYLoad,
  26199. scrollYStore = _this6.scrollYStore;
  26200. if (scrollYLoad) {
  26201. var rHeight = 48;
  26202. if (sYOpts.rHeight) {
  26203. rHeight = sYOpts.rHeight;
  26204. } else {
  26205. var firstItemElem;
  26206. if ($refs.virtualBody) {
  26207. if (sYOpts.sItem) {
  26208. firstItemElem = $refs.virtualBody.querySelector(sYOpts.sItem);
  26209. }
  26210. if (!firstItemElem) {
  26211. firstItemElem = $refs.virtualBody.children[0];
  26212. }
  26213. }
  26214. if (firstItemElem) {
  26215. rHeight = firstItemElem.offsetHeight;
  26216. }
  26217. }
  26218. var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil($refs.virtualWrapper.clientHeight / rHeight));
  26219. scrollYStore.visibleSize = visibleYSize;
  26220. scrollYStore.rowHeight = rHeight;
  26221. if (!sYOpts.oSize) {
  26222. scrollYStore.offsetSize = visibleYSize;
  26223. }
  26224. if (!sYOpts.rSize) {
  26225. scrollYStore.renderSize = Math.max(6, visibleYSize + 2);
  26226. }
  26227. _this6.updateYData();
  26228. } else {
  26229. _this6.updateYSpace();
  26230. }
  26231. });
  26232. },
  26233. scrollEvent: function scrollEvent(evnt) {
  26234. var scrollBodyElem = evnt.target;
  26235. var scrollTop = scrollBodyElem.scrollTop;
  26236. var scrollLeft = scrollBodyElem.scrollLeft;
  26237. var isX = scrollLeft !== this.lastScrollLeft;
  26238. var isY = scrollTop !== this.lastScrollTop;
  26239. this.lastScrollTop = scrollTop;
  26240. this.lastScrollLeft = scrollLeft;
  26241. if (this.scrollYLoad) {
  26242. this.loadYData(evnt);
  26243. }
  26244. this.$emit('scroll', {
  26245. scrollLeft: scrollLeft,
  26246. scrollTop: scrollTop,
  26247. isX: isX,
  26248. isY: isY,
  26249. $event: evnt
  26250. });
  26251. },
  26252. loadYData: function loadYData(evnt) {
  26253. var fullData = this.fullData,
  26254. scrollYStore = this.scrollYStore,
  26255. isLoadData = this.isLoadData;
  26256. var startIndex = scrollYStore.startIndex,
  26257. renderSize = scrollYStore.renderSize,
  26258. offsetSize = scrollYStore.offsetSize,
  26259. visibleSize = scrollYStore.visibleSize,
  26260. rowHeight = scrollYStore.rowHeight;
  26261. var scrollBodyElem = evnt.target;
  26262. var scrollTop = scrollBodyElem.scrollTop;
  26263. var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
  26264. var preload = false;
  26265. if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
  26266. var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
  26267. if (scrollYStore.visibleIndex > toVisibleIndex) {
  26268. preload = toVisibleIndex - offsetSize <= startIndex;
  26269. if (preload) {
  26270. scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
  26271. }
  26272. } else {
  26273. preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
  26274. if (preload) {
  26275. scrollYStore.startIndex = Math.max(0, Math.min(fullData.length - renderSize, toVisibleIndex - marginSize));
  26276. }
  26277. }
  26278. if (preload) {
  26279. this.updateYData();
  26280. }
  26281. scrollYStore.visibleIndex = toVisibleIndex;
  26282. this.isLoadData = false;
  26283. }
  26284. },
  26285. updateYData: function updateYData() {
  26286. this.handleData();
  26287. this.updateYSpace();
  26288. },
  26289. updateYSpace: function updateYSpace() {
  26290. var scrollYStore = this.scrollYStore,
  26291. scrollYLoad = this.scrollYLoad,
  26292. fullData = this.fullData;
  26293. this.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
  26294. this.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
  26295. },
  26296. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  26297. this.recalculate();
  26298. }
  26299. }
  26300. });
  26301. // CONCATENATED MODULE: ./packages/list/index.js
  26302. src_list.install = function (Vue) {
  26303. Vue.component(src_list.name, src_list);
  26304. };
  26305. var List = src_list;
  26306. /* harmony default export */ var packages_list = (src_list);
  26307. // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
  26308. /* harmony default export */ var pulldown = ({
  26309. name: 'VxePulldown',
  26310. props: {
  26311. disabled: Boolean,
  26312. placement: String,
  26313. size: {
  26314. type: String,
  26315. default: function _default() {
  26316. return conf.size;
  26317. }
  26318. },
  26319. destroyOnClose: Boolean,
  26320. transfer: Boolean
  26321. },
  26322. data: function data() {
  26323. return {
  26324. inited: false,
  26325. panelIndex: 0,
  26326. panelStyle: null,
  26327. panelPlacement: null,
  26328. currentValue: null,
  26329. visiblePanel: false,
  26330. animatVisible: false,
  26331. isActivated: false
  26332. };
  26333. },
  26334. computed: {
  26335. vSize: function vSize() {
  26336. return this.size || this.$parent.size || this.$parent.vSize;
  26337. }
  26338. },
  26339. created: function created() {
  26340. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  26341. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  26342. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  26343. },
  26344. beforeDestroy: function beforeDestroy() {
  26345. var panelElem = this.$refs.panel;
  26346. if (panelElem && panelElem.parentNode) {
  26347. panelElem.parentNode.removeChild(panelElem);
  26348. }
  26349. },
  26350. destroyed: function destroyed() {
  26351. GlobalEvent.off(this, 'mousewheel');
  26352. GlobalEvent.off(this, 'mousedown');
  26353. GlobalEvent.off(this, 'blur');
  26354. },
  26355. render: function render(h) {
  26356. var _ref, _ref2;
  26357. var $scopedSlots = this.$scopedSlots,
  26358. inited = this.inited,
  26359. vSize = this.vSize,
  26360. destroyOnClose = this.destroyOnClose,
  26361. transfer = this.transfer,
  26362. isActivated = this.isActivated,
  26363. disabled = this.disabled,
  26364. animatVisible = this.animatVisible,
  26365. visiblePanel = this.visiblePanel,
  26366. panelStyle = this.panelStyle,
  26367. panelPlacement = this.panelPlacement;
  26368. var defaultSlot = $scopedSlots.default;
  26369. var downSlot = $scopedSlots.dropdown;
  26370. return h('div', {
  26371. 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)]
  26372. }, [h('div', {
  26373. ref: 'content',
  26374. class: 'vxe-pulldown--content'
  26375. }, defaultSlot ? defaultSlot.call(this, {
  26376. $pulldown: this
  26377. }, h) : []), h('div', {
  26378. ref: 'panel',
  26379. 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)],
  26380. attrs: {
  26381. 'data-placement': panelPlacement
  26382. },
  26383. style: panelStyle
  26384. }, downSlot ? !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : downSlot.call(this, {
  26385. $pulldown: this
  26386. }, h) : [])]);
  26387. },
  26388. methods: {
  26389. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  26390. var $refs = this.$refs,
  26391. disabled = this.disabled,
  26392. visiblePanel = this.visiblePanel;
  26393. if (!disabled) {
  26394. if (visiblePanel) {
  26395. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  26396. this.updatePlacement();
  26397. } else {
  26398. this.hidePanel();
  26399. this.$emit('hide-panel', {
  26400. $event: evnt
  26401. });
  26402. }
  26403. }
  26404. }
  26405. },
  26406. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  26407. var $refs = this.$refs,
  26408. $el = this.$el,
  26409. disabled = this.disabled,
  26410. visiblePanel = this.visiblePanel;
  26411. if (!disabled) {
  26412. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  26413. if (visiblePanel && !this.isActivated) {
  26414. this.hidePanel();
  26415. this.$emit('hide-panel', {
  26416. $event: evnt
  26417. });
  26418. }
  26419. }
  26420. },
  26421. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  26422. if (this.visiblePanel) {
  26423. this.hidePanel();
  26424. this.$emit('hide-panel', {
  26425. $event: evnt
  26426. });
  26427. }
  26428. },
  26429. updateZindex: function updateZindex() {
  26430. if (this.panelIndex < UtilTools.getLastZIndex()) {
  26431. this.panelIndex = UtilTools.nextZIndex();
  26432. }
  26433. },
  26434. isPanelVisible: function isPanelVisible() {
  26435. return this.visiblePanel;
  26436. },
  26437. /**
  26438. * 切换下拉面板
  26439. */
  26440. togglePanel: function togglePanel() {
  26441. if (this.visiblePanel) {
  26442. return this.hidePanel();
  26443. }
  26444. return this.showPanel();
  26445. },
  26446. /**
  26447. * 显示下拉面板
  26448. */
  26449. showPanel: function showPanel() {
  26450. var _this = this;
  26451. if (!this.inited) {
  26452. this.inited = true;
  26453. if (this.transfer) {
  26454. document.body.appendChild(this.$refs.panel);
  26455. }
  26456. }
  26457. return new Promise(function (resolve) {
  26458. if (!_this.disabled) {
  26459. clearTimeout(_this.hidePanelTimeout);
  26460. _this.isActivated = true;
  26461. _this.animatVisible = true;
  26462. setTimeout(function () {
  26463. _this.visiblePanel = true;
  26464. _this.updatePlacement();
  26465. setTimeout(function () {
  26466. resolve(_this.updatePlacement());
  26467. }, 40);
  26468. }, 10);
  26469. _this.updateZindex();
  26470. } else {
  26471. resolve(_this.$nextTick());
  26472. }
  26473. });
  26474. },
  26475. /**
  26476. * 隐藏下拉面板
  26477. */
  26478. hidePanel: function hidePanel() {
  26479. var _this2 = this;
  26480. this.visiblePanel = false;
  26481. return new Promise(function (resolve) {
  26482. if (_this2.animatVisible) {
  26483. _this2.hidePanelTimeout = setTimeout(function () {
  26484. _this2.animatVisible = false;
  26485. resolve(_this2.$nextTick());
  26486. }, 350);
  26487. } else {
  26488. resolve(_this2.$nextTick());
  26489. }
  26490. });
  26491. },
  26492. /**
  26493. * 手动更新位置
  26494. */
  26495. updatePlacement: function updatePlacement() {
  26496. var _this3 = this;
  26497. return this.$nextTick().then(function () {
  26498. var $refs = _this3.$refs,
  26499. transfer = _this3.transfer,
  26500. placement = _this3.placement,
  26501. panelIndex = _this3.panelIndex,
  26502. visiblePanel = _this3.visiblePanel;
  26503. if (visiblePanel) {
  26504. var panelElem = $refs.panel;
  26505. var targetElem = $refs.content;
  26506. if (panelElem && targetElem) {
  26507. var targetHeight = targetElem.offsetHeight;
  26508. var targetWidth = targetElem.offsetWidth;
  26509. var panelHeight = panelElem.offsetHeight;
  26510. var panelWidth = panelElem.offsetWidth;
  26511. var marginSize = 5;
  26512. var panelStyle = {
  26513. zIndex: panelIndex
  26514. };
  26515. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  26516. boundingTop = _DomTools$getAbsolute.boundingTop,
  26517. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  26518. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  26519. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  26520. var panelPlacement = 'bottom';
  26521. if (transfer) {
  26522. var left = boundingLeft;
  26523. var top = boundingTop + targetHeight;
  26524. if (placement === 'top') {
  26525. panelPlacement = 'top';
  26526. top = boundingTop - panelHeight;
  26527. } else if (!placement) {
  26528. // 如果下面不够放,则向上
  26529. if (top + panelHeight + marginSize > visibleHeight) {
  26530. panelPlacement = 'top';
  26531. top = boundingTop - panelHeight;
  26532. } // 如果上面不够放,则向下(优先)
  26533. if (top < marginSize) {
  26534. panelPlacement = 'bottom';
  26535. top = boundingTop + targetHeight;
  26536. }
  26537. } // 如果溢出右边
  26538. if (left + panelWidth + marginSize > visibleWidth) {
  26539. left -= left + panelWidth + marginSize - visibleWidth;
  26540. } // 如果溢出左边
  26541. if (left < marginSize) {
  26542. left = marginSize;
  26543. }
  26544. Object.assign(panelStyle, {
  26545. left: "".concat(left, "px"),
  26546. top: "".concat(top, "px"),
  26547. minWidth: "".concat(targetWidth, "px")
  26548. });
  26549. } else {
  26550. if (placement === 'top') {
  26551. panelPlacement = 'top';
  26552. panelStyle.bottom = "".concat(targetHeight, "px");
  26553. } else if (!placement) {
  26554. // 如果下面不够放,则向上
  26555. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  26556. // 如果上面不够放,则向下(优先)
  26557. if (boundingTop - targetHeight - panelHeight > marginSize) {
  26558. panelPlacement = 'top';
  26559. panelStyle.bottom = "".concat(targetHeight, "px");
  26560. }
  26561. }
  26562. }
  26563. }
  26564. _this3.panelStyle = panelStyle;
  26565. _this3.panelPlacement = panelPlacement;
  26566. }
  26567. }
  26568. return _this3.$nextTick();
  26569. });
  26570. }
  26571. }
  26572. });
  26573. // CONCATENATED MODULE: ./packages/pulldown/index.js
  26574. pulldown.install = function (Vue) {
  26575. Vue.component(pulldown.name, pulldown);
  26576. };
  26577. var Pulldown = pulldown;
  26578. /* harmony default export */ var packages_pulldown = (pulldown);
  26579. // CONCATENATED MODULE: ./packages/edit/src/mixin.js
  26580. /* harmony default export */ var edit_src_mixin = ({
  26581. methods: {
  26582. /**
  26583. * 往表格中插入临时数据
  26584. *
  26585. * @param {*} records
  26586. */
  26587. _insert: function _insert(records) {
  26588. return this.insertAt(records);
  26589. },
  26590. /**
  26591. * 往表格指定行中插入临时数据
  26592. * 如果 row 为空则从插入到顶部
  26593. * 如果 row 为 -1 则从插入到底部
  26594. * 如果 row 为有效行则插入到该行的位置
  26595. * @param {Object/Array} records 新的数据
  26596. * @param {Row} row 指定行
  26597. */
  26598. _insertAt: function _insertAt(records, row) {
  26599. var _this = this,
  26600. _editStore$insertList;
  26601. var mergeList = this.mergeList,
  26602. afterFullData = this.afterFullData,
  26603. editStore = this.editStore,
  26604. sYOpts = this.sYOpts,
  26605. scrollYLoad = this.scrollYLoad,
  26606. tableFullData = this.tableFullData,
  26607. treeConfig = this.treeConfig;
  26608. if (!ctor_amd_xe_utils_default.a.isArray(records)) {
  26609. records = [records];
  26610. }
  26611. var newRecords = records.map(function (record) {
  26612. return _this.defineField(Object.assign({}, record));
  26613. });
  26614. if (!row) {
  26615. afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
  26616. tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  26617. mergeList.forEach(function (mergeItem) {
  26618. var mergeRowIndex = mergeItem.row;
  26619. if (mergeRowIndex > 0) {
  26620. mergeItem.row = mergeRowIndex + newRecords.length;
  26621. }
  26622. });
  26623. } else {
  26624. if (row === -1) {
  26625. afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
  26626. tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  26627. mergeList.forEach(function (mergeItem) {
  26628. var mergeRowIndex = mergeItem.row,
  26629. mergeRowspan = mergeItem.rowspan;
  26630. if (mergeRowIndex + mergeRowspan > afterFullData.length) {
  26631. mergeItem.rowspan = mergeRowspan + newRecords.length;
  26632. }
  26633. });
  26634. } else {
  26635. if (treeConfig) {
  26636. throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
  26637. }
  26638. var afIndex = afterFullData.indexOf(row);
  26639. if (afIndex === -1) {
  26640. throw new Error(UtilTools.error('vxe.error.unableInsert'));
  26641. }
  26642. afterFullData.splice.apply(afterFullData, _toConsumableArray([afIndex, 0].concat(newRecords)));
  26643. tableFullData.splice.apply(tableFullData, _toConsumableArray([tableFullData.indexOf(row), 0].concat(newRecords))); // 刷新单元格合并
  26644. mergeList.forEach(function (mergeItem) {
  26645. var mergeRowIndex = mergeItem.row,
  26646. mergeRowspan = mergeItem.rowspan;
  26647. if (mergeRowIndex > afIndex) {
  26648. mergeItem.row = mergeRowIndex + newRecords.length;
  26649. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  26650. mergeItem.rowspan = mergeRowspan + newRecords.length;
  26651. }
  26652. });
  26653. }
  26654. }
  26655. (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
  26656. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  26657. this.handleTableData();
  26658. this.updateFooter();
  26659. this.updateCache();
  26660. this.checkSelectionStatus();
  26661. if (scrollYLoad) {
  26662. this.updateScrollYSpace();
  26663. }
  26664. return this.$nextTick().then(function () {
  26665. _this.recalculate();
  26666. _this.updateCellAreas();
  26667. return {
  26668. row: newRecords.length ? newRecords[newRecords.length - 1] : null,
  26669. rows: newRecords
  26670. };
  26671. });
  26672. },
  26673. /**
  26674. * 删除指定行数据
  26675. * 如果传 row 则删除一行
  26676. * 如果传 rows 则删除多行
  26677. * 如果为空则删除所有
  26678. */
  26679. _remove: function _remove(rows) {
  26680. var _this2 = this;
  26681. var afterFullData = this.afterFullData,
  26682. tableFullData = this.tableFullData,
  26683. treeConfig = this.treeConfig,
  26684. mergeList = this.mergeList,
  26685. editStore = this.editStore,
  26686. checkboxOpts = this.checkboxOpts,
  26687. selection = this.selection,
  26688. isInsertByRow = this.isInsertByRow,
  26689. sYOpts = this.sYOpts,
  26690. scrollYLoad = this.scrollYLoad;
  26691. var actived = editStore.actived,
  26692. removeList = editStore.removeList,
  26693. insertList = editStore.insertList;
  26694. var property = checkboxOpts.checkField;
  26695. var rest = [];
  26696. if (!rows) {
  26697. rows = tableFullData;
  26698. } else if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
  26699. rows = [rows];
  26700. } // 如果是新增,则保存记录
  26701. rows.forEach(function (row) {
  26702. if (!isInsertByRow(row)) {
  26703. removeList.push(row);
  26704. }
  26705. }); // 如果绑定了多选属性,则更新状态
  26706. if (!property) {
  26707. rows.forEach(function (row) {
  26708. var sIndex = selection.indexOf(row);
  26709. if (sIndex > -1) {
  26710. selection.splice(sIndex, 1);
  26711. }
  26712. });
  26713. } // 从数据源中移除
  26714. if (tableFullData === rows) {
  26715. rows = rest = tableFullData.slice(0);
  26716. this.tableFullData = [];
  26717. this.afterFullData = [];
  26718. this.clearMergeCells();
  26719. } else {
  26720. rows.forEach(function (row) {
  26721. var tfIndex = tableFullData.indexOf(row);
  26722. if (tfIndex > -1) {
  26723. var rItems = tableFullData.splice(tfIndex, 1);
  26724. rest.push(rItems[0]);
  26725. }
  26726. var afIndex = afterFullData.indexOf(row);
  26727. if (afIndex > -1) {
  26728. // 刷新单元格合并
  26729. mergeList.forEach(function (mergeItem) {
  26730. var mergeRowIndex = mergeItem.row,
  26731. mergeRowspan = mergeItem.rowspan;
  26732. if (mergeRowIndex > afIndex) {
  26733. mergeItem.row = mergeRowIndex - 1;
  26734. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  26735. mergeItem.rowspan = mergeRowspan - 1;
  26736. }
  26737. });
  26738. afterFullData.splice(afIndex, 1);
  26739. }
  26740. });
  26741. } // 如果当前行被激活编辑,则清除激活状态
  26742. if (actived.row && rows.indexOf(actived.row) > -1) {
  26743. this.clearActived();
  26744. } // 从新增中移除已删除的数据
  26745. rows.forEach(function (row) {
  26746. var iIndex = insertList.indexOf(row);
  26747. if (iIndex > -1) {
  26748. insertList.splice(iIndex, 1);
  26749. }
  26750. });
  26751. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  26752. this.handleTableData();
  26753. this.updateFooter();
  26754. this.updateCache();
  26755. this.checkSelectionStatus();
  26756. if (scrollYLoad) {
  26757. this.updateScrollYSpace();
  26758. }
  26759. return this.$nextTick().then(function () {
  26760. _this2.recalculate();
  26761. _this2.updateCellAreas();
  26762. return {
  26763. row: rest.length ? rest[rest.length - 1] : null,
  26764. rows: rest
  26765. };
  26766. });
  26767. },
  26768. _removeSelecteds: function _removeSelecteds() {
  26769. // 在 v3 中废弃 removeSelecteds
  26770. UtilTools.warn('vxe.error.delFunc', ['removeSelecteds', 'removeCheckboxRow']);
  26771. return this.removeCheckboxRow();
  26772. },
  26773. /**
  26774. * 删除复选框选中的数据
  26775. */
  26776. _removeCheckboxRow: function _removeCheckboxRow() {
  26777. var _this3 = this;
  26778. return this.remove(this.getCheckboxRecords()).then(function (params) {
  26779. _this3.clearCheckboxRow();
  26780. return params;
  26781. });
  26782. },
  26783. /**
  26784. * 删除单选框选中的数据
  26785. */
  26786. _removeRadioRow: function _removeRadioRow() {
  26787. var _this4 = this;
  26788. var radioRecord = this.getRadioRecord();
  26789. return this.remove(radioRecord || []).then(function (params) {
  26790. _this4.clearRadioRow();
  26791. return params;
  26792. });
  26793. },
  26794. /**
  26795. * 删除当前行选中的数据
  26796. */
  26797. _removeCurrentRow: function _removeCurrentRow() {
  26798. var _this5 = this;
  26799. var currentRecord = this.getCurrentRecord();
  26800. return this.remove(currentRecord || []).then(function (params) {
  26801. _this5.clearCurrentRow();
  26802. return params;
  26803. });
  26804. },
  26805. /**
  26806. * 获取表格数据集,包含新增、删除、修改
  26807. */
  26808. _getRecordset: function _getRecordset() {
  26809. return {
  26810. insertRecords: this.getInsertRecords(),
  26811. removeRecords: this.getRemoveRecords(),
  26812. updateRecords: this.getUpdateRecords()
  26813. };
  26814. },
  26815. /**
  26816. * 获取新增的临时数据
  26817. */
  26818. _getInsertRecords: function _getInsertRecords() {
  26819. var insertList = this.editStore.insertList;
  26820. var insertRecords = [];
  26821. if (insertList.length) {
  26822. this.tableFullData.forEach(function (row) {
  26823. if (insertList.indexOf(row) > -1) {
  26824. insertRecords.push(row);
  26825. }
  26826. });
  26827. }
  26828. return insertRecords;
  26829. },
  26830. /**
  26831. * 获取已删除的数据
  26832. */
  26833. _getRemoveRecords: function _getRemoveRecords() {
  26834. return this.editStore.removeList;
  26835. },
  26836. /**
  26837. * 获取更新数据
  26838. * 只精准匹配 row 的更改
  26839. * 如果是树表格,子节点更改状态不会影响父节点的更新状态
  26840. */
  26841. _getUpdateRecords: function _getUpdateRecords() {
  26842. var keepSource = this.keepSource,
  26843. tableFullData = this.tableFullData,
  26844. isUpdateByRow = this.isUpdateByRow,
  26845. treeConfig = this.treeConfig,
  26846. treeOpts = this.treeOpts,
  26847. editStore = this.editStore; // 在 v3 中必须要开启 keep-source
  26848. if (!keepSource) {
  26849. UtilTools.warn('vxe.error.reqProp', ['keep-source']);
  26850. }
  26851. if (keepSource) {
  26852. var actived = editStore.actived;
  26853. var row = actived.row,
  26854. column = actived.column;
  26855. if (row || column) {
  26856. this._syncActivedCell();
  26857. }
  26858. if (treeConfig) {
  26859. return ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  26860. return isUpdateByRow(row);
  26861. }, treeOpts);
  26862. }
  26863. return tableFullData.filter(function (row) {
  26864. return isUpdateByRow(row);
  26865. });
  26866. }
  26867. return [];
  26868. },
  26869. /**
  26870. * 处理激活编辑
  26871. */
  26872. handleActived: function handleActived(params, evnt) {
  26873. var _this6 = this;
  26874. var editStore = this.editStore,
  26875. editOpts = this.editOpts,
  26876. tableColumn = this.tableColumn,
  26877. mouseConfig = this.mouseConfig;
  26878. var mode = editOpts.mode,
  26879. activeMethod = editOpts.activeMethod;
  26880. var actived = editStore.actived;
  26881. var row = params.row,
  26882. column = params.column;
  26883. var editRender = column.editRender;
  26884. var cell = params.cell = params.cell || this.getCell(row, column);
  26885. if (UtilTools.isEnableConf(editRender) && cell) {
  26886. if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
  26887. // 判断是否禁用编辑
  26888. var type = 'edit-disabled';
  26889. if (!activeMethod || activeMethod(params)) {
  26890. if (mouseConfig) {
  26891. this.clearCopyed(evnt);
  26892. this.clearChecked();
  26893. this.clearSelected(evnt);
  26894. this.clearCellAreas(evnt);
  26895. this.clearCopyCellArea(evnt);
  26896. }
  26897. this.closeTooltip();
  26898. this.clearActived(evnt);
  26899. type = 'edit-actived';
  26900. column.renderHeight = cell.offsetHeight;
  26901. actived.args = params;
  26902. actived.row = row;
  26903. actived.column = column;
  26904. if (mode === 'row') {
  26905. tableColumn.forEach(function (column) {
  26906. return _this6._getColumnModel(row, column);
  26907. });
  26908. } else {
  26909. this._getColumnModel(row, column);
  26910. }
  26911. this.$nextTick(function () {
  26912. _this6.handleFocus(params, evnt);
  26913. });
  26914. }
  26915. this.emitEvent(type, Object.assign({}, params, {
  26916. row: row,
  26917. rowIndex: this.getRowIndex(row),
  26918. $rowIndex: this.getVMRowIndex(row),
  26919. column: column,
  26920. columnIndex: this.getColumnIndex(column),
  26921. $columnIndex: this.getVMColumnIndex(column)
  26922. }), evnt);
  26923. } else {
  26924. var oldColumn = actived.column;
  26925. if (mouseConfig) {
  26926. this.clearCopyed(evnt);
  26927. this.clearChecked();
  26928. this.clearSelected(evnt);
  26929. this.clearCellAreas(evnt);
  26930. this.clearCopyCellArea(evnt);
  26931. }
  26932. if (oldColumn !== column) {
  26933. var oldModel = oldColumn.model;
  26934. if (oldModel.update) {
  26935. UtilTools.setCellValue(row, oldColumn, oldModel.value);
  26936. }
  26937. this.clearValidate();
  26938. }
  26939. column.renderHeight = cell.offsetHeight;
  26940. actived.args = params;
  26941. actived.column = column;
  26942. setTimeout(function () {
  26943. _this6.handleFocus(params, evnt);
  26944. });
  26945. }
  26946. this.focus();
  26947. }
  26948. return this.$nextTick();
  26949. },
  26950. _getColumnModel: function _getColumnModel(row, column) {
  26951. var model = column.model,
  26952. editRender = column.editRender;
  26953. if (editRender) {
  26954. model.value = UtilTools.getCellValue(row, column);
  26955. model.update = false;
  26956. }
  26957. },
  26958. _setColumnModel: function _setColumnModel(row, column) {
  26959. var model = column.model,
  26960. editRender = column.editRender;
  26961. if (editRender && model.update) {
  26962. UtilTools.setCellValue(row, column, model.value);
  26963. model.update = false;
  26964. model.value = null;
  26965. }
  26966. },
  26967. _syncActivedCell: function _syncActivedCell() {
  26968. var _this7 = this;
  26969. var tableColumn = this.tableColumn,
  26970. editStore = this.editStore,
  26971. editOpts = this.editOpts;
  26972. var actived = editStore.actived;
  26973. var row = actived.row,
  26974. column = actived.column;
  26975. if (row || column) {
  26976. if (editOpts.mode === 'row') {
  26977. tableColumn.forEach(function (column) {
  26978. return _this7._setColumnModel(row, column);
  26979. });
  26980. } else {
  26981. this._setColumnModel(row, column);
  26982. }
  26983. }
  26984. },
  26985. /**
  26986. * 清除激活的编辑
  26987. */
  26988. _clearActived: function _clearActived(evnt) {
  26989. var editStore = this.editStore;
  26990. var actived = editStore.actived;
  26991. var args = actived.args,
  26992. row = actived.row,
  26993. column = actived.column;
  26994. if (row || column) {
  26995. this._syncActivedCell();
  26996. actived.args = null;
  26997. actived.row = null;
  26998. actived.column = null;
  26999. this.updateFooter();
  27000. this.emitEvent('edit-closed', Object.assign({}, args, {
  27001. row: row,
  27002. rowIndex: this.getRowIndex(row),
  27003. $rowIndex: this.getVMRowIndex(row),
  27004. column: column,
  27005. columnIndex: this.getColumnIndex(column),
  27006. $columnIndex: this.getVMColumnIndex(column)
  27007. }), evnt);
  27008. }
  27009. return (v_x_e_table._valid ? this.clearValidate() : this.$nextTick()).then(this.recalculate);
  27010. },
  27011. // 在 v3.0 中废弃 getActiveRow
  27012. _getActiveRow: function _getActiveRow() {
  27013. UtilTools.warn('vxe.error.delFunc', ['getActiveRow', 'getActiveRecord']);
  27014. return this.getActiveRecord();
  27015. },
  27016. _getActiveRecord: function _getActiveRecord() {
  27017. var $el = this.$el,
  27018. editStore = this.editStore,
  27019. afterFullData = this.afterFullData;
  27020. var _editStore$actived = editStore.actived,
  27021. args = _editStore$actived.args,
  27022. row = _editStore$actived.row;
  27023. if (args && afterFullData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
  27024. return Object.assign({}, args);
  27025. }
  27026. return null;
  27027. },
  27028. // 在 v3.0 中废弃 hasActiveRow
  27029. _hasActiveRow: function _hasActiveRow(row) {
  27030. UtilTools.warn('vxe.error.delFunc', ['hasActiveRow', 'isActiveByRow']);
  27031. return this.isActiveByRow(row);
  27032. },
  27033. /**
  27034. * 判断行是否为激活编辑状态
  27035. * @param {Row} row 行对象
  27036. */
  27037. _isActiveByRow: function _isActiveByRow(row) {
  27038. return this.editStore.actived.row === row;
  27039. },
  27040. /**
  27041. * 处理聚焦
  27042. */
  27043. handleFocus: function handleFocus(params) {
  27044. var row = params.row,
  27045. column = params.column,
  27046. cell = params.cell;
  27047. var editRender = column.editRender;
  27048. if (UtilTools.isEnableConf(editRender)) {
  27049. var compRender = v_x_e_table.renderer.get(editRender.name);
  27050. var autofocus = editRender.autofocus,
  27051. autoselect = editRender.autoselect;
  27052. var inputElem; // 如果指定了聚焦 class
  27053. if (autofocus) {
  27054. inputElem = cell.querySelector(autofocus);
  27055. } // 渲染器的聚焦处理
  27056. if (!inputElem && compRender && compRender.autofocus) {
  27057. inputElem = cell.querySelector(compRender.autofocus);
  27058. }
  27059. if (inputElem) {
  27060. inputElem.focus();
  27061. if (autoselect) {
  27062. inputElem.select();
  27063. } else {
  27064. // 保持一致行为,光标移到末端
  27065. if (DomTools.browse.msie) {
  27066. var textRange = inputElem.createTextRange();
  27067. textRange.collapse(false);
  27068. textRange.select();
  27069. }
  27070. }
  27071. } else {
  27072. // 显示到可视区中
  27073. this.scrollToRow(row, column);
  27074. }
  27075. }
  27076. },
  27077. /**
  27078. * 激活行编辑
  27079. */
  27080. _setActiveRow: function _setActiveRow(row) {
  27081. return this.setActiveCell(row, ctor_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
  27082. return UtilTools.isEnableConf(column.editRender);
  27083. }));
  27084. },
  27085. /**
  27086. * 激活单元格编辑
  27087. */
  27088. _setActiveCell: function _setActiveCell(row, fieldOrColumn) {
  27089. var _this8 = this;
  27090. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  27091. if (row && column && UtilTools.isEnableConf(column.editRender)) {
  27092. return this.scrollToRow(row, true).then(function () {
  27093. var cell = _this8.getCell(row, column);
  27094. if (cell) {
  27095. _this8.handleActived({
  27096. row: row,
  27097. rowIndex: _this8.getRowIndex(row),
  27098. column: column,
  27099. columnIndex: _this8.getColumnIndex(column),
  27100. cell: cell,
  27101. $table: _this8
  27102. });
  27103. _this8.lastCallTime = Date.now();
  27104. }
  27105. });
  27106. }
  27107. return this.$nextTick();
  27108. },
  27109. /**
  27110. * 只对 trigger=dblclick 有效,选中单元格
  27111. */
  27112. _setSelectCell: function _setSelectCell(row, fieldOrColumn) {
  27113. var tableData = this.tableData,
  27114. editOpts = this.editOpts,
  27115. visibleColumn = this.visibleColumn;
  27116. var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  27117. if (row && column && editOpts.trigger !== 'manual') {
  27118. var rowIndex = tableData.indexOf(row);
  27119. if (rowIndex > -1 && column) {
  27120. var cell = this.getCell(row, column);
  27121. var params = {
  27122. row: row,
  27123. rowIndex: rowIndex,
  27124. column: column,
  27125. columnIndex: visibleColumn.indexOf(column),
  27126. cell: cell
  27127. };
  27128. this.handleSelected(params, {});
  27129. }
  27130. }
  27131. return this.$nextTick();
  27132. },
  27133. /**
  27134. * 处理选中源
  27135. */
  27136. handleSelected: function handleSelected(params, evnt) {
  27137. var _this9 = this;
  27138. var mouseConfig = this.mouseConfig,
  27139. mouseOpts = this.mouseOpts,
  27140. editOpts = this.editOpts,
  27141. editStore = this.editStore,
  27142. elemStore = this.elemStore;
  27143. var actived = editStore.actived,
  27144. selected = editStore.selected;
  27145. var row = params.row,
  27146. column = params.column,
  27147. cell = params.cell;
  27148. var isMouseSelected = mouseConfig && mouseOpts.selected; // 在 v3.0 中废弃 mouse-config.checked
  27149. var isMouseChecked = mouseConfig && mouseOpts.checked;
  27150. var selectMethod = function selectMethod() {
  27151. if ((isMouseSelected || isMouseChecked) && (selected.row !== row || selected.column !== column)) {
  27152. if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
  27153. if (_this9.keyboardConfig) {
  27154. _this9.clearChecked(evnt);
  27155. _this9.clearIndexChecked();
  27156. _this9.clearHeaderChecked();
  27157. }
  27158. _this9.clearActived(evnt);
  27159. _this9.clearSelected(evnt);
  27160. _this9.clearCellAreas(evnt);
  27161. _this9.clearCopyCellArea(evnt);
  27162. selected.args = params;
  27163. selected.row = row;
  27164. selected.column = column;
  27165. if (isMouseSelected) {
  27166. _this9.addColSdCls();
  27167. } // 如果配置了批量选中功能,则为批量选中状态
  27168. if (isMouseChecked) {
  27169. var headerElem = elemStore['main-header-list'];
  27170. _this9.handleChecked([[cell]]);
  27171. if (headerElem) {
  27172. _this9.handleHeaderChecked([[headerElem.querySelector(".".concat(column.id))]]);
  27173. }
  27174. _this9.handleIndexChecked([[cell.parentNode.querySelector('.col--seq')]]);
  27175. }
  27176. _this9.focus();
  27177. if (evnt) {
  27178. _this9.emitEvent('cell-selected', params, evnt);
  27179. }
  27180. }
  27181. }
  27182. return _this9.$nextTick();
  27183. };
  27184. return selectMethod();
  27185. },
  27186. /**
  27187. * 清除所选中源状态
  27188. */
  27189. _clearSelected: function _clearSelected() {
  27190. var selected = this.editStore.selected;
  27191. selected.row = null;
  27192. selected.column = null;
  27193. this.reColTitleSdCls();
  27194. this.reColSdCls();
  27195. return this.$nextTick();
  27196. },
  27197. reColTitleSdCls: function reColTitleSdCls() {
  27198. var headerElem = this.elemStore['main-header-list'];
  27199. if (headerElem) {
  27200. ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) {
  27201. return DomTools.removeClass(elem, 'col--title-selected');
  27202. });
  27203. }
  27204. },
  27205. reColSdCls: function reColSdCls() {
  27206. var cell = this.$el.querySelector('.col--selected');
  27207. if (cell) {
  27208. DomTools.removeClass(cell, 'col--selected');
  27209. }
  27210. },
  27211. addColSdCls: function addColSdCls() {
  27212. var selected = this.editStore.selected;
  27213. var row = selected.row,
  27214. column = selected.column;
  27215. this.reColSdCls();
  27216. if (row && column) {
  27217. var cell = this.getCell(row, column);
  27218. if (cell) {
  27219. DomTools.addClass(cell, 'col--selected');
  27220. }
  27221. }
  27222. }
  27223. }
  27224. });
  27225. // CONCATENATED MODULE: ./packages/edit/index.js
  27226. var Edit = {
  27227. install: function install() {
  27228. v_x_e_table.reg('edit');
  27229. packages_table.mixins.push(edit_src_mixin);
  27230. }
  27231. };
  27232. /* harmony default export */ var edit = (Edit);
  27233. // CONCATENATED MODULE: ./packages/export/src/export-panel.js
  27234. /* harmony default export */ var export_panel = ({
  27235. name: 'VxeExportPanel',
  27236. props: {
  27237. defaultOptions: Object,
  27238. storeData: Object
  27239. },
  27240. components: {
  27241. VxeModal: modal,
  27242. VxeInput: input,
  27243. VxeCheckbox: src_checkbox,
  27244. VxeSelect: src_select,
  27245. VxeOption: src_option
  27246. },
  27247. data: function data() {
  27248. return {
  27249. isAll: false,
  27250. isIndeterminate: false,
  27251. loading: false
  27252. };
  27253. },
  27254. computed: {
  27255. vSize: function vSize() {
  27256. return this.size || this.$parent.size || this.$parent.vSize;
  27257. },
  27258. showSheet: function showSheet() {
  27259. return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
  27260. }
  27261. },
  27262. render: function render(h) {
  27263. var _this = this;
  27264. var _e = this._e,
  27265. isAll = this.isAll,
  27266. isIndeterminate = this.isIndeterminate,
  27267. showSheet = this.showSheet,
  27268. defaultOptions = this.defaultOptions,
  27269. storeData = this.storeData;
  27270. var cols = [];
  27271. ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  27272. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  27273. var isColGroup = column.children && column.children.length;
  27274. cols.push(h('li', {
  27275. class: ['vxe-export--panel-column-option', "level--".concat(column.level), {
  27276. 'is--group': isColGroup,
  27277. 'is--checked': column.checked,
  27278. 'is--indeterminate': column.halfChecked,
  27279. 'is--disabled': column.disabled
  27280. }],
  27281. attrs: {
  27282. title: colTitle
  27283. },
  27284. on: {
  27285. click: function click() {
  27286. if (!column.disabled) {
  27287. _this.changeOption(column);
  27288. }
  27289. }
  27290. }
  27291. }, [h('span', {
  27292. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  27293. }), h('span', {
  27294. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  27295. }), h('span', {
  27296. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  27297. }), h('span', {
  27298. class: 'vxe-checkbox--label'
  27299. }, colTitle)]));
  27300. });
  27301. return h('vxe-modal', {
  27302. res: 'modal',
  27303. props: {
  27304. value: storeData.visible,
  27305. title: conf.i18n('vxe.export.expTitle'),
  27306. width: 660,
  27307. mask: true,
  27308. lockView: true,
  27309. showFooter: false,
  27310. escClosable: true,
  27311. maskClosable: true,
  27312. loading: this.loading
  27313. },
  27314. on: {
  27315. input: function input(value) {
  27316. storeData.visible = value;
  27317. },
  27318. show: this.showEvent
  27319. }
  27320. }, [h('div', {
  27321. class: 'vxe-export--panel'
  27322. }, [h('table', {
  27323. attrs: {
  27324. cellspacing: 0,
  27325. cellpadding: 0,
  27326. border: 0
  27327. }
  27328. }, [h('tbody', [[h('tr', [h('td', conf.i18n('vxe.export.expName')), h('td', [h('vxe-input', {
  27329. ref: 'filename',
  27330. props: {
  27331. value: defaultOptions.filename,
  27332. type: 'text',
  27333. clearable: true,
  27334. placeholder: conf.i18n('vxe.export.expNamePlaceholder')
  27335. },
  27336. on: {
  27337. input: function input(value) {
  27338. defaultOptions.filename = value;
  27339. }
  27340. }
  27341. })])]), h('tr', [h('td', conf.i18n('vxe.export.expType')), h('td', [h('vxe-select', {
  27342. props: {
  27343. value: defaultOptions.type
  27344. },
  27345. on: {
  27346. input: function input(value) {
  27347. defaultOptions.type = value;
  27348. }
  27349. }
  27350. }, storeData.typeList.map(function (item) {
  27351. return h('vxe-option', {
  27352. props: {
  27353. value: item.value,
  27354. label: conf.i18n(item.label)
  27355. }
  27356. });
  27357. }))])]), showSheet ? h('tr', [h('td', conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
  27358. props: {
  27359. value: defaultOptions.sheetName,
  27360. type: 'text',
  27361. clearable: true,
  27362. placeholder: conf.i18n('vxe.export.expSheetNamePlaceholder')
  27363. },
  27364. on: {
  27365. input: function input(value) {
  27366. defaultOptions.sheetName = value;
  27367. }
  27368. }
  27369. })])]) : _e(), h('tr', [h('td', conf.i18n('vxe.export.expMode')), h('td', [h('vxe-select', {
  27370. props: {
  27371. value: defaultOptions.mode
  27372. },
  27373. on: {
  27374. input: function input(value) {
  27375. defaultOptions.mode = value;
  27376. }
  27377. }
  27378. }, storeData.modeList.map(function (item) {
  27379. return h('vxe-option', {
  27380. props: {
  27381. value: item.value,
  27382. label: conf.i18n(item.label)
  27383. }
  27384. });
  27385. }))])]), h('tr', [h('td', [conf.i18n('vxe.export.expColumn')]), h('td', [h('div', {
  27386. class: 'vxe-export--panel-column'
  27387. }, [h('ul', {
  27388. class: 'vxe-export--panel-column-header'
  27389. }, [h('li', {
  27390. class: ['vxe-export--panel-column-option', {
  27391. 'is--checked': isAll,
  27392. 'is--indeterminate': isIndeterminate
  27393. }],
  27394. attrs: {
  27395. title: conf.i18n('vxe.table.allTitle')
  27396. },
  27397. on: {
  27398. click: this.allColumnEvent
  27399. }
  27400. }, [h('span', {
  27401. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  27402. }), h('span', {
  27403. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  27404. }), h('span', {
  27405. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  27406. }), h('span', {
  27407. class: 'vxe-checkbox--label'
  27408. }, conf.i18n('vxe.export.expCurrentColumn'))])]), h('ul', {
  27409. class: 'vxe-export--panel-column-body'
  27410. }, cols)])])]), h('tr', [h('td', conf.i18n('vxe.export.expOpts')), h('td', [h('vxe-checkbox', {
  27411. props: {
  27412. value: defaultOptions.isHeader,
  27413. title: conf.i18n('vxe.export.expHeaderTitle')
  27414. },
  27415. on: {
  27416. input: function input(value) {
  27417. defaultOptions.isHeader = value;
  27418. }
  27419. }
  27420. }, conf.i18n('vxe.export.expOptHeader')), h('vxe-checkbox', {
  27421. props: {
  27422. value: defaultOptions.isFooter,
  27423. disabled: !storeData.hasFooter,
  27424. title: conf.i18n('vxe.export.expFooterTitle')
  27425. },
  27426. on: {
  27427. input: function input(value) {
  27428. defaultOptions.isFooter = value;
  27429. }
  27430. }
  27431. }, conf.i18n('vxe.export.expOptFooter')), h('vxe-checkbox', {
  27432. props: {
  27433. value: defaultOptions.original,
  27434. title: conf.i18n('vxe.export.expOriginalTitle')
  27435. },
  27436. on: {
  27437. input: function input(value) {
  27438. defaultOptions.original = value;
  27439. }
  27440. }
  27441. }, conf.i18n('vxe.export.expOptOriginal'))])])]])]), h('div', {
  27442. class: 'vxe-export--panel-btns'
  27443. }, [defaultOptions.isPrint ? h('vxe-button', {
  27444. on: {
  27445. click: this.printEvent
  27446. }
  27447. }, conf.i18n('vxe.export.expPrint')) : null, h('vxe-button', {
  27448. props: {
  27449. status: 'primary'
  27450. },
  27451. on: {
  27452. click: this.exportEvent
  27453. }
  27454. }, conf.i18n('vxe.export.expConfirm'))])])]);
  27455. },
  27456. methods: {
  27457. changeOption: function changeOption(column) {
  27458. var isChecked = !column.checked;
  27459. ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
  27460. item.checked = isChecked;
  27461. item.halfChecked = false;
  27462. });
  27463. this.handleOptionCheck(column);
  27464. this.checkStatus();
  27465. },
  27466. handleOptionCheck: function handleOptionCheck(column) {
  27467. var matchObj = ctor_amd_xe_utils_default.a.findTree(this.storeData.columns, function (item) {
  27468. return item === column;
  27469. });
  27470. if (matchObj && matchObj.parent) {
  27471. var parent = matchObj.parent;
  27472. if (parent.children && parent.children.length) {
  27473. parent.checked = parent.children.every(function (column) {
  27474. return column.checked;
  27475. });
  27476. parent.halfChecked = !parent.checked && parent.children.some(function (column) {
  27477. return column.checked || column.halfChecked;
  27478. });
  27479. this.handleOptionCheck(parent);
  27480. }
  27481. }
  27482. },
  27483. checkStatus: function checkStatus() {
  27484. var columns = this.storeData.columns;
  27485. this.isAll = columns.every(function (column) {
  27486. return column.disabled || column.checked;
  27487. });
  27488. this.isIndeterminate = !this.isAll && columns.some(function (column) {
  27489. return !column.disabled && (column.checked || column.halfChecked);
  27490. });
  27491. },
  27492. allColumnEvent: function allColumnEvent() {
  27493. var isAll = !this.isAll;
  27494. ctor_amd_xe_utils_default.a.eachTree(this.storeData.columns, function (column) {
  27495. if (!column.disabled) {
  27496. column.checked = isAll;
  27497. column.halfChecked = false;
  27498. }
  27499. });
  27500. this.isAll = isAll;
  27501. this.checkStatus();
  27502. },
  27503. showEvent: function showEvent() {
  27504. var _this2 = this;
  27505. this.$nextTick(function () {
  27506. _this2.$refs.filename.focus();
  27507. });
  27508. this.checkStatus();
  27509. },
  27510. getExportOption: function getExportOption() {
  27511. var storeData = this.storeData,
  27512. defaultOptions = this.defaultOptions;
  27513. var checkColumns = [];
  27514. ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  27515. var isColGroup = column.children && column.children.length;
  27516. if (!isColGroup && column.checked) {
  27517. checkColumns.push(column);
  27518. }
  27519. });
  27520. return Object.assign({}, defaultOptions, {
  27521. columns: checkColumns
  27522. });
  27523. },
  27524. printEvent: function printEvent() {
  27525. var $xetable = this.$parent;
  27526. this.storeData.visible = false;
  27527. $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
  27528. },
  27529. exportEvent: function exportEvent() {
  27530. var _this3 = this;
  27531. var $xetable = this.$parent;
  27532. this.loading = true;
  27533. $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(function () {
  27534. _this3.loading = false;
  27535. _this3.storeData.visible = false;
  27536. }).catch(function () {
  27537. _this3.loading = false;
  27538. });
  27539. }
  27540. }
  27541. });
  27542. // CONCATENATED MODULE: ./packages/export/src/import-panel.js
  27543. /* harmony default export */ var import_panel = ({
  27544. name: 'VxeImportPanel',
  27545. props: {
  27546. defaultOptions: Object,
  27547. storeData: Object
  27548. },
  27549. components: {
  27550. VxeModal: modal,
  27551. VxeRadio: src_radio
  27552. },
  27553. data: function data() {
  27554. return {
  27555. loading: false
  27556. };
  27557. },
  27558. computed: {
  27559. vSize: function vSize() {
  27560. return this.size || this.$parent.size || this.$parent.vSize;
  27561. },
  27562. selectName: function selectName() {
  27563. return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
  27564. },
  27565. hasFile: function hasFile() {
  27566. return this.storeData.file && this.storeData.type;
  27567. },
  27568. parseTypeLabel: function parseTypeLabel() {
  27569. var storeData = this.storeData;
  27570. var type = storeData.type,
  27571. typeList = storeData.typeList;
  27572. if (type) {
  27573. var selectItem = ctor_amd_xe_utils_default.a.find(typeList, function (item) {
  27574. return type === item.value;
  27575. });
  27576. return selectItem ? conf.i18n(selectItem.label) : '*.*';
  27577. }
  27578. return "*.".concat(typeList.map(function (item) {
  27579. return item.value;
  27580. }).join(', *.'));
  27581. }
  27582. },
  27583. render: function render(h) {
  27584. var hasFile = this.hasFile,
  27585. parseTypeLabel = this.parseTypeLabel,
  27586. defaultOptions = this.defaultOptions,
  27587. storeData = this.storeData,
  27588. selectName = this.selectName;
  27589. return h('vxe-modal', {
  27590. res: 'modal',
  27591. props: {
  27592. value: storeData.visible,
  27593. title: conf.i18n('vxe.import.impTitle'),
  27594. width: 440,
  27595. mask: true,
  27596. lockView: true,
  27597. showFooter: false,
  27598. escClosable: true,
  27599. maskClosable: true,
  27600. loading: this.loading
  27601. },
  27602. on: {
  27603. input: function input(value) {
  27604. storeData.visible = value;
  27605. }
  27606. }
  27607. }, [h('div', {
  27608. class: 'vxe-export--panel'
  27609. }, [h('table', {
  27610. attrs: {
  27611. cellspacing: 0,
  27612. cellpadding: 0,
  27613. border: 0
  27614. }
  27615. }, [h('tbody', [h('tr', [h('td', conf.i18n('vxe.import.impFile')), h('td', [hasFile ? h('div', {
  27616. class: 'vxe-import-selected--file',
  27617. attrs: {
  27618. title: selectName
  27619. }
  27620. }, [h('span', selectName), h('i', {
  27621. class: conf.icon.INPUT_CLEAR,
  27622. on: {
  27623. click: this.clearFileEvent
  27624. }
  27625. })]) : h('span', {
  27626. class: 'vxe-import-select--file',
  27627. on: {
  27628. click: this.selectFileEvent
  27629. }
  27630. }, 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', {
  27631. props: {
  27632. value: defaultOptions.mode
  27633. },
  27634. on: {
  27635. input: function input(value) {
  27636. defaultOptions.mode = value;
  27637. }
  27638. }
  27639. }, storeData.modeList.map(function (item) {
  27640. return h('vxe-radio', {
  27641. props: {
  27642. label: item.value
  27643. }
  27644. }, conf.i18n(item.label));
  27645. }))])])])]), h('div', {
  27646. class: 'vxe-export--panel-btns'
  27647. }, [h('vxe-button', {
  27648. props: {
  27649. status: 'primary',
  27650. disabled: !hasFile
  27651. },
  27652. on: {
  27653. click: this.importEvent
  27654. }
  27655. }, conf.i18n('vxe.import.impConfirm'))])])]);
  27656. },
  27657. methods: {
  27658. clearFileEvent: function clearFileEvent() {
  27659. Object.assign(this.storeData, {
  27660. filename: '',
  27661. sheetName: '',
  27662. type: ''
  27663. });
  27664. },
  27665. selectFileEvent: function selectFileEvent() {
  27666. var _this = this;
  27667. var $xetable = this.$parent;
  27668. $xetable.readFile(this.defaultOptions).then(function (params) {
  27669. var file = params.file;
  27670. Object.assign(_this.storeData, UtilTools.parseFile(file), {
  27671. file: file
  27672. });
  27673. }).catch(function (e) {
  27674. return e;
  27675. });
  27676. },
  27677. importEvent: function importEvent() {
  27678. var _this2 = this;
  27679. var $xetable = this.$parent;
  27680. this.loading = true;
  27681. $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
  27682. _this2.loading = false;
  27683. _this2.storeData.visible = false;
  27684. }).catch(function () {
  27685. _this2.loading = false;
  27686. });
  27687. }
  27688. }
  27689. });
  27690. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
  27691. var es_array_includes = __webpack_require__("caad");
  27692. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
  27693. var es_string_includes = __webpack_require__("2532");
  27694. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
  27695. var web_url = __webpack_require__("2b3d");
  27696. // CONCATENATED MODULE: ./packages/export/src/mixin.js
  27697. // 默认导出或打印的 HTML 样式
  27698. 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}';
  27699. var htmlCellElem; // 导入
  27700. var fileForm;
  27701. var fileInput; // 打印
  27702. var printFrame;
  27703. var csvBOM = "\uFEFF";
  27704. var enterSymbol = '\r\n';
  27705. function createFrame() {
  27706. var frame = document.createElement('iframe');
  27707. frame.className = 'vxe-table--print-frame';
  27708. return frame;
  27709. }
  27710. function getExportBlobByContent(content, options) {
  27711. if (window.Blob) {
  27712. return new Blob([content], {
  27713. type: "text/".concat(options.type)
  27714. });
  27715. }
  27716. return null;
  27717. }
  27718. function hasTreeChildren($xetable, row) {
  27719. var treeOpts = $xetable.treeOpts;
  27720. return row[treeOpts.children] && row[treeOpts.children].length;
  27721. }
  27722. function getSeq($xetable, row, rowIndex, column, columnIndex) {
  27723. // 在 v3.0 中废弃 startIndex、indexMethod
  27724. var seqOpts = $xetable.seqOpts;
  27725. var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
  27726. return seqMethod ? seqMethod({
  27727. row: row,
  27728. rowIndex: rowIndex,
  27729. column: column,
  27730. columnIndex: columnIndex
  27731. }) : (seqOpts.startIndex || $xetable.startIndex) + rowIndex + 1;
  27732. }
  27733. function defaultFilterExportColumn(column) {
  27734. return column.property || ['seq', 'index', 'checkbox', 'selection', 'radio'].indexOf(column.type) > -1;
  27735. }
  27736. function toTableBorder(border) {
  27737. if (border === true) {
  27738. return 'full';
  27739. }
  27740. if (border) {
  27741. return border;
  27742. }
  27743. return 'default';
  27744. }
  27745. function toBooleanValue(cellValue) {
  27746. return ctor_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
  27747. }
  27748. function getLabelData($xetable, opts, columns, datas) {
  27749. var treeConfig = $xetable.treeConfig,
  27750. treeOpts = $xetable.treeOpts,
  27751. radioOpts = $xetable.radioOpts,
  27752. checkboxOpts = $xetable.checkboxOpts;
  27753. if (!htmlCellElem) {
  27754. htmlCellElem = document.createElement('div');
  27755. }
  27756. if (treeConfig) {
  27757. // 如果是树表格只允许导出数据源
  27758. var rest = [];
  27759. ctor_amd_xe_utils_default.a.eachTree(datas, function (row, rowIndex, items, path, parent, nodes) {
  27760. var item = {
  27761. _level: nodes.length - 1,
  27762. _hasChild: hasTreeChildren($xetable, row)
  27763. };
  27764. columns.forEach(function (column, columnIndex) {
  27765. var cellValue = '';
  27766. var renderOpts = column.editRender || column.cellRender;
  27767. var exportLabelMethod = column.exportMethod;
  27768. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27769. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27770. if (compConf) {
  27771. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  27772. }
  27773. }
  27774. if (exportLabelMethod) {
  27775. cellValue = exportLabelMethod({
  27776. $table: $xetable,
  27777. row: row,
  27778. column: column,
  27779. options: opts
  27780. });
  27781. } else {
  27782. switch (column.type) {
  27783. // v3.0 废弃 type=index
  27784. case 'seq':
  27785. case 'index':
  27786. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  27787. break;
  27788. // v3.0 废弃 type=selection
  27789. case 'selection':
  27790. case 'checkbox':
  27791. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  27792. item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  27793. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  27794. row: row
  27795. });
  27796. break;
  27797. case 'radio':
  27798. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  27799. item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  27800. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  27801. row: row
  27802. });
  27803. break;
  27804. default:
  27805. if (opts.original) {
  27806. cellValue = UtilTools.getCellValue(row, column);
  27807. } else {
  27808. cellValue = $xetable.getCellLabel(row, column);
  27809. if (column.type === 'html') {
  27810. htmlCellElem.innerHTML = cellValue;
  27811. cellValue = htmlCellElem.innerText.trim();
  27812. }
  27813. }
  27814. }
  27815. }
  27816. item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
  27817. });
  27818. rest.push(Object.assign(item, row));
  27819. }, treeOpts);
  27820. return rest;
  27821. }
  27822. return datas.map(function (row, rowIndex) {
  27823. var item = {};
  27824. columns.forEach(function (column, columnIndex) {
  27825. var cellValue = '';
  27826. var renderOpts = column.editRender || column.cellRender;
  27827. var exportLabelMethod = column.exportMethod;
  27828. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27829. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27830. if (compConf) {
  27831. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  27832. }
  27833. }
  27834. if (exportLabelMethod) {
  27835. cellValue = exportLabelMethod({
  27836. $table: $xetable,
  27837. row: row,
  27838. column: column,
  27839. options: opts
  27840. });
  27841. } else {
  27842. switch (column.type) {
  27843. // v3.0 废弃 type=index
  27844. case 'seq':
  27845. case 'index':
  27846. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  27847. break;
  27848. // v3.0 废弃 type=selection
  27849. case 'selection':
  27850. case 'checkbox':
  27851. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  27852. item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  27853. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  27854. row: row
  27855. });
  27856. break;
  27857. case 'radio':
  27858. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  27859. item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  27860. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  27861. row: row
  27862. });
  27863. break;
  27864. default:
  27865. if (opts.original) {
  27866. cellValue = UtilTools.getCellValue(row, column);
  27867. } else {
  27868. cellValue = $xetable.getCellLabel(row, column);
  27869. if (column.type === 'html') {
  27870. htmlCellElem.innerHTML = cellValue;
  27871. cellValue = htmlCellElem.innerText.trim();
  27872. }
  27873. }
  27874. }
  27875. }
  27876. item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
  27877. });
  27878. return item;
  27879. });
  27880. }
  27881. function getExportData($xetable, opts) {
  27882. var columnFilterMethod = opts.columnFilterMethod,
  27883. dataFilterMethod = opts.dataFilterMethod;
  27884. var columns = opts.columns;
  27885. var datas = opts.data;
  27886. if (columnFilterMethod) {
  27887. columns = columns.filter(function (column, index) {
  27888. return columnFilterMethod({
  27889. column: column,
  27890. $columnIndex: index
  27891. });
  27892. });
  27893. }
  27894. if (dataFilterMethod) {
  27895. datas = datas.filter(function (row, index) {
  27896. return dataFilterMethod({
  27897. row: row,
  27898. $rowIndex: index
  27899. });
  27900. });
  27901. }
  27902. return {
  27903. columns: columns,
  27904. datas: getLabelData($xetable, opts, columns, datas)
  27905. };
  27906. }
  27907. function getBooleanValue(cellValue) {
  27908. return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
  27909. }
  27910. function getHeaderTitle(opts, column) {
  27911. return (opts.original ? column.property : column.getTitle()) || '';
  27912. }
  27913. function getFooterCellValue($xetable, opts, items, column) {
  27914. var renderOpts = column.editRender || column.cellRender;
  27915. var exportLabelMethod = column.footerExportMethod;
  27916. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  27917. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  27918. if (compConf) {
  27919. exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
  27920. }
  27921. }
  27922. var _columnIndex = $xetable.getVTColumnIndex(column);
  27923. var cellValue = exportLabelMethod ? exportLabelMethod({
  27924. $table: $xetable,
  27925. items: items,
  27926. itemIndex: _columnIndex,
  27927. _columnIndex: _columnIndex,
  27928. column: column,
  27929. options: opts
  27930. }) : ctor_amd_xe_utils_default.a.toString(items[_columnIndex]);
  27931. return cellValue;
  27932. }
  27933. function getFooterData(opts, footerTableData) {
  27934. var footerFilterMethod = opts.footerFilterMethod;
  27935. return footerFilterMethod ? footerTableData.filter(function (items, index) {
  27936. return footerFilterMethod({
  27937. items: items,
  27938. $rowIndex: index
  27939. });
  27940. }) : footerTableData;
  27941. }
  27942. function toCsv($xetable, opts, columns, datas) {
  27943. var content = csvBOM;
  27944. if (opts.isHeader) {
  27945. content += columns.map(function (column) {
  27946. return "\"".concat(getHeaderTitle(opts, column), "\"");
  27947. }).join(',') + enterSymbol;
  27948. }
  27949. datas.forEach(function (row) {
  27950. content += columns.map(function (column) {
  27951. return "\"".concat(row[column.id], "\"");
  27952. }).join(',') + enterSymbol;
  27953. });
  27954. if (opts.isFooter) {
  27955. var footerTableData = $xetable.footerTableData;
  27956. var footers = getFooterData(opts, footerTableData);
  27957. footers.forEach(function (rows) {
  27958. content += columns.map(function (column) {
  27959. return "\"".concat(getFooterCellValue($xetable, opts, rows, column), "\"");
  27960. }).join(',') + enterSymbol;
  27961. });
  27962. }
  27963. return content;
  27964. }
  27965. function toTxt($xetable, opts, columns, datas) {
  27966. var content = '';
  27967. if (opts.isHeader) {
  27968. content += columns.map(function (column) {
  27969. return "".concat(getHeaderTitle(opts, column));
  27970. }).join('\t') + enterSymbol;
  27971. }
  27972. datas.forEach(function (row) {
  27973. content += columns.map(function (column) {
  27974. return "".concat(row[column.id]);
  27975. }).join('\t') + enterSymbol;
  27976. });
  27977. if (opts.isFooter) {
  27978. var footerTableData = $xetable.footerTableData;
  27979. var footers = getFooterData(opts, footerTableData);
  27980. footers.forEach(function (rows) {
  27981. content += columns.map(function (column) {
  27982. return "".concat(getFooterCellValue($xetable, opts, rows, column));
  27983. }).join(',') + enterSymbol;
  27984. });
  27985. }
  27986. return content;
  27987. }
  27988. function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
  27989. var columnOverflow = column[property];
  27990. var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(columnOverflow) || ctor_amd_xe_utils_default.a.isNull(columnOverflow) ? allColumnOverflow : columnOverflow;
  27991. var showEllipsis = headOverflow === 'ellipsis';
  27992. var showTitle = headOverflow === 'title';
  27993. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  27994. var isEllipsis = showTitle || showTooltip || showEllipsis; // 虚拟滚动不支持动态高度
  27995. if (($xetable.scrollXLoad || $xetable.scrollYLoad) && !isEllipsis) {
  27996. isEllipsis = true;
  27997. }
  27998. return isEllipsis;
  27999. }
  28000. function createHtmlPage(opts, content) {
  28001. var style = opts.style;
  28002. 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('');
  28003. }
  28004. function toHtml($xetable, opts, columns, datas) {
  28005. var id = $xetable.id,
  28006. border = $xetable.border,
  28007. treeConfig = $xetable.treeConfig,
  28008. treeOpts = $xetable.treeOpts,
  28009. isAllSelected = $xetable.isAllSelected,
  28010. isIndeterminate = $xetable.isIndeterminate,
  28011. allHeaderAlign = $xetable.headerAlign,
  28012. allAlign = $xetable.align,
  28013. allFooterAlign = $xetable.footerAlign,
  28014. allColumnOverflow = $xetable.showOverflow,
  28015. allColumnHeaderOverflow = $xetable.showHeaderOverflow;
  28016. var isPrint = opts.print,
  28017. isHeader = opts.isHeader,
  28018. isFooter = opts.isFooter;
  28019. var allCls = 'check-all';
  28020. var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'show--head' : ''].filter(function (cls) {
  28021. return cls;
  28022. });
  28023. var body = ["<table class=\"".concat(clss.join(' '), "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"), "<colgroup>".concat(columns.map(function (column) {
  28024. return "<col style=\"width:".concat(column.renderWidth, "px\">");
  28025. }).join(''), "</colgroup>")].join('');
  28026. if (isHeader) {
  28027. body += "<thead><tr>".concat(columns.map(function (column) {
  28028. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  28029. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  28030. var cellTitle = getHeaderTitle(opts, column);
  28031. if (headAlign) {
  28032. classNames.push("col--".concat(headAlign));
  28033. }
  28034. if (column.type === 'checkbox' || column.type === 'selection') {
  28035. 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>");
  28036. }
  28037. 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>");
  28038. }).join(''), "</tr></thead>");
  28039. }
  28040. if (datas.length) {
  28041. body += '<tbody>';
  28042. if (treeConfig) {
  28043. datas.forEach(function (item) {
  28044. body += '<tr>' + columns.map(function (column) {
  28045. var cellAlign = column.align || allAlign;
  28046. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28047. var cellValue = item[column.id];
  28048. if (cellAlign) {
  28049. classNames.push("col--".concat(cellAlign));
  28050. }
  28051. if (column.treeNode) {
  28052. var treeIcon = '';
  28053. if (item._hasChild) {
  28054. treeIcon = "<i class=\"".concat(item._expand ? 'vxe-table--tree-fold-icon' : 'vxe-table--tree-unfold-icon', "\"></i>");
  28055. }
  28056. classNames.push('vxe-table--tree-node');
  28057. if (column.type === 'radio') {
  28058. 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>");
  28059. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28060. 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>");
  28061. }
  28062. 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>");
  28063. }
  28064. if (column.type === 'radio') {
  28065. 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>");
  28066. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28067. 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>");
  28068. }
  28069. 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>");
  28070. }).join('') + '</tr>';
  28071. });
  28072. } else {
  28073. datas.forEach(function (item) {
  28074. body += '<tr>' + columns.map(function (column) {
  28075. var cellAlign = column.align || allAlign;
  28076. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28077. var cellValue = item[column.id];
  28078. if (cellAlign) {
  28079. classNames.push("col--".concat(cellAlign));
  28080. }
  28081. if (column.type === 'radio') {
  28082. 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>");
  28083. } else if (column.type === 'checkbox' || column.type === 'selection') {
  28084. 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>");
  28085. }
  28086. 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>");
  28087. }).join('') + '</tr>';
  28088. });
  28089. }
  28090. body += '</tbody>';
  28091. }
  28092. if (isFooter) {
  28093. var footerTableData = $xetable.footerTableData;
  28094. var footers = getFooterData(opts, footerTableData);
  28095. if (footers.length) {
  28096. body += '<tfoot>';
  28097. footers.forEach(function (rows) {
  28098. body += "<tr>".concat(columns.map(function (column) {
  28099. var footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
  28100. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  28101. var cellValue = getFooterCellValue($xetable, opts, rows, column);
  28102. if (footAlign) {
  28103. classNames.push("col--".concat(footAlign));
  28104. }
  28105. 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>");
  28106. }).join(''), "</tr>");
  28107. });
  28108. body += '</tfoot>';
  28109. }
  28110. } // 是否半选状态
  28111. var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
  28112. body += '</table>' + script;
  28113. return isPrint ? body : createHtmlPage(opts, body);
  28114. }
  28115. function toXML($xetable, opts, columns, datas) {
  28116. 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) {
  28117. return "<Column ss:Width=\"".concat(column.renderWidth, "\"/>");
  28118. }).join('')].join('');
  28119. if (opts.isHeader) {
  28120. xml += "<Row>".concat(columns.map(function (column) {
  28121. return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
  28122. }).join(''), "</Row>");
  28123. }
  28124. datas.forEach(function (row) {
  28125. xml += '<Row>' + columns.map(function (column) {
  28126. return "<Cell><Data ss:Type=\"String\">".concat(row[column.id], "</Data></Cell>");
  28127. }).join('') + '</Row>';
  28128. });
  28129. if (opts.isFooter) {
  28130. var footerTableData = $xetable.footerTableData;
  28131. var footers = getFooterData(opts, footerTableData);
  28132. footers.forEach(function (rows) {
  28133. xml += "<Row>".concat(columns.map(function (column) {
  28134. return "<Cell><Data ss:Type=\"String\">".concat(getFooterCellValue($xetable, opts, rows, column), "</Data></Cell>");
  28135. }).join(''), "</Row>");
  28136. });
  28137. }
  28138. return "".concat(xml, "</Table></Worksheet></Workbook>");
  28139. }
  28140. function getContent($xetable, opts, columns, datas) {
  28141. if (columns.length) {
  28142. switch (opts.type) {
  28143. case 'csv':
  28144. return toCsv($xetable, opts, columns, datas);
  28145. case 'txt':
  28146. return toTxt($xetable, opts, columns, datas);
  28147. case 'html':
  28148. return toHtml($xetable, opts, columns, datas);
  28149. case 'xml':
  28150. return toXML($xetable, opts, columns, datas);
  28151. }
  28152. }
  28153. return '';
  28154. }
  28155. /**
  28156. * 保存文件到本地
  28157. * @param {*} options 参数
  28158. */
  28159. function saveLocalFile(options) {
  28160. var filename = options.filename,
  28161. type = options.type,
  28162. content = options.content;
  28163. var name = "".concat(filename, ".").concat(type);
  28164. if (window.Blob) {
  28165. var blob = content instanceof Blob ? content : getExportBlobByContent(ctor_amd_xe_utils_default.a.toString(content), options);
  28166. if (navigator.msSaveBlob) {
  28167. navigator.msSaveBlob(blob, name);
  28168. } else {
  28169. var linkElem = document.createElement('a');
  28170. linkElem.target = '_blank';
  28171. linkElem.download = name;
  28172. linkElem.href = URL.createObjectURL(blob);
  28173. document.body.appendChild(linkElem);
  28174. linkElem.click();
  28175. document.body.removeChild(linkElem);
  28176. }
  28177. return Promise.resolve();
  28178. }
  28179. return Promise.reject(new Error(UtilTools.getLog('vxe.error.notExp')));
  28180. }
  28181. function downloadFile($xetable, opts, content) {
  28182. var filename = opts.filename,
  28183. type = opts.type,
  28184. download = opts.download;
  28185. if (!download) {
  28186. var blob = getExportBlobByContent(content, opts);
  28187. return Promise.resolve({
  28188. type: type,
  28189. content: content,
  28190. blob: blob
  28191. });
  28192. }
  28193. saveLocalFile({
  28194. filename: filename,
  28195. type: type,
  28196. content: content
  28197. }).then(function () {
  28198. if (opts.message !== false) {
  28199. v_x_e_table.modal.message({
  28200. message: conf.i18n('vxe.table.expSuccess'),
  28201. status: 'success'
  28202. });
  28203. }
  28204. });
  28205. }
  28206. function handleExport($xetable, opts) {
  28207. if (opts.remote) {
  28208. var params = {
  28209. options: opts,
  28210. $table: $xetable,
  28211. $grid: $xetable.$xegrid
  28212. };
  28213. if (opts.exportMethod) {
  28214. return opts.exportMethod(params);
  28215. }
  28216. return Promise.resolve(params);
  28217. }
  28218. var _getExportData = getExportData($xetable, opts),
  28219. columns = _getExportData.columns,
  28220. datas = _getExportData.datas;
  28221. return Promise.resolve($xetable.preventEvent(null, 'event.export', {
  28222. options: opts,
  28223. columns: columns,
  28224. datas: datas
  28225. }, function () {
  28226. return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
  28227. }));
  28228. }
  28229. function getElementsByTagName(elem, qualifiedName) {
  28230. return elem.getElementsByTagName(qualifiedName);
  28231. }
  28232. function replaceDoubleQuotation(val) {
  28233. return val.replace(/^"/, '').replace(/"$/, '');
  28234. }
  28235. function parseCsv(columns, content) {
  28236. var list = content.split(enterSymbol);
  28237. var rows = [];
  28238. var fields = [];
  28239. if (list.length) {
  28240. var rList = list.slice(1);
  28241. fields = list[0].split(',').map(replaceDoubleQuotation);
  28242. rList.forEach(function (r) {
  28243. if (r) {
  28244. var item = {};
  28245. r.split(',').forEach(function (val, colIndex) {
  28246. if (fields[colIndex]) {
  28247. item[fields[colIndex]] = replaceDoubleQuotation(val);
  28248. }
  28249. });
  28250. rows.push(item);
  28251. }
  28252. });
  28253. }
  28254. return {
  28255. fields: fields,
  28256. rows: rows
  28257. };
  28258. }
  28259. function parseTxt(columns, content) {
  28260. var list = content.split('\n');
  28261. var rows = [];
  28262. var fields = [];
  28263. if (list.length) {
  28264. var rList = list.slice(1);
  28265. fields = list[0].split('\t');
  28266. rList.forEach(function (r) {
  28267. if (r) {
  28268. var item = {};
  28269. r.split('\t').forEach(function (val, colIndex) {
  28270. if (fields[colIndex]) {
  28271. item[fields[colIndex]] = replaceDoubleQuotation(val);
  28272. }
  28273. });
  28274. rows.push(item);
  28275. }
  28276. });
  28277. }
  28278. return {
  28279. fields: fields,
  28280. rows: rows
  28281. };
  28282. }
  28283. function parseHTML(columns, content) {
  28284. var domParser = new DOMParser();
  28285. var xmlDoc = domParser.parseFromString(content, 'text/html');
  28286. var bodyNodes = getElementsByTagName(xmlDoc, 'body');
  28287. var rows = [];
  28288. var fields = [];
  28289. if (bodyNodes.length) {
  28290. var tableNodes = getElementsByTagName(bodyNodes[0], 'table');
  28291. if (tableNodes.length) {
  28292. var theadNodes = getElementsByTagName(tableNodes[0], 'thead');
  28293. if (theadNodes.length) {
  28294. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
  28295. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
  28296. fields.push(cellNode.textContent);
  28297. });
  28298. });
  28299. var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
  28300. if (tbodyNodes.length) {
  28301. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
  28302. var item = {};
  28303. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'td'), function (cellNode, colIndex) {
  28304. if (fields[colIndex]) {
  28305. item[fields[colIndex]] = cellNode.textContent || '';
  28306. }
  28307. });
  28308. rows.push(item);
  28309. });
  28310. }
  28311. }
  28312. }
  28313. }
  28314. return {
  28315. fields: fields,
  28316. rows: rows
  28317. };
  28318. }
  28319. function parseXML(columns, content) {
  28320. var domParser = new DOMParser();
  28321. var xmlDoc = domParser.parseFromString(content, 'application/xml');
  28322. var sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
  28323. var rows = [];
  28324. var fields = [];
  28325. if (sheetNodes.length) {
  28326. var tableNodes = getElementsByTagName(sheetNodes[0], 'Table');
  28327. if (tableNodes.length) {
  28328. var rowNodes = getElementsByTagName(tableNodes[0], 'Row');
  28329. if (rowNodes.length) {
  28330. ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
  28331. fields.push(cellNode.textContent);
  28332. });
  28333. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
  28334. if (index) {
  28335. var item = {};
  28336. var cellNodes = getElementsByTagName(rowNode, 'Cell');
  28337. ctor_amd_xe_utils_default.a.arrayEach(cellNodes, function (cellNode, colIndex) {
  28338. if (fields[colIndex]) {
  28339. item[fields[colIndex]] = cellNode.textContent;
  28340. }
  28341. });
  28342. rows.push(item);
  28343. }
  28344. });
  28345. }
  28346. }
  28347. }
  28348. return {
  28349. fields: fields,
  28350. rows: rows
  28351. };
  28352. }
  28353. /**
  28354. * 检查导入的列是否完整
  28355. * @param {Array} fields 字段名列表
  28356. * @param {Array} rows 数据列表
  28357. */
  28358. function checkImportData(columns, fields) {
  28359. var tableFields = [];
  28360. columns.forEach(function (column) {
  28361. var field = column.property;
  28362. if (field) {
  28363. tableFields.push(field);
  28364. }
  28365. });
  28366. return tableFields.every(function (field) {
  28367. return fields.indexOf(field) > -1;
  28368. });
  28369. }
  28370. function handleImport($xetable, content, opts) {
  28371. var tableFullColumn = $xetable.tableFullColumn,
  28372. _importResolve = $xetable._importResolve;
  28373. var rest = {
  28374. fields: [],
  28375. rows: []
  28376. };
  28377. switch (opts.type) {
  28378. case 'csv':
  28379. rest = parseCsv(tableFullColumn, content);
  28380. break;
  28381. case 'txt':
  28382. rest = parseTxt(tableFullColumn, content);
  28383. break;
  28384. case 'html':
  28385. rest = parseHTML(tableFullColumn, content);
  28386. break;
  28387. case 'xml':
  28388. rest = parseXML(tableFullColumn, content);
  28389. break;
  28390. }
  28391. var _rest = rest,
  28392. fields = _rest.fields,
  28393. rows = _rest.rows;
  28394. var status = checkImportData(tableFullColumn, fields);
  28395. if (status) {
  28396. $xetable.createData(rows).then(function (data) {
  28397. if (opts.mode === 'insert') {
  28398. $xetable.insert(data);
  28399. } else {
  28400. $xetable.reloadData(data);
  28401. }
  28402. });
  28403. if (opts.message !== false) {
  28404. v_x_e_table.modal.message({
  28405. message: conf.i18n('vxe.table.impSuccess', [rows.length]),
  28406. status: 'success'
  28407. });
  28408. }
  28409. } else if (opts.message !== false) {
  28410. v_x_e_table.modal.message({
  28411. message: conf.i18n('vxe.error.impFields'),
  28412. status: 'error'
  28413. });
  28414. }
  28415. if (_importResolve) {
  28416. _importResolve(status);
  28417. $xetable._importResolve = null;
  28418. }
  28419. }
  28420. function afterPrintEvent() {
  28421. if (printFrame && printFrame.parentNode) {
  28422. printFrame.parentNode.removeChild(printFrame);
  28423. }
  28424. }
  28425. function handlePrint($xetable, opts, content) {
  28426. var beforePrintMethod = opts.beforePrintMethod;
  28427. if (beforePrintMethod) {
  28428. content = beforePrintMethod({
  28429. content: content,
  28430. options: opts,
  28431. $table: $xetable
  28432. }) || '';
  28433. }
  28434. content = createHtmlPage(opts, content);
  28435. var blob = getExportBlobByContent(content, opts);
  28436. if (DomTools.browse.msie) {
  28437. if (printFrame) {
  28438. try {
  28439. printFrame.contentDocument.write('');
  28440. printFrame.contentDocument.clear();
  28441. } catch (e) {}
  28442. document.body.removeChild(printFrame);
  28443. }
  28444. printFrame = createFrame();
  28445. document.body.appendChild(printFrame);
  28446. printFrame.contentDocument.write(content);
  28447. printFrame.contentDocument.execCommand('print');
  28448. } else {
  28449. if (!printFrame) {
  28450. printFrame = createFrame();
  28451. printFrame.onload = function (evnt) {
  28452. if (evnt.target.src) {
  28453. evnt.target.contentWindow.onafterprint = afterPrintEvent;
  28454. evnt.target.contentWindow.print();
  28455. }
  28456. };
  28457. }
  28458. if (!printFrame.parentNode) {
  28459. document.body.appendChild(printFrame);
  28460. }
  28461. printFrame.src = URL.createObjectURL(blob);
  28462. }
  28463. }
  28464. /* harmony default export */ var export_src_mixin = ({
  28465. methods: {
  28466. // 在 v3.0 中废弃 exportCsv 方法
  28467. _exportCsv: function _exportCsv(options) {
  28468. UtilTools.warn('vxe.error.delFunc', ['exportCsv', 'exportData']);
  28469. return this.exportData(options);
  28470. },
  28471. /**
  28472. * 导出文件,支持 csv/html/xml/txt
  28473. * 如果是树表格,则默认是导出所有节点
  28474. * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
  28475. * @param {Object} options 参数
  28476. */
  28477. _exportData: function _exportData(options) {
  28478. var _this = this;
  28479. var $xegrid = this.$xegrid,
  28480. visibleColumn = this.visibleColumn,
  28481. tableFullColumn = this.tableFullColumn,
  28482. afterFullData = this.afterFullData,
  28483. treeConfig = this.treeConfig,
  28484. treeOpts = this.treeOpts,
  28485. exportOpts = this.exportOpts;
  28486. var columns = options && options.columns;
  28487. var expColumns = [];
  28488. if (columns && columns.length) {
  28489. columns.forEach(function (item) {
  28490. var targetColumn;
  28491. if (item) {
  28492. if (UtilTools.isColumn(item)) {
  28493. targetColumn = item;
  28494. } else if (ctor_amd_xe_utils_default.a.isString(item)) {
  28495. targetColumn = _this.getColumnByField(item);
  28496. } else {
  28497. var type = item.type;
  28498. var field = item.property || item.field;
  28499. if (field && type) {
  28500. targetColumn = tableFullColumn.find(function (column) {
  28501. return column.property === field && column.type === type;
  28502. });
  28503. } else if (field) {
  28504. targetColumn = _this.getColumnByField(field);
  28505. } else if (type) {
  28506. targetColumn = tableFullColumn.find(function (column) {
  28507. return column.type === type;
  28508. });
  28509. }
  28510. }
  28511. if (targetColumn) {
  28512. expColumns.push(targetColumn);
  28513. }
  28514. }
  28515. });
  28516. } else {
  28517. expColumns = visibleColumn;
  28518. }
  28519. var opts = Object.assign({
  28520. // filename: '',
  28521. // sheetName: '',
  28522. // original: false,
  28523. // message: false,
  28524. isHeader: true,
  28525. isFooter: true,
  28526. download: true,
  28527. type: 'csv',
  28528. mode: 'current',
  28529. // data: null,
  28530. // remote: false,
  28531. // dataFilterMethod: null,
  28532. // footerFilterMethod: null,
  28533. // exportMethod: null,
  28534. columnFilterMethod: columns && columns.length ? null : function (_ref) {
  28535. var column = _ref.column;
  28536. return defaultFilterExportColumn(column);
  28537. }
  28538. }, exportOpts, {
  28539. print: false
  28540. }, options, {
  28541. columns: expColumns
  28542. });
  28543. if (!opts.filename) {
  28544. opts.filename = conf.i18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [ctor_amd_xe_utils_default.a.toDateString(Date.now(), 'yyyyMMddHHmmss')]);
  28545. }
  28546. if (!opts.sheetName) {
  28547. opts.sheetName = document.title;
  28548. }
  28549. if (v_x_e_table.exportTypes.indexOf(opts.type) === -1) {
  28550. throw new Error(UtilTools.getLog('vxe.error.notType', [opts.type]));
  28551. }
  28552. if (!opts.data) {
  28553. opts.data = afterFullData;
  28554. if (opts.mode === 'selected') {
  28555. var selectRecords = this.getCheckboxRecords();
  28556. if (['html', 'pdf'].indexOf(opts.type) > -1 && treeConfig) {
  28557. opts.data = ctor_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
  28558. return selectRecords.indexOf(item) > -1;
  28559. }, treeOpts);
  28560. } else {
  28561. opts.data = selectRecords;
  28562. }
  28563. } else if (opts.mode === 'all') {
  28564. if ($xegrid && !opts.remote) {
  28565. var _$xegrid$proxyOpts = $xegrid.proxyOpts,
  28566. beforeQueryAll = _$xegrid$proxyOpts.beforeQueryAll,
  28567. afterQueryAll = _$xegrid$proxyOpts.afterQueryAll,
  28568. _$xegrid$proxyOpts$aj = _$xegrid$proxyOpts.ajax,
  28569. ajax = _$xegrid$proxyOpts$aj === void 0 ? {} : _$xegrid$proxyOpts$aj,
  28570. _$xegrid$proxyOpts$pr = _$xegrid$proxyOpts.props,
  28571. props = _$xegrid$proxyOpts$pr === void 0 ? {} : _$xegrid$proxyOpts$pr;
  28572. var ajaxMethods = ajax.queryAll;
  28573. if (ajaxMethods) {
  28574. var params = {
  28575. $table: this,
  28576. $grid: $xegrid,
  28577. sort: $xegrid.sortData,
  28578. filters: $xegrid.filterData,
  28579. form: $xegrid.formData,
  28580. target: ajaxMethods,
  28581. options: opts
  28582. };
  28583. return Promise.resolve((beforeQueryAll || ajaxMethods)(params)).catch(function (e) {
  28584. return e;
  28585. }).then(function (rest) {
  28586. opts.data = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  28587. if (afterQueryAll) {
  28588. afterQueryAll(params);
  28589. }
  28590. return handleExport(_this, opts);
  28591. });
  28592. }
  28593. }
  28594. }
  28595. }
  28596. return handleExport(this, opts);
  28597. },
  28598. _importByFile: function _importByFile(file, opts) {
  28599. var _this2 = this;
  28600. if (window.FileReader) {
  28601. var _UtilTools$parseFile = UtilTools.parseFile(file),
  28602. type = _UtilTools$parseFile.type,
  28603. filename = _UtilTools$parseFile.filename;
  28604. var options = Object.assign({
  28605. mode: 'insert'
  28606. }, opts, {
  28607. type: type,
  28608. filename: filename
  28609. });
  28610. var types = options.types || v_x_e_table.importTypes;
  28611. if (types.indexOf(type) > -1) {
  28612. if (options.remote) {
  28613. var params = {
  28614. file: file,
  28615. options: options,
  28616. $table: this
  28617. };
  28618. if (options.importMethod) {
  28619. return options.importMethod(params);
  28620. }
  28621. return Promise.resolve(params);
  28622. }
  28623. this.preventEvent(null, 'event.import', {
  28624. file: file,
  28625. options: options,
  28626. columns: this.tableFullColumn
  28627. }, function () {
  28628. var reader = new FileReader();
  28629. reader.onerror = function () {
  28630. UtilTools.error('vxe.error.notType', [type]);
  28631. };
  28632. reader.onload = function (e) {
  28633. handleImport(_this2, e.target.result.trim(), options);
  28634. };
  28635. reader.readAsText(file, 'UTF-8');
  28636. });
  28637. } else {
  28638. UtilTools.error('vxe.error.notType', [type]);
  28639. }
  28640. } else {
  28641. UtilTools.error('vxe.error.notExp');
  28642. }
  28643. return Promise.resolve();
  28644. },
  28645. _importData: function _importData(options) {
  28646. var _this3 = this;
  28647. var opts = Object.assign({
  28648. types: v_x_e_table.importTypes
  28649. }, this.importOpts, options);
  28650. var rest = new Promise(function (resolve, reject) {
  28651. var _importResolve = function _importResolve(params) {
  28652. resolve(params);
  28653. _this3._importResolve = null;
  28654. _this3._importReject = null;
  28655. };
  28656. var _importReject = function _importReject(params) {
  28657. reject(params);
  28658. _this3._importResolve = null;
  28659. _this3._importReject = null;
  28660. };
  28661. _this3._importResolve = _importResolve;
  28662. _this3._importReject = _importReject;
  28663. });
  28664. this.readFile(opts).then(function (params) {
  28665. var file = params.file;
  28666. _this3.importByFile(file, opts);
  28667. }).catch(function (params) {
  28668. _this3._importReject(params);
  28669. _this3._importReject = null;
  28670. });
  28671. return rest;
  28672. },
  28673. _saveFile: function _saveFile(options) {
  28674. return saveLocalFile(options);
  28675. },
  28676. _readFile: function _readFile() {
  28677. var _this4 = this;
  28678. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  28679. if (!fileForm) {
  28680. fileForm = document.createElement('form');
  28681. fileInput = document.createElement('input');
  28682. fileForm.className = 'vxe-table--file-form';
  28683. fileInput.name = 'file';
  28684. fileInput.type = 'file';
  28685. fileForm.appendChild(fileInput);
  28686. document.body.appendChild(fileForm);
  28687. }
  28688. var types = options.types || [];
  28689. var isAllType = !types.length || types.some(function (type) {
  28690. return type === '*';
  28691. });
  28692. fileInput.multiple = !!options.multiple;
  28693. fileInput.accept = isAllType ? '' : ".".concat(types.join(', .'));
  28694. fileInput.onchange = function (evnt) {
  28695. var files = evnt.target.files;
  28696. var file = files[0];
  28697. var errType; // 校验类型
  28698. if (!isAllType) {
  28699. for (var fIndex = 0; fIndex < files.length; fIndex++) {
  28700. var _UtilTools$parseFile2 = UtilTools.parseFile(files[fIndex]),
  28701. type = _UtilTools$parseFile2.type;
  28702. if (!ctor_amd_xe_utils_default.a.includes(types, type)) {
  28703. errType = type;
  28704. break;
  28705. }
  28706. }
  28707. }
  28708. if (!errType) {
  28709. _this4._fileResolve({
  28710. files: files,
  28711. file: file,
  28712. target: evnt.target
  28713. });
  28714. } else {
  28715. if (options.message !== false) {
  28716. v_x_e_table.modal.message({
  28717. message: ctor_amd_xe_utils_default.a.template(conf.i18n('vxe.error.notType'), [errType]),
  28718. status: 'error'
  28719. });
  28720. }
  28721. _this4._fileReject({
  28722. files: files,
  28723. file: file
  28724. });
  28725. }
  28726. _this4._fileResolve = null;
  28727. };
  28728. fileForm.reset();
  28729. fileInput.click();
  28730. return new Promise(function (resolve, reject) {
  28731. _this4._fileResolve = resolve;
  28732. _this4._fileReject = reject;
  28733. });
  28734. },
  28735. _print: function _print(options) {
  28736. var _this5 = this;
  28737. var opts = Object.assign({
  28738. original: false
  28739. }, this.printOpts, options, {
  28740. type: 'html',
  28741. download: false,
  28742. remote: false,
  28743. print: true
  28744. });
  28745. if (!opts.sheetName) {
  28746. opts.sheetName = document.title;
  28747. }
  28748. if (opts.content) {
  28749. handlePrint(this, opts, opts.content);
  28750. } else {
  28751. this.exportData(opts).then(function (_ref2) {
  28752. var content = _ref2.content;
  28753. handlePrint(_this5, opts, content);
  28754. });
  28755. }
  28756. },
  28757. _openImport: function _openImport(options) {
  28758. var defOpts = Object.assign({
  28759. mode: 'insert',
  28760. message: true
  28761. }, options, this.importOpts);
  28762. var types = defOpts.types || v_x_e_table.exportTypes;
  28763. var isTree = !!this.getTreeStatus();
  28764. if (isTree) {
  28765. if (defOpts.message) {
  28766. v_x_e_table.modal.message({
  28767. message: conf.i18n('vxe.error.treeNotImp'),
  28768. status: 'error'
  28769. });
  28770. }
  28771. return;
  28772. }
  28773. if (!this.importConfig) {
  28774. UtilTools.error('vxe.error.reqProp', ['import-config']);
  28775. } // 处理类型
  28776. var typeList = types.map(function (value) {
  28777. return {
  28778. value: value,
  28779. label: "vxe.export.types.".concat(value)
  28780. };
  28781. });
  28782. var modeList = defOpts.modes.map(function (value) {
  28783. return {
  28784. value: value,
  28785. label: "vxe.import.modes.".concat(value)
  28786. };
  28787. });
  28788. Object.assign(this.importStore, {
  28789. file: null,
  28790. type: '',
  28791. filename: '',
  28792. modeList: modeList,
  28793. typeList: typeList,
  28794. visible: true
  28795. });
  28796. Object.assign(this.importParams, defOpts);
  28797. },
  28798. _openExport: function _openExport(options) {
  28799. var $toolbar = this.$toolbar,
  28800. exportConfig = this.exportConfig,
  28801. customOpts = this.customOpts,
  28802. exportOpts = this.exportOpts,
  28803. collectColumn = this.collectColumn,
  28804. footerTableData = this.footerTableData;
  28805. var selectRecords = this.getCheckboxRecords();
  28806. var hasFooter = !!footerTableData.length;
  28807. var defOpts = Object.assign({
  28808. message: true,
  28809. isHeader: true
  28810. }, exportOpts, options);
  28811. var types = defOpts.types || v_x_e_table.exportTypes;
  28812. var checkMethod = customOpts.checkMethod || ($toolbar ? $toolbar.customOpts.checkMethod : null);
  28813. var exportColumns = collectColumn.slice(0);
  28814. var columns = defOpts.columns;
  28815. if (!exportConfig) {
  28816. UtilTools.error('vxe.error.reqProp', ['export-config']);
  28817. } // 处理类型
  28818. var typeList = types.map(function (value) {
  28819. return {
  28820. value: value,
  28821. label: "vxe.export.types.".concat(value)
  28822. };
  28823. });
  28824. var modeList = defOpts.modes.map(function (value) {
  28825. return {
  28826. value: value,
  28827. label: "vxe.export.modes.".concat(value)
  28828. };
  28829. }); // 默认选中
  28830. ctor_amd_xe_utils_default.a.eachTree(exportColumns, function (column, index, items, path, parent) {
  28831. var isColGroup = column.children && column.children.length;
  28832. if (isColGroup || defaultFilterExportColumn(column)) {
  28833. column.checked = columns ? columns.some(function (item) {
  28834. if (UtilTools.isColumn(item)) {
  28835. return column === item;
  28836. } else if (ctor_amd_xe_utils_default.a.isString(item)) {
  28837. return column.field === item;
  28838. } else {
  28839. var colid = item.id;
  28840. var type = item.type;
  28841. var field = item.property || item.field;
  28842. if (colid) {
  28843. return column.id === colid;
  28844. } else if (field && type) {
  28845. return column.property === field && column.type === type;
  28846. } else if (field) {
  28847. return column.property === field;
  28848. } else if (type) {
  28849. return column.type === type;
  28850. }
  28851. }
  28852. }) : column.visible;
  28853. column.halfChecked = false;
  28854. column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
  28855. column: column
  28856. }) : false);
  28857. }
  28858. }); // 更新条件
  28859. Object.assign(this.exportStore, {
  28860. columns: exportColumns,
  28861. typeList: typeList,
  28862. modeList: modeList,
  28863. hasFooter: hasFooter,
  28864. visible: true
  28865. }); // 重置参数
  28866. Object.assign(this.exportParams, {
  28867. filename: defOpts.filename || '',
  28868. sheetName: defOpts.sheetName || '',
  28869. type: defOpts.type || typeList[0].value,
  28870. mode: selectRecords.length ? 'selected' : 'current',
  28871. original: defOpts.original,
  28872. message: defOpts.message,
  28873. isHeader: defOpts.isHeader,
  28874. isFooter: hasFooter && (ctor_amd_xe_utils_default.a.isBoolean(exportOpts.isFooter) ? exportOpts.isFooter : true),
  28875. isPrint: defOpts.isPrint
  28876. });
  28877. return this.$nextTick();
  28878. }
  28879. }
  28880. });
  28881. // CONCATENATED MODULE: ./packages/export/index.js
  28882. function print(options) {
  28883. var opts = Object.assign({}, options, {
  28884. type: 'html'
  28885. });
  28886. handlePrint(null, opts, opts.content);
  28887. }
  28888. var Export = {
  28889. install: function install(Vue) {
  28890. v_x_e_table.reg('export');
  28891. v_x_e_table.saveFile = saveLocalFile;
  28892. v_x_e_table.print = print;
  28893. v_x_e_table.setup({
  28894. export: {
  28895. types: {
  28896. csv: 0,
  28897. html: 0,
  28898. xml: 0,
  28899. txt: 0
  28900. }
  28901. }
  28902. });
  28903. packages_table.mixins.push(export_src_mixin);
  28904. Vue.component(export_panel.name, export_panel);
  28905. Vue.component(import_panel.name, import_panel);
  28906. }
  28907. };
  28908. /* harmony default export */ var packages_export = (Export);
  28909. // CONCATENATED MODULE: ./packages/keyboard/src/mixin.js
  28910. var mixin_browse = DomTools.browse;
  28911. function getTargetOffset(target, container) {
  28912. var offsetTop = 0;
  28913. var offsetLeft = 0;
  28914. var triggerCheckboxLabel = !mixin_browse.firefox && DomTools.hasClass(target, 'vxe-checkbox--label');
  28915. if (triggerCheckboxLabel) {
  28916. var checkboxLabelStyle = getComputedStyle(target);
  28917. offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
  28918. offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingLeft);
  28919. }
  28920. while (target && target !== container) {
  28921. offsetTop += target.offsetTop;
  28922. offsetLeft += target.offsetLeft;
  28923. target = target.offsetParent;
  28924. if (triggerCheckboxLabel) {
  28925. var checkboxStyle = getComputedStyle(target);
  28926. offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
  28927. offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingLeft);
  28928. }
  28929. }
  28930. return {
  28931. offsetTop: offsetTop,
  28932. offsetLeft: offsetLeft
  28933. };
  28934. }
  28935. function getCheckboxRangeRows(_vm, params, targetTrElem, moveRange) {
  28936. var countHeight = 0;
  28937. var rangeRows = [];
  28938. var isDown = moveRange > 0;
  28939. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  28940. var afterFullData = _vm.afterFullData,
  28941. scrollYStore = _vm.scrollYStore,
  28942. scrollYLoad = _vm.scrollYLoad;
  28943. if (scrollYLoad) {
  28944. var _rowIndex = _vm.getVTRowIndex(params.row);
  28945. if (isDown) {
  28946. rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
  28947. } else {
  28948. rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
  28949. }
  28950. } else {
  28951. var siblingProp = isDown ? 'next' : 'previous';
  28952. while (targetTrElem && countHeight < moveSize) {
  28953. rangeRows.push(_vm.getRowNode(targetTrElem).item);
  28954. countHeight += targetTrElem.offsetHeight;
  28955. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  28956. }
  28957. }
  28958. return rangeRows;
  28959. }
  28960. /* harmony default export */ var keyboard_src_mixin = ({
  28961. methods: {
  28962. // 处理 Tab 键移动
  28963. moveTabSelected: function moveTabSelected(args, isLeft, evnt) {
  28964. var _this = this;
  28965. var afterFullData = this.afterFullData,
  28966. visibleColumn = this.visibleColumn,
  28967. editConfig = this.editConfig,
  28968. editOpts = this.editOpts,
  28969. isSeqColumn = this.isSeqColumn;
  28970. var targetRow;
  28971. var targetRowIndex;
  28972. var targetColumn;
  28973. var targetColumnIndex;
  28974. var params = Object.assign({}, args);
  28975. var rowIndex = afterFullData.indexOf(params.row);
  28976. var columnIndex = visibleColumn.indexOf(params.column);
  28977. evnt.preventDefault();
  28978. if (isLeft) {
  28979. // 向左
  28980. for (var len = columnIndex - 1; len >= 0; len--) {
  28981. if (!isSeqColumn(visibleColumn[len])) {
  28982. targetColumnIndex = len;
  28983. targetColumn = visibleColumn[len];
  28984. break;
  28985. }
  28986. }
  28987. if (!targetColumn && rowIndex > 0) {
  28988. // 如果找不到从上一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
  28989. targetRowIndex = rowIndex - 1;
  28990. targetRow = afterFullData[targetRowIndex];
  28991. for (var _len = visibleColumn.length - 1; _len >= 0; _len--) {
  28992. if (!isSeqColumn(visibleColumn[_len])) {
  28993. targetColumnIndex = _len;
  28994. targetColumn = visibleColumn[_len];
  28995. break;
  28996. }
  28997. }
  28998. }
  28999. } else {
  29000. // 向右
  29001. for (var index = columnIndex + 1; index < visibleColumn.length; index++) {
  29002. if (!isSeqColumn(visibleColumn[index])) {
  29003. targetColumnIndex = index;
  29004. targetColumn = visibleColumn[index];
  29005. break;
  29006. }
  29007. }
  29008. if (!targetColumn && rowIndex < afterFullData.length - 1) {
  29009. // 如果找不到从下一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
  29010. targetRowIndex = rowIndex + 1;
  29011. targetRow = afterFullData[targetRowIndex];
  29012. for (var _index = 0; _index < visibleColumn.length; _index++) {
  29013. if (!isSeqColumn(visibleColumn[_index])) {
  29014. targetColumnIndex = _index;
  29015. targetColumn = visibleColumn[_index];
  29016. break;
  29017. }
  29018. }
  29019. }
  29020. }
  29021. if (targetColumn) {
  29022. if (targetRow) {
  29023. params.rowIndex = targetRowIndex;
  29024. params.row = targetRow;
  29025. } else {
  29026. params.rowIndex = rowIndex;
  29027. }
  29028. params.columnIndex = targetColumnIndex;
  29029. params.column = targetColumn;
  29030. params.cell = this.getCell(params.row, params.column);
  29031. if (editConfig) {
  29032. if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
  29033. if (editOpts.mode === 'row') {
  29034. this.handleActived(params, evnt);
  29035. } else {
  29036. this.scrollToRow(params.row, params.column).then(function () {
  29037. return _this.handleSelected(params, evnt);
  29038. });
  29039. }
  29040. }
  29041. }
  29042. }
  29043. },
  29044. // 处理当前行方向键移动
  29045. moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) {
  29046. var _this2 = this;
  29047. var currentRow = this.currentRow,
  29048. treeConfig = this.treeConfig,
  29049. treeOpts = this.treeOpts,
  29050. afterFullData = this.afterFullData;
  29051. var targetRow;
  29052. evnt.preventDefault();
  29053. if (currentRow) {
  29054. if (treeConfig) {
  29055. var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  29056. return item === currentRow;
  29057. }, treeOpts),
  29058. index = _XEUtils$findTree.index,
  29059. items = _XEUtils$findTree.items;
  29060. if (isUpArrow && index > 0) {
  29061. targetRow = items[index - 1];
  29062. } else if (isDwArrow && index < items.length - 1) {
  29063. targetRow = items[index + 1];
  29064. }
  29065. } else {
  29066. var _rowIndex = this.getVTRowIndex(currentRow);
  29067. if (isUpArrow && _rowIndex > 0) {
  29068. targetRow = afterFullData[_rowIndex - 1];
  29069. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  29070. targetRow = afterFullData[_rowIndex + 1];
  29071. }
  29072. }
  29073. } else {
  29074. targetRow = afterFullData[0];
  29075. }
  29076. if (targetRow) {
  29077. var params = {
  29078. $table: this,
  29079. row: targetRow
  29080. };
  29081. this.scrollToRow(targetRow).then(function () {
  29082. return _this2.triggerCurrentRowEvent(evnt, params);
  29083. });
  29084. }
  29085. },
  29086. // 处理可编辑方向键移动
  29087. moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
  29088. var _this3 = this;
  29089. var afterFullData = this.afterFullData,
  29090. visibleColumn = this.visibleColumn,
  29091. isSeqColumn = this.isSeqColumn;
  29092. var params = Object.assign({}, args);
  29093. var _rowIndex = this.getVTRowIndex(params.row);
  29094. var _columnIndex = this.getVTColumnIndex(params.column);
  29095. evnt.preventDefault();
  29096. if (isUpArrow && _rowIndex > 0) {
  29097. // 移动到上一行
  29098. params.rowIndex = _rowIndex - 1;
  29099. params.row = afterFullData[params.rowIndex];
  29100. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  29101. // 移动到下一行
  29102. params.rowIndex = _rowIndex + 1;
  29103. params.row = afterFullData[params.rowIndex];
  29104. } else if (isLeftArrow && _columnIndex) {
  29105. for (var len = _columnIndex - 1; len >= 0; len--) {
  29106. if (!isSeqColumn(visibleColumn[len])) {
  29107. params.columnIndex = len;
  29108. params.column = visibleColumn[len];
  29109. break;
  29110. }
  29111. }
  29112. } else if (isRightArrow) {
  29113. for (var index = _columnIndex + 1; index < visibleColumn.length; index++) {
  29114. if (!isSeqColumn(visibleColumn[index])) {
  29115. params.columnIndex = index;
  29116. params.column = visibleColumn[index];
  29117. break;
  29118. }
  29119. }
  29120. }
  29121. this.scrollToRow(params.row, params.column).then(function () {
  29122. params.cell = _this3.getCell(params.row, params.column);
  29123. _this3.handleSelected(params, evnt);
  29124. });
  29125. },
  29126. /**
  29127. * 表头按下事件
  29128. */
  29129. triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) {
  29130. var mouseConfig = this.mouseConfig,
  29131. mouseOpts = this.mouseOpts;
  29132. var cell = evnt.currentTarget;
  29133. var triggerSort = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  29134. var triggerFilter = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  29135. if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
  29136. this.handleHeaderCellAreaEvent(evnt, Object.assign({
  29137. cell: cell,
  29138. triggerSort: triggerSort,
  29139. triggerFilter: triggerFilter
  29140. }, params));
  29141. } else if (mouseConfig && mouseOpts.checked) {
  29142. this.handleHeaderCellCheckedEvent(evnt, Object.assign({
  29143. cell: cell,
  29144. triggerSort: triggerSort,
  29145. triggerFilter: triggerFilter
  29146. }, params));
  29147. }
  29148. this.focus();
  29149. this.closeMenu();
  29150. },
  29151. /**
  29152. * 单元格按下事件
  29153. */
  29154. triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) {
  29155. var cell = evnt.currentTarget;
  29156. params.cell = cell;
  29157. this.handleCellMousedownEvent(evnt, params);
  29158. this.focus();
  29159. this.closeFilter();
  29160. this.closeMenu();
  29161. },
  29162. handleCellMousedownEvent: function handleCellMousedownEvent(evnt, params) {
  29163. var mouseConfig = this.mouseConfig,
  29164. mouseOpts = this.mouseOpts,
  29165. checkboxConfig = this.checkboxConfig,
  29166. checkboxOpts = this.checkboxOpts,
  29167. editConfig = this.editConfig,
  29168. editOpts = this.editOpts;
  29169. var column = params.column;
  29170. if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
  29171. this.handleCellAreaEvent(evnt, params);
  29172. } else if (mouseConfig && mouseOpts.checked) {
  29173. // 在 v3.0 中废弃 mouse-config.checked
  29174. this.handleCheckedRangeEvent(evnt, params);
  29175. } else {
  29176. if (checkboxConfig && checkboxOpts.range) {
  29177. this.handleCheckboxRangeEvent(evnt, params);
  29178. }
  29179. if (mouseConfig && mouseOpts.selected) {
  29180. // v3.0 废弃 type=index
  29181. if (!(column.type === 'seq' || column.type === 'index') && (!editConfig || editOpts.mode === 'cell')) {
  29182. this.handleSelected(params, evnt);
  29183. }
  29184. }
  29185. }
  29186. },
  29187. handleHeaderCellCheckedEvent: function handleHeaderCellCheckedEvent(evnt, params) {
  29188. var $el = this.$el,
  29189. tableData = this.tableData,
  29190. mouseConfig = this.mouseConfig,
  29191. mouseOpts = this.mouseOpts,
  29192. elemStore = this.elemStore,
  29193. handleChecked = this.handleChecked,
  29194. handleHeaderChecked = this.handleHeaderChecked;
  29195. var button = evnt.button;
  29196. var column = params.column;
  29197. var cell = evnt.currentTarget;
  29198. var isLeftBtn = button === 0; // v3.0 废弃 type=index
  29199. var isIndex = column.type === 'seq' || column.type === 'index';
  29200. if (mouseConfig) {
  29201. // 在 v3.0 中废弃 mouse-config.checked
  29202. if (mouseOpts.checked) {
  29203. var headerList = elemStore['main-header-list'].children;
  29204. var bodyList = elemStore['main-body-list'].children;
  29205. if (isIndex) {
  29206. this.handleAllChecked(evnt);
  29207. } else {
  29208. this.clearSelected(evnt);
  29209. this.clearHeaderChecked();
  29210. this.clearIndexChecked();
  29211. var startCell = bodyList[0].querySelector(".".concat(column.id));
  29212. if (isLeftBtn) {
  29213. var domMousemove = document.onmousemove;
  29214. var domMouseup = document.onmouseup;
  29215. var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
  29216. var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, $el, 'vxe-header--column'),
  29217. flag = _DomTools$getEventTar.flag,
  29218. targetElem = _DomTools$getEventTar.targetElem;
  29219. if (!flag) {
  29220. var nodeRest = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column');
  29221. flag = nodeRest.flag;
  29222. targetElem = nodeRest.targetElem;
  29223. }
  29224. if (flag && !DomTools.hasClass(targetElem, 'col--seq')) {
  29225. var colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
  29226. var endCell = bodyList[bodyList.length - 1].children[colIndex];
  29227. var head = headerList[0].children[colIndex];
  29228. handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(cell)));
  29229. handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
  29230. }
  29231. }, 80, {
  29232. leading: true,
  29233. trailing: true
  29234. });
  29235. DomTools.addClass($el, 'c--checked');
  29236. document.onmousemove = function (evnt) {
  29237. evnt.preventDefault();
  29238. evnt.stopPropagation();
  29239. updateEvent(evnt);
  29240. };
  29241. document.onmouseup = function () {
  29242. DomTools.removeClass($el, 'c--checked');
  29243. document.onmousemove = domMousemove;
  29244. document.onmouseup = domMouseup;
  29245. };
  29246. }
  29247. handleHeaderChecked([[cell]]);
  29248. if (bodyList.length) {
  29249. var endCell = bodyList[bodyList.length - 1].querySelector(".".concat(column.id));
  29250. var firstTrElem = bodyList[0];
  29251. var lastTrElem = bodyList[bodyList.length - 1];
  29252. var firstCell = firstTrElem.querySelector('.col--seq');
  29253. params.rowIndex = 0;
  29254. params.row = tableData[0];
  29255. params.cell = this.getCell(params.row, params.column);
  29256. this.handleSelected(params, evnt);
  29257. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector('.col--seq'))));
  29258. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
  29259. }
  29260. }
  29261. }
  29262. }
  29263. },
  29264. getCheckboxRangeRows: function getCheckboxRangeRows(targetTrElem, moveRange) {
  29265. var countHeight = 0;
  29266. var rangeRows = [];
  29267. var siblingProp = moveRange > 0 ? 'next' : 'previous';
  29268. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  29269. while (targetTrElem && countHeight < moveSize) {
  29270. rangeRows.push(this.getRowNode(targetTrElem).item);
  29271. countHeight += targetTrElem.offsetHeight;
  29272. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  29273. }
  29274. return rangeRows;
  29275. },
  29276. handleCheckedRangeEvent: function handleCheckedRangeEvent(evnt, params) {
  29277. var _this4 = this;
  29278. var $el = this.$el,
  29279. visibleColumn = this.visibleColumn,
  29280. editStore = this.editStore,
  29281. mouseOpts = this.mouseOpts,
  29282. elemStore = this.elemStore;
  29283. var checked = editStore.checked;
  29284. var column = params.column;
  29285. var button = evnt.button;
  29286. var cell = evnt.currentTarget;
  29287. var isLeftBtn = button === 0; // v3.0 废弃 type=index
  29288. var isIndex = column.type === 'seq' || column.type === 'index';
  29289. this.clearHeaderChecked();
  29290. this.clearIndexChecked();
  29291. var bodyList = elemStore['main-body-list'].children;
  29292. var headerList = elemStore['main-header-list'].children;
  29293. var cellLastElementChild = cell.parentNode.lastElementChild;
  29294. var cellFirstElementChild = cell.parentNode.firstElementChild;
  29295. if (isLeftBtn) {
  29296. var domMousemove = document.onmousemove;
  29297. var domMouseup = document.onmouseup;
  29298. var startCellNode = DomTools.getCellNodeIndex(cell);
  29299. var colIndex = [].indexOf.call(cell.parentNode.children, cell);
  29300. var headStart = headerList[0].children[colIndex];
  29301. var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
  29302. var _DomTools$getEventTar2 = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column'),
  29303. flag = _DomTools$getEventTar2.flag,
  29304. targetElem = _DomTools$getEventTar2.targetElem;
  29305. if (flag) {
  29306. if (isIndex) {
  29307. var firstCell = targetElem.parentNode.firstElementChild;
  29308. _this4.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
  29309. _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
  29310. } else if (!DomTools.hasClass(targetElem, 'col--seq')) {
  29311. var _firstCell = targetElem.parentNode.firstElementChild;
  29312. var _colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
  29313. var head = headerList[0].children[_colIndex];
  29314. _this4.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(headStart)));
  29315. _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(_firstCell), DomTools.getCellNodeIndex(cellFirstElementChild)));
  29316. _this4.handleChecked(DomTools.getRowNodes(bodyList, startCellNode, DomTools.getCellNodeIndex(targetElem)));
  29317. }
  29318. }
  29319. }, 80, {
  29320. leading: true,
  29321. trailing: true
  29322. });
  29323. document.onmousemove = function (evnt) {
  29324. evnt.preventDefault();
  29325. evnt.stopPropagation();
  29326. updateEvent(evnt);
  29327. };
  29328. document.onmouseup = function () {
  29329. document.onmousemove = domMousemove;
  29330. document.onmouseup = domMouseup;
  29331. };
  29332. }
  29333. if (isIndex) {
  29334. var firstCell = cell.parentNode.firstElementChild;
  29335. params.columnIndex++;
  29336. params.column = visibleColumn[params.columnIndex];
  29337. params.cell = cell.nextElementSibling;
  29338. this.handleSelected(params, evnt);
  29339. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
  29340. this.handleHeaderChecked([headerList[0].querySelectorAll('.vxe-header--column:not(.col--seq)')]);
  29341. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
  29342. } else {
  29343. if (isLeftBtn) {
  29344. var _firstCell2 = cell.parentNode.firstElementChild;
  29345. this.handleSelected(params, evnt);
  29346. this.handleHeaderChecked([[headerList[0].querySelector(".".concat(column.id))]]);
  29347. this.handleIndexChecked([[_firstCell2]]);
  29348. } else {
  29349. if (mouseOpts.selected) {
  29350. // 如果右键单元格不在所有选中的范围之内则重新选中
  29351. if (!checked.rowNodes || !checked.rowNodes.some(function (list) {
  29352. return list.indexOf(cell) > -1;
  29353. })) {
  29354. this.handleSelected(params, evnt);
  29355. }
  29356. }
  29357. }
  29358. }
  29359. },
  29360. handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
  29361. var _this5 = this;
  29362. var column = params.column,
  29363. cell = params.cell;
  29364. var isLeftBtn = evnt.button === 0; // 在 v3.0 中废弃 type=selection
  29365. if (isLeftBtn && ['checkbox', 'selection'].indexOf(column.type) > -1) {
  29366. var $el = this.$el,
  29367. elemStore = this.elemStore;
  29368. var disX = evnt.clientX;
  29369. var disY = evnt.clientY;
  29370. var bodyWrapperElem = elemStore["".concat(column.fixed || 'main', "-body-wrapper")] || elemStore['main-body-wrapper'];
  29371. var checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
  29372. var domMousemove = document.onmousemove;
  29373. var domMouseup = document.onmouseup;
  29374. var trElem = cell.parentNode;
  29375. var selectRecords = this.getCheckboxRecords();
  29376. var lastRangeRows = [];
  29377. var marginSize = 1;
  29378. var offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
  29379. var startTop = offsetRest.offsetTop + evnt.offsetY;
  29380. var startLeft = offsetRest.offsetLeft + evnt.offsetX;
  29381. var startScrollTop = bodyWrapperElem.scrollTop;
  29382. var rowHeight = trElem.offsetHeight;
  29383. var mouseScrollTimeout = null;
  29384. var isMouseScrollDown = false;
  29385. var mouseScrollSpaceSize = 1;
  29386. var triggerEvent = function triggerEvent(type, evnt) {
  29387. _this5.emitEvent("checkbox-range-".concat(type), {
  29388. records: _this5.getCheckboxRecords(),
  29389. reserves: _this5.getCheckboxReserveRecords()
  29390. }, evnt);
  29391. };
  29392. var handleChecked = function handleChecked(evnt) {
  29393. var clientX = evnt.clientX,
  29394. clientY = evnt.clientY;
  29395. var offsetLeft = clientX - disX;
  29396. var offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
  29397. var rangeHeight = Math.abs(offsetTop);
  29398. var rangeWidth = Math.abs(offsetLeft);
  29399. var rangeTop = startTop;
  29400. var rangeLeft = startLeft;
  29401. if (offsetTop < marginSize) {
  29402. // 向上
  29403. rangeTop += offsetTop;
  29404. if (rangeTop < marginSize) {
  29405. rangeTop = marginSize;
  29406. rangeHeight = startTop;
  29407. }
  29408. } else {
  29409. // 向下
  29410. rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
  29411. }
  29412. if (offsetLeft < marginSize) {
  29413. // 向左
  29414. rangeLeft += offsetLeft;
  29415. if (rangeWidth > startLeft) {
  29416. rangeLeft = marginSize;
  29417. rangeWidth = startLeft;
  29418. }
  29419. } else {
  29420. // 向右
  29421. rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
  29422. }
  29423. checkboxRangeElem.style.height = "".concat(rangeHeight, "px");
  29424. checkboxRangeElem.style.width = "".concat(rangeWidth, "px");
  29425. checkboxRangeElem.style.left = "".concat(rangeLeft, "px");
  29426. checkboxRangeElem.style.top = "".concat(rangeTop, "px");
  29427. checkboxRangeElem.style.display = 'block';
  29428. var rangeRows = getCheckboxRangeRows(_this5, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
  29429. if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
  29430. lastRangeRows = rangeRows;
  29431. if (evnt.ctrlKey) {
  29432. rangeRows.forEach(function (row) {
  29433. _this5.handleSelectRow({
  29434. row: row
  29435. }, selectRecords.indexOf(row) === -1);
  29436. });
  29437. } else {
  29438. _this5.setAllCheckboxRow(false);
  29439. _this5.setCheckboxRow(rangeRows, true);
  29440. }
  29441. triggerEvent('change', evnt);
  29442. }
  29443. }; // 停止鼠标滚动
  29444. var stopMouseScroll = function stopMouseScroll() {
  29445. clearTimeout(mouseScrollTimeout);
  29446. mouseScrollTimeout = null;
  29447. }; // 开始鼠标滚动
  29448. var startMouseScroll = function startMouseScroll(evnt) {
  29449. stopMouseScroll();
  29450. mouseScrollTimeout = setTimeout(function () {
  29451. if (mouseScrollTimeout) {
  29452. var scrollLeft = bodyWrapperElem.scrollLeft,
  29453. scrollTop = bodyWrapperElem.scrollTop,
  29454. clientHeight = bodyWrapperElem.clientHeight,
  29455. scrollHeight = bodyWrapperElem.scrollHeight;
  29456. var topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
  29457. if (isMouseScrollDown) {
  29458. if (scrollTop + clientHeight < scrollHeight) {
  29459. _this5.scrollTo(scrollLeft, scrollTop + topSize);
  29460. startMouseScroll(evnt);
  29461. handleChecked(evnt);
  29462. } else {
  29463. stopMouseScroll();
  29464. }
  29465. } else {
  29466. if (scrollTop) {
  29467. _this5.scrollTo(scrollLeft, scrollTop - topSize);
  29468. startMouseScroll(evnt);
  29469. handleChecked(evnt);
  29470. } else {
  29471. stopMouseScroll();
  29472. }
  29473. }
  29474. }
  29475. }, 50);
  29476. };
  29477. DomTools.addClass($el, 'drag--area');
  29478. document.onmousemove = function (evnt) {
  29479. evnt.preventDefault();
  29480. evnt.stopPropagation();
  29481. var clientY = evnt.clientY;
  29482. var _DomTools$getAbsolute = DomTools.getAbsolutePos(bodyWrapperElem),
  29483. boundingTop = _DomTools$getAbsolute.boundingTop; // 如果超过可视区,触发滚动
  29484. if (clientY < boundingTop) {
  29485. isMouseScrollDown = false;
  29486. mouseScrollSpaceSize = boundingTop - clientY;
  29487. if (!mouseScrollTimeout) {
  29488. startMouseScroll(evnt);
  29489. }
  29490. } else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
  29491. isMouseScrollDown = true;
  29492. mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
  29493. if (!mouseScrollTimeout) {
  29494. startMouseScroll(evnt);
  29495. }
  29496. } else if (mouseScrollTimeout) {
  29497. stopMouseScroll();
  29498. }
  29499. handleChecked(evnt);
  29500. };
  29501. document.onmouseup = function (evnt) {
  29502. stopMouseScroll();
  29503. DomTools.removeClass($el, 'drag--area');
  29504. checkboxRangeElem.removeAttribute('style');
  29505. document.onmousemove = domMousemove;
  29506. document.onmouseup = domMouseup;
  29507. triggerEvent('end', evnt);
  29508. };
  29509. triggerEvent('start', evnt);
  29510. }
  29511. },
  29512. /**
  29513. * 清除所有选中状态
  29514. */
  29515. _clearChecked: function _clearChecked() {
  29516. var $refs = this.$refs,
  29517. editStore = this.editStore,
  29518. mouseConfig = this.mouseConfig,
  29519. mouseOpts = this.mouseOpts;
  29520. var checked = editStore.checked; // 在 v3.0 中废弃 mouse-config.checked
  29521. if (mouseConfig && mouseOpts.checked) {
  29522. var tableBody = $refs.tableBody;
  29523. checked.rows = [];
  29524. checked.columns = [];
  29525. checked.tRows = [];
  29526. checked.tColumns = [];
  29527. var checkBorders = tableBody.$refs.checkBorders;
  29528. checkBorders.style.display = 'none';
  29529. ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--checked'), function (elem) {
  29530. return DomTools.removeClass(elem, 'col--checked');
  29531. });
  29532. }
  29533. return this.$nextTick();
  29534. },
  29535. _getMouseSelecteds: function _getMouseSelecteds() {
  29536. UtilTools.warn('vxe.error.delFunc', ['getMouseSelecteds', 'getSelectedCell']);
  29537. return this.getSelectedCell();
  29538. },
  29539. _getMouseCheckeds: function _getMouseCheckeds() {
  29540. // UtilTools.warn('vxe.error.delFunc', ['getMouseCheckeds', 'getSelectedRanges'])
  29541. return this.getSelectedRanges();
  29542. },
  29543. /**
  29544. * 获取选中的单元格
  29545. */
  29546. _getSelectedCell: function _getSelectedCell() {
  29547. var _this$editStore$selec = this.editStore.selected,
  29548. args = _this$editStore$selec.args,
  29549. column = _this$editStore$selec.column;
  29550. if (args && column) {
  29551. return Object.assign({}, args);
  29552. }
  29553. return null;
  29554. },
  29555. /**
  29556. * 获取所有选中的单元格
  29557. */
  29558. _getSelectedRanges: function _getSelectedRanges() {
  29559. var _this6 = this;
  29560. var checked = this.editStore.checked;
  29561. var _checked$rowNodes = checked.rowNodes,
  29562. rowNodes = _checked$rowNodes === void 0 ? [] : _checked$rowNodes;
  29563. var columns = [];
  29564. var rows = [];
  29565. if (rowNodes && rowNodes.length) {
  29566. rows = rowNodes.map(function (list) {
  29567. return _this6.getRowNode(list[0].parentNode).item;
  29568. });
  29569. columns = rowNodes[0].map(function (cell) {
  29570. return _this6.getColumnNode(cell).item;
  29571. });
  29572. }
  29573. return {
  29574. columns: columns,
  29575. rows: rows,
  29576. rowNodes: rowNodes
  29577. };
  29578. },
  29579. /**
  29580. * 处理所有选中
  29581. */
  29582. handleChecked: function handleChecked(rowNodes) {
  29583. var checked = this.editStore.checked;
  29584. this.clearChecked();
  29585. var cWidth = -2;
  29586. var cHeight = -2;
  29587. var offsetTop = 0;
  29588. var offsetLeft = 0;
  29589. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
  29590. var isTop = rowIndex === 0;
  29591. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
  29592. var isLeft = colIndex === 0;
  29593. if (isLeft && isTop) {
  29594. offsetTop = elem.offsetTop;
  29595. offsetLeft = elem.offsetLeft;
  29596. }
  29597. if (isTop) {
  29598. cWidth += elem.offsetWidth;
  29599. }
  29600. if (isLeft) {
  29601. cHeight += elem.offsetHeight;
  29602. }
  29603. DomTools.addClass(elem, 'col--checked');
  29604. });
  29605. });
  29606. var _this$$refs$tableBody = this.$refs.tableBody.$refs,
  29607. checkBorders = _this$$refs$tableBody.checkBorders,
  29608. checkTop = _this$$refs$tableBody.checkTop,
  29609. checkRight = _this$$refs$tableBody.checkRight,
  29610. checkBottom = _this$$refs$tableBody.checkBottom,
  29611. checkLeft = _this$$refs$tableBody.checkLeft;
  29612. checkBorders.style.display = 'block';
  29613. Object.assign(checkTop.style, {
  29614. top: "".concat(offsetTop, "px"),
  29615. left: "".concat(offsetLeft, "px"),
  29616. width: "".concat(cWidth, "px")
  29617. });
  29618. Object.assign(checkRight.style, {
  29619. top: "".concat(offsetTop, "px"),
  29620. left: "".concat(offsetLeft + cWidth, "px"),
  29621. height: "".concat(cHeight, "px")
  29622. });
  29623. Object.assign(checkBottom.style, {
  29624. top: "".concat(offsetTop + cHeight, "px"),
  29625. left: "".concat(offsetLeft, "px"),
  29626. width: "".concat(cWidth, "px")
  29627. });
  29628. Object.assign(checkLeft.style, {
  29629. top: "".concat(offsetTop, "px"),
  29630. left: "".concat(offsetLeft, "px"),
  29631. height: "".concat(cHeight, "px")
  29632. });
  29633. checked.rowNodes = rowNodes;
  29634. },
  29635. handleAllChecked: function handleAllChecked(evnt) {
  29636. var tableData = this.tableData,
  29637. visibleColumn = this.visibleColumn,
  29638. mouseConfig = this.mouseConfig,
  29639. mouseOpts = this.mouseOpts,
  29640. elemStore = this.elemStore; // 在 v3.0 中废弃 mouse-config.checked
  29641. if (mouseConfig && mouseOpts.checked) {
  29642. evnt.preventDefault();
  29643. var headerListElem = elemStore['main-header-list'];
  29644. var headerList = headerListElem.children;
  29645. var bodyList = elemStore['main-body-list'].children; // v3.0 废弃 type=index
  29646. var column = ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
  29647. return column.type === 'seq' || column.type === 'index';
  29648. }) || visibleColumn[0];
  29649. var cell = headerListElem.querySelector(".".concat(column.id));
  29650. var firstTrElem = bodyList[0];
  29651. var lastTrElem = bodyList[bodyList.length - 1];
  29652. var firstCell = firstTrElem.querySelector(".".concat(column.id));
  29653. var params = {
  29654. $table: this,
  29655. rowIndex: 0,
  29656. row: tableData[0],
  29657. column: ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
  29658. return column.property;
  29659. })
  29660. };
  29661. params.columnIndex = this.getColumnIndex(params.column);
  29662. params.cell = this.getCell(params.row, params.column);
  29663. this.handleSelected(params, evnt);
  29664. this.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(cell.nextElementSibling), DomTools.getCellNodeIndex(cell.parentNode.lastElementChild)));
  29665. this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector(".".concat(column.id)))));
  29666. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(lastTrElem.lastElementChild)));
  29667. }
  29668. },
  29669. handleIndexChecked: function handleIndexChecked(rowNodes) {
  29670. var indexs = this.editStore.indexs;
  29671. this.clearIndexChecked();
  29672. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
  29673. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
  29674. DomTools.addClass(elem, 'col--seq-checked');
  29675. });
  29676. });
  29677. indexs.rowNodes = rowNodes;
  29678. },
  29679. _clearIndexChecked: function _clearIndexChecked() {
  29680. var elemStore = this.elemStore;
  29681. var bodyElem = elemStore['main-body-list'];
  29682. ctor_amd_xe_utils_default.a.arrayEach(bodyElem.querySelectorAll('.col--seq-checked'), function (elem) {
  29683. return DomTools.removeClass(elem, 'col--seq-checked');
  29684. });
  29685. return this.$nextTick();
  29686. },
  29687. handleHeaderChecked: function handleHeaderChecked(rowNodes) {
  29688. var titles = this.editStore.titles;
  29689. this.clearHeaderChecked();
  29690. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
  29691. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
  29692. DomTools.addClass(elem, 'col--title-checked');
  29693. });
  29694. });
  29695. titles.rowNodes = rowNodes;
  29696. },
  29697. _clearHeaderChecked: function _clearHeaderChecked() {
  29698. var elemStore = this.elemStore;
  29699. var headerElem = elemStore['main-header-list'];
  29700. if (headerElem) {
  29701. ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-checked'), function (elem) {
  29702. return DomTools.removeClass(elem, 'col--title-checked');
  29703. });
  29704. }
  29705. return this.$nextTick();
  29706. },
  29707. /**
  29708. * 清空已复制的内容
  29709. */
  29710. _clearCopyed: function _clearCopyed() {
  29711. var $refs = this.$refs,
  29712. editStore = this.editStore,
  29713. keyboardConfig = this.keyboardConfig;
  29714. var copyed = editStore.copyed;
  29715. if (keyboardConfig && keyboardConfig.isCut) {
  29716. var tableBody = $refs.tableBody;
  29717. var copyBorders = $refs.tableBody.$refs.copyBorders;
  29718. copyed.cut = false;
  29719. copyed.rows = [];
  29720. copyed.columns = [];
  29721. copyBorders.style.display = 'none';
  29722. ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--copyed'), function (elem) {
  29723. return DomTools.removeClass(elem, 'col--copyed');
  29724. });
  29725. }
  29726. return this.$nextTick();
  29727. },
  29728. /**
  29729. * 处理复制
  29730. */
  29731. handleCopyed: function handleCopyed(cut) {
  29732. var tableData = this.tableData,
  29733. tableColumn = this.tableColumn,
  29734. editStore = this.editStore;
  29735. var copyed = editStore.copyed,
  29736. checked = editStore.checked;
  29737. var rowNodes = checked.rowNodes;
  29738. this.clearCopyed();
  29739. var cWidth = -3;
  29740. var cHeight = -3;
  29741. var offsetTop = 0;
  29742. var offsetLeft = 0;
  29743. var columns = [];
  29744. var rows = [];
  29745. if (rowNodes.length) {
  29746. var firstRows = rowNodes[0];
  29747. var _DomTools$getCellNode = DomTools.getCellNodeIndex(firstRows[0]),
  29748. rowIndex = _DomTools$getCellNode.rowIndex,
  29749. columnIndex = _DomTools$getCellNode.columnIndex;
  29750. columns = tableColumn.slice(columnIndex, columnIndex + firstRows.length);
  29751. rows = tableData.slice(rowIndex, rowIndex + rowNodes.length);
  29752. }
  29753. ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
  29754. var isTop = rowIndex === 0;
  29755. ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
  29756. var isLeft = colIndex === 0;
  29757. if (isLeft && isTop) {
  29758. offsetTop = elem.offsetTop;
  29759. offsetLeft = elem.offsetLeft;
  29760. }
  29761. if (isTop) {
  29762. cWidth += elem.offsetWidth;
  29763. }
  29764. if (isLeft) {
  29765. cHeight += elem.offsetHeight;
  29766. }
  29767. DomTools.addClass(elem, 'col--copyed');
  29768. });
  29769. });
  29770. var _this$$refs$tableBody2 = this.$refs.tableBody.$refs,
  29771. copyBorders = _this$$refs$tableBody2.copyBorders,
  29772. copyTop = _this$$refs$tableBody2.copyTop,
  29773. copyRight = _this$$refs$tableBody2.copyRight,
  29774. copyBottom = _this$$refs$tableBody2.copyBottom,
  29775. copyLeft = _this$$refs$tableBody2.copyLeft;
  29776. copyBorders.style.display = 'block';
  29777. Object.assign(copyTop.style, {
  29778. top: "".concat(offsetTop, "px"),
  29779. left: "".concat(offsetLeft, "px"),
  29780. width: "".concat(cWidth, "px")
  29781. });
  29782. Object.assign(copyRight.style, {
  29783. top: "".concat(offsetTop, "px"),
  29784. left: "".concat(offsetLeft + cWidth, "px"),
  29785. height: "".concat(cHeight, "px")
  29786. });
  29787. Object.assign(copyBottom.style, {
  29788. top: "".concat(offsetTop + cHeight, "px"),
  29789. left: "".concat(offsetLeft, "px"),
  29790. width: "".concat(cWidth, "px")
  29791. });
  29792. Object.assign(copyLeft.style, {
  29793. top: "".concat(offsetTop, "px"),
  29794. left: "".concat(offsetLeft, "px"),
  29795. height: "".concat(cHeight, "px")
  29796. });
  29797. copyed.cut = cut;
  29798. copyed.rows = rows;
  29799. copyed.columns = columns;
  29800. copyed.rowNodes = rowNodes;
  29801. },
  29802. /**
  29803. * 处理粘贴
  29804. */
  29805. handlePaste: function handlePaste() {
  29806. var tableData = this.tableData,
  29807. visibleColumn = this.visibleColumn,
  29808. editStore = this.editStore,
  29809. elemStore = this.elemStore;
  29810. var copyed = editStore.copyed,
  29811. selected = editStore.selected;
  29812. var cut = copyed.cut,
  29813. rows = copyed.rows,
  29814. columns = copyed.columns;
  29815. if (rows.length && columns.length && selected.row && selected.column) {
  29816. var _selected$args = selected.args,
  29817. rowIndex = _selected$args.rowIndex,
  29818. columnIndex = _selected$args.columnIndex;
  29819. ctor_amd_xe_utils_default.a.arrayEach(rows, function (row, rIndex) {
  29820. var offsetRow = tableData[rowIndex + rIndex];
  29821. if (offsetRow) {
  29822. ctor_amd_xe_utils_default.a.arrayEach(columns, function (column, cIndex) {
  29823. var offsetColumn = visibleColumn[columnIndex + cIndex];
  29824. if (offsetColumn) {
  29825. UtilTools.setCellValue(offsetRow, offsetColumn, UtilTools.getCellValue(row, column));
  29826. }
  29827. if (cut) {
  29828. UtilTools.setCellValue(row, column, null);
  29829. }
  29830. });
  29831. }
  29832. });
  29833. if (cut) {
  29834. this.clearCopyed();
  29835. }
  29836. var bodyList = elemStore['main-body-list'].children;
  29837. var cell = selected.args.cell;
  29838. var trElem = cell.parentNode;
  29839. var colIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
  29840. var rIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(bodyList, trElem);
  29841. var targetTrElem = bodyList[rIndex + rows.length - 1];
  29842. var targetCell = targetTrElem.children[colIndex + columns.length - 1];
  29843. this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(cell), DomTools.getCellNodeIndex(targetCell)));
  29844. }
  29845. }
  29846. }
  29847. });
  29848. // CONCATENATED MODULE: ./packages/keyboard/index.js
  29849. var Keyboard = {
  29850. install: function install() {
  29851. v_x_e_table.reg('keyboard');
  29852. packages_table.mixins.push(keyboard_src_mixin);
  29853. }
  29854. };
  29855. /* harmony default export */ var packages_keyboard = (Keyboard);
  29856. // CONCATENATED MODULE: ./packages/validator/src/mixin.js
  29857. /**
  29858. * 校验规则
  29859. */
  29860. var mixin_Rule = /*#__PURE__*/function () {
  29861. function Rule(rule) {
  29862. _classCallCheck(this, Rule);
  29863. Object.assign(this, {
  29864. $options: rule,
  29865. required: rule.required,
  29866. min: rule.min,
  29867. max: rule.max,
  29868. type: rule.type,
  29869. pattern: rule.pattern,
  29870. validator: rule.validator,
  29871. trigger: rule.trigger,
  29872. maxWidth: rule.maxWidth
  29873. });
  29874. }
  29875. /**
  29876. * 获取校验不通过的消息
  29877. * 支持国际化翻译
  29878. */
  29879. _createClass(Rule, [{
  29880. key: "content",
  29881. get: function get() {
  29882. return UtilTools.getFuncText(this.$options.content || this.$options.message);
  29883. }
  29884. }, {
  29885. key: "message",
  29886. get: function get() {
  29887. return this.content;
  29888. }
  29889. }]);
  29890. return Rule;
  29891. }();
  29892. /* harmony default export */ var validator_src_mixin = ({
  29893. methods: {
  29894. /**
  29895. * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
  29896. */
  29897. _fullValidate: function _fullValidate(rows, cb) {
  29898. return this.beginValidate(rows, cb, true);
  29899. },
  29900. /**
  29901. * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
  29902. */
  29903. _validate: function _validate(rows, cb) {
  29904. return this.beginValidate(rows, cb);
  29905. },
  29906. /**
  29907. * 聚焦到校验通过的单元格并弹出校验错误提示
  29908. */
  29909. handleValidError: function handleValidError(params) {
  29910. var _this = this;
  29911. if (this.validOpts.autoPos === false) {
  29912. this.emitEvent('valid-error', params);
  29913. } else {
  29914. this.handleActived(params, {
  29915. type: 'valid-error',
  29916. trigger: 'call'
  29917. }).then(function () {
  29918. return setTimeout(function () {
  29919. return _this.showValidTooltip(params);
  29920. }, 10);
  29921. });
  29922. }
  29923. },
  29924. /**
  29925. * 对表格数据进行校验
  29926. * 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
  29927. * 如果传 true 则校验当前表格数据
  29928. * 如果传 row 指定行记录,则只验证传入的行
  29929. * 如果传 rows 为多行记录,则只验证传入的行
  29930. * 如果只传 callback 否则默认验证整个表格数据
  29931. * 返回 Promise 对象,或者使用回调方式
  29932. */
  29933. beginValidate: function beginValidate(rows, cb, isFull) {
  29934. var _this2 = this;
  29935. var validRest = {};
  29936. var editRules = this.editRules,
  29937. afterFullData = this.afterFullData,
  29938. treeConfig = this.treeConfig,
  29939. treeOpts = this.treeOpts;
  29940. var vaildDatas;
  29941. if (rows === true) {
  29942. vaildDatas = afterFullData;
  29943. } else if (rows) {
  29944. if (ctor_amd_xe_utils_default.a.isFunction(rows)) {
  29945. cb = rows;
  29946. } else {
  29947. vaildDatas = ctor_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
  29948. }
  29949. }
  29950. if (!vaildDatas) {
  29951. // 在 v3.0 中废弃 setup.validFullData
  29952. if (conf.validFullData === 'obsolete') {
  29953. vaildDatas = afterFullData;
  29954. } else {
  29955. vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
  29956. }
  29957. }
  29958. var status = true;
  29959. var rowValids = [];
  29960. this.lastCallTime = Date.now();
  29961. this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
  29962. this.clearValidate();
  29963. if (editRules) {
  29964. var columns = this.getColumns();
  29965. var handleVaild = function handleVaild(row) {
  29966. if (isFull || !_this2.validRuleErr) {
  29967. var colVailds = [];
  29968. columns.forEach(function (column) {
  29969. if ((isFull || !_this2.validRuleErr) && ctor_amd_xe_utils_default.a.has(editRules, column.property)) {
  29970. colVailds.push(_this2.validCellRules('all', row, column).catch(function (_ref) {
  29971. var rule = _ref.rule,
  29972. rules = _ref.rules;
  29973. var rest = {
  29974. rule: rule,
  29975. rules: rules,
  29976. rowIndex: _this2.getRowIndex(row),
  29977. row: row,
  29978. columnIndex: _this2.getColumnIndex(column),
  29979. column: column,
  29980. $table: _this2
  29981. };
  29982. if (!validRest[column.property]) {
  29983. validRest[column.property] = [];
  29984. }
  29985. validRest[column.property].push(rest);
  29986. if (!isFull) {
  29987. _this2.validRuleErr = true;
  29988. return Promise.reject(rest);
  29989. }
  29990. }));
  29991. }
  29992. });
  29993. rowValids.push(Promise.all(colVailds));
  29994. }
  29995. };
  29996. if (treeConfig) {
  29997. ctor_amd_xe_utils_default.a.eachTree(vaildDatas, handleVaild, treeOpts);
  29998. } else {
  29999. vaildDatas.forEach(handleVaild);
  30000. }
  30001. return Promise.all(rowValids).then(function () {
  30002. var ruleProps = Object.keys(validRest);
  30003. return _this2.$nextTick().then(function () {
  30004. if (ruleProps.length) {
  30005. return Promise.reject(validRest[ruleProps[0]][0]);
  30006. }
  30007. if (cb) {
  30008. // 在 v3.0 中废弃 setup.validArgs
  30009. if (conf.validArgs === 'obsolete') {
  30010. cb(status);
  30011. } else {
  30012. cb();
  30013. }
  30014. }
  30015. });
  30016. }).catch(function (firstErrParams) {
  30017. return new Promise(function (resolve, reject) {
  30018. var finish = function finish() {
  30019. _this2.$nextTick(function () {
  30020. status = false;
  30021. if (cb) {
  30022. // 在 v3.0 中废弃 setup.validArgs
  30023. if (conf.validArgs === 'obsolete') {
  30024. cb(status, validRest);
  30025. } else {
  30026. cb(validRest);
  30027. }
  30028. resolve();
  30029. } else {
  30030. reject(validRest);
  30031. }
  30032. });
  30033. };
  30034. var posAndFinish = function posAndFinish() {
  30035. firstErrParams.cell = _this2.getCell(firstErrParams.row, firstErrParams.column);
  30036. DomTools.toView(firstErrParams.cell);
  30037. _this2.handleValidError(firstErrParams);
  30038. finish();
  30039. };
  30040. /**
  30041. * 当校验不通过时
  30042. * 将表格滚动到可视区
  30043. * 由于提示信息至少需要占一行,定位向上偏移一行
  30044. */
  30045. var row = firstErrParams.row;
  30046. var rowIndex = afterFullData.indexOf(row);
  30047. var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
  30048. if (_this2.validOpts.autoPos === false) {
  30049. finish();
  30050. } else {
  30051. if (treeConfig) {
  30052. _this2.scrollToTreeRow(locatRow).then(posAndFinish);
  30053. } else {
  30054. _this2.scrollToRow(locatRow).then(posAndFinish);
  30055. }
  30056. }
  30057. });
  30058. });
  30059. }
  30060. return this.$nextTick().then(function () {
  30061. if (cb) {
  30062. // 在 v3.0 中废弃 setup.validArgs
  30063. if (conf.validArgs === 'obsolete') {
  30064. cb(status);
  30065. } else {
  30066. cb();
  30067. }
  30068. }
  30069. });
  30070. },
  30071. hasCellRules: function hasCellRules(type, row, column) {
  30072. var editRules = this.editRules;
  30073. var property = column.property;
  30074. if (property && editRules) {
  30075. var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
  30076. return rules && ctor_amd_xe_utils_default.a.find(rules, function (rule) {
  30077. return type === 'all' || !rule.trigger || type === rule.trigger;
  30078. });
  30079. }
  30080. return false;
  30081. },
  30082. /**
  30083. * 校验数据
  30084. * 按表格行、同步列顺序校验/异步并发校验
  30085. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  30086. * 如果校验失败则,触发回调或者Promise<不通过列的错误消息>
  30087. * 如果是传回调方式这返回一个校验不通过列的错误消息
  30088. *
  30089. * rule 配置:
  30090. * required=Boolean 是否必填
  30091. * min=Number 最小长度
  30092. * max=Number 最大长度
  30093. * validator=Function({ cellValue, rule, rules, row, column, rowIndex, columnIndex }) 自定义校验,接收一个 Promise
  30094. * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行)
  30095. */
  30096. validCellRules: function validCellRules(type, row, column, val) {
  30097. var _this3 = this;
  30098. var editRules = this.editRules;
  30099. var property = column.property;
  30100. var errorRules = [];
  30101. var syncVailds = [];
  30102. if (property && editRules) {
  30103. var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
  30104. if (rules) {
  30105. var cellValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(row, property) : val;
  30106. rules.forEach(function (rule) {
  30107. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  30108. if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
  30109. var customValid; // 在 v3.0 中废弃 setup.validArgs
  30110. if (conf.validArgs === 'obsolete') {
  30111. customValid = new Promise(function (resolve) {
  30112. rule.validator(rule, cellValue, function (e) {
  30113. if (ctor_amd_xe_utils_default.a.isError(e)) {
  30114. _this3.validRuleErr = true;
  30115. errorRules.push(new mixin_Rule({
  30116. type: 'custom',
  30117. trigger: rule.trigger,
  30118. message: e.message,
  30119. rule: new mixin_Rule(rule)
  30120. }));
  30121. }
  30122. resolve();
  30123. }, {
  30124. rule: rule,
  30125. rules: rules,
  30126. row: row,
  30127. column: column,
  30128. rowIndex: _this3.getRowIndex(row),
  30129. columnIndex: _this3.getColumnIndex(column),
  30130. $table: _this3
  30131. });
  30132. });
  30133. } else {
  30134. customValid = rule.validator({
  30135. cellValue: cellValue,
  30136. rule: rule,
  30137. rules: rules,
  30138. row: row,
  30139. rowIndex: _this3.getRowIndex(row),
  30140. column: column,
  30141. columnIndex: _this3.getColumnIndex(column),
  30142. $table: _this3
  30143. });
  30144. }
  30145. if (customValid) {
  30146. if (ctor_amd_xe_utils_default.a.isError(customValid)) {
  30147. _this3.validRuleErr = true;
  30148. errorRules.push(new mixin_Rule({
  30149. type: 'custom',
  30150. trigger: rule.trigger,
  30151. message: customValid.message,
  30152. rule: new mixin_Rule(rule)
  30153. }));
  30154. } else if (customValid.catch) {
  30155. // 如果为异步校验(注:异步校验是并发无序的)
  30156. syncVailds.push(customValid.catch(function (e) {
  30157. _this3.validRuleErr = true;
  30158. errorRules.push(new mixin_Rule({
  30159. type: 'custom',
  30160. trigger: rule.trigger,
  30161. message: e && e.message ? e.message : rule.content || rule.message,
  30162. rule: new mixin_Rule(rule)
  30163. }));
  30164. }));
  30165. }
  30166. }
  30167. } else {
  30168. var isNumType = rule.type === 'number';
  30169. var isArrType = rule.type === 'array';
  30170. var numVal = isNumType ? ctor_amd_xe_utils_default.a.toNumber(cellValue) : ctor_amd_xe_utils_default.a.getSize(cellValue);
  30171. if (rule.required && (isArrType ? !ctor_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : cellValue === null || cellValue === undefined || cellValue === '')) {
  30172. _this3.validRuleErr = true;
  30173. errorRules.push(new mixin_Rule(rule));
  30174. } 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)) {
  30175. _this3.validRuleErr = true;
  30176. errorRules.push(new mixin_Rule(rule));
  30177. }
  30178. }
  30179. }
  30180. });
  30181. }
  30182. }
  30183. return Promise.all(syncVailds).then(function () {
  30184. if (errorRules.length) {
  30185. var rest = {
  30186. rules: errorRules,
  30187. rule: errorRules[0]
  30188. };
  30189. return Promise.reject(rest);
  30190. }
  30191. });
  30192. },
  30193. _clearValidate: function _clearValidate() {
  30194. var validTip = this.$refs.validTip;
  30195. Object.assign(this.validStore, {
  30196. visible: false,
  30197. row: null,
  30198. column: null,
  30199. content: '',
  30200. rule: null
  30201. });
  30202. if (validTip && validTip.visible) {
  30203. validTip.close();
  30204. }
  30205. return this.$nextTick();
  30206. },
  30207. /**
  30208. * 触发校验
  30209. */
  30210. triggerValidate: function triggerValidate(type) {
  30211. var _this4 = this;
  30212. var editConfig = this.editConfig,
  30213. editStore = this.editStore,
  30214. editRules = this.editRules,
  30215. validStore = this.validStore;
  30216. var actived = editStore.actived;
  30217. if (actived.row && editRules) {
  30218. var _actived$args = actived.args,
  30219. row = _actived$args.row,
  30220. column = _actived$args.column,
  30221. cell = _actived$args.cell;
  30222. if (this.hasCellRules(type, row, column)) {
  30223. return this.validCellRules(type, row, column).then(function () {
  30224. if (editConfig.mode === 'row') {
  30225. if (validStore.visible && validStore.row === row && validStore.column === column) {
  30226. _this4.clearValidate();
  30227. }
  30228. }
  30229. }).catch(function (_ref2) {
  30230. var rule = _ref2.rule;
  30231. // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
  30232. if (!rule.trigger || type === rule.trigger) {
  30233. var rest = {
  30234. rule: rule,
  30235. row: row,
  30236. column: column,
  30237. cell: cell
  30238. };
  30239. _this4.showValidTooltip(rest);
  30240. return Promise.reject(rest);
  30241. }
  30242. return Promise.resolve();
  30243. });
  30244. }
  30245. }
  30246. return Promise.resolve();
  30247. },
  30248. /**
  30249. * 弹出校验错误提示
  30250. */
  30251. showValidTooltip: function showValidTooltip(params) {
  30252. var _this5 = this;
  30253. var $refs = this.$refs,
  30254. height = this.height,
  30255. tableData = this.tableData,
  30256. validOpts = this.validOpts;
  30257. var rule = params.rule,
  30258. row = params.row,
  30259. column = params.column,
  30260. cell = params.cell;
  30261. var validTip = $refs.validTip;
  30262. var content = rule.message;
  30263. this.$nextTick(function () {
  30264. Object.assign(_this5.validStore, {
  30265. row: row,
  30266. column: column,
  30267. rule: rule,
  30268. content: content,
  30269. visible: true
  30270. });
  30271. if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
  30272. validTip.open(cell, content);
  30273. }
  30274. _this5.emitEvent('valid-error', params);
  30275. });
  30276. }
  30277. }
  30278. });
  30279. // CONCATENATED MODULE: ./packages/validator/index.js
  30280. var Validator = {
  30281. install: function install() {
  30282. v_x_e_table.reg('valid');
  30283. packages_table.mixins.push(validator_src_mixin);
  30284. }
  30285. };
  30286. /* harmony default export */ var validator = (Validator);
  30287. // CONCATENATED MODULE: ./packages/resize/index.js
  30288. var Resize = {
  30289. /* eslint-disable @typescript-eslint/no-empty-function */
  30290. install: function install() {}
  30291. };
  30292. /* harmony default export */ var packages_resize = (Resize);
  30293. // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
  30294. /* harmony default export */ var zh_CN = ({
  30295. vxe: {
  30296. error: {
  30297. groupFixed: '如果使用分组表头,固定列必须按组设置',
  30298. groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
  30299. groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
  30300. scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
  30301. scrollXNotGroup: '横向虚拟滚动不支持分组表头,需要设置 "scroll-x.enabled=false" 参数,否则可能会导致出现错误',
  30302. errConflicts: '参数 "{0}" 与 "{1}" 有冲突',
  30303. unableInsert: '无法插入到指定位置,请检查参数是否正确',
  30304. useErr: '安装 "{0}" 模块时发生错误,可能顺序不正确,依赖的模块需要在 Table 之前安装',
  30305. barUnableLink: '工具栏无法关联表格',
  30306. expandContent: '展开行的插槽应该是 "content",请检查是否正确',
  30307. reqModule: '缺少 "{0}" 模块',
  30308. reqProp: '缺少必要的 "{0}" 参数,这可能会导致出现错误',
  30309. emptyProp: '参数 "{0}" 不允许为空',
  30310. errProp: '不支持的参数 "{0}",可能为 "{1}"',
  30311. colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
  30312. notFunc: '方法 "{0}" 不存在',
  30313. notSlot: '插槽 "{0}" 不存在',
  30314. noTree: '树结构不支持 "{0}"',
  30315. notProp: '不支持的参数 "{0}"',
  30316. coverProp: '"{0}" 的参数 "{1}" 被覆盖,这可能会出现错误',
  30317. delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
  30318. delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
  30319. delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
  30320. removeProp: '参数 "{0}" 已废弃,不建议使用,这可能会导致出现错误',
  30321. errFormat: '全局的格式化内容应该使用 "VXETable.formats" 定义,挂载 "formatter={0}" 的方式已不建议使用',
  30322. notType: '不支持的文件类型 "{0}"',
  30323. notExp: '该浏览器不支持导入/导出功能',
  30324. impFields: '导入失败,请检查字段名和数据格式是否正确',
  30325. treeNotImp: '树表格不支持导入'
  30326. },
  30327. renderer: {
  30328. search: '搜索',
  30329. cases: {
  30330. equal: '等于',
  30331. unequal: '不等于',
  30332. gt: '大于',
  30333. ge: '大于或等于',
  30334. lt: '小于',
  30335. le: '小于或等于',
  30336. begin: '开头是',
  30337. notbegin: '开头不是',
  30338. endin: '结尾是',
  30339. notendin: '结尾不是',
  30340. include: '包含',
  30341. exclude: '不包含',
  30342. between: '介于',
  30343. custom: '自定义筛选',
  30344. insensitive: '不区分大小写',
  30345. isSensitive: '区分大小写'
  30346. },
  30347. combination: {
  30348. menus: {
  30349. sortAsc: '升序',
  30350. sortDesc: '降序',
  30351. fixedColumn: '锁定列',
  30352. fixedGroup: '锁定组',
  30353. cancelFixed: '取消锁定',
  30354. fixedLeft: '锁定左侧',
  30355. fixedRight: '锁定右侧',
  30356. clearFilter: '清除筛选',
  30357. textOption: '文本筛选',
  30358. numberOption: '数值筛选'
  30359. },
  30360. popup: {
  30361. title: '自定义筛选的方式',
  30362. currColumnTitle: '当前列:',
  30363. and: '与',
  30364. or: '或',
  30365. describeHtml: '可用 ? 代表单个字符<br/>用 * 代表任意多个字符'
  30366. },
  30367. empty: '(空白)',
  30368. notData: '无匹配项'
  30369. }
  30370. },
  30371. pro: {
  30372. area: {
  30373. mergeErr: '无法对合并单元格进行该操作',
  30374. multiErr: '无法对多重选择区域进行该操作',
  30375. extendErr: '如果延伸的区域包含被合并的单元格,所有合并的单元格需大小相同'
  30376. },
  30377. fnr: {
  30378. title: '查找和替换',
  30379. findLabel: '查找',
  30380. replaceLabel: '替换',
  30381. findTitle: '查找内容:',
  30382. replaceTitle: '替换为:',
  30383. tabs: {
  30384. find: '查找',
  30385. replace: '替换'
  30386. },
  30387. filter: {
  30388. re: '正则表达式',
  30389. whole: '全词匹配',
  30390. sensitive: '区分大小写'
  30391. },
  30392. btns: {
  30393. findNext: '查找下一个',
  30394. findAll: '查找全部',
  30395. replace: '替换',
  30396. replaceAll: '替换全部',
  30397. cancel: '取消'
  30398. },
  30399. header: {
  30400. seq: '#',
  30401. cell: '单元格',
  30402. value: '值'
  30403. },
  30404. empty: '(空值)',
  30405. reError: '无效的正则表达式',
  30406. recordCount: '已找到 {0} 个单元格',
  30407. notCell: '找不到匹配的单元格',
  30408. replaceSuccess: '成功替换 {0} 个单元格'
  30409. }
  30410. },
  30411. table: {
  30412. emptyText: '暂无数据',
  30413. allTitle: '全选/取消',
  30414. seqTitle: '#',
  30415. confirmFilter: '筛选',
  30416. resetFilter: '重置',
  30417. allFilter: '全部',
  30418. sortAsc: '升序:最低到最高',
  30419. sortDesc: '降序:最高到最低',
  30420. filter: '对所选的列启用筛选',
  30421. impSuccess: '成功导入 {0} 条记录',
  30422. expLoading: '正在导出中',
  30423. expSuccess: '导出成功',
  30424. expFilename: '导出_{0}',
  30425. expOriginFilename: '导出_源_{0}',
  30426. customTitle: '列设置',
  30427. customAll: '全部',
  30428. customConfirm: '确认',
  30429. customRestore: '还原'
  30430. },
  30431. grid: {
  30432. selectOneRecord: '请至少选择一条记录!',
  30433. deleteSelectRecord: '您确定要删除所选记录吗?',
  30434. removeSelectRecord: '您确定要移除所选记录吗?',
  30435. dataUnchanged: '数据未改动!',
  30436. delSuccess: '成功删除所选记录!',
  30437. saveSuccess: '保存成功!',
  30438. operError: '发生错误,操作失败!'
  30439. },
  30440. select: {
  30441. emptyText: '暂无数据'
  30442. },
  30443. pager: {
  30444. goto: '前往',
  30445. pagesize: '{0}条/页',
  30446. total: '共 {0} 条记录',
  30447. pageClassifier: '页',
  30448. prevPage: '上一页',
  30449. nextPage: '下一页',
  30450. prevJump: '向上跳页',
  30451. nextJump: '向下跳页'
  30452. },
  30453. alert: {
  30454. title: '消息提示'
  30455. },
  30456. button: {
  30457. confirm: '确认',
  30458. cancel: '取消'
  30459. },
  30460. import: {
  30461. modes: {
  30462. covering: '覆盖',
  30463. insert: '新增'
  30464. },
  30465. impTitle: '导入数据',
  30466. impFile: '文件名',
  30467. impSelect: '选择文件',
  30468. impType: '文件类型',
  30469. impOpts: '参数设置',
  30470. impConfirm: '导入',
  30471. impCancel: '取消'
  30472. },
  30473. export: {
  30474. types: {
  30475. csv: 'CSV (逗号分隔)(*.csv)',
  30476. html: '网页(*.html)',
  30477. xml: 'XML 数据(*.xml)',
  30478. txt: '文本文件(制表符分隔)(*.txt)',
  30479. xls: 'Excel 97-2003 工作簿(*.xls)',
  30480. xlsx: 'Excel 工作簿(*.xlsx)',
  30481. pdf: 'PDF (*.pdf)'
  30482. },
  30483. modes: {
  30484. current: '当前数据(当前页的数据)',
  30485. selected: '选中数据(当前页选中的数据)',
  30486. all: '全量数据(包括所有分页的数据)'
  30487. },
  30488. printTitle: '打印数据',
  30489. expTitle: '导出数据',
  30490. expName: '文件名',
  30491. expNamePlaceholder: '请输入文件名',
  30492. expSheetName: '标题',
  30493. expSheetNamePlaceholder: '请输入标题',
  30494. expType: '保存类型',
  30495. expMode: '选择数据',
  30496. expCurrentColumn: '全部字段',
  30497. expColumn: '选择字段',
  30498. expOpts: '参数设置',
  30499. expOptHeader: '表头',
  30500. expHeaderTitle: '是否需要表头',
  30501. expOptFooter: '表尾',
  30502. expFooterTitle: '是否需要表尾',
  30503. expOptColgroup: '分组表头',
  30504. expColgroupTitle: '如果存在,则支持带有分组结构的表头',
  30505. expOptMerge: '合并',
  30506. expMergeTitle: '如果存在,则支持带有合并结构的单元格',
  30507. expOptAllExpand: '展开层级',
  30508. expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
  30509. expOptUseStyle: '样式',
  30510. expUseStyleTitle: '如果存在,则支持带样式的单元格',
  30511. expOptOriginal: '源数据',
  30512. expOriginalTitle: '如果为源数据,则支持导入到表格中',
  30513. expPrint: '打印',
  30514. expConfirm: '导出',
  30515. expCancel: '取消'
  30516. },
  30517. modal: {
  30518. zoomIn: '最大化',
  30519. zoomOut: '还原',
  30520. close: '关闭'
  30521. },
  30522. form: {
  30523. folding: '收起',
  30524. unfolding: '展开'
  30525. },
  30526. toolbar: {
  30527. import: '导入',
  30528. export: '导出',
  30529. print: '打印',
  30530. refresh: '刷新',
  30531. zoomIn: '全屏',
  30532. zoomOut: '还原',
  30533. custom: '列设置',
  30534. customAll: '全部',
  30535. customConfirm: '确认',
  30536. customRestore: '还原'
  30537. },
  30538. input: {
  30539. date: {
  30540. m1: '01 月',
  30541. m2: '02 月',
  30542. m3: '03 月',
  30543. m4: '04 月',
  30544. m5: '05 月',
  30545. m6: '06 月',
  30546. m7: '07 月',
  30547. m8: '08 月',
  30548. m9: '09 月',
  30549. m10: '10 月',
  30550. m11: '11 月',
  30551. m12: '12 月',
  30552. quarterLabel: '{0} 年',
  30553. monthLabel: '{0} 年',
  30554. dayLabel: '{0} 年 {1}',
  30555. labelFormat: {
  30556. date: 'yyyy-MM-dd',
  30557. time: 'HH:mm:ss',
  30558. datetime: 'yyyy-MM-dd HH:mm:ss',
  30559. week: 'yyyy 年第 WW 周',
  30560. month: 'yyyy-MM',
  30561. quarter: 'yyyy 年第 q 季度',
  30562. year: 'yyyy'
  30563. },
  30564. weeks: {
  30565. w: '周',
  30566. w0: '周日',
  30567. w1: '周一',
  30568. w2: '周二',
  30569. w3: '周三',
  30570. w4: '周四',
  30571. w5: '周五',
  30572. w6: '周六'
  30573. },
  30574. months: {
  30575. m0: '一月',
  30576. m1: '二月',
  30577. m2: '三月',
  30578. m3: '四月',
  30579. m4: '五月',
  30580. m5: '六月',
  30581. m6: '七月',
  30582. m7: '八月',
  30583. m8: '九月',
  30584. m9: '十月',
  30585. m10: '十一月',
  30586. m11: '十二月'
  30587. },
  30588. quarters: {
  30589. q1: '第一季度',
  30590. q2: '第二季度',
  30591. q3: '第三季度',
  30592. q4: '第四季度'
  30593. }
  30594. }
  30595. }
  30596. }
  30597. });
  30598. // CONCATENATED MODULE: ./packages/vxe-table.js
  30599. // 按需加载的组件
  30600. var components = [// 模块
  30601. 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, // 核心
  30602. packages_table]; // 默认安装
  30603. function vxe_table_install(Vue, options) {
  30604. if (ctor_amd_xe_utils_default.a.isPlainObject(options)) {
  30605. v_x_e_table.setup(options);
  30606. }
  30607. components.map(function (component) {
  30608. return component.install(Vue);
  30609. });
  30610. } // 默认中文
  30611. v_x_e_table.setup({
  30612. i18n: ctor_amd_xe_utils_default.a.toFormatString ? function (key, args) {
  30613. return ctor_amd_xe_utils_default.a.toFormatString(ctor_amd_xe_utils_default.a.get(zh_CN, key), args);
  30614. } : function (key, args) {
  30615. return ctor_amd_xe_utils_default.a.template(ctor_amd_xe_utils_default.a.get(zh_CN, key), args, {
  30616. tmplRE: /\{([.\w[\]\s]+)\}/g
  30617. });
  30618. }
  30619. });
  30620. v_x_e_table.install = vxe_table_install;
  30621. if (typeof window !== 'undefined' && window.Vue && window.Vue.use) {
  30622. window.Vue.use(v_x_e_table);
  30623. }
  30624. /* harmony default export */ var vxe_table = (v_x_e_table);
  30625. // CONCATENATED MODULE: ./index.js
  30626. // 默认主题
  30627. // 默认安装全部模块
  30628. /* harmony default export */ var index_0 = (vxe_table);
  30629. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  30630. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (index_0);
  30631. /***/ }),
  30632. /***/ "fb6a":
  30633. /***/ (function(module, exports, __webpack_require__) {
  30634. "use strict";
  30635. var $ = __webpack_require__("23e7");
  30636. var isObject = __webpack_require__("861d");
  30637. var isArray = __webpack_require__("e8b5");
  30638. var toAbsoluteIndex = __webpack_require__("23cb");
  30639. var toLength = __webpack_require__("50c4");
  30640. var toIndexedObject = __webpack_require__("fc6a");
  30641. var createProperty = __webpack_require__("8418");
  30642. var wellKnownSymbol = __webpack_require__("b622");
  30643. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  30644. var arrayMethodUsesToLength = __webpack_require__("ae40");
  30645. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  30646. var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
  30647. var SPECIES = wellKnownSymbol('species');
  30648. var nativeSlice = [].slice;
  30649. var max = Math.max;
  30650. // `Array.prototype.slice` method
  30651. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  30652. // fallback for not array-like ES3 strings and DOM objects
  30653. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  30654. slice: function slice(start, end) {
  30655. var O = toIndexedObject(this);
  30656. var length = toLength(O.length);
  30657. var k = toAbsoluteIndex(start, length);
  30658. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  30659. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  30660. var Constructor, result, n;
  30661. if (isArray(O)) {
  30662. Constructor = O.constructor;
  30663. // cross-realm fallback
  30664. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  30665. Constructor = undefined;
  30666. } else if (isObject(Constructor)) {
  30667. Constructor = Constructor[SPECIES];
  30668. if (Constructor === null) Constructor = undefined;
  30669. }
  30670. if (Constructor === Array || Constructor === undefined) {
  30671. return nativeSlice.call(O, k, fin);
  30672. }
  30673. }
  30674. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  30675. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  30676. result.length = n;
  30677. return result;
  30678. }
  30679. });
  30680. /***/ }),
  30681. /***/ "fc6a":
  30682. /***/ (function(module, exports, __webpack_require__) {
  30683. // toObject with fallback for non-array-like ES3 strings
  30684. var IndexedObject = __webpack_require__("44ad");
  30685. var requireObjectCoercible = __webpack_require__("1d80");
  30686. module.exports = function (it) {
  30687. return IndexedObject(requireObjectCoercible(it));
  30688. };
  30689. /***/ }),
  30690. /***/ "fdbc":
  30691. /***/ (function(module, exports) {
  30692. // iterable DOM collections
  30693. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  30694. module.exports = {
  30695. CSSRuleList: 0,
  30696. CSSStyleDeclaration: 0,
  30697. CSSValueList: 0,
  30698. ClientRectList: 0,
  30699. DOMRectList: 0,
  30700. DOMStringList: 0,
  30701. DOMTokenList: 1,
  30702. DataTransferItemList: 0,
  30703. FileList: 0,
  30704. HTMLAllCollection: 0,
  30705. HTMLCollection: 0,
  30706. HTMLFormElement: 0,
  30707. HTMLSelectElement: 0,
  30708. MediaList: 0,
  30709. MimeTypeArray: 0,
  30710. NamedNodeMap: 0,
  30711. NodeList: 1,
  30712. PaintRequestList: 0,
  30713. Plugin: 0,
  30714. PluginArray: 0,
  30715. SVGLengthList: 0,
  30716. SVGNumberList: 0,
  30717. SVGPathSegList: 0,
  30718. SVGPointList: 0,
  30719. SVGStringList: 0,
  30720. SVGTransformList: 0,
  30721. SourceBufferList: 0,
  30722. StyleSheetList: 0,
  30723. TextTrackCueList: 0,
  30724. TextTrackList: 0,
  30725. TouchList: 0
  30726. };
  30727. /***/ }),
  30728. /***/ "fdbf":
  30729. /***/ (function(module, exports, __webpack_require__) {
  30730. var NATIVE_SYMBOL = __webpack_require__("4930");
  30731. module.exports = NATIVE_SYMBOL
  30732. // eslint-disable-next-line no-undef
  30733. && !Symbol.sham
  30734. // eslint-disable-next-line no-undef
  30735. && typeof Symbol.iterator == 'symbol';
  30736. /***/ })
  30737. /******/ })["default"];
  30738. });
  30739. //# sourceMappingURL=index.umd.js.map